Re: interface to partial support for DW_OP_piece in dwarf2expr.[ch]

Jim Blandy
2004-08-04T18:26:16Z

Andrew Cagney <cagney@gnu.org> writes:
> I'm just having trouble getting my head around how this will affect
> core-gdb, and seeing how this addresses our need to meet GCC 3.5's
> requirements?
>
> Can we expand on that?
>
> Looking at the below:
>
> - a single value can have multiple locations (important for store)
> - could dwarf2_expr_piece be called ``struct location''? :-)

That's where we're heading, yes. But I think one of the valuable
things about dwarf2expr.[ch] is that it does its job --- evaluating
Dwarf location expressions --- and only that job. We ought to leave
the work of constructing GDB-specific data structures to its clients,
like dwarf2loc.c and dwarf2-frame.c. That separation is important to
preserve; I see this as just another aspect of the priorities that led
to me revising Kevin's 2003 patch in the first place.

So in my view, dwarf2expr.[ch] should construct a data structure that
accurately reflects the result of evaluating a Dwarf 2 location
expression; it should be a Dwarf-specific data structure. The
construction of something like a 'struct location' should be left to
dwarf2loc.c.