This is the mail archive of the gdb-patches@sources.redhat.com 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: [RFA]: dwarf2expr.[ch]


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


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