From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gVNRFiiPqWoAUg8AWB0awg (envelope-from ) for ; Tue, 15 Sep 2026 14:32:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1789497128; bh=tRT3+tAB2lwjMC2cRMNU3TknUaJE1fKhdOvG+M7NC28=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LQmkrd5tTkm0/lM6QpvnpOSnsY/9t47debYueZCp6k3CwU+AYDYfOToe1MVv2RCOH VNxOqS20O2Pw4JR15uKyhBdX2MtcvCeCFgHIfDr7h/BXTZUwEAltqwDVn+tx4/tn63 jMS8GBkkTCSiRk8EjwbCuVFawgv3SoiqUl9Qdg0U= Received: by simark.ca (Postfix, from userid 112) id 46B561E06B; Tue, 15 Sep 2026 14:32:08 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=Y3BmhUyd; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id BAC9C1E051 for ; Tue, 15 Sep 2026 14:32:07 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D72E64B9DB50 for ; Tue, 15 Sep 2026 18:31:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D72E64B9DB50 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=Y3BmhUyd Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 939CF4BA9006 for ; Tue, 15 Sep 2026 18:31:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 939CF4BA9006 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 939CF4BA9006 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789497096; cv=none; b=YN2IDIc8A1z0D2TdcZ/5N5w4u2rddiuSDxknJItv9MYdRXwqKkFYivIMK9XRFQmv+gytunUlp1SuVipEXhFsYn3UorNLrOhn98uR1zE4ZfsOa36T1i+Q85MiNkLFm6Neh9CkNS/xr+pnalAbHKX/kR3u7mDzsLYwVHcoLtff13k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789497096; c=relaxed/simple; bh=tRT3+tAB2lwjMC2cRMNU3TknUaJE1fKhdOvG+M7NC28=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=rqtcbHxVY81KAdaCFt+64aOxGvYdYgJBuvy1GdeIPf9rKnc9g7O/1MUr71fzbiyGvfcewRvfPM30IjlWp4kOJyVznkGWD70D6S4ijdrjshAT6D+Py6cHvgJzpAX8JXSQpnu3+Z+QEIwJAVzM1x75SJEtY4Xnj8TiY7gzPW7J7H0= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=Y3BmhUyd DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 939CF4BA9006 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1789497096; bh=tRT3+tAB2lwjMC2cRMNU3TknUaJE1fKhdOvG+M7NC28=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Y3BmhUydfWkV/PvWUj16T7r/dCU7uentdMg3x2vqhGxVuRDsZ0bUBLbT4n3yoBNvZ XZWkPS0qheVc8d/5rq1ORVmSDFnQOz2lr/1vxMRW1q5C7f7zlDhVwO9QotY67BWzKa jJP297jbp5RbI3jPNAnzjiFqFMbaYeXr5+Ganh9o= Received: by simark.ca (Postfix) id E5BB51E051; Tue, 15 Sep 2026 14:31:35 -0400 (EDT) Message-ID: <758947b4-77f5-47c6-a4c6-16e77f23e21b@simark.ca> Date: Tue, 15 Sep 2026 14:31:35 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 1/1] gdb: avoid conversion of SIGSEGV to SIGTRAP on user breakpoints To: Tom Tromey , Klaus Gerlicher Cc: gdb-patches@sourceware.org, TankutBaris.Aktemur@amd.com, aburgess@redhat.com References: <20260828125003.253648-1-klaus.gerlicher@intel.com> <87qzjb4fzo.fsf@tromey.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <87qzjb4fzo.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 2026-09-02 15:20, Tom Tromey wrote: >>>>>> Klaus Gerlicher writes: > >> From: "Gerlicher, Klaus" >> 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. This >> conversion logic assumes that when these signals occur at a breakpoint >> location, the signal was actually caused by hitting the breakpoint rather >> than a genuine fault. > > Thanks for the patch. > >> 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. Architectures with imprecise fault reporting should >> override this to return true. > > My first thought was that, without an implementation in the tree, this > will cause gdb/check-gdbarch.py to complain. However, I saw that the > plan is a follow-up patch to use this. > > Maybe temporarily marking this 'unused' would be good, provided that is > removed in the follow-up. > > Also I was wondering, why a Function and not a Value? > >> + predefault="[] () -> bool {return false;}", > > This doesn't take arguments, so presumably just a value would be > sufficient? Yeah if it can be a value, let's make it a value. My only comment would be that here: if (ecs->ws.kind () == TARGET_WAITKIND_STOPPED && (ecs->ws.sig () == GDB_SIGNAL_ILL || (ecs->ws.sig () == GDB_SIGNAL_SEGV && !gdbarch_imprecise_pagefault_reporting (target_thread_architecture (ecs->event_thread->ptid))) || ecs->ws.sig () == GDB_SIGNAL_EMT)) You would need some extra parentheses to make emacs happy: if (ecs->ws.kind () == TARGET_WAITKIND_STOPPED && (ecs->ws.sig () == GDB_SIGNAL_ILL || (ecs->ws.sig () == GDB_SIGNAL_SEGV && !(gdbarch_imprecise_pagefault_reporting (target_thread_architecture (ecs->event_thread->ptid)))) || ecs->ws.sig () == GDB_SIGNAL_EMT)) With that and Tom's two suggestions (make it a value and temporarily mark unused), the patch LGTM. Approved-By: Simon Marchi Simon