public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: Powerpc fix gdb.multi/multi-arch-exec.exp test
@ 2021-11-20  0:21 Carl Love
  2021-11-29 16:53 ` [PING] " Carl Love
  2021-11-30 21:20 ` Tom Tromey
  0 siblings, 2 replies; 4+ messages in thread
From: Carl Love @ 2021-11-20  0:21 UTC (permalink / raw)
  To: gdb-patches; +Cc: Rogerio Alves, Will Schmidt, cel

GDB maintainers:

The following patch add a check for powerpc64 to properly set the
variable mach.  The variable is used to set the gcc command line
arguments when compiling the test.  Currently without the test mach
defaults to -m32 which causes the test program compile to fail.

This patch adds the needed if statement to check for powerpc64 and set
the mach variable to -m64.

The patch was tested on Power 10 to verify there are no compilation
failures and the test runs successfully.

Please let me know if this patch is acceptable for mainline.  

Thanks.

                     Carl 


--------------------------------------------------------
 gdb: Powerpc fix gdb.multi/multi-arch-exec.exp test

The expect file has a procedure append_arch_options which sets march based
the istarget.  The current if / else statement does not check for
powerpc64.  The else statement is hit which sets march to -m32.  This
results in compilation errors on 64-bit PowerPC.

This patch adds an if statement to check for powerpc64 and if true sets mach
to -m64.

The patch was tested on a Power 10 system.  No compile errors were generated.
The test completes with 1 expected pass and no failures.
---
 gdb/testsuite/gdb.multi/multi-arch-exec.exp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.exp b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
index e9a8abd6748..a5d1ed481a7 100644
--- a/gdb/testsuite/gdb.multi/multi-arch-exec.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
@@ -71,7 +71,9 @@ proc append_arch2_options {options_var} {
 	}
     }
 
