This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: DWARF-2 expression error in location list entries
- From: Daniel Jacobowitz <drow at false dot org>
- To: Carl Burch <cdb at cup dot hp dot com>
- Cc: gdb at sourceware dot org
- Date: Tue, 8 May 2007 16:35:49 -0400
- Subject: Re: DWARF-2 expression error in location list entries
- References: <200705082022.NAA04796@hpadl693.cup.hp.com>
On Tue, May 08, 2007 at 01:22:25PM -0700, Carl Burch wrote:
> In dwarf2expr.c function execute_stack_op() there are two occurrences of
> error() calls asserting :
>
> if (op_ptr != op_end && *op_ptr != DW_OP_piece)
> error (_("DWARF-2 expression error: DW_OP_reg operations must be "
> "used either alone or in conjuction with DW_OP_piece."));
>
> A couple of us have looked for that first restriction in the DWARF3
> standard and not found it. I also went back to the DWARF2 standard
> literally cited by the message and failed to find it there as well. Can
> anyone point out where to read the restriction these error() calls refer to?
I believe the language was recently discussed on the dwarf workgroup
list. It's unclear, but the error is correct. DW_OP_regx describes
a location ("the value is in this register"), not a value ("the value is
the contents of this register"). Therefore the value may not be
stack-sized, and is not pushed on to the expression stack, so there's
nothing for you to DW_OP_deref later.
> The expression we have in mind to add is to describe Fortran reference
> parameters in location list entries like :
>
> { 0x4022720--0x4022724: DW_OP_regx 32 DW_OP_deref }
Isn't that just "DW_OP_bregx 32 0"?
--
Daniel Jacobowitz
CodeSourcery