Message ID | 1460473982-20054-1-git-send-email-antoine.tremblay@ericsson.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 17080 invoked by alias); 12 Apr 2016 15:13:19 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 17031 invoked by uid 89); 12 Apr 2016 15:13:18 -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, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: usplmg20.ericsson.net Received: from usplmg20.ericsson.net (HELO usplmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 12 Apr 2016 15:13:17 +0000 Received: from EUSAAHC003.ericsson.se (Unknown_Domain [147.117.188.81]) by usplmg20.ericsson.net (Symantec Mail Security) with SMTP id D3.43.09012.B0A0D075; Tue, 12 Apr 2016 16:45:31 +0200 (CEST) Received: from elxa4wqvvz1.dyn.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.81) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 12 Apr 2016 11:13:13 -0400 From: Antoine Tremblay <antoine.tremblay@ericsson.com> To: <gdb-patches@sourceware.org> CC: Antoine Tremblay <antoine.tremblay@ericsson.com> Subject: [PATCH] Fix aarch64 ftrace JIT condition testcase Date: Tue, 12 Apr 2016 11:13:02 -0400 Message-ID: <1460473982-20054-1-git-send-email-antoine.tremblay@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes |
Commit Message
Antoine Tremblay
April 12, 2016, 3:13 p.m. UTC
This patch fixes the following failure: FAIL: gdb.trace/trace-condition.exp: ftrace: -(21 << 1) == -42: check 10 frames were collected. This was due to aarch64_emit_sub using the wrong order in its operands, so the operation would end up being 42 - 0 rather than 0 - 42. This patch also fixes the order of aarch64_emit_add for clarity. Tested on aarch64-native-extended-gdbserver. Note: trace-condition.exp was broken a bit so I had to modify it to run the test. A fix is coming for that in another patch. gdb/gdbserver/ChangeLog: * linux-aarch64-low.c (aarch64_emit_add): Switch x1 and x0. (aarch64_emit_sub): Likewise. --- gdb/gdbserver/linux-aarch64-low.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Hi Antoine, On 12/04/16 16:13, Antoine Tremblay wrote: > This patch fixes the following failure: > FAIL: gdb.trace/trace-condition.exp: ftrace: -(21 << 1) == -42: check 10 > frames were collected. > > This was due to aarch64_emit_sub using the wrong order in its operands, so the > operation would end up being 42 - 0 rather than 0 - 42. Ooops, thanks for the fix! I was a little confused how I could have missed this, it turns out I had forgotten to had parentheses in `-(21 << 1) == -42' at the time, so `emit_sub' was not tested here. I aimed at testing `emit_sub' with the following test case which is clearly not good enough: gdb.trace/trace-condition.exp: ftrace: 21 - 21 == 0 Would you be OK with changing it to "42 - 21 == 21" or something? Thanks again! Pierre > > This patch also fixes the order of aarch64_emit_add for clarity. > > Tested on aarch64-native-extended-gdbserver. > > Note: trace-condition.exp was broken a bit so I had to modify it to run > the test. A fix is coming for that in another patch. > > gdb/gdbserver/ChangeLog: > > * linux-aarch64-low.c (aarch64_emit_add): Switch x1 and x0. > (aarch64_emit_sub): Likewise. > --- > gdb/gdbserver/linux-aarch64-low.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c > index 12fe2e6..d237bde 100644 > --- a/gdb/gdbserver/linux-aarch64-low.c > +++ b/gdb/gdbserver/linux-aarch64-low.c > @@ -2258,7 +2258,7 @@ aarch64_emit_add (void) > uint32_t *p = buf; > > p += emit_pop (p, x1); > - p += emit_add (p, x0, x0, register_operand (x1)); > + p += emit_add (p, x0, x1, register_operand (x0)); > > emit_ops_insns (buf, p - buf); > } > @@ -2272,7 +2272,7 @@ aarch64_emit_sub (void) > uint32_t *p = buf; > > p += emit_pop (p, x1); > - p += emit_sub (p, x0, x0, register_operand (x1)); > + p += emit_sub (p, x0, x1, register_operand (x0)); > > emit_ops_insns (buf, p - buf); > } >
Pierre Langlois writes: > Hi Antoine, > > On 12/04/16 16:13, Antoine Tremblay wrote: >> This patch fixes the following failure: >> FAIL: gdb.trace/trace-condition.exp: ftrace: -(21 << 1) == -42: check 10 >> frames were collected. >> >> This was due to aarch64_emit_sub using the wrong order in its operands, so the >> operation would end up being 42 - 0 rather than 0 - 42. > > Ooops, thanks for the fix! I was a little confused how I could have > missed this, it turns out I had forgotten to had parentheses in > `-(21 << 1) == -42' at the time, so `emit_sub' was not tested here. hehe. > > I aimed at testing `emit_sub' with the following test case which is > clearly not good enough: > > gdb.trace/trace-condition.exp: ftrace: 21 - 21 == 0 > > Would you be OK with changing it to "42 - 21 == 21" or something? > Right indeed good idea, I'm sending a v2 with this. > Thanks again! np. Antoine >> This patch also fixes the order of aarch64_emit_add for clarity. >> >> Tested on aarch64-native-extended-gdbserver. >> >> Note: trace-condition.exp was broken a bit so I had to modify it to run >> the test. A fix is coming for that in another patch. >> >> gdb/gdbserver/ChangeLog: >> >> * linux-aarch64-low.c (aarch64_emit_add): Switch x1 and x0. >> (aarch64_emit_sub): Likewise. >> --- >> gdb/gdbserver/linux-aarch64-low.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c >> index 12fe2e6..d237bde 100644 >> --- a/gdb/gdbserver/linux-aarch64-low.c >> +++ b/gdb/gdbserver/linux-aarch64-low.c >> @@ -2258,7 +2258,7 @@ aarch64_emit_add (void) >> uint32_t *p = buf; >> >> p += emit_pop (p, x1); >> - p += emit_add (p, x0, x0, register_operand (x1)); >> + p += emit_add (p, x0, x1, register_operand (x0)); >> >> emit_ops_insns (buf, p - buf); >> } >> @@ -2272,7 +2272,7 @@ aarch64_emit_sub (void) >> uint32_t *p = buf; >> >> p += emit_pop (p, x1); >> - p += emit_sub (p, x0, x0, register_operand (x1)); >> + p += emit_sub (p, x0, x1, register_operand (x0)); >> >> emit_ops_insns (buf, p - buf); >> } >>
diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c index 12fe2e6..d237bde 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -2258,7 +2258,7 @@ aarch64_emit_add (void) uint32_t *p = buf; p += emit_pop (p, x1); - p += emit_add (p, x0, x0, register_operand (x1)); + p += emit_add (p, x0, x1, register_operand (x0)); emit_ops_insns (buf, p - buf); } @@ -2272,7 +2272,7 @@ aarch64_emit_sub (void) uint32_t *p = buf; p += emit_pop (p, x1); - p += emit_sub (p, x0, x0, register_operand (x1)); + p += emit_sub (p, x0, x1, register_operand (x0)); emit_ops_insns (buf, p - buf); }