From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DA3723858C41; Thu, 4 Jan 2024 14:40:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA3723858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1704379250; bh=aLx2WnkM0R/wwoHMPaVf7Ewf56LRdddi+GxzGvaPMzg=; h=From:To:Subject:Date:From; b=YrQhGGf5Dq9mZZm4JMKps1jZsuOkfGlSve+Oz93uWs93MdWVFr88hVRi204g//Wub gIPYPgrmOJbDt2P9wEdT6mGtMOL6TIIcin+edInRuhHE5H0gJglrSE2vt7yHCtInTx bt5PAnsNreKlOX2wOxksBnrMsiCzyyAjJDgNvF18= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/31211] New: [gdb] info checkpoints show incorrect info Date: Thu, 04 Jan 2024 14:40:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 Bug ID: 31211 Summary: [gdb] info checkpoints show incorrect info Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- Consider test-case test.c: ... $ cat test.c #include int main (void) { printf ("1\n"); printf ("2\n"); printf ("3\n"); printf ("4\n"); printf ("5\n"); printf ("6\n"); printf ("7\n"); printf ("8\n"); printf ("9\n"); printf ("10\n"); return 0; } ... Compiled with: ... $ gcc -g test.c ... Let's look at the output of "info checkpoints": ... $ 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) info checkpoints No checkpoints. ... OK, sofar so good. Now let's add a checkpoint: ... (gdb) checkpoint checkpoint 1: fork returned pid 7886. (gdb) info checkpoints=20 * 0 process 7881 (main process) at 0x0 1 process 7886 at 0x40051b, file test.c, line 6 ... The documentation says checkpoints, but what we really have is fork child/parent, which are initially equal, so it's odd that they're not both shown with "at 0x40051b, file test.c, line 6". After switching to checkpoint 1, we have: ... (gdb) restart 1 Switching to process 7886 #0 main () at test.c:6 6 printf ("1\n"); (gdb) info checkpoints=20 0 process 7881 (main process) at 0x40051b, file test.c, line 6 * 1 process 7886 at 0x40051b, file test.c, line 6 (gdb)=20 ... OK, so now they're indeed equal. Let's see what happens when we step to the next line: ... (gdb) next 1 7 printf ("2\n"); (gdb) info checkpoints=20 0 process 7881 (main process) at 0x40051b, file test.c, line 6 * 1 process 7886 at 0x40051b, file test.c, line 6 (gdb)=20 ... Hmm, the line number didn't change. So, are we stuck at line 6? Let's try switching forth and back: ... (gdb) restart 0 Switching to process 7881 #0 main () at test.c:6 6 printf ("1\n"); (gdb) info checkpoints * 0 process 7881 (main process) at 0x40051b, file test.c, line 6 1 process 7886 at 0x400525, file test.c, line 7 (gdb) restart 1 Switching to process 7886 #0 main () at test.c:7 7 printf ("2\n"); (gdb) info checkpoints 0 process 7881 (main process) at 0x40051b, file test.c, line 6 * 1 process 7886 at 0x400525, file test.c, line 7 (gdb)=20 ... Now the line is updated to 7. So, it seems info checkpoints show outdated info for the current fork. --=20 You are receiving this mail because: You are on the CC list for the bug.=