From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/testsuite] Fix _selftest_setup on ppc64le-linux
Date: Fri, 14 Aug 2026 14:38:38 +0200 [thread overview]
Message-ID: <8728955b-d549-4776-9399-0d695b39c346@suse.de> (raw)
In-Reply-To: <20260729131224.3114252-1-tdevries@suse.de>
On 7/29/26 3:12 PM, Tom de Vries wrote:
> On ppc64le-linux, with gcc 7.5.0 and an O0 gdb build, I get:
> ...
> (gdb) run ...
> ...
> Breakpoint 1, main (argc=12, argv=0x7fffffffea78) at .../gdb.c:30^M
> 30 gdb_assert (is_main_thread ());^M
> (gdb) PASS: gdb.gdb/python-helper.exp: run until breakpoint at main
> ...
>
> But with an O2 gdb build, I run into:
> ...
> (gdb) run ...
> ...
> Breakpoint 1, 0x000000001003b438 in main (argc=12, argv=0x7fffffffea78) at \
> /space/vries/gdb/src/gdb/gdb.c:25
> 25 {
> (gdb) FAIL: gdb.gdb/python-helper.exp: run until breakpoint at main
> ...
>
> The breakpoint is indeed set at address 0x1003b438:
> ...
> (gdb) break main^M
> Breakpoint 1 at 0x1003b438: file /space/vries/gdb/src/gdb/gdb.c, line 25.^M
> ...
> which is the local entry point:
> ...
> (gdb) disassemble main
> Dump of assembler code for function main(int, char**):
> 0x000000001003b430 <+0>: lis r2,4606
> 0x000000001003b434 <+4>: addi r2,r2,28416
> 0x000000001003b438 <+8>: mflr r0
> ...
>
> And indeed, at that address, there's no "recommended breakpoint location":
> ...
> gdb.c:
> File name Line number Starting address View Stmt
> gdb.c 25 0x1003b430 x
> gdb.c 30 0x1003b454 x
> gdb.c 37 0x1003b464 x
> ...
>
> So gdb behaves as expected.
>
> Fix this by updating the pass regexp to allow this type of gdb output.
>
> This fixes both test-case gdb.gdb/python-helper.exp and gdb.gdb/selftest.exp.
>
I've pushed this to trunk, then reproduced the same problem on
gdb-18-branch, and applied the patch there.
Thanks,
- Tom
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34463
> ---
> gdb/testsuite/lib/selftest-support.exp | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp
> index 8d402288c51..bcfa99e8f34 100644
> --- a/gdb/testsuite/lib/selftest-support.exp
> +++ b/gdb/testsuite/lib/selftest-support.exp
> @@ -163,7 +163,8 @@ proc _selftest_setup { } {
> [multi_line \
> "Starting program: $re_hs" \
> ".*" \
> - [string cat "Breakpoint $::decimal, $function $re_args at" \
> + [string cat \
> + "Breakpoint $::decimal,( $::hex in)? $function $re_args at" \
> " ${re_hs}gdb.c:$re_hs"] \
> ".*"]
> set re_xfail \
>
> base-commit: 46a7f5580ebb8c6e0712ff83fbdfba658944ea01
prev parent reply other threads:[~2026-08-14 12:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 13:12 Tom de Vries
2026-08-14 12:38 ` Tom de Vries [this message]
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=8728955b-d549-4776-9399-0d695b39c346@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
/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