This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] better dwarf checking for values on the stack
- From: Tom Tromey <tromey at redhat dot com>
- To: dje at google dot com (Doug Evans)
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 11 Sep 2009 12:48:02 -0600
- Subject: Re: [RFC] better dwarf checking for values on the stack
- References: <20090910231912.0733A843B9@localhost>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Doug" == Doug Evans <dje@google.com> writes:
Doug> 2009-09-10 Doug Evans <dje@google.com>
Doug> Add better checking for values on stack.
Doug> * dwarf2expr.h (dwarf_value_location): Rename DWARF_VALUE_STACK to
Doug> DWARF_VALUE_DWARF_STACK, all uses updated.
Doug> New enum DWARF_VALUE_MEMORY_STACK.
Doug> * dwarf2expr.c (execute_stack_op, case DW_OP_fbreg): Mark location
Doug> as DWARF_VALUE_MEMORY_STACK.
Doug> (execute_stack_op, case DW_OP_call_frame_cfa): Ditto.
Doug> (execute_stack_op, cases DW_OP_deref, DW_OP_deref_size): Mark
Doug> location as DWARF_VALUE_MEMORY.
Doug> (execute_stack_op, case DW_OP_piece): Remove unused addr_or_regnum.
I think the tracking idea is sound, but I think this implementation has
a flaw.
It seems to me that the inferior-stack-ness of a value must be an
attribute carried alongside the value on the dwarf stack.
Here's a really bogus example that I hope still shows what I mean:
DW_OP_call_frame_cfa
DW_OP_deref
DW_OP_call_frame_cfa
DW_OP_drop
After the drop, ctx->location will be DWARF_VALUE_MEMORY_STACK.
However, this is incorrect.
Tom