Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: Tankut Baris Aktemur <tankutbaris.aktemur@amd.com>,
	gdb-patches@sourceware.org, lancelot.six@amd.com
Subject: Re: [PATCH] gdb, amdgpu: report SIGSEGV instead of SIGTRAP
Date: Tue, 29 Sep 2026 13:25:20 -0400	[thread overview]
Message-ID: <3501e2a3-1ec1-44fc-abcf-764e3991018c@efficios.com> (raw)
In-Reply-To: <20260929143125.1098582-1-tankutbaris.aktemur@amd.com>

On 9/29/26 10:31 AM, Tankut Baris Aktemur wrote:
> diff --git a/gdb/testsuite/gdb.rocm/precise-memory-warning-sigsegv.exp b/gdb/testsuite/gdb.rocm/precise-memory-warning-sigsegv.exp
> index 460d14a2b30..755fc0a7a56 100644
> --- a/gdb/testsuite/gdb.rocm/precise-memory-warning-sigsegv.exp
> +++ b/gdb/testsuite/gdb.rocm/precise-memory-warning-sigsegv.exp
> @@ -29,8 +29,7 @@ if {[build_executable "failed to prepare" $testfile $srcfile {debug hip}]} {
>  }
>  
>  proc do_test { } {
> -    clean_restart
> -    gdb_load $::binfile
> +    clean_restart $::testfile
>  
>      with_rocm_gpu_lock {
>  	if {![runto_main]} {
> @@ -41,6 +40,26 @@ proc do_test { } {
>  	gdb_test "continue" \
>  	    "SIGSEGV, Segmentation fault.*Warning: precise memory violation signal reporting is not enabled.*"
>      }
> +
> +    clean_restart $::testfile
> +
> +    with_rocm_gpu_lock {
> +	if {![runto_main]} {
> +	    return
> +	}
> +
> +	with_test_prefix "with-breakpoint" {
> +	    gdb_test_no_output "set amdgpu precise-memory off"
> +
> +	    # Define a breakpoint right after the line that would
> +	    # cause segfault.  SIGSEGV should be reported, not a
> +	    # breakpoint hit.
> +	    gdb_breakpoint [gdb_get_line_number "Break here"] -allow-pending
> +
> +	    gdb_test "continue" \
> +		"SIGSEGV, Segmentation fault.*Warning: precise memory violation signal reporting is not enabled.*"
> +	}
> +    }

I think this should use

  foreach_with_prefix with_breakpoint {yes no} {
     ...
  }

and then only set the breakpoint if $with_breakpoint is yes.

Otherwise, LGTM.

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon

      reply	other threads:[~2026-09-29 17:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 14:31 Tankut Baris Aktemur
2026-09-29 17:25 ` Simon Marchi [this message]

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=3501e2a3-1ec1-44fc-abcf-764e3991018c@efficios.com \
    --to=simon.marchi@efficios.com \
    --cc=gdb-patches@sourceware.org \
    --cc=lancelot.six@amd.com \
    --cc=tankutbaris.aktemur@amd.com \
    /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