[Lldb-commits] [lldb] r303965 - FreeBSD ProcessMonitor: map TRAP_CAP to a trace trap

Ed Maste via lldb-commits lldb-commits at lists.llvm.org
Thu May 25 20:15:46 PDT 2017


Author: emaste
Date: Thu May 25 22:15:46 2017
New Revision: 303965

URL: http://llvm.org/viewvc/llvm-project?rev=303965&view=rev
Log:
FreeBSD ProcessMonitor: map TRAP_CAP to a trace trap

In the absense of a more specific handler for TRAP_CAP (generated by
ENOTCAPABLE or ECAPMODE while in capability mode) treat it as a trace
trap. Obtained from FreeBSD r318884.

We should later add an option to have LLDB control the trapcap procctl 
(as with ASLR), as well as report a specific stop reason. For now this
change eliminates an assertion failure from LLDB.

Modified:
    lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp

Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp?rev=303965&r1=303964&r2=303965&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Thu May 25 22:15:46 2017
@@ -1132,6 +1132,10 @@ ProcessMessage ProcessMonitor::MonitorSI
 
   case 0:
   case TRAP_TRACE:
+#ifdef TRAP_CAP
+  // Map TRAP_CAP to a trace trap in the absense of a more specific handler.
+  case TRAP_CAP:
+#endif
     if (log)
       log->Printf("ProcessMonitor::%s() received trace event, tid = %" PRIu64
                   "  : si_code = %d",




More information about the lldb-commits mailing list