When doing "checkpoint delete 0" we run into an assertion failure:
...
+delete checkpoint 0
inferior.c:406: internal-error: find_inferior_pid: Assertion `pid != 0' failed.
...
Fix this by handling the "pptid == null_ptid" case in
delete_checkpoint_command.
Tested on x86_64-linux.
Approved-By: Kevin Buettner <kevinb@redhat.com>
PR gdb/31209
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31209
delete_fork (ptid);
+ if (pptid == null_ptid)
+ {
+ int status;
+ /* Wait to collect the inferior's exit status. Do not check whether
+ this succeeds though, since we may be dealing with a process that we
+ attached to. Such a process will only report its exit status to its
+ original parent. */
+ waitpid (ptid.pid (), &status, 0);
+ return;
+ }
+
/* If fi->parent_ptid is not a part of lwp but it's a part of checkpoint
list, waitpid the ptid.
If fi->parent_ptid is a part of lwp and it is stopped, waitpid the
#
# Finished: cleanup
#
+
+#
+# Now let's try to delete checkpoint 0.
+#
+
+with_test_prefix "delete checkpoint 0" {
+ clean_restart $binfile
+ runto_main
+
+ gdb_test "checkpoint" "checkpoint 1: fork returned pid $decimal\\."
+ gdb_test "restart 1" "Switching to .*"
+ gdb_test "delete checkpoint 0" "Killed process $decimal"
+ gdb_test "info checkpoints" [string_to_regexp "No checkpoints."]
+}