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: [RFA] Delayed physname computation


On 04/23/2010 04:03 PM, Tom Tromey wrote:
Keith>  +static void
Keith>  +add_to_method_list (struct type *type, int fnfield_index, int index,
Keith>  +		    const char *name, struct die_info *die,
Keith>  +		    struct dwarf2_cu *cu)

This needs some kind of header comment. It can be pretty mild.

Done.


Keith> + physname = (char *) dwarf2_physname ((char *) mi->name, mi->die, cu);

It would be nice to make all this stuff const-correct.  It is definitely
not needed for this patch, I just didn't notice this earlier.

I'll add that to my immediate TODO list.


I didn't go dig through the code, so consider this a conditional
request.  If we are careful about cleanups here, then this needs a
cleanup; otherwise an error results in a memory leak.  If we aren't
already careful, then don't bother, I think we will need to make a pass
through this to make the reader a bit more robust in the face of weird
DWARF.  In this case, either file a bug or let me know and I will file
one.

Yeah, I wasn't 100% sure whether this needed a cleanup, either. Nonetheless, we have two options, catch any errors (which I think was suggested in another thread for a different problem) or add a cleanup. A little paranoia can't hurt that much. If you have a preference, I'll implement that.


Keith>       complaint (&symfile_complaints, _("member function type missing for '%s'"),
Keith>  -	       physname);
Keith>  +	       dwarf2_physname (fieldname, die, cu));

Can this call to dwarf2_physname exhibit the problem that this patch is
trying to circumvent?

Unfortunately, it very well could. I guess it would be almost as useful if this called dwarf2_fullname instead. What do you think?


Keith


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