Hi abidh, clayborg, zturner,

Add thread-id field in *stopped notification (MI) + tests

All tests pass on OS X

http://reviews.llvm.org/D7501

Files:
  test/tools/lldb-mi/TestMiNotification.py
  tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp

Index: test/tools/lldb-mi/TestMiNotification.py
===================================================================
--- test/tools/lldb-mi/TestMiNotification.py
+++ test/tools/lldb-mi/TestMiNotification.py
@@ -63,7 +63,7 @@
         self.expect("\^done")
 
         # Test that *stopped is printed
-        
self.expect("\*stopped,reason=\"signal-received\",signal=\"17\",stopped-threads=\"all\"")
+        
self.expect("\*stopped,reason=\"signal-received\",signal=\"17\",thread-id=\"1\",stopped-threads=\"all\"")
 
     @lldbmi_test
     @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for 
windows")
@@ -101,7 +101,7 @@
             self.expect("\^done")
 
             # Test that *stopped is printed
-            
self.expect("\*stopped,reason=\"signal-received\",signal=\"17\",stopped-threads=\"all\"")
+            
self.expect("\*stopped,reason=\"signal-received\",signal=\"17\",thread-id=\"1\",stopped-threads=\"all\"")
 
             # Exit
             self.runCmd("-gdb-exit")
Index: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
===================================================================
--- tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
+++ tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
@@ -911,17 +911,21 @@
         }
         default:
         {
-            // MI print 
"*stopped,reason=\"signal-received\",signal=\"%lld\",stopped-threads=\"all\""
+            // MI print 
"*stopped,reason=\"signal-received\",signal=\"%lld\",thread-id=\"%d\",stopped-threads=\"all\""
             const CMICmnMIValueConst miValueConst("signal-received");
             const CMICmnMIValueResult miValueResult("reason", miValueConst);
             CMICmnMIOutOfBandRecord 
miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult);
             const CMIUtilString strReason(CMIUtilString::Format("%lld", 
nStopReason));
             const CMICmnMIValueConst miValueConst2(strReason);
             const CMICmnMIValueResult miValueResult2("signal", miValueConst2);
             bOk = miOutOfBandRecord.Add(miValueResult2);
-            const CMICmnMIValueConst miValueConst3("all");
-            const CMICmnMIValueResult miValueResult3("stopped-threads", 
miValueConst3);
+            const CMIUtilString strThreadId(CMIUtilString::Format("%d", 
sbProcess.GetSelectedThread().GetIndexID()));
+            const CMICmnMIValueConst miValueConst3(strThreadId);
+            const CMICmnMIValueResult miValueResult3("thread-id", 
miValueConst3);
             bOk = bOk && miOutOfBandRecord.Add(miValueResult3);
+            const CMICmnMIValueConst miValueConst4("all");
+            const CMICmnMIValueResult miValueResult4("stopped-threads", 
miValueConst4);
+            bOk = bOk && miOutOfBandRecord.Add(miValueResult4);
             bOk = bOk && MiOutOfBandRecordToStdout(miOutOfBandRecord);
             bOk = bOk && TextToStdout("(gdb)");
         }

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
Index: test/tools/lldb-mi/TestMiNotification.py
===================================================================
--- test/tools/lldb-mi/TestMiNotification.py
+++ test/tools/lldb-mi/TestMiNotification.py
@@ -63,7 +63,7 @@
         self.expect("\^done")
 
         # Test that *stopped is printed
-        self.expect("\*stopped,reason=\"signal-received\",signal=\"17\",stopped-threads=\"all\"")
+        self.expect("\*stopped,reason=\"signal-received\",signal=\"17\",thread-id=\"1\",stopped-threads=\"all\"")
 
     @lldbmi_test
     @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@@ -101,7 +101,7 @@
             self.expect("\^done")
 
             # Test that *stopped is printed
-            self.expect("\*stopped,reason=\"signal-received\",signal=\"17\",stopped-threads=\"all\"")
+            self.expect("\*stopped,reason=\"signal-received\",signal=\"17\",thread-id=\"1\",stopped-threads=\"all\"")
 
             # Exit
             self.runCmd("-gdb-exit")
Index: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
===================================================================
--- tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
+++ tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
@@ -911,17 +911,21 @@
         }
         default:
         {
-            // MI print "*stopped,reason=\"signal-received\",signal=\"%lld\",stopped-threads=\"all\""
+            // MI print "*stopped,reason=\"signal-received\",signal=\"%lld\",thread-id=\"%d\",stopped-threads=\"all\""
             const CMICmnMIValueConst miValueConst("signal-received");
             const CMICmnMIValueResult miValueResult("reason", miValueConst);
             CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult);
             const CMIUtilString strReason(CMIUtilString::Format("%lld", nStopReason));
             const CMICmnMIValueConst miValueConst2(strReason);
             const CMICmnMIValueResult miValueResult2("signal", miValueConst2);
             bOk = miOutOfBandRecord.Add(miValueResult2);
-            const CMICmnMIValueConst miValueConst3("all");
-            const CMICmnMIValueResult miValueResult3("stopped-threads", miValueConst3);
+            const CMIUtilString strThreadId(CMIUtilString::Format("%d", sbProcess.GetSelectedThread().GetIndexID()));
+            const CMICmnMIValueConst miValueConst3(strThreadId);
+            const CMICmnMIValueResult miValueResult3("thread-id", miValueConst3);
             bOk = bOk && miOutOfBandRecord.Add(miValueResult3);
+            const CMICmnMIValueConst miValueConst4("all");
+            const CMICmnMIValueResult miValueResult4("stopped-threads", miValueConst4);
+            bOk = bOk && miOutOfBandRecord.Add(miValueResult4);
             bOk = bOk && MiOutOfBandRecordToStdout(miOutOfBandRecord);
             bOk = bOk && TextToStdout("(gdb)");
         }
_______________________________________________
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to