3
3
#include " ReplayTimeline.h"
4
4
#include " ScopedFd.h"
5
5
#include " rr_pcp.capnp.h"
6
+ #include " util.h"
6
7
#include < algorithm>
7
8
#include < capnp/blob.h>
8
9
#include < capnp/message.h>
@@ -22,9 +23,10 @@ MarkData::MarkData(const ReplayTimeline::Mark& m)
22
23
extra_regs(m.extra_regs()),
23
24
return_addresses(m.get_internal()->proto.return_addresses),
24
25
singlestep_to_next_mark_no_signal(
25
- m.get_internal()->singlestep_to_next_mark_no_signal) {}
26
+ m.get_internal()->singlestep_to_next_mark_no_signal),
27
+ arch(m.get_internal()->extra_regs.arch()) {}
26
28
27
- MarkData::MarkData (rr::pcp::MarkData::Reader reader, SupportedArch arch,
29
+ MarkData::MarkData (rr::pcp::MarkData::Reader reader,
28
30
const CPUIDRecords& cpuid_recs)
29
31
: time(reader.getTime()),
30
32
ticks(reader.getTicks()),
@@ -34,7 +36,8 @@ MarkData::MarkData(rr::pcp::MarkData::Reader reader, SupportedArch arch,
34
36
extra_regs(),
35
37
return_addresses(),
36
38
singlestep_to_next_mark_no_signal(
37
- reader.getSinglestepToNextMarkNoSignal()) {
39
+ reader.getSinglestepToNextMarkNoSignal()),
40
+ arch(from_trace_arch(reader.getArch())) {
38
41
regs.set_arch (arch);
39
42
regs.set_from_trace (arch, reader.getRegs ().getRaw ().begin (),
40
43
reader.getRegs ().getRaw ().size ());
@@ -69,8 +72,7 @@ static std::vector<string> checkpoint_directories(const string& trace_dir) {
69
72
}
70
73
71
74
std::vector<CheckpointInfo> get_checkpoint_infos (
72
- const std::string& trace_dir, SupportedArch arch,
73
- const CPUIDRecords& cpuid_recs) {
75
+ const std::string& trace_dir, const CPUIDRecords& cpuid_recs) {
74
76
75
77
std::vector<CheckpointInfo> checkpoints;
76
78
for (auto checkpoint_dir : checkpoint_directories (trace_dir)) {
@@ -81,8 +83,8 @@ std::vector<CheckpointInfo> get_checkpoint_infos(
81
83
}
82
84
capnp::PackedFdMessageReader reader (fd);
83
85
auto checkpointsInfoReader = reader.getRoot <pcp::CheckpointInfo>();
84
- auto info = CheckpointInfo{ checkpoint_dir, checkpointsInfoReader, arch,
85
- cpuid_recs };
86
+ auto info =
87
+ CheckpointInfo{ checkpoint_dir, checkpointsInfoReader, cpuid_recs };
86
88
checkpoints.push_back (info);
87
89
}
88
90
@@ -138,6 +140,7 @@ bool CheckpointInfo::serialize(ReplaySession& session) {
138
140
builder.setTicksAtEventStart (mark_data.ticks_at_event_start );
139
141
builder.setSinglestepToNextMarkNoSignal (
140
142
mark_data.singlestep_to_next_mark_no_signal );
143
+ builder.setArch (to_trace_arch (mark_data.arch ));
141
144
};
142
145
143
146
if (is_explicit ()) {
@@ -220,18 +223,17 @@ CheckpointInfo::CheckpointInfo(const Checkpoint& non_explicit_cp,
220
223
221
224
CheckpointInfo::CheckpointInfo (std::string metadata_file,
222
225
rr::pcp::CheckpointInfo::Reader reader,
223
- SupportedArch arch,
224
226
const CPUIDRecords& cpuid_recs)
225
227
: capnp_directory(std::move(metadata_file)),
226
228
unique_id(reader.getId()),
227
229
where(data_to_str(reader.getWhere())),
228
230
next_serial(reader.getNextSerial()),
229
231
clone_data(reader.isExplicit() ? reader.getExplicit()
230
232
: reader.getNonExplicit().getCloneMark(),
231
- arch, cpuid_recs),
233
+ cpuid_recs),
232
234
non_explicit_mark_data(
233
235
reader.isNonExplicit()
234
- ? new MarkData{ reader.getNonExplicit ().getCheckpointMark (), arch,
236
+ ? new MarkData{ reader.getNonExplicit ().getCheckpointMark (),
235
237
cpuid_recs }
236
238
: nullptr ),
237
239
stats () {
0 commit comments