Skip to content

Commit

Permalink
Don't allow creating checkpoints when at end state or not running
Browse files Browse the repository at this point in the history
  • Loading branch information
dzaima committed Feb 23, 2024
1 parent 5e271ab commit 2e4b211
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/GdbCommand.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ static int gNextCheckpointId = 0;
string invoke_checkpoint(GdbServer& gdb_server, Task*,
const vector<string>& args) {
const string& where = args[0];
if (gdb_server.in_debuggee_end_state) {
return string("The program is not being run.");
}
int checkpoint_id = ++gNextCheckpointId;
GdbServer::Checkpoint::Explicit e;
if (gdb_server.timeline.can_add_checkpoint()) {
Expand Down
6 changes: 5 additions & 1 deletion src/test/restart_invalid_checkpoint.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
from util import *

send_gdb('c')
send_gdb('checkpoint')
expect_gdb('is not being run')

send_gdb('b main')
expect_gdb('Breakpoint 1')
send_gdb('c')
restart_replay()
expect_gdb('Breakpoint 1')
send_gdb('b atomic_puts')
expect_gdb('Breakpoint 2')
Expand Down

0 comments on commit 2e4b211

Please sign in to comment.