From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5F4CD3858C35; Sun, 31 Dec 2023 20:45:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F4CD3858C35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1704055504; bh=o+3QzCRUuiOLzA3XaJAJ9QwuN9HbUWXc/0TWt+/0Vak=; h=From:To:Subject:Date:In-Reply-To:References:From; b=L/4mqTi/nfmFyAA7m7q6dwye4ocRzhnOa0IEq586o/DKSkVRVCL1VHRydDA250nHv WtUzGBYXjDZf2382KUlv5wiPjslSv1l3b8eJs5mHbUnoT0Jo5Uuq9LbHc0PQKxBqNI HLxweZksKeHtaoJOv7JDNvrGoPGyqSK3X4hIcMYA= From: "tromey at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug gdb/31194] Stepping on "int3" instruction fails assertion. Date: Sun, 31 Dec 2023 20:45:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tromey at sourceware dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31194 --- Comment #10 from Tom Tromey --- This works but I have no idea if it is correct. diff --git a/gdb/infrun.c b/gdb/infrun.c index 1d863896c40..c9c16001f82 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -7115,6 +7115,7 @@ handle_signal_stop (struct execution_control_state *e= cs) /* Maybe this was a trap for a software breakpoint that has since been removed. */ + bool program_bp =3D false; if (random_signal && target_stopped_by_sw_breakpoint ()) { if (gdbarch_program_breakpoint_here_p (gdbarch, @@ -7123,6 +7124,7 @@ handle_signal_stop (struct execution_control_state *e= cs) struct regcache *regcache; int decr_pc; + program_bp =3D true; /* Re-adjust PC to what the program would see if GDB was not debugging it. */ regcache =3D get_thread_regcache (ecs->event_thread); @@ -7161,7 +7163,8 @@ handle_signal_stop (struct execution_control_state *e= cs) /* If not, perhaps stepping/nexting can. */ if (random_signal) random_signal =3D !(ecs->event_thread->stop_signal () =3D=3D GDB_SIGNA= L_TRAP - && currently_stepping (ecs->event_thread)); + && currently_stepping (ecs->event_thread) + && !program_bp); /* Perhaps the thread hit a single-step breakpoint of _another_ thread. Single-step breakpoints are transparent to the --=20 You are receiving this mail because: You are on the CC list for the bug.=