aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2016-04-07 17:06:14 +0100
committerYao Qi <yao.qi@linaro.org>2016-04-07 17:06:14 +0100
commitc8064e7e9b4d7d9cc29a613af899a7739df60be6 (patch)
treebca6538337d39ec2f7b27c13112bd8a54c6f27d2
parentbde475616e3fdb6d41c047956aaf627fbf34a85d (diff)
downloadgdb-c8064e7e9b4d7d9cc29a613af899a7739df60be6.zip
gdb-c8064e7e9b4d7d9cc29a613af899a7739df60be6.tar.gz
gdb-c8064e7e9b4d7d9cc29a613af899a7739df60be6.tar.bz2
Fix gdb.reverse/finish-reverse-bkpt.exp
I see the following fail on aarch64-linux break void_func Breakpoint 2 at 0x4007a0: file gdb/testsuite/gdb.reverse/finish-reverse.c, line 44. (gdb) PASS: gdb.reverse/finish-reverse-bkpt.exp: set breakpoint on void_func continue Continuing. Breakpoint 2, void_func () at gdb/testsuite/gdb.reverse/finish-reverse.c:44^M 44 void_test = 1; /* VOID FUNC */^M (gdb) PASS: gdb.reverse/finish-reverse-bkpt.exp: continue to breakpoint: void_func break *void_func^M Note: breakpoint 2 also set at pc 0x4007a0.^M Breakpoint 3 at 0x4007a0: file gdb/testsuite/gdb.reverse/finish-reverse.c, line 44. (gdb) PASS: gdb.reverse/finish-reverse-bkpt.exp: set breakpoint at void_func's entry reverse-finish^M Run back to call of #0 void_func () at gdb/testsuite/gdb.reverse/finish-reverse.c:44 main (argc=1, argv=0x7ffffffb78) at gdb/testsuite/gdb.reverse/finish-reverse.c:98 98 void_func (); /* call to void_func */^M (gdb) FAIL: gdb.reverse/finish-reverse-bkpt.exp: reverse-finish from void_func trips breakpoint at entry The test assumes that brekapoints on "void_func" and "*void_func" are set on different places because of function prologue. However, on aarch64-linux, there is no prologue in void_func, so two breakpoints are set at the same place (0x4007a0). (gdb) disassemble void_func Dump of assembler code for function void_func: 0x00000000004007a0 <+0>: adrp x0, 0x410000 0x00000000004007a4 <+4>: add x0, x0, #0xc14 0x00000000004007a8 <+8>: mov w1, #0x1 0x00000000004007ac <+12>: str w1, [x0] 0x00000000004007b0 <+16>: ret The fix to this problem is to single step forward before setting breakpoint on *void_func. gdb/testsuite: 2016-04-07 Yao Qi <yao.qi@linaro.org> * gdb.reverse/finish-reverse-bkpt.exp: Use temporary breakpoint. Execute "si" command.
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp9
2 files changed, 12 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index a044d5a..e00afa7 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2016-04-07 Yao Qi <yao.qi@linaro.org>
+ * gdb.reverse/finish-reverse-bkpt.exp: Use temporary breakpoint.
+ Execute "si" command.
+
+2016-04-07 Yao Qi <yao.qi@linaro.org>
+
* gdb.reverse/next-reverse-bkpt-over-sr.exp: Match the breakpoint
number instead of the comments on some line.
diff --git a/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp b/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
index ccc332d..1dff8e1 100644
--- a/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
+++ b/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
@@ -40,11 +40,16 @@ if [supports_process_record] {
}
set breakloc [gdb_get_line_number "VOID FUNC" "$srcfile"]
-gdb_test "break void_func" \
- "Breakpoint $decimal at .*$srcfile, line $breakloc\." \
+gdb_test "tbreak void_func" \
+ "Temporary breakpoint $decimal at .*$srcfile, line $breakloc\." \
"set breakpoint on void_func"
gdb_continue_to_breakpoint "void_func" ".*$srcfile:$breakloc.*"
+# We stop at the brekapoint on void_func, but breakpoint on
+# *void_func will be set at the same place if function void_func doesn't
+# have prologue. One step forward to avoid this.
+gdb_test "si"
+
gdb_test "break \*void_func" \
"Breakpoint $decimal at .*" \
"set breakpoint at void_func's entry"