Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/2] [gdb/testsuite] Two ppc64 fixes
@ 2026-08-02  9:34 Tom de Vries
  2026-08-02  9:34 ` [PATCH 1/2] [gdb/testsuite] Fix gdb.base/examine-address-class.exp for big endian Tom de Vries
  2026-08-02  9:34 ` [PATCH 2/2] [gdb/testsuite] Fix gdb.base/msym-lang.exp on ppc64-linux Tom de Vries
  0 siblings, 2 replies; 6+ messages in thread
From: Tom de Vries @ 2026-08-02  9:34 UTC (permalink / raw)
  To: gdb-patches

Two patches fixing test-cases that fail on ppc64-linux.

Tom de Vries (2):
  [gdb/testsuite] Fix gdb.base/examine-address-class.exp for big endian
  [gdb/testsuite] Fix gdb.base/msym-lang.exp on ppc64-linux

 gdb/testsuite/gdb.base/examine-address-class.c | 2 +-
 gdb/testsuite/gdb.base/msym-lang.exp           | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)


base-commit: 99e6cde739b4e8413c92d657edca86f3df07f841
-- 
2.51.0


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

* [PATCH 1/2] [gdb/testsuite] Fix gdb.base/examine-address-class.exp for big endian
  2026-08-02  9:34 [PATCH 0/2] [gdb/testsuite] Two ppc64 fixes Tom de Vries
@ 2026-08-02  9:34 ` Tom de Vries
  2026-08-03  4:51   ` Kevin Buettner
  2026-08-02  9:34 ` [PATCH 2/2] [gdb/testsuite] Fix gdb.base/msym-lang.exp on ppc64-linux Tom de Vries
  1 sibling, 1 reply; 6+ messages in thread
From: Tom de Vries @ 2026-08-02  9:34 UTC (permalink / raw)
  To: gdb-patches

On ppc64-linux and s390x-linux, with test-case
gdb.base/examine-address-class.exp I get:
...
(gdb) x/1dh (int *) &var^M
0x3fffffffe560: 0^M
(gdb) FAIL: $exp: x/1dh (int *) &var
...

This is caused by big vs. little endian.

On x86_64-linux (little endian), we have:
...
(gdb) p /x ((short *)&var)[0]
$6 = 0x2a
(gdb) p /x ((short *)&var)[1]
$7 = 0x0
(gdb)
...

And on ppc64-linux (big endian), we have:
...
(gdb) p /x ((short *)&var)[0]
$2 = 0x0
(gdb) p /x ((short *)&var)[1]
$3 = 0x2a
...

Fix this by assigning 0x002a0x002a to var, making sure that
((short *)&var)[0] == ((short *)&var)[1] == 42.

Tested on x86_64-linux, ppc64-linux and s390x-linux.
---
 gdb/testsuite/gdb.base/examine-address-class.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/examine-address-class.c b/gdb/testsuite/gdb.base/examine-address-class.c
index c868b10119f..8f6b89c14bf 100644
--- a/gdb/testsuite/gdb.base/examine-address-class.c
+++ b/gdb/testsuite/gdb.base/examine-address-class.c
@@ -18,6 +18,6 @@
 int
 main (void)
 {
-  int var = 42;
+  int var = 0x002a002a;
   return 0; /* break-here.  */
 }
-- 
2.51.0


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

* [PATCH 2/2] [gdb/testsuite] Fix gdb.base/msym-lang.exp on ppc64-linux
  2026-08-02  9:34 [PATCH 0/2] [gdb/testsuite] Two ppc64 fixes Tom de Vries
  2026-08-02  9:34 ` [PATCH 1/2] [gdb/testsuite] Fix gdb.base/examine-address-class.exp for big endian Tom de Vries
@ 2026-08-02  9:34 ` Tom de Vries
  2026-08-03  4:57   ` Kevin Buettner
  1 sibling, 1 reply; 6+ messages in thread
From: Tom de Vries @ 2026-08-02  9:34 UTC (permalink / raw)
  To: gdb-patches

