Skip to content

Commit 5c98163

Browse files
committed
[lldb] Log when we use fallback register information
These fallback layouts are essentially guesses. Used when there is no other way to query register information from the debug server. Therefore there is a risk that LLDB and the debug server disagree, which can produce strange effects. I have added a log message here so we have a clue when triaging these problems. Note that it's not wrong to assume a layout in some situations. It's how some debug servers were built. However if you end up using the fallback when the server expected you to use XML, you're likely going to have a bad time.
1 parent d162afa commit 5c98163

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,13 @@ void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
570570
}
571571
}
572572

573-
if (registers.empty())
573+
if (registers.empty()) {
574574
registers = GetFallbackRegisters(arch_to_use);
575+
if (!registers.empty())
576+
LLDB_LOG(
577+
log,
578+
"All other methods failed, using fallback register information.");
579+
}
575580

576581
AddRemoteRegisters(registers, arch_to_use);
577582
}

0 commit comments

Comments
 (0)