Author: ki.stfu
Date: Tue May 19 04:57:56 2015
New Revision: 237676

URL: http://llvm.org/viewvc/llvm-project?rev=237676&view=rev
Log:
Don't print =breakpoint-created if BP info was emitted in the result record (MI)


Modified:
    lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py
    lldb/trunk/test/tools/lldb-mi/interpreter/TestMiCliSupport.py
    lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
    lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp

Modified: lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py?rev=237676&r1=237675&r2=237676&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py (original)
+++ lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py Tue May 19 04:57:56 
2015
@@ -26,8 +26,8 @@ class MiBreakTestCase(lldbmi_testcase.Mi
         
#self.expect("\^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0xffffffffffffffff\",func=\"printf\",file=\"\?\?\",fullname=\"\?\?\",line=\"-1\",pending=\[\"printf\"\],times=\"0\",original-location=\"printf\"}")
         
self.expect("\^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0xffffffffffffffff\",func=\"\?\?\",file=\"\?\?\",fullname=\"\?\?/\?\?\",line=\"0\",pending=\[\"printf\"\],times=\"0\",original-location=\"printf\"}")
         #FIXME function name is unknown on Darwin, fullname should be ??, line 
-1
-        
#self.expect("=breakpoint-created,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0xffffffffffffffff\",func=\"printf\",file=\"\?\?\",fullname=\"\?\?\",line=\"-1\",pending=\[\"printf\"\],times=\"0\",original-location=\"printf\"}")
-        
self.expect("=breakpoint-created,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0xffffffffffffffff\",func=\"\?\?\",file=\"\?\?\",fullname=\"\?\?/\?\?\",line=\"0\",pending=\[\"printf\"\],times=\"0\",original-location=\"printf\"}")
+        
#self.expect("=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0xffffffffffffffff\",func=\"printf\",file=\"\?\?\",fullname=\"\?\?\",line=\"-1\",pending=\[\"printf\"\],times=\"0\",original-location=\"printf\"}")
+        
self.expect("=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0xffffffffffffffff\",func=\"\?\?\",file=\"\?\?\",fullname=\"\?\?/\?\?\",line=\"0\",pending=\[\"printf\"\],times=\"0\",original-location=\"printf\"}")
 
         self.runCmd("-exec-run")
         self.expect("\^running")
@@ -47,7 +47,7 @@ class MiBreakTestCase(lldbmi_testcase.Mi
 
         self.runCmd("-break-insert -f main")
         
self.expect("\^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"\d+\",pending=\[\"main\"\],times=\"0\",original-location=\"main\"}")
-        
self.expect("=breakpoint-created,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"\d+\",pending=\[\"main\"\],times=\"0\",original-location=\"main\"}")
+        
self.expect("=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"\d+\",pending=\[\"main\"\],times=\"0\",original-location=\"main\"}")
 
         self.runCmd("-exec-run")
         self.expect("\^running")
@@ -60,8 +60,8 @@ class MiBreakTestCase(lldbmi_testcase.Mi
         
#self.expect("\^done,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"printf\",file=\".+?\",fullname=\".+?\",line=\"(-1|\d+)\",times=\"0\",original-location=\"printf\"}")
         
self.expect("\^done,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\".+?\",file=\".+?\",fullname=\".+?\",line=\"(-1|\d+)\",times=\"0\",original-location=\"printf\"}")
         #FIXME function name is unknown on Darwin
-        
#self.expect("=breakpoint-created,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"printf\",file=\".+?\",fullname=\".+?\",line=\"(-1|\d+)\",times=\"0\",original-location=\"printf\"}")
-        
self.expect("=breakpoint-created,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\".+?\",file=\".+?\",fullname=\".+?\",line=\"(-1|\d+)\",times=\"0\",original-location=\"printf\"}")
+        
#self.expect("=breakpoint-modified,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"printf\",file=\".+?\",fullname=\".+?\",line=\"(-1|\d+)\",times=\"0\",original-location=\"printf\"}")
+        
self.expect("=breakpoint-modified,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\".+?\",file=\".+?\",fullname=\".+?\",line=\"(-1|\d+)\",times=\"0\",original-location=\"printf\"}")
         # FIXME function name is unknown on Darwin
         
#self.expect("=breakpoint-modified,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"printf\",file=\".+?\",fullname=\".+?\",line=\"(-1|\d+)\",times=\"0\",original-location=\"printf\"}")
         
self.expect("=breakpoint-modified,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\".+?\",file=\".+?\",fullname=\".+?\",line=\"(-1|\d+)\",times=\"0\",original-location=\"printf\"}")
@@ -91,7 +91,7 @@ class MiBreakTestCase(lldbmi_testcase.Mi
         line = line_number('main.cpp', '// BP_return')
         self.runCmd("-break-insert -f main.cpp:%d" % line)
         
self.expect("\^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"%d\",pending=\[\"main.cpp:%d\"\],times=\"0\",original-location=\"main.cpp:%d\"}"
 % (line, line, line))
-        
self.expect("=breakpoint-created,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"%d\",pending=\[\"main.cpp:%d\"\],times=\"0\",original-location=\"main.cpp:%d\"}"
 % (line, line, line))
+        
self.expect("=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"%d\",pending=\[\"main.cpp:%d\"\],times=\"0\",original-location=\"main.cpp:%d\"}"
 % (line, line, line))
 
         self.runCmd("-exec-run")
         self.expect("\^running")
@@ -119,7 +119,7 @@ class MiBreakTestCase(lldbmi_testcase.Mi
         line = line_number('main.cpp', '// BP_return')
         self.runCmd("-break-insert main.cpp:%d" % line)
         
self.expect("\^done,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"%d\",times=\"0\",original-location=\"main.cpp:%d\"}"
 % (line, line))
-        
self.expect("=breakpoint-created,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"%d\",times=\"0\",original-location=\"main.cpp:%d\"}"
 % (line, line))
+        
self.expect("=breakpoint-modified,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"%d\",times=\"0\",original-location=\"main.cpp:%d\"}"
 % (line, line))
 
         # Test that -break-insert fails if non-pending BP can't be resolved
         self.runCmd("-break-insert unknown_file:1")

Modified: lldb/trunk/test/tools/lldb-mi/interpreter/TestMiCliSupport.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/interpreter/TestMiCliSupport.py?rev=237676&r1=237675&r2=237676&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/interpreter/TestMiCliSupport.py (original)
+++ lldb/trunk/test/tools/lldb-mi/interpreter/TestMiCliSupport.py Tue May 19 
04:57:56 2015
@@ -45,10 +45,12 @@ class MiCliSupportTestCase(lldbmi_testca
         # Test that "breakpoint set" sets a breakpoint
         self.runCmd("breakpoint set --name main")
         self.expect("\^done")
+        self.expect("=breakpoint-created,bkpt={number=\"1\"")
 
         # Test that breakpoint was set properly
         self.runCmd("-exec-run")
         self.expect("\^running")
+        self.expect("=breakpoint-modified,bkpt={number=\"1\"")
         self.expect("\*stopped,reason=\"breakpoint-hit\"")
 
     @lldbmi_test

Modified: lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py?rev=237676&r1=237675&r2=237676&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py 
(original)
+++ lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py Tue May 
19 04:57:56 2015
@@ -44,10 +44,12 @@ class MiInterpreterExecTestCase(lldbmi_t
         # Test that "breakpoint set" sets a breakpoint
         self.runCmd("-interpreter-exec console \"breakpoint set --name main\"")
         self.expect("\^done")
+        self.expect("=breakpoint-created,bkpt={number=\"1\"")
 
         # Test that breakpoint was set properly
         self.runCmd("-exec-run")
         self.expect("\^running")
+        self.expect("=breakpoint-modified,bkpt={number=\"1\"")
         self.expect("\*stopped,reason=\"breakpoint-hit\"")
 
     @lldbmi_test

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp?rev=237676&r1=237675&r2=237676&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp Tue May 19 
04:57:56 2015
@@ -432,7 +432,16 @@ CMICmnLLDBDebuggerHandleEvents::HandleEv
         return MIstatus::failure;
     }
 
-    if (!bBrkPtExistAlready)
+    bool bOk = MIstatus::success;
+    if (bBrkPtExistAlready)
+    {
+        // MI print
+        // 
"=breakpoint-modified,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%016"
 PRIx64 
"\",func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\",times=\"%d\",original-location=\"%s\"}"
+        const CMICmnMIValueResult miValueResult("bkpt", miValueTuple);
+        const CMICmnMIOutOfBandRecord 
miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointModified, 
miValueResult);
+        bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
+    }
+    else
     {
         // CODETAG_LLDB_BRKPT_ID_MAX
         if (brkPt.GetID() > (lldb::break_id_t)rSessionInfo.m_nBrkPointCntMax)
@@ -447,13 +456,15 @@ CMICmnLLDBDebuggerHandleEvents::HandleEv
                 
CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_SET), 
"HandleEventSBBreakpointAdded()", sBrkPtInfo.m_id));
             return MIstatus::failure;
         }
+
+        // MI print
+        // 
"=breakpoint-created,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%016"
 PRIx64 
"\",func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\",times=\"%d\",original-location=\"%s\"}"
+        const CMICmnMIValueResult miValueResult("bkpt", miValueTuple);
+        const CMICmnMIOutOfBandRecord 
miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointCreated, 
miValueResult);
+        bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
     }
 
-    // MI print
-    // 
"=breakpoint-created,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%016"
 PRIx64 
"\",func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\",times=\"%d\",original-location=\"%s\"}"
-    const CMICmnMIValueResult miValueResult("bkpt", miValueTuple);
-    const CMICmnMIOutOfBandRecord 
miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointCreated, 
miValueResult);
-    return MiOutOfBandRecordToStdout(miOutOfBandRecord);
+    return bOk;
 }
 
 //++ 
------------------------------------------------------------------------------------


_______________________________________________
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to