Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] [gdb/testsuite] Fix gdb.base/ending-run.exp on manjaro linux
@ 2024-03-14  9:57 Tom de Vries
  2024-03-28  7:27 ` Tom de Vries
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2024-03-14  9:57 UTC (permalink / raw)
  To: gdb-patches

On aarch64-linux, using the manjaro linux distro, I run into:
...
(gdb) next^M
32      }^M
(gdb) next^M
0x0000fffff7d67b80 in ?? () from /usr/lib/libc.so.6^M
(gdb) FAIL: gdb.base/ending-run.exp: step out of main
...

What happens here is described in detail in this clause:
...
    -re "0x.*\\?\\? \\(\\) from /lib/powerpc.*$gdb_prompt $" {
	# This case occurs on Powerpc when gdb steps out of main and the
	# needed debug info files are not loaded on the system, preventing
	# GDB to determine which function it reached (__libc_start_call_main).
	# Ideally, the target system would have the necessary debugging
	# information, but in its absence, GDB's behavior is as expected.
	...
    }
...
but the clause only matches for powerpc.

Fix this by:
- making the regexp generic enough to also match /usr/lib/libc.so.6, and
- updating the comment to not mention powerpc.

Tested on aarch64-linux.

PR testsuite/31450
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31450
---
 gdb/testsuite/gdb.base/ending-run.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp
index 9c80de6879b..b9a72b0e70e 100644
--- a/gdb/testsuite/gdb.base/ending-run.exp
+++ b/gdb/testsuite/gdb.base/ending-run.exp
@@ -206,8 +206,8 @@ gdb_test_multiple "next" "step out of main" {
 	# This is what happens on system using uClibc.
 	pass "step out of main"
     }
-    -re "0x.*\\?\\? \\(\\) from /lib/powerpc.*$gdb_prompt $" {
-	# This case occurs on Powerpc when gdb steps out of main and the
+    -re -wrap "$hex in \\?\\? \\(\\) from \[^\r\n\]+" {
+	# This case occurs when gdb steps out of main and the
 	# needed debug info files are not loaded on the system, preventing
 	# GDB to determine which function it reached (__libc_start_call_main).
 	# Ideally, the target system would have the necessary debugging

base-commit: 2618e5f141c89c15f5b13fd0b79312f1bc723bc9
-- 
2.35.3


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

* Re: [PATCH] [gdb/testsuite] Fix gdb.base/ending-run.exp on manjaro linux
  2024-03-14  9:57 [PATCH] [gdb/testsuite] Fix gdb.base/ending-run.exp on manjaro linux Tom de Vries
@ 2024-03-28  7:27 ` Tom de Vries
  0 siblings, 0 replies; 2+ messages in thread
From: Tom de Vries @ 2024-03-28  7:27 UTC (permalink / raw)
  To: gdb-patches

On 3/14/24 10:57, Tom de Vries wrote:
> On aarch64-linux, using the manjaro linux distro, I run into:
> ...
> (gdb) next^M
> 32      }^M
> (gdb) next^M
> 0x0000fffff7d67b80 in ?? () from /usr/lib/libc.so.6^M
> (gdb) FAIL: gdb.base/ending-run.exp: step out of main
> ...
> 
> What happens here is described in detail in this clause:
> ...
>      -re "0x.*\\?\\? \\(\\) from /lib/powerpc.*$gdb_prompt $" {
> 	# This case occurs on Powerpc when gdb steps out of main and the
> 	# needed debug info files are not loaded on the system, preventing
> 	# GDB to determine which function it reached (__libc_start_call_main).
> 	# Ideally, the target system would have the necessary debugging
> 	# information, but in its absence, GDB's behavior is as expected.
> 	...
>      }
> ...
> but the clause only matches for powerpc.
> 
> Fix this by:
> - making the regexp generic enough to also match /usr/lib/libc.so.6, and
> - updating the comment to not mention powerpc.
> 
> Tested on aarch64-linux.
> 

Pushed.

Thanks,
- Tom

> PR testsuite/31450
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31450
> ---
>   gdb/testsuite/gdb.base/ending-run.exp | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp
> index 9c80de6879b..b9a72b0e70e 100644
> --- a/gdb/testsuite/gdb.base/ending-run.exp
> +++ b/gdb/testsuite/gdb.base/ending-run.exp
> @@ -206,8 +206,8 @@ gdb_test_multiple "next" "step out of main" {
>   	# This is what happens on system using uClibc.
>   	pass "step out of main"
>       }
> -    -re "0x.*\\?\\? \\(\\) from /lib/powerpc.*$gdb_prompt $" {
> -	# This case occurs on Powerpc when gdb steps out of main and the
> +    -re -wrap "$hex in \\?\\? \\(\\) from \[^\r\n\]+" {
> +	# This case occurs when gdb steps out of main and the
>   	# needed debug info files are not loaded on the system, preventing
>   	# GDB to determine which function it reached (__libc_start_call_main).
>   	# Ideally, the target system would have the necessary debugging
> 
> base-commit: 2618e5f141c89c15f5b13fd0b79312f1bc723bc9


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

end of thread, other threads:[~2024-03-28  7:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-14  9:57 [PATCH] [gdb/testsuite] Fix gdb.base/ending-run.exp on manjaro linux Tom de Vries
2024-03-28  7:27 ` Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox