This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA]: dwarf2expr.[ch]
- From: Andrew Cagney <ac131313 at ges dot redhat dot com>
- To: jimb at redhat dot com
- Cc: Daniel Berlin <dberlin at dberlin dot org>,gdb-patches at sources dot redhat dot com
- Date: Mon, 08 Jul 2002 23:49:00 -0400
- Subject: Re: [RFA]: dwarf2expr.[ch]
- References: <Pine.LNX.4.44.0207081941190.31676-100000@dberlin.org>
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