[PATCH] powerpc-prologue.exp

Mark Kettenis
2008-08-20T14:20:51Z

While running the testsuite on openbsd4.4-unknown-powerpc, I spotted
the following new fail:

+FAIL: gdb.arch/powerpc-prologue.exp: saved registers in PIC

The problem is that "info frame" no longer reports r31 as saved. As
far as I can tell, the assembly code doesn't actually save r31, so I
suspect this is actually a bug in the testcase that got uncovered by
the following fix by Daniel:

2008-08-18 Daniel Jacobowitz <dan@codesourcery.com>

* rs6000-tdep.c (struct rs6000_framedata): Add gpr_mask, used_bl,
lr_register.
(rs6000_in_function_epilogue_p): Check for bctr.
(skip_prologue): Initialize lr_register. Set lr_reg to a register
number. Set gpr_mask and used_bl. Continue scanning while some
expected registers are not saved. Set lr_register if LR is not
stored.
(rs6000_frame_cache): Handle gpr_mask and lr_register.

So the following testsuite fix seems to be appropriate. ok?

Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>

* gdb.arch/powerpc-prologue.exp: Code doesn't save %r31 so don't
expect to find it in the "info frame" output.

Index: gdb.arch/powerpc-prologue.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.arch/powerpc-prologue.exp,v
retrieving revision 1.6
diff -u -p -r1.6 powerpc-prologue.exp
--- gdb.arch/powerpc-prologue.exp 18 Aug 2008 12:32:47 -0000 1.6
+++ gdb.arch/powerpc-prologue.exp 20 Aug 2008 14:14:44 -0000
@@ -64,7 +64,7 @@ gdb_test "backtrace 10" \
"backtrace in PIC"

gdb_test "info frame" \
- ".*Saved registers:.*r30 at.*r31 at.*pc at.*lr at.*" \
+ ".*Saved registers:.*r30 at.*pc at.*lr at.*" \
"saved registers in PIC"

# Testcase for scheduled prologue.