[RFA]: dwarf2expr.[ch]

Andrew Cagney ac131313@ges.redhat.com
Mon Jul 8 21:12:00 GMT 2002


Jim,

Is it possible to simplify some of this.  For instance:

> +   void (*error) (const char *fmt, ...);

In GDB, the function error() has well understood semantics - no return, 
long jump, fprintf parameter checking, .....  Why not use error() 
directly?  Failing that, the function probably wants to be marked up 
with NORETURN and a printf attribute.

> + 
> +   /* If it has a location expression for fbreg, record it.  
> +      Since not all symbols use location expressions exclusively yet,
> +      we still need to decode it above. */
> +   if (attr)
> +     {
> +       baton = obstack_alloc (&objfile->symbol_obstack, sizeof (struct locexpr_baton));
> +       baton->sym = new->name;
> +       baton->obj = objfile;
> +       memcpy (&baton->locexpr, DW_BLOCK (attr), sizeof (struct dwarf_block));
> +       SYMBOL_LOCATION_FUNCS (new->name) = &locexpr_funcs;
> +       SYMBOL_LOCATION_BATON (new->name) = baton;
> +     }
> + 

Is there also a way of implementing these objects such that they check, 
at compile time, a match between initialized members and those that 
require assignment?  Perhaphs a memset(0) will be easiest.

I suspect, for instance, you'll need to add a thread_local_storgage() 
method pretty soon :-)

Andrew



More information about the Gdb-patches mailing list