aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/linux-aarch64-low.c
diff options
context:
space:
mode:
authorAntoine Tremblay <antoine.tremblay@ericsson.com>2016-04-13 09:40:00 -0400
committerAntoine Tremblay <antoine.tremblay@ericsson.com>2016-04-13 09:40:00 -0400
commit45e3745ed0e034fdec5beee0738f383bd6e2e045 (patch)
treed7958eb9c9c8ce9a0b2d3ce8063eca1d76d2c52b /gdb/gdbserver/linux-aarch64-low.c
parent3a00c80277a54abe0b286a6e8babc8fe50120205 (diff)
downloadgdb-45e3745ed0e034fdec5beee0738f383bd6e2e045.zip
gdb-45e3745ed0e034fdec5beee0738f383bd6e2e045.tar.gz
gdb-45e3745ed0e034fdec5beee0738f383bd6e2e045.tar.bz2
Fix aarch64 ftrace JIT condition testcase
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. The test case for emit_sub is fixed so that the proper order of the operands is needed for the test to pass. 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/testsuite/ChangeLog: * gdb.trace/trace-condition.exp (foreach): Fix emit_sub testcase.
Diffstat (limited to 'gdb/gdbserver/linux-aarch64-low.c')
-rw-r--r--gdb/gdbserver/linux-aarch64-low.c4
1 files 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);
}