[Lldb-commits] [PATCH] Fix a problem where lldb-mi would not stop the debuggee after -exec-interrupt command.

Hafiz Abid Qadeer abidh.haq at gmail.com
Fri Feb 20 03:26:15 PST 2015


Hi ki.stfu, clayborg,

This revision fixes a problem where lldb-mi would not stop the execution after exec-interrupt call.
On Linux, SIGSTOP is used to stop the debuggee process. LLDB stopped the debuggee alright. But when
lldb-mi received the notification of stopping with reason as SIGSTOP, it would resume the process.
This was heppening in CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopSignal. This function aslo
used hard coded numbers for signal istead of symbolic names.

This revision changes code to treat SIGSTOP reason as SIGINT. Also used symbolic names for signals
instead of numbers.

http://reviews.llvm.org/D7783

Files:
  tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp

Index: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
===================================================================
--- tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
+++ tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
@@ -836,7 +836,8 @@
     const MIuint64 nStopReason = sbProcess.GetSelectedThread().GetStopReasonDataAtIndex(0);
     switch (nStopReason)
     {
-        case 2: // Terminal interrupt signal. SIGINT
+        case SIGINT: // Terminal interrupt signal. SIGINT
+        case SIGSTOP:
         {
             // MI print "*stopped,reason=\"signal-received\",signal-name=\"SIGNINT\",signal-meaning=\"Interrupt\",frame={%s}"
             const CMICmnMIValueConst miValueConst("signal-received");
@@ -856,7 +857,7 @@
             bOk = bOk && TextToStdout("(gdb)");
         }
         break;
-        case 11: // Invalid memory reference. SIGSEGV
+        case SIGSEGV: // Invalid memory reference. SIGSEGV
         {
             // MI print "*stopped,reason=\"signal-received\",signal-name=\"SIGSEGV\",signal-meaning=\"Segmentation
             // fault\",thread-id=\"%d\",frame={%s}"
@@ -881,11 +882,7 @@
             // Note no "(gdb)" output here
         }
         break;
-        case 19:
-            if (sbProcess.IsValid())
-                sbProcess.Continue();
-            break;
-        case 5: //  Trace/breakpoint trap. SIGTRAP
+        case SIGTRAP: //  Trace/breakpoint trap. SIGTRAP
         {
             lldb::SBThread thread = sbProcess.GetSelectedThread();
             const MIuint nFrames = thread.GetNumFrames();

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7783.20384.patch
Type: text/x-patch
Size: 1564 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150220/02b934f2/attachment.bin>


More information about the lldb-commits mailing list