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: implement typed DWARF stack


On Mon, May 16, 2011 at 12:09:28PM -0600, Tom Tromey wrote:
> CCing Jakub.
> 
> Ulrich> So just to clarify: in the discussion a while back, you said:
> 
> Sorry for any confusion.  I hope this email will clear it up.
> 
> During our discussion I was convinced that DW_OP_shr should generally
> use the sign of any explicit type to decide what to do (with a special
> case for implicit type).  However, Jakub informed me that GCC relied on
> 'shr' always zero-filling, even for explicit types.  So, I changed the
> code back.  What is now in the tree implements the same semantics that
> GCC assumes.

My point is that we have two right shift operations, DW_OP_shr{,a}, so
it is IMHO better to just keep them as two operations even for typed
stack.  The type in that case is used only for the size of the shift,
whether the upper bits are filled with 0s or msb is determined by the
operation.  DW_OP_mod or DW_OP_div are different, there is just one
operation, so it has some default for untyped arguments (unsigned for
mod, signed for div) and for typed operands both type's size and signedness
matter.
If DW_OP_shr{,a} was the same, the producer would often need to add
additional DW_OP_convert ops.

OT, DW_OP_mod should be documented as:
"This operation operates only on integral values."
and DW_OP_const_type description uses "The second operand" twice, where
"The third operand" should be used in the second occurrence.

	Jakub


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