From d3b0a7ece7b01a3b762699ae73574e78b5a0af02 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Tue, 6 Jun 2023 16:29:51 +0800 Subject: [PATCH] Fix register widget shows empty registers when their values cannot be read --- core/adapters/dbgengadapter.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/adapters/dbgengadapter.cpp b/core/adapters/dbgengadapter.cpp index df668fe..a15c1ec 100644 --- a/core/adapters/dbgengadapter.cpp +++ b/core/adapters/dbgengadapter.cpp @@ -1141,7 +1141,14 @@ std::unordered_map DbgEngAdapter::ReadAllRegisters() std::unordered_map 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; }