[Lldb-commits] [lldb] r243484 - [lldb-mi] Fix setting of breakpoints using file:func syntax.
Dawn Perchik
dawn at burble.org
Tue Jul 28 14:40:57 PDT 2015
Author: dperchik
Date: Tue Jul 28 16:40:57 2015
New Revision: 243484
URL: http://llvm.org/viewvc/llvm-project?rev=243484&view=rev
Log:
[lldb-mi] Fix setting of breakpoints using file:func syntax.
Reviewed by: ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11499
Modified:
lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py
lldb/trunk/tools/lldb-mi/MICmdCmdBreak.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=243484&r1=243483&r2=243484&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py (original)
+++ lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py Tue Jul 28 16:40:57 2015
@@ -133,7 +133,25 @@ class MiBreakTestCase(lldbmi_testcase.Mi
# 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")
Modified: lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp?rev=243484&r1=243483&r2=243484&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp Tue Jul 28 16:40:57 2015
@@ -239,8 +239,13 @@ CMICmdCmdBreakInsert::Execute(void)
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;
More information about the lldb-commits
mailing list