From: Carl Love <cel@us.ibm.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
Will Schmidt <will_schmidt@vnet.ibm.com>,
cel@us.ibm.com
Subject: [PATCH] Fix test next-reverse-bkpt-over-sr.exp
Date: Tue, 27 Sep 2022 09:14:33 -0700 [thread overview]
Message-ID: <e0f721cd4a34b242d7046d7823be04aeb54efdd7.camel@us.ibm.com> (raw)
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
next reply other threads:[~2022-09-27 16:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-27 16:14 Carl Love [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e0f721cd4a34b242d7046d7823be04aeb54efdd7.camel@us.ibm.com \
--to=cel@us.ibm.com \
--cc=Ulrich.Weigand@de.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=will_schmidt@vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).