Not supported on windows
Supported on linux
Not supported on embedded
Not supported on android

delete checkpoint command

Deletes a previously created checkpoint

Syntax

delete checkpoint [Checkpoint number]

Parameters

Checkpoint number
Specifies the number of a checkpoint previously created using the checkpoint command.

Remarks

Please see the description of the checkpoint command for an overview of checkpoints.

Note that you cannot delete the currently selected checkpoint unless you switch to another checkpoint using the restart command.

Note that GDB will not reuse checkpoint numbers after they are deleted using this command unless you delete all checkpoints.

Examples

We will demonstrate the use of the delete checkpoint command using a basic C program consisting of several printf() lines:

#include <stdio.h>

int main(int argc, char **argv)
{
    printf("Line 1\n");
    printf("Line 2\n");
    printf("Line 3\n");
    printf("Line 4\n");
    printf("Line 5\n");
    return 0;
}

We will create several checkpoints when the program execution passes different lines and then use the delete checkpoint command to delete some of them:

(gdb) start
Temporary breakpoint 1 at 0x8048426: file test.cpp, line 5.
Starting program: /home/bazis/test

Temporary breakpoint 1, main (argc=1, argv=0xbffff064) at test.cpp:5
5 printf("Line 1\n");
(gdb) next
Line 1
6 printf("Line 2\n");
(gdb) checkpoint
checkpoint: fork returned pid 2175.
(gdb) next
Line 2
7 printf("Line 3\n");
(gdb) checkpoint
checkpoint: fork returned pid 2176.
(gdb) next
Line 3
8 printf("Line 4\n");
(gdb) checkpoint
checkpoint: fork returned pid 2177.
(gdb) info checkpoints
3 process 2177 at 0x804844a, file test.cpp, line 8
2 process 2176 at 0x804843e, file test.cpp, line 7
1 process 2175 at 0x8048432, file test.cpp, line 6
* 0 process 2171 (main process) at 0x804844a, file test.cpp, line 8
(gdb) delete checkpoint 2
Killed process 2176
(gdb) next
Line 4
9 printf("Line 5\n");
(gdb) checkpoint
checkpoint: fork returned pid 2178.
(gdb) info checkpoints
4 process 2178 at 0x8048456, file test.cpp, line 9
3 process 2177 at 0x804844a, file test.cpp, line 8
1 process 2175 at 0x8048432, file test.cpp, line 6
* 0 process 2171 (main process) at 0x8048456, file test.cpp, line 9
(gdb) restart 1
Switching to process 2175
#0 main (argc=1, argv=0xbffff064) at test.cpp:6
6 printf("Line 2\n");
(gdb) next
Line 2
7 printf("Line 3\n");
(gdb) info checkpoints
4 process 2178 at 0x8048456, file test.cpp, line 9
3 process 2177 at 0x804844a, file test.cpp, line 8
* 1 process 2175 at 0x804843e, file test.cpp, line 7
0 process 2171 (main process) at 0x8048456, file test.cpp, line 9

Compatibility with VisualGDB

You can use the delete checkpoint command with VisualGDB using the GDB Session window in Visual Studio.

See also