From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Cc: Tom de Vries <tdevries@suse.de>
Subject: Re: [PATCH 1/2] [gdb/testsuite] Fix gdb.base/examine-address-class.exp for big endian
Date: Sun, 2 Aug 2026 21:51:35 -0700 [thread overview]
Message-ID: <20260802215135.37d2c18f@f44-mesa-1> (raw)
In-Reply-To: <20260802093421.794182-2-tdevries@suse.de>
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>
next prev parent reply other threads:[~2026-08-03 4:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=20260802215135.37d2c18f@f44-mesa-1 \
--to=kevinb@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/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