RFC: fix bug in pieced value with offset

Tom Tromey tromey@redhat.com
Fri May 14 20:02:00 GMT 2010


>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> On Fri, 14 May 2010 19:29:33 +0200, Tom Tromey wrote:
>> >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
>> 
Jan> Thinking now if the BFD_ENDIAN_BIG patch by Ulrich Weigand
Jan> [rfc] Handle DWARF-2 value pieces residing in *parts* of a register
Jan> http://sourceware.org/ml/gdb-patches/2009-12/msg00305.html
Jan> should not have been applied also for DWARF_VALUE_STACK; but this
Jan> is outside of the scope of this patch.
[...]
Jan> I am sorry, s/should not have/should have/.  Does it make sense now?

Yeah.  However I think this is adequately handled by store_unsigned_integer.
Is it not?

Jan> I believe it should be instead:
Jan> # +	      reg_offset = (register_size (arch, gdb_regnum)
Jan> # +			    - this_size);

Jan> Therefore I believe we should read in 0xad, 0xbe, 0xef.
Jan> Your patch reads in 0xba, 0xad, 0xbe.

Thanks for walking me through it.

Jan> I agree with your sentence.  I do not agree your sentence describes
Jan> your code.  The comparison present in code is exactly the opposite
Jan> one.  Your sentence describes "n < c->addr_size".

Hah, true.

I thought for sure I asked about this on the DWARF list, but I can't
find the discussion.

Issuing a complaint in this code is somewhat strange.  We don't have
information about where the piece originated.  I think it would be
better to issue complaints in execute_stack_op... though even that is
not super, because they will be issued over and over again.

Tom



More information about the Gdb-patches mailing list