* [PATCH] [gdb/testsuite] Fix gdb.arch/i386-signal.exp on x86_64
@ 2023-10-01 11:14 Tom de Vries
2023-10-06 22:06 ` John Baldwin
0 siblings, 1 reply; 5+ messages in thread
From: Tom de Vries @ 2023-10-01 11:14 UTC (permalink / raw)
To: gdb-patches; +Cc: Jan Beulich
On x86_64-linux, with test-case gdb.arch/i386-signal.exp I run into:
...
builtin_spawn -ignore SIGHUP gcc -fno-stack-protector i386-signal.c \
-fdiagnostics-color=never -fno-pie -g -no-pie -lm -o i386-signal^M
/tmp/cc2xydTG.s: Assembler messages:^M
/tmp/cc2xydTG.s:50: Error: operand size mismatch for `push'^M
compiler exited with status 1
output is:
/tmp/cc2xydTG.s: Assembler messages:^M
/tmp/cc2xydTG.s:50: Error: operand size mismatch for `push'^M
gdb compile failed, /tmp/cc2xydTG.s: Assembler messages:
/tmp/cc2xydTG.s:50: Error: operand size mismatch for `push'
UNTESTED: gdb.arch/i386-signal.exp: failed to compile
...
This is with gas 2.41, it compiles without problems with gas 2.40. Some more
strict checking was added in commit 5cc007751cd ("x86: further adjust
extend-to-32bit-address conditions").
The offending bit is:
...
" push $sigframe\n"
...
which refers to a function:
...
" .globl sigframe\n"
"sigframe:\n"
...
The test-case passes with target board unix/-m32.
Make the test-case work by using pushq instead of push for the
is_amd64_regs_target case.
Tested on x86_64-linux, with target boards:
- unix/-m64 (is_amd64_regs_target == 1), and
- unix/-m32 (is_amd64_regs_target == 0),
PR testsuite/30928
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30928
---
gdb/testsuite/gdb.arch/i386-signal.c | 4 ++++
gdb/testsuite/gdb.arch/i386-signal.exp | 7 ++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.arch/i386-signal.c b/gdb/testsuite/gdb.arch/i386-signal.c
index 19bb1bbaaf8..4bf97e5f159 100644
--- a/gdb/testsuite/gdb.arch/i386-signal.c
+++ b/gdb/testsuite/gdb.arch/i386-signal.c
@@ -45,7 +45,11 @@ asm(".text\n"
" .align 8\n"
" .globl setup\n"
"setup:\n"
+#if IS_AMD64_REGS_TARGET
+ " pushq $sigframe\n"
+#else
" push $sigframe\n"
+#endif
" jmp func\n"
"\n"
" .cfi_startproc\n"
diff --git a/gdb/testsuite/gdb.arch/i386-signal.exp b/gdb/testsuite/gdb.arch/i386-signal.exp
index f6a88719a40..a69172ed5cb 100644
--- a/gdb/testsuite/gdb.arch/i386-signal.exp
+++ b/gdb/testsuite/gdb.arch/i386-signal.exp
@@ -19,8 +19,13 @@ require {is_any_target "i?86-*-*" "x86_64-*-*"}
standard_testfile
+set opts {}
+lappend opts debug
+lappend opts nopie
+lappend opts additional_flags=-DIS_AMD64_REGS_TARGET=[is_amd64_regs_target]
+
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
- executable { debug nopie }] != "" } {
+ executable $opts] != "" } {
untested "failed to compile"
return -1
}
base-commit: 23b5268986d9b68b965939416a7aa96e8698e403
--
2.35.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [gdb/testsuite] Fix gdb.arch/i386-signal.exp on x86_64
2023-10-01 11:14 [PATCH] [gdb/testsuite] Fix gdb.arch/i386-signal.exp on x86_64 Tom de Vries
@ 2023-10-06 22:06 ` John Baldwin
2023-10-07 8:37 ` Tom de Vries
0 siblings, 1 reply; 5+ messages in thread
From: John Baldwin @ 2023-10-06 22:06 UTC (permalink / raw)
To: Tom de Vries, gdb-patches; +Cc: Jan Beulich
On 10/1/23 7:14 AM, Tom de Vries via Gdb-patches wrote:
> On x86_64-linux, with test-case gdb.arch/i386-signal.exp I run into:
> ...
> builtin_spawn -ignore SIGHUP gcc -fno-stack-protector i386-signal.c \
> -fdiagnostics-color=never -fno-pie -g -no-pie -lm -o i386-signal^M
> /tmp/cc2xydTG.s: Assembler messages:^M
> /tmp/cc2xydTG.s:50: Error: operand size mismatch for `push'^M
> compiler exited with status 1
> output is:
> /tmp/cc2xydTG.s: Assembler messages:^M
> /tmp/cc2xydTG.s:50: Error: operand size mismatch for `push'^M
>
> gdb compile failed, /tmp/cc2xydTG.s: Assembler messages:
> /tmp/cc2xydTG.s:50: Error: operand size mismatch for `push'
> UNTESTED: gdb.arch/i386-signal.exp: failed to compile
> ...
>
> This is with gas 2.41, it compiles without problems with gas 2.40. Some more
> strict checking was added in commit 5cc007751cd ("x86: further adjust
> extend-to-32bit-address conditions").
>
> The offending bit is:
> ...
> " push $sigframe\n"
> ...
> which refers to a function:
> ...
> " .globl sigframe\n"
> "sigframe:\n"
> ...
>
> The test-case passes with target board unix/-m32.
>
> Make the test-case work by using pushq instead of push for the
> is_amd64_regs_target case.
>
> Tested on x86_64-linux, with target boards:
> - unix/-m64 (is_amd64_regs_target == 1), and
> - unix/-m32 (is_amd64_regs_target == 0),
>
> PR testsuite/30928
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30928
> ---
> gdb/testsuite/gdb.arch/i386-signal.c | 4 ++++
> gdb/testsuite/gdb.arch/i386-signal.exp | 7 ++++++-
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/gdb/testsuite/gdb.arch/i386-signal.c b/gdb/testsuite/gdb.arch/i386-signal.c
> index 19bb1bbaaf8..4bf97e5f159 100644
> --- a/gdb/testsuite/gdb.arch/i386-signal.c
> +++ b/gdb/testsuite/gdb.arch/i386-signal.c
> @@ -45,7 +45,11 @@ asm(".text\n"
> " .align 8\n"
> " .globl setup\n"
> "setup:\n"
> +#if IS_AMD64_REGS_TARGET
> + " pushq $sigframe\n"
> +#else
> " push $sigframe\n"
> +#endif
> " jmp func\n"
> "\n"
> " .cfi_startproc\n"
> diff --git a/gdb/testsuite/gdb.arch/i386-signal.exp b/gdb/testsuite/gdb.arch/i386-signal.exp
> index f6a88719a40..a69172ed5cb 100644
> --- a/gdb/testsuite/gdb.arch/i386-signal.exp
> +++ b/gdb/testsuite/gdb.arch/i386-signal.exp
> @@ -19,8 +19,13 @@ require {is_any_target "i?86-*-*" "x86_64-*-*"}
>
> standard_testfile
>
> +set opts {}
> +lappend opts debug
> +lappend opts nopie
> +lappend opts additional_flags=-DIS_AMD64_REGS_TARGET=[is_amd64_regs_target]
> +
> if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
> - executable { debug nopie }] != "" } {
> + executable $opts] != "" } {
> untested "failed to compile"
> return -1
> }
>
> base-commit: 23b5268986d9b68b965939416a7aa96e8698e403
LGRM
--
John Baldwin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [gdb/testsuite] Fix gdb.arch/i386-signal.exp on x86_64
2023-10-06 22:06 ` John Baldwin
@ 2023-10-07 8:37 ` Tom de Vries
2023-10-16 7:53 ` Jan Beulich
0 siblings, 1 reply; 5+ messages in thread
From: Tom de Vries @ 2023-10-07 8:37 UTC (permalink / raw)
To: John Baldwin, gdb-patches; +Cc: Jan Beulich
On 10/7/23 00:06, John Baldwin wrote:
> On 10/1/23 7:14 AM, Tom de Vries via Gdb-patches wrote:
>> On x86_64-linux, with test-case gdb.arch/i386-signal.exp I run into:
>> ...
>> builtin_spawn -ignore SIGHUP gcc -fno-stack-protector i386-signal.c \
>> -fdiagnostics-color=never -fno-pie -g -no-pie -lm -o i386-signal^M
>> /tmp/cc2xydTG.s: Assembler messages:^M
>> /tmp/cc2xydTG.s:50: Error: operand size mismatch for `push'^M
>> compiler exited with status 1
>> output is:
>> /tmp/cc2xydTG.s: Assembler messages:^M
>> /tmp/cc2xydTG.s:50: Error: operand size mismatch for `push'^M
>>
>> gdb compile failed, /tmp/cc2xydTG.s: Assembler messages:
>> /tmp/cc2xydTG.s:50: Error: operand size mismatch for `push'
>> UNTESTED: gdb.arch/i386-signal.exp: failed to compile
>> ...
>>
>> This is with gas 2.41, it compiles without problems with gas 2.40.
>> Some more
>> strict checking was added in commit 5cc007751cd ("x86: further adjust
>> extend-to-32bit-address conditions").
>>
>> The offending bit is:
>> ...
>> " push $sigframe\n"
>> ...
>> which refers to a function:
>> ...
>> " .globl sigframe\n"
>> "sigframe:\n"
>> ...
>>
>> The test-case passes with target board unix/-m32.
>>
>> Make the test-case work by using pushq instead of push for the
>> is_amd64_regs_target case.
>>
>> Tested on x86_64-linux, with target boards:
>> - unix/-m64 (is_amd64_regs_target == 1), and
>> - unix/-m32 (is_amd64_regs_target == 0),
>>
>> PR testsuite/30928
>> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30928
>> ---
>> gdb/testsuite/gdb.arch/i386-signal.c | 4 ++++
>> gdb/testsuite/gdb.arch/i386-signal.exp | 7 ++++++-
>> 2 files changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/gdb/testsuite/gdb.arch/i386-signal.c
>> b/gdb/testsuite/gdb.arch/i386-signal.c
>> index 19bb1bbaaf8..4bf97e5f159 100644
>> --- a/gdb/testsuite/gdb.arch/i386-signal.c
>> +++ b/gdb/testsuite/gdb.arch/i386-signal.c
>> @@ -45,7 +45,11 @@ asm(".text\n"
>> " .align 8\n"
>> " .globl setup\n"
>> "setup:\n"
>> +#if IS_AMD64_REGS_TARGET
>> + " pushq $sigframe\n"
>> +#else
>> " push $sigframe\n"
>> +#endif
>> " jmp func\n"
>> "\n"
>> " .cfi_startproc\n"
>> diff --git a/gdb/testsuite/gdb.arch/i386-signal.exp
>> b/gdb/testsuite/gdb.arch/i386-signal.exp
>> index f6a88719a40..a69172ed5cb 100644
>> --- a/gdb/testsuite/gdb.arch/i386-signal.exp
>> +++ b/gdb/testsuite/gdb.arch/i386-signal.exp
>> @@ -19,8 +19,13 @@ require {is_any_target "i?86-*-*" "x86_64-*-*"}
>> standard_testfile
>> +set opts {}
>> +lappend opts debug
>> +lappend opts nopie
>> +lappend opts
>> additional_flags=-DIS_AMD64_REGS_TARGET=[is_amd64_regs_target]
>> +
>> if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
>> - executable { debug nopie }] != "" } {
>> + executable $opts] != "" } {
>> untested "failed to compile"
>> return -1
>> }
>>
>> base-commit: 23b5268986d9b68b965939416a7aa96e8698e403
>
> LGRM
>
Thanks for the review.
I've committed after adding a note about
https://sourceware.org/pipermail/binutils/2023-October/129818.html to
the commit log.
Thanks,
- Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [gdb/testsuite] Fix gdb.arch/i386-signal.exp on x86_64
2023-10-07 8:37 ` Tom de Vries
@ 2023-10-16 7:53 ` Jan Beulich
2023-10-16 8:23 ` Tom de Vries
0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2023-10-16 7:53 UTC (permalink / raw)
To: Tom de Vries; +Cc: John Baldwin, gdb-patches
On 07.10.2023 10:37, Tom de Vries wrote:
> I've committed after adding a note about
> https://sourceware.org/pipermail/binutils/2023-October/129818.html to
> the commit log.
Perhaps the better course of action would have been to backport
fb1c10585ead to the respective gdb branch(es)?
Jan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [gdb/testsuite] Fix gdb.arch/i386-signal.exp on x86_64
2023-10-16 7:53 ` Jan Beulich
@ 2023-10-16 8:23 ` Tom de Vries
0 siblings, 0 replies; 5+ messages in thread
From: Tom de Vries @ 2023-10-16 8:23 UTC (permalink / raw)
To: Jan Beulich; +Cc: John Baldwin, gdb-patches
On 10/16/23 09:53, Jan Beulich wrote:
> On 07.10.2023 10:37, Tom de Vries wrote:
>> I've committed after adding a note about
>> https://sourceware.org/pipermail/binutils/2023-October/129818.html to
>> the commit log.
>
> Perhaps the better course of action would have been to backport
> fb1c10585ead to the respective gdb branch(es)?
The committed patch makes the gdb test-case robust against a problem in
a released gas version. So this is the right fix.
Backporting the gas fix to a gdb release branch has no effect for the
case that gas is build from binutils releases and branches.
Thanks,
- Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-10-16 8:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-01 11:14 [PATCH] [gdb/testsuite] Fix gdb.arch/i386-signal.exp on x86_64 Tom de Vries
2023-10-06 22:06 ` John Baldwin
2023-10-07 8:37 ` Tom de Vries
2023-10-16 7:53 ` Jan Beulich
2023-10-16 8:23 ` 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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).