[Lldb-commits] [lldb] 9ed9742 - Only perform the login_session_has_gui_access on macOS

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 10 18:16:42 PST 2020


Author: Jason Molenda
Date: 2020-02-10T18:16:31-08:00
New Revision: 9ed9742ec05091e4c16d93005acbfafc6f801e7d

URL: https://github.com/llvm/llvm-project/commit/9ed9742ec05091e4c16d93005acbfafc6f801e7d
DIFF: https://github.com/llvm/llvm-project/commit/9ed9742ec05091e4c16d93005acbfafc6f801e7d.diff

LOG: Only perform the login_session_has_gui_access on macOS

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp
index b4dd9031eb67..87aca91c00c4 100644
--- a/lldb/tools/debugserver/source/RNBRemote.cpp
+++ b/lldb/tools/debugserver/source/RNBRemote.cpp
@@ -3741,12 +3741,17 @@ static bool process_is_already_being_debugged (nub_process_t pid) {
 // for debug permission by popping up a dialog box and attach
 // may fail outright).
 static bool login_session_has_gui_access () {
+  // I believe this API only works on macOS.
+#if TARGET_OS_OSX == 0
+  return true;
+#else
   auditinfo_addr_t info;
   getaudit_addr(&info, sizeof(info));
   if (info.ai_flags & AU_SESSION_FLAG_HAS_GRAPHIC_ACCESS)
     return true;
   else
     return false;
+#endif
 }
 
 // Checking for 
@@ -3766,6 +3771,7 @@ static bool login_session_has_gui_access () {
 // $ security authorizationdb read system.privilege.taskport.debug
 
 static bool developer_mode_enabled () {
+  // This API only exists on macOS.
 #if TARGET_OS_OSX == 0
   return true;
 #else


        


More information about the lldb-commits mailing list