This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: Location list support for DWARF-2
- From: Jim Blandy <jimb at redhat dot com>
- To: Daniel Jacobowitz <drow at mvista dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: 09 Apr 2003 00:06:37 -0500
- Subject: Re: RFA: Location list support for DWARF-2
- References: <20030310160628.GA1988@nevyn.them.org><vt28yvknu5r.fsf@zenia.red-bean.com><20030312224043.GA8247@nevyn.them.org>
This looks good to me --- please commit it, once you've addressed the
minor things I mention here.
(Yay!)
Daniel Jacobowitz <drow at mvista dot com> writes:
> > Rather than putting 'if (foo->is_list)' everywhere, why not just
> > introduce a separate 'struct location_funcs' for location lists?
> > Aside from just being cleaner, you'll save a word in each baton.
>
> Actually, it won't save any space to remove is_list: it goes into the
> padding between size and the following CORE_ADDR/pointer. It does save
> space for non-location-list variables though, because of the base
> address, so I think it's a good idea.
Okay, I think that's a big improvement.
> It requires introducing one annoying hack in dwarf_expr_frame_base
> but I'm not terribly upset by it.
I can think of a nice solution in C++, but it would lose so much in
the translation to C that it's not worth it.
> +struct dwarf2_loclist_baton
> +{
> + CORE_ADDR base_address;
> + unsigned char *data;
> + unsigned short size;
> + struct objfile *objfile;
> +};
The fields of this structure need to be documented, as do those of
dwarf2_locexpr_baton.
> + {
> + dwarf2_invalid_attrib_class_complaint ("location description",
> + SYMBOL_NATURAL_NAME (sym));
> + baton->size = 0;
> + baton->data = NULL;
> + }
dwarf2_evaluate_loc_desc isn't prepared to handle this; it'll get an
error when it tries to fetch the top value off the stack after
evaluating no location instructions, won't it? It should probably
return a value with its "optimized_out" flag set.