[PATCH v2] gdb.trace: Fix string collection for 64-bit platforms.

Marcin Kościelnicki koriakin@0x04.net
Thu Jan 21 18:51:00 GMT 2016


On 21/01/16 17:55, Pedro Alves wrote:
> On 01/21/2016 04:43 PM, Marcin Kościelnicki wrote:
>> String collection always used ref32 to fetch the string pointer.  Make it
>> use gen_fetch instead.
>>
>> As a side effect, this patch changes dup+const+trace+pop sequence used
>> for collecting the string's address to a trace_quick opcode.  This
>> results in a shorter agent expression.
>>
>> This appeared to work on x86_64 since it's a little-endian platform, and
>> malloc (used in gdb.trace/collection.exp) returns addresses in low 4GB.
>> Noticed and tested on s390x-ibm-linux-gnu, also tested on
>> i686-unknown-linux-gnu and x86_64-unknown-linux-gnu.
>>
>> gdb/ChangeLog:
>>
>> 	* ax-gdb.c (gen_traced_pop): Use gen_fetch for string collection.
>> ---
>> Instead of factoring out the switch, I just delegated to gen_fetch.
>> Turns out we can shave off a few ops this way, too.  Likewise tested
>> on s390, s390x, i686, x86_64.
>
> Even better.  This is OK.
>
> Thanks,
> Pedro Alves
>

Thanks, pushed.



More information about the Gdb-patches mailing list