Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Re: DWARF-2 expression error in location list entries
@ 2007-05-08 22:49 Carl Burch
  2007-05-08 23:51 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Carl Burch @ 2007-05-08 22:49 UTC (permalink / raw)
  To: gdb


Daniel-

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

   Yes, I think so.  Thanks for the clear explanation.
   
   Any idea why the same situation in decode_locdesc() of dwarf2read.c is only
a complaint?

							- Carl Burch
							  HP WDB Team
							  


^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: DWARF-2 expression error in location list entries
@ 2007-05-10  1:21 David Anderson
  0 siblings, 0 replies; 5+ messages in thread
From: David Anderson @ 2007-05-10  1:21 UTC (permalink / raw)
  To: gdb

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

The clearest hint is in DWARF3 2.6.1: 
"The following DWARF operations can be used to name a register. They can be used only in
location expressions. Each register name operator must be used alone (as a DWARF expression
consisting of just that one operation)."
(goes on to mention DW_OP_reg*).

It's true that this is not as clear as it should be 
(DW_OP_piece is not mentioned in 2.6.1, for example).
2.6.2 does try to clarify this, but it's not easy to interpret.
But Daniel Jacobowitz is exactly right.  
These can only be used stand-alone (or with DW_OP_piece).

Jim Blandy suggested a nice little grammar
which made all this quite clear (March 8 2007, dwarf-discuss mailing list).

The lack of clarity issue got lost in a discussion about a proposal
on constant expressions in location lists.    I'll resurrect Jim's suggestion
for the DWARF committee.

Regards,
David Anderson








^ permalink raw reply	[flat|nested] 5+ messages in thread
* DWARF-2 expression error in location list entries
@ 2007-05-08 20:22 Carl Burch
  2007-05-08 20:36 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Carl Burch @ 2007-05-08 20:22 UTC (permalink / raw)
  To: gdb

   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?

   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   }

Yes, we know that Gnu Fortran describes reference params in terms of passing
the underlying pointers by value instead of the original Fortran types by
reference, thereby avoiding this problem.  This is a case where we're trying
to be better instead of de facto standard.

						- Carl Burch
						  HP WDB Team

P.S. If anyone edits this file soon, you might want to fix the spelling of
"conjuction" in the message.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-05-10  1:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-08 22:49 DWARF-2 expression error in location list entries Carl Burch
2007-05-08 23:51 ` Daniel Jacobowitz
  -- strict thread matches above, loose matches on Subject: below --
2007-05-10  1:21 David Anderson
2007-05-08 20:22 Carl Burch
2007-05-08 20:36 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox