public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix test next-reverse-bkpt-over-sr.exp
@ 2022-09-27 16:14 Carl Love
  2022-09-28  7:35 ` Bruno Larsen
  0 siblings, 1 reply; 17+ messages in thread
From: Carl Love @ 2022-09-27 16:14 UTC (permalink / raw)
  To: gdb-patches; +Cc: Ulrich Weigand, Will Schmidt, cel


GDB maintainers:

The next-reverse-bkpt-over-sr.exp test sets a breakpoint on *callee.
The intention is the test is setting a breakpoint on the entry point of
the function.  However on PowerPC, the statement sets the breakpoint on
the global entry point.  The test uses the local entry point to the
function callee and thus the breakpoint on the global entry point is
never hit resulting in the test failing.

This patch changes the break instruction to callee to properly set the
breakpoint.  

The patch has been tested on both Power10 and X86-64 with no regression
errors.

Please let me know if this patch is acceptable for mainline.  Thanks.

                    Carl Love


---------------------------------------------------------------
Fix test next-reverse-bkpt-over-sr.exp

The test suses a gdb_test to set a breakpoint at *callee.  The message
says "set breakpoint at callee's entry".

The statement b *callee will set a breakpoint on the first instruction of
the function.  On some architectres, that may be the function entry point.
The PowerPC ABI specifies both local and global entry points.  The statement
b *callee sets the breakpoint t the global entry point and b callee sets
the breakpoint at the beginning of the fucntion, i.e. after the local
entry point and prolog.  The local entry point is generally used.  The
global entry point is only used if the TOC needs to be stup.

  int callee() {          /* ENTER CALLEE */
      100007ac:   02 10 40 3c     lis     r2,4098     <- global entry point
      100007b0:   00 7f 42 38     addi    r2,r2,32512
      100007b4:   f8 ff e1 fb     std     r31,-8(r1)  <- local entry point
      100007b8:   d1 ff 21 f8     stdu    r1,-48(r1)  <- prolog
      100007bc:   78 0b 3f 7c     mr      r31,r1      <- prolog
    return myglob++;	/* ARRIVED IN CALLEE */
      100007c0:	00 00 00 60 	nop                       <- location b callee
      100007c4:	40 81 22 39 	addi    r9,r2,-32448
      100007c8:	00 00 29 81 	lwz     r9,0(r9)
      100007cc:	01 00 09 39 	addi    r8,r9,1
       ...

The test should break on callee, not *callee, to get the desired behaviour
on PowerPC as well as other architecturs like X86-64.

This patch has been tested on Poser PC and X86-64 without any regression
failures.
---
 gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp b/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp
index 6ef56d30e7b..4e163c5c2f8 100644
--- a/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp
+++ b/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp
@@ -45,7 +45,7 @@ if [supports_process_record] {
 set lineno [gdb_get_line_number "STEP INTO THIS CALL"]
 gdb_test "advance $lineno" ".*STEP INTO THIS CALL.*" "get past callee call"
 
-gdb_test "b \*callee" "" "set breakpoint at callee's entry"
+gdb_test "b callee" "" "set breakpoint at callee's entry"
 
 set bpnum [get_integer_valueof "\$bpnum" 0]
 gdb_test "reverse-next" \
-- 
2.37.2



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-12-01 16:03 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 16:14 [PATCH] Fix test next-reverse-bkpt-over-sr.exp Carl Love
2022-09-28  7:35 ` Bruno Larsen
2022-11-14 21:05   ` [PATCH] PowerPC, fix gdb.reverse/finish-reverse-bkpt.exp and gdb.reverse/next-reverse-bkpt-over-sr.exp Carl Love
2022-11-21 16:36     ` [PING] " Carl Love
2022-11-22  9:42     ` Bruno Larsen
2022-11-22 16:53       ` Carl Love
2022-11-23  8:44         ` Bruno Larsen
2022-11-23 17:56         ` Ulrich Weigand
2022-11-23 23:33           ` Carl Love
2022-11-28 18:52           ` Carl Love
2022-11-29  8:52             ` Bruno Larsen
2022-11-29 16:50               ` Carl Love
2022-11-29 16:57               ` [PATCH V4] " Carl Love
2022-11-30 11:30                 ` Ulrich Weigand
2022-12-01  1:33                   ` Carl Love
2022-12-01 15:50                     ` [PATCH V5] " Carl Love
2022-12-01 16:02                       ` Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).