Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Gerlicher, Klaus" <klaus.gerlicher@intel.com>
To: "Aktemur, Baris" <TankutBaris.Aktemur@amd.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: "aburgess@redhat.com" <aburgess@redhat.com>
Subject: RE: [PATCH v4 1/1] gdb: avoid conversion of SIGSEGV to SIGTRAP on user breakpoints
Date: Fri, 17 Jul 2026 13:25:06 +0000	[thread overview]
Message-ID: <DM3PPFD7E67F03693672C3527F9BF86C849E8C62@DM3PPFD7E67F036.namprd11.prod.outlook.com> (raw)
In-Reply-To: <DM4PR12MB6470472CBEC1DEC33E2F02ECF8C62@DM4PR12MB6470.namprd12.prod.outlook.com>

Thank you, Baris.

 I discovered this too *after* I posted. I'll make sure it's updated once Andrew approves again.

Thanks
Klaus

> -----Original Message-----
> From: Aktemur, Baris <TankutBaris.Aktemur@amd.com>
> Sent: Friday, July 17, 2026 11:17 AM
> To: Gerlicher, Klaus <klaus.gerlicher@intel.com>; gdb-
> patches@sourceware.org
> Cc: aburgess@redhat.com
> Subject: RE: [PATCH v4 1/1] gdb: avoid conversion of SIGSEGV to SIGTRAP on
> user breakpoints
> 
> AMD General
> 
> Hi Klaus,
> 
> On Friday, July 17, 2026 9:45 AM, Klaus Gerlicher wrote:
> > GDB converts signals GDB_SIGNAL_ILL, GDB_SIGNAL_SEGV and
> GDB_SIGNAL_EMT to
> > GDB_SIGNAL_TRAP if a breakpoint is inserted at the fault location.  If, due
> > to imprecise page fault reporting, a breakpoint is at the same address as
> > the fault address, this signal would always be reported as
> GDB_SIGNAL_TRAP.
> >
> > Add a new gdbarch function, imprecise_pagefault_reporting, that allows the
> > signal conversion from GDB_SIGNAL_SEGV to GDB_SIGNAL_TRAP to be
> skipped for
> > an architecture.  The default is false (conversion enabled), preserving
> > existing behavior.
> 
> It seems gdbarch.py has been updated since the last time you generated
> gdbarch files.
> Re-generating gives the diff below.  The patch LGTM with that fixed.
> 
> Reviewed-By: Tankut Baris Aktemur <TankutBaris.Aktemur@amd.com>
> 
> Thank you.
> -Baris
> 
> 
> diff --git a/gdb/gdbarch-gen.c b/gdb/gdbarch-gen.c
> index d9bb3e7078c..0b815296261 100644
> --- a/gdb/gdbarch-gen.c
> +++ b/gdb/gdbarch-gen.c
> @@ -5295,8 +5295,8 @@ set_gdbarch_get_shadow_stack_pointer (struct
> gdbarch *gdbarch,
>  bool
>  gdbarch_imprecise_pagefault_reporting (struct gdbarch *gdbarch)
>  {
> -  gdb_assert (gdbarch != NULL);
> -  gdb_assert (gdbarch->imprecise_pagefault_reporting != NULL);
> +  gdb_assert (gdbarch != nullptr);
> +  gdb_assert (gdbarch->imprecise_pagefault_reporting != nullptr);
>    if (gdbarch_debug >= 2)
>      gdb_printf (gdb_stdlog, "gdbarch_imprecise_pagefault_reporting
> called\n");
>    return gdbarch->imprecise_pagefault_reporting ();
> diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h
> index bb95df25eb6..a96692c206c 100644
> --- a/gdb/gdbarch-gen.h
> +++ b/gdb/gdbarch-gen.h
> @@ -1756,6 +1756,6 @@ void set_gdbarch_get_shadow_stack_pointer
> (struct gdbarch *gdbarch, gdbarch_get_
>  /* Returns true if architecture has imprecise pagefault reporting.  This is
>     used in conversion of SIGSEGV to SIGTRAP for an architecture. */
> 
> -typedef bool (gdbarch_imprecise_pagefault_reporting_ftype) ();
> -extern bool gdbarch_imprecise_pagefault_reporting (struct gdbarch
> *gdbarch);
> -extern void set_gdbarch_imprecise_pagefault_reporting (struct gdbarch
> *gdbarch, gdbarch_imprecise_pagefault_reporting_ftype
> *imprecise_pagefault_reporting);
> +using gdbarch_imprecise_pagefault_reporting_ftype = bool ();
> +bool gdbarch_imprecise_pagefault_reporting (struct gdbarch *gdbarch);
> +void set_gdbarch_imprecise_pagefault_reporting (struct gdbarch *gdbarch,
> gdbarch_imprecise_pagefault_reporting_ftype
> *imprecise_pagefault_reporting);
> 

Intel Deutschland GmbH

Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


  reply	other threads:[~2026-07-17 13:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13  8:19 [PATCH v3 " Aktemur, Baris
2026-05-19 10:29 ` Gerlicher, Klaus
2026-07-07  6:35   ` Aktemur, Baris
2026-07-17  7:44     ` [PATCH v4 0/1] " Klaus Gerlicher
2026-07-17  7:44       ` [PATCH v4 1/1] " Klaus Gerlicher
2026-07-17  9:16         ` Aktemur, Baris
2026-07-17 13:25           ` Gerlicher, Klaus [this message]
2026-07-28  8:49             ` Aktemur, Baris
2026-07-17  7:46     ` [PATCH v3 " Gerlicher, Klaus

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=DM3PPFD7E67F03693672C3527F9BF86C849E8C62@DM3PPFD7E67F036.namprd11.prod.outlook.com \
    --to=klaus.gerlicher@intel.com \
    --cc=TankutBaris.Aktemur@amd.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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