Compress/decompress memory automatically in trace files

This commit is contained in:
Dr. Chat
2015-11-20 16:58:40 -06:00
parent f3832a06c1
commit 0f2f4ab9b6
7 changed files with 78 additions and 8 deletions

View File

@@ -150,8 +150,14 @@ void TracePlayer::PlayTraceOnThread(const uint8_t* trace_data,
case TraceCommandType::kMemoryRead: {
auto cmd = reinterpret_cast<const MemoryReadCommand*>(trace_ptr);
trace_ptr += sizeof(*cmd);
std::memcpy(memory->TranslatePhysical(cmd->base_ptr), trace_ptr,
cmd->length);
if (cmd->full_length) {
DecompressMemory(trace_ptr, cmd->length,
memory->TranslatePhysical(cmd->base_ptr),
cmd->full_length);
} else {
std::memcpy(memory->TranslatePhysical(cmd->base_ptr), trace_ptr,
cmd->length);
}
trace_ptr += cmd->length;
break;
}