[Lldb-commits] [lldb] [lldb] Improve logging of failure to get register information from Target XML (PR #170478)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Dec 3 15:47:57 PST 2025


================
@@ -5135,14 +5145,19 @@ void ProcessGDBRemote::AddRemoteRegisters(
 
 // query the target of gdb-remote for extended target information returns
 // true on success (got register definitions), false on failure (did not).
-bool ProcessGDBRemote::GetGDBServerRegisterInfo(ArchSpec &arch_to_use) {
-  // Make sure LLDB has an XML parser it can use first
-  if (!XMLDocument::XMLEnabled())
-    return false;
-
-  // check that we have extended feature read support
+llvm::Error ProcessGDBRemote::GetGDBServerRegisterInfo(ArchSpec &arch_to_use) {
+  // If the remote does not offer XML, does not matter if we would have been
+  // able to parse it.
   if (!m_gdb_comm.GetQXferFeaturesReadSupported())
-    return false;
+    return llvm::createStringError(
+        llvm::inconvertibleErrorCode(),
+        "The debug server does not support \"qXfer:features:read\"");
----------------
JDevlieghere wrote:

In my quest to make errors and warning more consistent, I'm being more vigilant about them following the LLVm [style](https://llvm.org/docs/CodingStandards.html#error-and-warning-messages) .

```suggestion
        "the debug server does not support \"qXfer:features:read\"");
```

https://github.com/llvm/llvm-project/pull/170478


More information about the lldb-commits mailing list