-    if [istarget "s390*-*-*"] {
+    if [istarget "powerpc64*-*-*"] {
+	set march "-m64"
+    } else if [istarget "s390*-*-*"] {
 	set march "-m31"
     } else {
 	set march "-m32"
-- 
2.30.2



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

* [PING] [PATCH] gdb: Powerpc fix gdb.multi/multi-arch-exec.exp test
  2021-11-20  0:21 [PATCH] gdb: Powerpc fix gdb.multi/multi-arch-exec.exp test Carl Love
@ 2021-11-29 16:53 ` Carl Love
  2021-11-30 21:20 ` Tom Tromey
  1 sibling, 0 replies; 4+ messages in thread
From: Carl Love @ 2021-11-29 16:53 UTC (permalink / raw)
  To: gdb-patches, cel; +Cc: Rogerio Alves, Will Schmidt

GDB maintainers:

I hadn't heard anything on this patch so just wanted to ping it. 
Thanks.

                  Carl 
--------------------------------------------------------------
On Fri, 2021-11-19 at 16:21 -0800, Carl Love wrote:
> GDB maintainers:
> 
> The following patch add a check for powerpc64 to properly set the
> variable mach.  The variable is used to set the gcc command line
> arguments when compiling the test.  Currently without the test mach
> defaults to -m32 which causes the test program compile to fail.
> 
> This patch adds the needed if statement to check for powerpc64 and
> set
> the mach variable to -m64.
> 
> The patch was tested on Power 10 to verify there are no compilation
> failures and the test runs successfully.
> 
> Please let me know if this patch is acceptable for mainline.  
> 
> Thanks.
> 
>                      Carl 
> 
> 
> --------------------------------------------------------
>  gdb: Powerpc fix gdb.multi/multi-arch-exec.exp test
> 
> The expect file has a procedure append_arch_options which sets march
> based
> the istarget.  The current if / else statement does not check for
> powerpc64.  The else statement is hit which sets march to -m32.  This
> results in compilation errors on 64-bit PowerPC.
> 
> This patch adds an if statement to check for powerpc64 and if true
> sets mach
> to -m64.
> 
> The patch was tested on a Power 10 system.  No compile errors were
> generated.
> The test completes with 1 expected pass and no failures.
> ---
>  gdb/testsuite/gdb.multi/multi-arch-exec.exp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.exp
> b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
> index e9a8abd6748..a5d1ed481a7 100644
> --- a/gdb/testsuite/gdb.multi/multi-arch-exec.exp
> +++ b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
> @@ -71,7 +71,9 @@ proc append_arch2_options {options_var} {
>  	}
>      }
> 
> -    if [istarget "s390*-*-*"] {
> +    if [istarget "powerpc64*-*-*"] {
> +	set march "-m64"
> +    } else if [istarget "s390*-*-*"] {
>  	set march "-m31"
>      } else {
>  	set march "-m32"


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

* Re: [PATCH] gdb: Powerpc fix gdb.multi/multi-arch-exec.exp test
  2021-11-20  0:21 [PATCH] gdb: Powerpc fix gdb.multi/multi-arch-exec.exp test Carl Love
  2021-11-29 16:53 ` [PING] " Carl Love
@ 2021-11-30 21:20 ` Tom Tromey
  2021-12-01 14:25   ` [committed][gdb/testsuite] Fix typo in gdb.multi/multi-arch-exec.exp Tom de Vries
  1 sibling, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2021-11-30 21:20 UTC (permalink / raw)
  To: Carl Love via Gdb-patches; +Cc: Carl Love, Rogerio Alves

>>>>> "Carl" == Carl Love via Gdb-patches <gdb-patches@sourceware.org> writes:

Carl> The following patch add a check for powerpc64 to properly set the
Carl> variable mach.  The variable is used to set the gcc command line
Carl> arguments when compiling the test.  Currently without the test mach
Carl> defaults to -m32 which causes the test program compile to fail.

Carl> This patch adds the needed if statement to check for powerpc64 and set
Carl> the mach variable to -m64.

This looks good to me.  Thank you.

Tom

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

* [committed][gdb/testsuite] Fix typo in gdb.multi/multi-arch-exec.exp
  2021-11-30 21:20 ` Tom Tromey
@ 2021-12-01 14:25   ` Tom de Vries
  0 siblings, 0 replies; 4+ messages in thread
From: Tom de Vries @ 2021-12-01 14:25 UTC (permalink / raw)
  To: Tom Tromey, Carl Love via Gdb-patches; +Cc: Rogerio Alves

[-- Attachment #1: Type: text/plain, Size: 677 bytes --]

[ was: Re: [PATCH] gdb: Powerpc fix gdb.multi/multi-arch-exec.exp test ]

On 11/30/21 10:20 PM, Tom Tromey wrote:
>>>>>> "Carl" == Carl Love via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Carl> The following patch add a check for powerpc64 to properly set the
> Carl> variable mach.  The variable is used to set the gcc command line
> Carl> arguments when compiling the test.  Currently without the test mach
> Carl> defaults to -m32 which causes the test program compile to fail.
> 
> Carl> This patch adds the needed if statement to check for powerpc64 and set
> Carl> the mach variable to -m64.
> 
> This looks good to me.  Thank you.

Fixed typo.

Thanks,
- Tom

[-- Attachment #2: 0001-gdb-testsuite-Fix-typo-in-gdb.multi-multi-arch-exec.exp.patch --]
[-- Type: text/x-patch, Size: 1160 bytes --]

[gdb/testsuite] Fix typo in gdb.multi/multi-arch-exec.exp

With gdb.multi/multi-arch-exec.exp I run into:
...
Running src/gdb/testsuite/gdb.multi/multi-arch-exec.exp ...
ERROR: tcl error sourcing src/gdb/testsuite/gdb.multi/multi-arch-exec.exp.
ERROR: wrong # args: extra words after "else" clause in "if" command
    while executing
"if [istarget "powerpc64*-*-*"] {
        set march "-m64"
    } else if [istarget "s390*-*-*"] {
        set march "-m31"
    } else {
        set march "-m32"
    }"
...

Fix the else if -> elseif typo.

Tested on x86_64-linux.

---
 gdb/testsuite/gdb.multi/multi-arch-exec.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.exp b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
index a5d1ed481a7..12edbc2faaa 100644
--- a/gdb/testsuite/gdb.multi/multi-arch-exec.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
@@ -73,7 +73,7 @@ proc append_arch2_options {options_var} {
 
     if [istarget "powerpc64*-*-*"] {
 	set march "-m64"
-    } else if [istarget "s390*-*-*"] {
+    } elseif [istarget "s390*-*-*"] {
 	set march "-m31"
     } else {
 	set march "-m32"

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

end of thread, other threads:[~2021-12-01 14:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-20  0:21 [PATCH] gdb: Powerpc fix gdb.multi/multi-arch-exec.exp test Carl Love
2021-11-29 16:53 ` [PING] " Carl Love
2021-11-30 21:20 ` Tom Tromey
2021-12-01 14:25   ` [committed][gdb/testsuite] Fix typo in gdb.multi/multi-arch-exec.exp 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).