summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2006-09-25 18:16:03 +0000
committerDaniel Jacobowitz <dan@debian.org>2006-09-25 18:16:03 +0000
commit0b7a9a318674291b8c5cb60eef0fe15d593f2439 (patch)
treeb085c469809d826ad8b5deac1a81118090e3858c
parente9a9f18976c76da4ded79ead0b5a27ca86a39dfc (diff)
downloadgdb-0b7a9a318674291b8c5cb60eef0fe15d593f2439.tar.gz
gdb/testsuite/
* gdb.arch/thumb-prologue.c: Update breakpoint mechanism. Restore lr before returning for completeness. * gdb.arch/thumb-prologue.exp: Update to set a breakpoint.
-rw-r--r--ChangeLog.csl7
-rw-r--r--gdb/testsuite/gdb.arch/thumb-prologue.c22
-rw-r--r--gdb/testsuite/gdb.arch/thumb-prologue.exp4
3 files changed, 27 insertions, 6 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl
index c51db412d37..73a2bb33a82 100644
--- a/ChangeLog.csl
+++ b/ChangeLog.csl
@@ -1,3 +1,10 @@
+2006-09-25 Daniel Jacobowitz <dan@codesourcery.com>
+
+ gdb/testsuite/
+ * gdb.arch/thumb-prologue.c: Update breakpoint mechanism. Restore
+ lr before returning for completeness.
+ * gdb.arch/thumb-prologue.exp: Update to set a breakpoint.
+
2006-09-21 Daniel Jacobowitz <dan@codesourcery.com>
gdb/
diff --git a/gdb/testsuite/gdb.arch/thumb-prologue.c b/gdb/testsuite/gdb.arch/thumb-prologue.c
index f6189634641..d78083b69ae 100644
--- a/gdb/testsuite/gdb.arch/thumb-prologue.c
+++ b/gdb/testsuite/gdb.arch/thumb-prologue.c
@@ -29,7 +29,8 @@ main (void)
}
/* Normally Thumb functions use r7 as the frame pointer. However,
- with the GCC option -mtpcs-frame, they may use fp instead. */
+ with the GCC option -mtpcs-frame, they may use fp instead. Make
+ sure that the prologue analyzer can handle this. */
asm(".text\n"
" .align 2\n"
@@ -51,8 +52,13 @@ asm(".text\n"
" mov r7, sl\n"
" push {r7}\n"
- /* Trap. */
- " .short 0xdffe\n"
+ /* We'll set a breakpoint at this call. We can't hardcode a trap
+ instruction; the right instruction to use varies too much. And
+ we can't use a global label, because GDB will think that's the
+ start of a new function. So, this slightly convoluted
+ technique. */
+ ".Ltpcs:\n"
+ " nop\n"
" pop {r2}\n"
" mov sl, r2\n"
@@ -63,6 +69,11 @@ asm(".text\n"
" bx lr\n"
" .align 2\n"
+ " .type tpcs_offset, %object\n"
+ "tpcs_offset:\n"
+ " .word .Ltpcs - tpcs_frame_1\n"
+
+ " .align 2\n"
" .thumb_func\n"
" .code 16\n"
"tpcs_frame:\n"
@@ -81,7 +92,7 @@ asm(".text\n"
" mov r7, sl\n"
" push {r7}\n"
- /* Clobber saved regs. */
+ /* Clobber saved regs around the call. */
" mov r7, #0\n"
" mov lr, r7\n"
" bl tpcs_frame_1\n"
@@ -89,8 +100,9 @@ asm(".text\n"
" pop {r2}\n"
" mov sl, r2\n"
" pop {r7}\n"
- " pop {r1, r2}\n"
+ " pop {r1, r2, r3}\n"
" mov fp, r1\n"
" mov sp, r2\n"
+ " mov lr, r3\n"
" bx lr\n"
);
diff --git a/gdb/testsuite/gdb.arch/thumb-prologue.exp b/gdb/testsuite/gdb.arch/thumb-prologue.exp
index 58a080fdb22..57ee7a00554 100644
--- a/gdb/testsuite/gdb.arch/thumb-prologue.exp
+++ b/gdb/testsuite/gdb.arch/thumb-prologue.exp
@@ -48,7 +48,9 @@ if ![runto_main] then {
# Testcase for TPCS prologue.
-gdb_test "continue" "Program received signal SIG.*" "continue to TPCS"
+gdb_breakpoint "* *(int *)tpcs_offset + (int) &tpcs_frame_1"
+gdb_test "continue" "Breakpoint .*, $hex in tpcs_frame_1 \\(\\)" \
+ "continue to TPCS"
gdb_test "backtrace 10" \
"#0\[ \t\]*$hex in tpcs_frame_1 .*\r\n#1\[ \t\]*$hex in tpcs_frame .*\r\n#2\[ \t\]*$hex in main.*" \