diff options
author | Daniel Jacobowitz <drow@false.org> | 2007-03-13 17:34:23 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2007-03-13 17:34:23 +0000 |
commit | 4e463ff5459d8c72eb1c5c1a7859e8556dbd69e2 (patch) | |
tree | 53db7049f2fd0de140d1c84c26136fbde1e65141 /gdb/testsuite | |
parent | 35d9dd2fb8ba23282114af75003ff0c2bee9661a (diff) | |
download | gdb-4e463ff5459d8c72eb1c5c1a7859e8556dbd69e2.zip gdb-4e463ff5459d8c72eb1c5c1a7859e8556dbd69e2.tar.gz gdb-4e463ff5459d8c72eb1c5c1a7859e8556dbd69e2.tar.bz2 |
* rs6000-tdep.c (rs6000_skip_prologue): Use skip_prologue_using_sal.
(rs6000_in_function_epilogue_p): Use extract_unsigned_integer.
(refine_prologue_limit): Delete.
(skip_prologue): Don't call it. Use extract_unsigned_integer.
Assume lim_pc is set. Correct check for incomplete prologues.
Do not skip clobbers of the frame pointer.
* symtab.c (skip_prologue_using_sal): Fail if there is only one
sal.
* gdb.arch/powerpc-prologue.c (optimized_1_marker, gdb2029_marker)
(optimized_1): New.
(main): Call optimized_1.
(gdb2029): Correct typos. Call gdb2029_marker.
* gdb.arch/powerpc-prologue.exp: Run new test. Use a breakpoint
for gdb2029.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/powerpc-prologue.c | 39 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/powerpc-prologue.exp | 32 |
3 files changed, 74 insertions, 6 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 9300ec3..bfa0b87 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2007-03-13 Daniel Jacobowitz <dan@codesourcery.com> + + * gdb.arch/powerpc-prologue.c (optimized_1_marker, gdb2029_marker) + (optimized_1): New. + (main): Call optimized_1. + (gdb2029): Correct typos. Call gdb2029_marker. + * gdb.arch/powerpc-prologue.exp: Run new test. Use a breakpoint + for gdb2029. + 2007-03-12 Mark Kettenis <kettenis@gnu.org> * gdb.gdb/selftest.exp (do_steps_and_nexts): Match spaces as well diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.c b/gdb/testsuite/gdb.arch/powerpc-prologue.c index 9f3836a..6dcec2f 100644 --- a/gdb/testsuite/gdb.arch/powerpc-prologue.c +++ b/gdb/testsuite/gdb.arch/powerpc-prologue.c @@ -31,23 +31,54 @@ int main (void) { gdb2029 (); + optimized_1 (); return 0; } +void +optimized_1_marker (void) +{ +} + +void +gdb2029_marker (void) +{ +} + /* A typical PIC prologue from GCC. */ asm(".text\n" - " .align 8\n" + " .p2align 3\n" SYMBOL (gdb2029) ":\n" - " stw %r1, -32(%r1)\n" + " stwu %r1, -32(%r1)\n" " mflr %r0\n" " bcl- 20,31,.+4\n" " stw %r30, 24(%r1)\n" " mflr %r30\n" " stw %r0, 36(%r1)\n" - " twge %r2, %r2\n" + " bl gdb2029_marker\n" " lwz %r0, 36(%r1)\n" " lwz %r30, 24(%r1)\n" " mtlr %r0\n" - " addi %r0, %r0, 32\n" + " addi %r1, %r1, 32\n" + " blr"); + +/* A heavily scheduled prologue. */ +asm(".text\n" + " .p2align 3\n" + SYMBOL (optimized_1) ":\n" + " stwu %r1,-32(%r1)\n" + " lis %r9,-16342\n" + " lis %r11,-16342\n" + " mflr %r0\n" + " addi %r11,%r11,3776\n" + " stmw %r27,12(%r1)\n" + " addi %r31,%r9,3152\n" + " cmplw %cr7,%r31,%r11\n" + " stw %r0,36(%r1)\n" + " mr %r30,%r3\n" + " bl optimized_1_marker\n" + " lwz %r0,36(%r1)\n" + " lmw %r27,12(%r1)\n" + " addi %r1,%r1,32\n" " blr"); diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-prologue.exp index c50c56b..9bacb99 100644 --- a/gdb/testsuite/gdb.arch/powerpc-prologue.exp +++ b/gdb/testsuite/gdb.arch/powerpc-prologue.exp @@ -50,12 +50,40 @@ if ![runto_main] then { # Testcase for PIC prologue. -gdb_test "continue" "Program received signal SIGTRAP.*" "continue to PIC" +gdb_breakpoint "gdb2029_marker" +gdb_test "continue" "Breakpoint $decimal, $hex in gdb2029_marker \\(\\)" \ + "continue to PIC" gdb_test "backtrace 10" \ - "#0\[ \t\]*$hex in gdb2029.*\r\n#1\[ \t\]*$hex in main.*" \ + "#0\[ \t\]*$hex in gdb2029_marker.*\r\n#1\[ \t\]*$hex in gdb2029.*\r\n#2\[ \t\]*$hex in main.*" \ + "backtrace in PIC marker" + +gdb_test "finish" ".*$hex in gdb2029 .*" "finish from PIC" + +gdb_test "backtrace 10" \ + "#0\[ \t\]*$hex in gdb2029 .*\r\n#1\[ \t\]*$hex in main.*" \ "backtrace in PIC" gdb_test "info frame" \ ".*Saved registers:.*r30 at.*r31 at.*pc at.*lr at.*" \ "saved registers in PIC" + +# Testcase for scheduled prologue. + +gdb_breakpoint "optimized_1_marker" +gdb_test "continue" "Breakpoint $decimal, $hex in optimized_1_marker \\(\\)" \ + "continue to optimized" + +gdb_test "backtrace 10" \ + "#0\[ \t\]*$hex in optimized_1_marker.*\r\n#1\[ \t\]*$hex in optimized_1.*\r\n#2\[ \t\]*$hex in main.*" \ + "backtrace in optimized marker" + +gdb_test "finish" ".*$hex in optimized_1 .*" "finish from optimized" + +gdb_test "backtrace 10" \ + "#0\[ \t\]*$hex in optimized_1 .*\r\n#1\[ \t\]*$hex in main.*" \ + "backtrace in optimized" + +gdb_test "info frame" \ + ".*Saved registers:.*r30 at.*r31 at.*pc at.*lr at.*" \ + "saved registers in optimized" |