[Lldb-commits] [PATCH] D157640: [lldb] Improve error message when trying to debug a non-debuggable process

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 11 10:47:47 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGbe237b76da7e: [lldb] Improve error message when trying to debug a non-debuggable process (authored by JDevlieghere).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D157640?vs=549119&id=549459#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157640

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


Index: lldb/tools/debugserver/source/DNB.cpp
===================================================================
--- lldb/tools/debugserver/source/DNB.cpp
+++ lldb/tools/debugserver/source/DNB.cpp
@@ -382,11 +382,22 @@
         if (err_str && err_len > 0) {
           if (launch_err.AsString()) {
             ::snprintf(err_str, err_len,
-                       "failed to get the task for process %i (%s)", pid,
+                       "failed to get the task for process %i: %s", pid,
                        launch_err.AsString());
           } else {
+
+            const char *ent_name =
+#if TARGET_OS_OSX
+              "com.apple.security.get-task-allow";
+#else
+              "get-task-allow";
+#endif
             ::snprintf(err_str, err_len,
-                       "failed to get the task for process %i", pid);
+                       "failed to get the task for process %i: this likely "
+                       "means the process cannot be debugged, either because "
+                       "it's a system process or because the process is "
+                       "missing the %s entitlement.",
+                       pid, ent_name);
           }
         }
       } else {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157640.549459.patch
Type: text/x-patch
Size: 1195 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230811/62b54310/attachment.bin>


More information about the lldb-commits mailing list