Author: ki.stfu Date: Tue Feb 10 06:02:03 2015 New Revision: 228681 URL: http://llvm.org/viewvc/llvm-project?rev=228681&view=rev Log: Add thread-id field in *stopped notification (MI)
Summary: Add thread-id field in *stopped notification (MI) + tests All tests pass on OS X Reviewers: zturner, clayborg, abidh Reviewed By: clayborg Subscribers: lldb-commits, zturner, clayborg, abidh Differential Revision: http://reviews.llvm.org/D7501 Modified: lldb/trunk/test/tools/lldb-mi/TestMiNotification.py lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp Modified: lldb/trunk/test/tools/lldb-mi/TestMiNotification.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/TestMiNotification.py?rev=228681&r1=228680&r2=228681&view=diff ============================================================================== --- lldb/trunk/test/tools/lldb-mi/TestMiNotification.py (original) +++ lldb/trunk/test/tools/lldb-mi/TestMiNotification.py Tue Feb 10 06:02:03 2015 @@ -63,7 +63,10 @@ class MiNotificationTestCase(lldbmi_test self.expect("\^done") # Test that *stopped is printed - self.expect("\*stopped.*") + # Note that message is different in Darwin and Linux: + # Darwin: "*stopped,reason=\"signal-received\",signal=\"17\",thread-id=\"1\",stopped-threads=\"all\"" + # Linux: "*stopped,reason=\"end-stepping-range\",frame={addr=\"0x[0-9a-f]+\",func=\"??\",args=\[\],file=\"??\",fullname=\"??\",line=\"-1\"},thread-id=\"1\",stopped-threads=\"all\" + self.expect("\*stopped,reason=\"(signal-received|end-stepping-range)\",.+,thread-id=\"1\",stopped-threads=\"all\"") # Run to main to make sure we have not exited the application self.runCmd("-break-insert -f main") @@ -108,7 +111,7 @@ class MiNotificationTestCase(lldbmi_test 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") Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp?rev=228681&r1=228680&r2=228681&view=diff ============================================================================== --- lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp (original) +++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp Tue Feb 10 06:02:03 2015 @@ -911,7 +911,7 @@ CMICmnLLDBDebuggerHandleEvents::HandlePr } 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); @@ -919,9 +919,13 @@ CMICmnLLDBDebuggerHandleEvents::HandlePr 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