On x86_64-linux, with test-case gdb.base/msym-lang.exp we get:
...
(gdb) info func foo
All functions matching regular expression "foo":

Non-debugging symbols:
0x0000000000401116  foo()
0x000000000040112c  foo()
(gdb) PASS: $exp: info func foo
...

But on ppc64-linux, we get:
...
(gdb) info func foo
All functions matching regular expression "foo":

Non-debugging symbols:
0x0000000000000914  .foo()
0x0000000000000974  .foo()
(gdb) FAIL: $exp: info func foo
...

The dot prefix is due to the function descriptors used in the PPC v1 ABI.

Fix this by allowing the dot prefix.

Tested on x86_64-linux and ppc64-linux.
---
 gdb/testsuite/gdb.base/msym-lang.exp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/msym-lang.exp b/gdb/testsuite/gdb.base/msym-lang.exp
index d0beddea417..38521e4ebf7 100644
--- a/gdb/testsuite/gdb.base/msym-lang.exp
+++ b/gdb/testsuite/gdb.base/msym-lang.exp
@@ -20,4 +20,11 @@ if {[prepare_for_testing "failed to prepare" $testfile [list $srcfile $srcfile2]
     return
 }
 
-gdb_test "info func foo" ".* foo\\(\\).* foo\\(\\).*"
+# The optional leading dot is for ppc64 v1 ABI function descriptors.
+set re_foo [quotemeta {@/[.]?/foo()}]
+
+gdb_test "info func foo" \
+    [multi_line \
+	 "Non-debugging symbols:" \
+	 "$hex  $re_foo" \
+	 "$hex  $re_foo"]
-- 
2.51.0


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

* Re: [PATCH 1/2] [gdb/testsuite] Fix gdb.base/examine-address-class.exp for big endian
  2026-08-02  9:34 ` [PATCH 1/2] [gdb/testsuite] Fix gdb.base/examine-address-class.exp for big endian Tom de Vries
@ 2026-08-03  4:51   ` Kevin Buettner
  2026-08-03  8:20     ` Tom de Vries
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin Buettner @ 2026-08-03  4:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom de Vries

Hi Tom,

LGTM except for one typo in the commit log...

On Sun,  2 Aug 2026 11:34:20 +0200
Tom de Vries <tdevries@suse.de> wrote:

> On ppc64-linux and s390x-linux, with test-case
> gdb.base/examine-address-class.exp I get:
> ...
> (gdb) x/1dh (int *) &var^M
> 0x3fffffffe560: 0^M
> (gdb) FAIL: $exp: x/1dh (int *) &var
> ...
> 
> This is caused by big vs. little endian.
> 
> On x86_64-linux (little endian), we have:
> ...
> (gdb) p /x ((short *)&var)[0]
> $6 = 0x2a
> (gdb) p /x ((short *)&var)[1]
> $7 = 0x0
> (gdb)
> ...
> 
> And on ppc64-linux (big endian), we have:
> ...
> (gdb) p /x ((short *)&var)[0]
> $2 = 0x0
> (gdb) p /x ((short *)&var)[1]
> $3 = 0x2a
> ...
> 
> Fix this by assigning 0x002a0x002a to var, making sure that

There's a '0x' in the middle of that constant.  The code shows it
correctly as 0x002a002a.

> ((short *)&var)[0] == ((short *)&var)[1] == 42.
> 
> Tested on x86_64-linux, ppc64-linux and s390x-linux.
> ---
>  gdb/testsuite/gdb.base/examine-address-class.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.base/examine-address-class.c b/gdb/testsuite/gdb.base/examine-address-class.c
> index c868b10119f..8f6b89c14bf 100644
> --- a/gdb/testsuite/gdb.base/examine-address-class.c
> +++ b/gdb/testsuite/gdb.base/examine-address-class.c
> @@ -18,6 +18,6 @@
>  int
>  main (void)
>  {
> -  int var = 42;
> +  int var = 0x002a002a;
>    return 0; /* break-here.  */
>  }
> -- 
> 2.51.0

With the typo fixed:

Approved-By: Kevin Buettner <kevinb@redhat.com>


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

* Re: [PATCH 2/2] [gdb/testsuite] Fix gdb.base/msym-lang.exp on ppc64-linux
  2026-08-02  9:34 ` [PATCH 2/2] [gdb/testsuite] Fix gdb.base/msym-lang.exp on ppc64-linux Tom de Vries
@ 2026-08-03  4:57   ` Kevin Buettner
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Buettner @ 2026-08-03  4:57 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom de Vries

On Sun,  2 Aug 2026 11:34:21 +0200
Tom de Vries <tdevries@suse.de> wrote:

> On x86_64-linux, with test-case gdb.base/msym-lang.exp we get:
> ...
> (gdb) info func foo
> All functions matching regular expression "foo":
> 
> Non-debugging symbols:
> 0x0000000000401116  foo()
> 0x000000000040112c  foo()
> (gdb) PASS: $exp: info func foo
> ...
> 
> But on ppc64-linux, we get:
> ...
> (gdb) info func foo
> All functions matching regular expression "foo":
> 
> Non-debugging symbols:
> 0x0000000000000914  .foo()
> 0x0000000000000974  .foo()
> (gdb) FAIL: $exp: info func foo
> ...
> 
> The dot prefix is due to the function descriptors used in the PPC v1 ABI.
> 
> Fix this by allowing the dot prefix.
> 
> Tested on x86_64-linux and ppc64-linux.
> ---
>  gdb/testsuite/gdb.base/msym-lang.exp | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.base/msym-lang.exp b/gdb/testsuite/gdb.base/msym-lang.exp
> index d0beddea417..38521e4ebf7 100644
> --- a/gdb/testsuite/gdb.base/msym-lang.exp
> +++ b/gdb/testsuite/gdb.base/msym-lang.exp
> @@ -20,4 +20,11 @@ if {[prepare_for_testing "failed to prepare" $testfile [list $srcfile $srcfile2]
>      return
>  }
>  
> -gdb_test "info func foo" ".* foo\\(\\).* foo\\(\\).*"
> +# The optional leading dot is for ppc64 v1 ABI function descriptors.
> +set re_foo [quotemeta {@/[.]?/foo()}]
> +
> +gdb_test "info func foo" \
> +    [multi_line \
> +	 "Non-debugging symbols:" \
> +	 "$hex  $re_foo" \
> +	 "$hex  $re_foo"]
> -- 
> 2.51.0
> 

LGTM.

Approved-By: Kevin Buettner <kevinb@redhat.com>


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

* Re: [PATCH 1/2] [gdb/testsuite] Fix gdb.base/examine-address-class.exp for big endian
  2026-08-03  4:51   ` Kevin Buettner
@ 2026-08-03  8:20     ` Tom de Vries
  0 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2026-08-03  8:20 UTC (permalink / raw)
  To: Kevin Buettner, gdb-patches

On 8/3/26 6:51 AM, Kevin Buettner wrote:
> There's a '0x' in the middle of that constant.  The code shows it
> correctly as 0x002a002a.
> 

Hi Kevin,

thanks for the reviews.  I've fixed this, and pushed both patches.

- Tom

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

end of thread, other threads:[~2026-08-03  8:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-02  9:34 [PATCH 0/2] [gdb/testsuite] Two ppc64 fixes Tom de Vries
2026-08-02  9:34 ` [PATCH 1/2] [gdb/testsuite] Fix gdb.base/examine-address-class.exp for big endian Tom de Vries
2026-08-03  4:51   ` Kevin Buettner
2026-08-03  8:20     ` Tom de Vries
2026-08-02  9:34 ` [PATCH 2/2] [gdb/testsuite] Fix gdb.base/msym-lang.exp on ppc64-linux Tom de Vries
2026-08-03  4:57   ` Kevin Buettner

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