From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17294 invoked by alias); 21 Jan 2016 18:51:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 17278 invoked by uid 89); 21 Jan 2016 18:51:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1073, agent, collecting, UD:collection.exp X-HELO: xyzzy.0x04.net Received: from xyzzy.0x04.net (HELO xyzzy.0x04.net) (109.74.193.254) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Jan 2016 18:51:31 +0000 Received: from hogfather.0x04.net (89-65-66-135.dynamic.chello.pl [89.65.66.135]) by xyzzy.0x04.net (Postfix) with ESMTPS id 18ACA3FE60; Thu, 21 Jan 2016 19:52:13 +0100 (CET) Received: from [192.168.1.7] (unknown [109.241.14.236]) by hogfather.0x04.net (Postfix) with ESMTPSA id 4259F580092; Thu, 21 Jan 2016 19:51:29 +0100 (CET) Subject: Re: [PATCH v2] gdb.trace: Fix string collection for 64-bit platforms. To: Pedro Alves References: <56A103D5.2090505@redhat.com> <1453394591-5181-1-git-send-email-koriakin@0x04.net> <56A10D73.9030505@redhat.com> Cc: gdb-patches@sourceware.org From: =?UTF-8?Q?Marcin_Ko=c5=9bcielnicki?= Message-ID: <56A128B0.20601@0x04.net> Date: Thu, 21 Jan 2016 18:51:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56A10D73.9030505@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00547.txt.bz2 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.