-var-info-path-expression

Nick Roberts nickrob@snap.net.nz
Sun Jan 28 00:46:00 GMT 2007


 >  c_describe_child (struct varobj *parent, int index,
 > -		  char **cname, struct value **cvalue, struct type **ctype)
 > +		  char **cname, struct value **cvalue, struct type **ctype,
 > +		  char **cfull_expression)

This argument list gets longer but, apart from only parent and index, only
one argument is non-null at any one time.  Would it be better to have

enum varobj_child_properties
  {
    CHILD_NAME,
    CHILD_VALUE,
    CHILD_TYPE,
    CHILD_FULL_EXPRESSION
  }

static void *
c_describe_child (enum varobj_child_properties property,
                  struct varobj *parent, int index)

and propagate these changes back to struct language_specific so we have:

static char *
name_of_child (struct varobj *var, int index)
{
  return (char *) (*var->root->lang->describe_child) (CHILD_NAME, var, index);
}

etc?

-- 
Nick                                           http://www.inet.net.nz/~nickrob



More information about the Gdb-patches mailing list