[Lldb-commits] [PATCH] D11499: [lldb-mi] Fix setting of breakpoints using file:func syntax.

Phabricator reviews at reviews.llvm.org
Tue Jul 28 14:41:29 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL243484: [lldb-mi] Fix setting of breakpoints using file:func syntax. (authored by dperchik).

Changed prior to commit:
  http://reviews.llvm.org/D11499?vs=30708&id=30858#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D11499

Files:
  lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py
  lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp

Index: lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp
===================================================================
--- lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp
+++ lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp
@@ -239,8 +239,13 @@
             m_brkPt = sbTarget.BreakpointCreateByAddress(nAddress);
             break;
         case eBreakPoint_ByFileFn:
-            m_brkPt = sbTarget.BreakpointCreateByName(strFileFn.c_str(), fileName.c_str());
+        {
+            lldb::SBFileSpecList module;    // search in all modules
+            lldb::SBFileSpecList compUnit;
+            compUnit.Append (lldb::SBFileSpec(fileName.c_str()));
+            m_brkPt = sbTarget.BreakpointCreateByName(strFileFn.c_str(), module, compUnit);
             break;
+        }
         case eBreakPoint_ByFileLine:
             m_brkPt = sbTarget.BreakpointCreateByLocation(fileName.c_str(), nFileLine);
             break;
Index: lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py
===================================================================
--- lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py
+++ lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py
@@ -133,7 +133,25 @@
         # Test that non-pending BP was set correctly
         self.runCmd("-exec-continue")
         self.expect("\^running")
-        self.expect("\*stopped,reason=\"breakpoint-hit\"")
+        self.expect("\*stopped,reason=\"breakpoint-hit\".*bkptno=\"2\"")
+
+        # Test that we can set a BP using the file:func syntax
+        self.runCmd("-break-insert main.cpp:main")
+        self.expect("\^done,bkpt={number=\"4\"")
+        self.runCmd("-break-insert main.cpp:ns::foo1")
+        self.expect("\^done,bkpt={number=\"5\"")
+        #FIXME: quotes on filenames aren't handled correctly in lldb-mi.
+        #self.runCmd("-break-insert \"main.cpp\":main")
+        #self.expect("\^done,bkpt={number=\"6\"")
+        #FIXME: this test is disabled due to lldb bug llvm.org/pr24271.
+        # Test that we can set a BP using the global namespace token
+        #self.runCmd("-break-insert \"main.cpp:::main\"")
+        #self.expect("\^done,bkpt={number=\"7\"")
+
+        # We should hit BP #5 on 'main.cpp:ns::foo1'
+        self.runCmd("-exec-continue")
+        self.expect("\^running")
+        self.expect("\*stopped,reason=\"breakpoint-hit\".*bkptno=\"5\"")
 
     @lldbmi_test
     @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11499.30858.patch
Type: text/x-patch
Size: 2468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150728/7fa64744/attachment.bin>


More information about the lldb-commits mailing list