This is the mail archive of the gdb-patches@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]

Re: -var-info-path-expression


On Sunday 28 January 2007 03:46, Nick Roberts wrote:
>  >  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.  

A future patch is very likely to change this. In particular, the 'create_child' function
needs both name of the child and its value. I might kill separate function
pointers in struct language_specific and use just single describe_child and
make create_child pass two non-NULL pointers?

> 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);

And have casts from void* to the right type? I'm not sure that's any advantage.

- Volodya


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