From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F12D53858C41; Thu, 4 Jan 2024 14:48:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F12D53858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1704379687; bh=MJ2CiPCFBCM3lbVRWxAYMbOuz/VegSPn92F0rF0QAcQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=q5MA2x/jTb8mVl6WIMrbhlFOxD4QEYYCd8IJ9ODIz7Fcx6TcVBazhGbVjVAS3XzfZ AFXgH5yq4yU43DGo15uLu7Zas1hZTgAhoDDLCT5BvrPQqAD6v97JS7IXvvagqlNY7o NSB0Y8TMPqRYBP6oPxfujbdrOzEfK8C6bM7PWVyY= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/31211] [gdb] info checkpoints show incorrect info Date: Thu, 04 Jan 2024 14:48:07 +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: vries at gcc dot gnu.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=3D31211 --- Comment #1 from Tom de Vries --- With this patch: ... diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c index 1430ff89fa7..4f34c72ef8e 100644 --- a/gdb/linux-fork.c +++ b/gdb/linux-fork.c @@ -594,12 +594,13 @@ info_checkpoints_command (const char *arg, int from_t= ty) continue; printed =3D &fi; - if (fi.ptid =3D=3D inferior_ptid) + bool is_current =3D fi.ptid =3D=3D inferior_ptid; + if (is_current) gdb_printf ("* "); else gdb_printf (" "); - ULONGEST pc =3D fi.pc; + ULONGEST pc =3D is_current ? get_frame_pc (get_current_frame ()) : f= i.pc ; gdb_printf ("%d %s", fi.num, target_pid_to_str (fi.ptid).c_str ()); if (fi.num =3D=3D 0) gdb_printf (_(" (main process)")); ... we get: ... $ gdb -q a.out Reading symbols from a.out... (gdb) start Temporary breakpoint 1 at 0x40051b: file test.c, line 6. Starting program: /data/vries/gdb/a.out=20 Temporary breakpoint 1, main () at test.c:6 6 printf ("1\n"); (gdb) checkpoint checkpoint 1: fork returned pid 9696. (gdb) info checkpoint * 0 process 9693 (main process) at 0x40051b, file test.c, line 6 1 process 9696 at 0x40051b, file test.c, line 6 (gdb) n 1 7 printf ("2\n"); (gdb) info checkpoint * 0 process 9693 (main process) at 0x400525, file test.c, line 7 1 process 9696 at 0x40051b, file test.c, line 6 (gdb)=20 ... --=20 You are receiving this mail because: You are on the CC list for the bug.=