[Lldb-commits] [PATCH] D138060: Improve error logging when xcrun fails to execute successfully

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 16 04:49:14 PST 2022


labath added inline comments.


================
Comment at: lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm:13
 #include "lldb/Host/macosx/HostInfoMacOSX.h"
+#include "lldb/Core/Debugger.h"
 #include "lldb/Utility/Args.h"
----------------
We shouldn't have Host->Core dependencies. Could you report the error in the caller?


================
Comment at: lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm:401
+    lldb_private::Status error = Host::RunShellCommand(
+        args, FileSpec(), &status, &signo, &output_str, timeout);
+
----------------
why not just pass `run_in_shell=false` (the optional argument coming after the timeout)?


================
Comment at: lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm:527
+    }
+    Debugger::ReportError(msg);
+  }
----------------
`ReportError(toString(path_or_err.takeError()))` ?


================
Comment at: lldb/unittests/Host/HostTest.cpp:40
+  auto timeout = std::chrono::seconds(60);
+  Status error = Host::RunShellCommand("/usr/bin/true", FileSpec(), &status,
+                                       &signo, &out, timeout);
----------------
On one (linux) machine I have access to, this is present in `/bin/true`. A different one has the same file in both paths.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138060/new/

https://reviews.llvm.org/D138060



More information about the lldb-commits mailing list