Skip to content

Commit

Permalink
Fix register widget shows empty registers when their values cannot be…
Browse files Browse the repository at this point in the history
… read
  • Loading branch information
xusheng6 committed Jun 19, 2023
1 parent 0676f00 commit d3b0a7e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/adapters/dbgengadapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,14 @@ std::unordered_map<std::string, DebugRegister> DbgEngAdapter::ReadAllRegisters()
std::unordered_map<std::string, DebugRegister> all_regs {};

for (const auto& reg : this->GetRegisterList())
all_regs[reg] = this->ReadRegister(reg);
{
const auto regRead = this->ReadRegister(reg);
// During TTD replay, some registers are present in the list, but their values are unavailable, e.g., ymm0.
// A better way is to have ReadRegister() fail for them. However, here I am doing it in a simple and dirty way
// by checking whether the name of the returned register is empty.
if (!regRead.m_name.empty())
all_regs[reg] = regRead;
}

return all_regs;
}
Expand Down

0 comments on commit d3b0a7e

Please sign in to comment.