From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C4D173858C52; Thu, 19 Jan 2023 15:42:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C4D173858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674142971; bh=1M4oTOzAbBqPol42vVhhtLxsJ7ev/1+yg08HBXIm2tY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dClB4GfdtSviPxlWGViluDOC2qtigKmvBi+So0FyZiyaXHaUrCv8x1np80pGZEGto LLngBenaocmeaanh5AxUbl3kxTg6ydfCzdNh2hjpTznMDfFdYe/hb3wbMvNF9bd+dW CPi7OnaceANZYiWsr0bskThzeOAsbQ+oQtekI0oE= From: "blarsen at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug record/30025] Adding an inferior when already recording makes GDB not handle SIGTRAP correctly Date: Thu, 19 Jan 2023 15:42:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: record X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: blarsen at redhat dot com 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=3D30025 --- Comment #1 from B. Larsen --- Upon further inspection, its not nat the state of inferior 1 is corrupted. Instead, GDB just doesn't handle the SIGTRAP correctly. Looking at the $PCs when stepping to the factorial function, we have: Program received signal SIGTRAP, Trace/breakpoint trap.=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 0x0000000000401107 in fact (n=3D32767) at t.c:1=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20 1 int fact(int n){=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 (gdb) p $pc=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 $1 =3D (void (*)()) 0x401107 (gdb) si 0x000000000040110a 1 int fact(int n){ (gdb)=20 0x000000000040110e 1 int fact(int n){ (gdb)=20 2 if (n<2) return n; (gdb) p $pc $2 =3D (void (*)()) 0x401111 While the exact same session without recording inferior 1 looks like this: (gdb) s fact (n=3D5) at t.c:2 2 if (n<2) return n; (gdb) p $pc $1 =3D (void (*)()) 0x401111 Seems clear to me that instead of continuing execution until we were at an "is_stmt", GDB is just stopping at the instruction that received the sigtrap --=20 You are receiving this mail because: You are on the CC list for the bug.=