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 v2] gdb.trace: Fix string collection for 64-bit platforms.


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


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