This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-var-info-path-expression


Hi Jim,

I'm porting Apple's -var-info-path-expression code to FSF, and have a couple of questions.

1. The code in cplus_path_expr_of_child looks like this:

	if (CPLUS_FAKE_CHILD (child))
		return parent_expr;

	if (CPLUS_FAKE_CHILD (parent))
	{
	}
	else if (index < TYPE_N_BASECLASSES (type))
	{
	}
	else
	{
		  /* Everything beyond the baseclasses can
		     only be "public", "private", or "protected" */
		index -= TYPE_N_BASECLASSES (type);
		switch (index)
		{
		case 0:
			if (children[v_public] != 0)
			{
				path_expr = "public";
			}		
		.......
	}

How the last "else" branch can ever be executed, when right at the 
beginning of the function we check for fake child and return?

2. When the parent is fake varobj, the following code is executed:

	index_in_type = 
            cplus_real_type_index_for_fake_child_index (type, prot, index);
          
	child_name = TYPE_FIELD_NAME (type, index_in_type);

Why is it necessary? Can't we just use 'child->name'?

Thanks in advance,
Volodya


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]