Author: Jim Ingham
Date: 2023-06-01T10:21:23-07:00
New Revision: 267a4cda82481da159492bc6d6597d11101f8abb

URL: 
https://github.com/llvm/llvm-project/commit/267a4cda82481da159492bc6d6597d11101f8abb
DIFF: 
https://github.com/llvm/llvm-project/commit/267a4cda82481da159492bc6d6597d11101f8abb.diff

LOG: Prevent some spurious error messages in the debugserver logs.

DNBGetDeploymentInfo was calling GetPlatformString w/o checking that
the load command it was processing actually provided a platform string.
That caused a bunch of worrisome looking error messages in the debugserver
log output.

Differential Revision: https://reviews.llvm.org/D151861

Added: 
    

Modified: 
    lldb/tools/debugserver/source/DNB.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/tools/debugserver/source/DNB.cpp 
b/lldb/tools/debugserver/source/DNB.cpp
index 8a8b1eeb355bd..7b86ca0bfb9dc 100644
--- a/lldb/tools/debugserver/source/DNB.cpp
+++ b/lldb/tools/debugserver/source/DNB.cpp
@@ -1456,9 +1456,13 @@ DNBGetDeploymentInfo(nub_process_t pid, bool 
is_executable,
     major_version = info.major_version;
     minor_version = info.minor_version;
     patch_version = info.patch_version;
+    // MachProcess::DeploymentInfo has a bool operator to tell whether we have
+    // set the platform.  If that's not true, don't report out the platform:
+    if (!info)
+      return {};
     return procSP->GetPlatformString(info.platform);
   }
-  return nullptr;
+  return {};
 }
 
 // Get the current shared library information for a process. Only return


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to