public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: will schmidt <will_schmidt@vnet.ibm.com>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb/testsuite] Handle SIGILL in two gdb.arch powerpc test-cases
Date: Tue, 02 Nov 2021 10:41:09 -0500	[thread overview]
Message-ID: <958ff6cb8e93ee7c9104a8502e446d06bfa1c56f.camel@vnet.ibm.com> (raw)
In-Reply-To: <20211029194516.GA27121@delia>

On Fri, 2021-10-29 at 21:45 +0200, Tom de Vries via Gdb-patches wrote:
> Hi,
> 
> On powerpc64le-linux, with test-case gdb.arch/powerpc-addpcis.exp I
> run into
> SIGILL:
> ...
> (gdb) PASS: gdb.arch/powerpc-addpcis.exp: get hexadecimal valueof
> "$r3"
> stepi^M
> ^M
> Program terminated with signal SIGILL, Illegal instruction.^M
> The program no longer exists.^M
> (gdb) PASS: gdb.arch/powerpc-addpcis.exp: set r4
> ...
> because it's a power9 insn, and I'm running on a power8 machine.
> 
> Fix this by handling the SIGILL.  Likewise in gdb.arch/powerpc-
> lnia.exp.

> 
> Tested on powerpc64le-linux.
> 
> Any comments?


This looks good to me.  Thanks for cleaning these up. :-)

Thanks
-Will



> 
> Thanks,
> - Tom
> 
> [gdb/testsuite] Handle SIGILL in two gdb.arch powerpc test-cases
> 
> ---
>  gdb/testsuite/gdb.arch/powerpc-addpcis.exp | 14 +++++++++++++-
>  gdb/testsuite/gdb.arch/powerpc-lnia.exp    | 14 +++++++++++++-
>  2 files changed, 26 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.arch/powerpc-addpcis.exp
> b/gdb/testsuite/gdb.arch/powerpc-addpcis.exp
> index d1bc7f49ce6..ff7052ce475 100644
> --- a/gdb/testsuite/gdb.arch/powerpc-addpcis.exp
> +++ b/gdb/testsuite/gdb.arch/powerpc-addpcis.exp
> @@ -50,7 +50,19 @@ gdb_breakpoint $bp1
>  gdb_breakpoint $bp2
>  gdb_breakpoint $bp3
> 
> -gdb_test "stepi" "" "set r3 "
> +set insn_supported 1
> +gdb_test_multiple "stepi" "set r3" {
> +    -re "Program received signal SIGILL, Illegal instruction\\..*" {
> +	set insn_supported 0
> +    }
> +    -re -wrap "" {
> +	pass $gdb_test_name
> +    }
> +}
> +if { ! $insn_supported } {
> +    unsupported "illegal instruction"
> +    return
> +}
>  set check_r3 [get_hexadecimal_valueof "\$r3" "default0"]
>  gdb_test "stepi" "" "set r4"
>  set check_r4 [get_hexadecimal_valueof "\$r4" "default0"]
> diff --git a/gdb/testsuite/gdb.arch/powerpc-lnia.exp
> b/gdb/testsuite/gdb.arch/powerpc-lnia.exp
> index 0f56d834046..4ab4f8d92be 100644
> --- a/gdb/testsuite/gdb.arch/powerpc-lnia.exp
> +++ b/gdb/testsuite/gdb.arch/powerpc-lnia.exp
> @@ -54,7 +54,19 @@ gdb_breakpoint $bp3
> 
>  # single-step through the lnia instructions, and retrieve the
>  # register values as we proceed.
> -gdb_test "stepi" "" "set r3"
> +set insn_supported 1
> +gdb_test_multiple "stepi" "set r3" {
> +    -re "Program received signal SIGILL, Illegal instruction\\..*" {
> +	set insn_supported 0
> +    }
> +    -re -wrap "" {
> +	pass $gdb_test_name
> +    }
> +}
> +if { ! $insn_supported } {
> +    unsupported "illegal instruction"
> +    return
> +}
>  set check_r3 [get_hexadecimal_valueof "\$r3" "default0"]
>  gdb_test "stepi" "" "set r4"
>  set check_r4 [get_hexadecimal_valueof "\$r4" "default0"]


  reply	other threads:[~2021-11-02 15:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29 19:45 Tom de Vries
2021-11-02 15:41 ` will schmidt [this message]
2021-11-02 17:06 ` 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=958ff6cb8e93ee7c9104a8502e446d06bfa1c56f.camel@vnet.ibm.com \
    --to=will_schmidt@vnet.ibm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).