File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55#include "ReplayTask.h"
66#include "log.h"
7+ #include "util.h"
78
89using namespace std;
910
@@ -56,6 +57,21 @@ static SimpleDebuggerExtensionCommand when_tid(
5657 return string("Current tid: ") + to_string(t->tid);
5758 });
5859
60+ static SimpleDebuggerExtensionCommand info_recording(
61+ "info recording",
62+ "Print the path of the recording RR is"
63+ " currently replaying.",
64+ [](GdbServer&, Task* t, const vector<string>&) {
65+ if (!t->session().is_replaying()) {
66+ return DebuggerExtensionCommandHandler::cmd_end_diversion();
67+ }
68+
69+ auto task = static_cast<ReplayTask*>(t);
70+ auto trace_dir = task->session().as_replay()->trace_reader().dir();
71+
72+ return string("Path of recording: \"") + json_escape(trace_dir) + string("\"");
73+ });
74+
5975static std::vector<ReplayTimeline::Mark> back_stack;
6076static ReplayTimeline::Mark current_history_cp;
6177static std::vector<ReplayTimeline::Mark> forward_stack;
Original file line number Diff line number Diff line change 1+ from util import *
2+
3+ import re
4+ import json
5+
6+ send_gdb ('info recording' )
7+ expect_gdb (re .compile (r'(?<=Path of recording: ).*' ))
8+ path_jsonstr = last_match ().group (0 )
9+ path_pystr = json .loads (path_jsonstr )
10+
11+ if len (path_pystr ) < 6 :
12+ failed ("ERROR ... Unreasonably short path for recording file found in output" )
13+
14+ # Inferior command also has the name of the binary at the end,
15+ # so the pattern matches opening but not closing paren.
16+ send_gdb ("inferior" )
17+ expect_gdb (f"\\ ({ path_pystr } " )
18+
19+ ok ()
Original file line number Diff line number Diff line change 1+ source `dirname $0`/util.sh
2+ record simple$bitness
3+ debug info_recording
You can’t perform that action at this time.
0 commit comments