[Lldb-commits] [lldb] 5c98163 - [lldb] Log when we use fallback register information

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Wed Dec 10 09:09:27 PST 2025


Author: David Spickett
Date: 2025-12-10T17:08:27Z
New Revision: 5c98163246187f519e96d16de388183769817b3c

URL: https://github.com/llvm/llvm-project/commit/5c98163246187f519e96d16de388183769817b3c
DIFF: https://github.com/llvm/llvm-project/commit/5c98163246187f519e96d16de388183769817b3c.diff

LOG: [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.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index cde68b5b18e67..b976b53c035b0 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -570,8 +570,13 @@ void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
     }
   }
 
-  if (registers.empty())
+  if (registers.empty()) {
     registers = GetFallbackRegisters(arch_to_use);
+    if (!registers.empty())
+      LLDB_LOG(
+          log,
+          "All other methods failed, using fallback register information.");
+  }
 
   AddRemoteRegisters(registers, arch_to_use);
 }


        


More information about the lldb-commits mailing list