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: [PATCH] PR gdb/21226: Take DWARF stack value pieces from LSB end


On Fri, Mar 10 2017, Ulrich Weigand wrote:

> Andreas Arnez wrote:
>
> Sorry, I overlooked one other issue:
>
>> +	    /* Piece offset is from least significant bit end.  */
>> +	    if (bits_big_endian)
>> +	      source_offset_bits += obj_size - (p->offset + p->size);
>> +	    else
>> +	      source_offset_bits += p->offset;
>
> Should this really consult bits_big_endian, as opposed to the
> regular byte order?  Note that in the DWARF_VALUE_REGISTER case,
> we have the same issue, and there the byte order is consulted.

Using the byte order would strictly be more correct, yes.  As opposed to
register pieces, we would have to get it from a different gdbarch,
though.  I think the right one would be the objfile gdbarch of the
underlying CU, right?

>
> (This doesn't make much of a difference today since in GDB
> bit order is always the same a byte order, but we might as
> well get it right ...)
>
> Also, is p->size the right value here?  Note that the code before
> the loop might already have partially reduced the size and updated
> the this_size(_bits) variables.  Again, I think this case basically
> ought to work the same as the DWARF_VALUE_REGISTER case.  (Hmmm.
> On the other hand, maybe the DWARF_VALUE_REGISTER case is wrong.
> Either way, it should be the same :-))

Yeah, p->size is correct, and the code for DWARF_VALUE_REGISTER is
wrong.  Again, I didn't want to mix fixes for other piece types into
this patch.  So I'll add another patch for that.

--
Andreas


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