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: [RFC] better dwarf checking for values on the stack


>>>>> "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


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