[Lldb-commits] [lldb] r150269 - in /lldb/tags/lldb-113/tools/debugserver/source/MacOSX: MachException.cpp MachException.h MachTask.cpp

Jim Ingham jingham at apple.com
Fri Feb 10 12:11:11 PST 2012


Author: jingham
Date: Fri Feb 10 14:11:10 2012
New Revision: 150269

URL: http://llvm.org/viewvc/llvm-project?rev=150269&view=rev
Log:
Switch to using a hand-built set of exceptions to watch rather than depending
on the EXC_MASK_ALL define.

Modified:
    lldb/tags/lldb-113/tools/debugserver/source/MacOSX/MachException.cpp
    lldb/tags/lldb-113/tools/debugserver/source/MacOSX/MachException.h
    lldb/tags/lldb-113/tools/debugserver/source/MacOSX/MachTask.cpp

Modified: lldb/tags/lldb-113/tools/debugserver/source/MacOSX/MachException.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/tags/lldb-113/tools/debugserver/source/MacOSX/MachException.cpp?rev=150269&r1=150268&r2=150269&view=diff
==============================================================================
--- lldb/tags/lldb-113/tools/debugserver/source/MacOSX/MachException.cpp (original)
+++ lldb/tags/lldb-113/tools/debugserver/source/MacOSX/MachException.cpp Fri Feb 10 14:11:10 2012
@@ -472,9 +472,9 @@
     count = (sizeof (ports) / sizeof (ports[0]));
     DNBLogThreadedIf(LOG_EXCEPTIONS | LOG_VERBOSE, "MachException::PortInfo::Save ( task = 0x%4.4x )", task);
     DNBError err;
-    err = ::task_get_exception_ports (task, EXC_MASK_ALL, masks, &count, ports, behaviors, flavors);
+    err = ::task_get_exception_ports (task, LLDB_MACH_EXC_MASK_BASE, masks, &count, ports, behaviors, flavors);
     if (DNBLogCheckLogBit(LOG_EXCEPTIONS) || err.Fail())
-        err.LogThreaded("::task_get_exception_ports ( task = 0x%4.4x, mask = 0x%x, maskCnt => %u, ports, behaviors, flavors )", task, EXC_MASK_ALL, count);
+        err.LogThreaded("::task_get_exception_ports ( task = 0x%4.4x, mask = 0x%x, maskCnt => %u, ports, behaviors, flavors )", task, LLDB_MACH_EXC_MASK_BASE, count);
     if (err.Fail())
         count = 0;
     return err.Error();

Modified: lldb/tags/lldb-113/tools/debugserver/source/MacOSX/MachException.h
URL: http://llvm.org/viewvc/llvm-project/lldb/tags/lldb-113/tools/debugserver/source/MacOSX/MachException.h?rev=150269&r1=150268&r2=150269&view=diff
==============================================================================
--- lldb/tags/lldb-113/tools/debugserver/source/MacOSX/MachException.h (original)
+++ lldb/tags/lldb-113/tools/debugserver/source/MacOSX/MachException.h Fri Feb 10 14:11:10 2012
@@ -22,6 +22,20 @@
 class MachProcess;
 class PThreadMutex;
 
+// This set of exceptions is common on 10.7 and up.  It is the
+// base exception set we should use, and then we can add others
+// as appropriate based on the system type.
+
+#define LLDB_MACH_EXC_MASK_BASE    (EXC_MASK_BAD_ACCESS |        \
+                         EXC_MASK_BAD_INSTRUCTION |             \
+                         EXC_MASK_ARITHMETIC |                  \
+                         EXC_MASK_EMULATION |                   \
+                         EXC_MASK_SOFTWARE |                    \
+                         EXC_MASK_BREAKPOINT |                  \
+                         EXC_MASK_SYSCALL |                     \
+                         EXC_MASK_MACH_SYSCALL |                \
+                         EXC_MASK_RPC_ALERT)
+
 typedef union MachMessageTag
 {
     mach_msg_header_t hdr;

Modified: lldb/tags/lldb-113/tools/debugserver/source/MacOSX/MachTask.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/tags/lldb-113/tools/debugserver/source/MacOSX/MachTask.cpp?rev=150269&r1=150268&r2=150269&view=diff
==============================================================================
--- lldb/tags/lldb-113/tools/debugserver/source/MacOSX/MachTask.cpp (original)
+++ lldb/tags/lldb-113/tools/debugserver/source/MacOSX/MachTask.cpp Fri Feb 10 14:11:10 2012
@@ -30,6 +30,7 @@
 #include "DNBError.h"
 #include "DNBLog.h"
 #include "MachProcess.h"
+#include "MachException.h"
 #include "DNBDataRef.h"
 #include "stack_logging.h"
 
@@ -368,7 +369,7 @@
         SaveExceptionPortInfo();
 
         // Set the ability to get all exceptions on this port
-        err = ::task_set_exception_ports (task, EXC_MASK_ALL, m_exception_port, EXCEPTION_DEFAULT | MACH_EXCEPTION_CODES, THREAD_STATE_NONE);
+        err = ::task_set_exception_ports (task, LLDB_MACH_EXC_MASK_BASE, m_exception_port, EXCEPTION_DEFAULT | MACH_EXCEPTION_CODES, THREAD_STATE_NONE);
         if (err.Fail())
             return false;
 





More information about the lldb-commits mailing list