This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] gdb.trace: Fix string collection for 64-bit platforms.
- From: Pedro Alves <palves at redhat dot com>
- To: Marcin KoÅcielnicki <koriakin at 0x04 dot net>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 21 Jan 2016 16:55:15 +0000
- Subject: Re: [PATCH v2] gdb.trace: Fix string collection for 64-bit platforms.
- Authentication-results: sourceware.org; auth=none
- References: <56A103D5 dot 2090505 at redhat dot com> <1453394591-5181-1-git-send-email-koriakin at 0x04 dot net>
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