diff options
| author | Ilia K <ki.stfu@gmail.com> | 2015-03-19 17:13:20 +0000 |
|---|---|---|
| committer | Ilia K <ki.stfu@gmail.com> | 2015-03-19 17:13:20 +0000 |
| commit | 641f027d82b2973a081333e9f59cc027e732cedd (patch) | |
| tree | 720ad31877a002f714b0941fdcfc86f8ed16ab3f | |
| parent | 8fa8e5fc74c604092707f35eb50859cdc886ae41 (diff) | |
| download | bcm5719-llvm-641f027d82b2973a081333e9f59cc027e732cedd.tar.gz bcm5719-llvm-641f027d82b2973a081333e9f59cc027e732cedd.zip | |
Fix -break-insert for system functions (MI)
Summary:
# Fix -break-insert for system functions
# Fix MiExecTestCase to use -break-insert instead of CLI "b"
# Improve MiBreakTestCase: now it uses printf() instead of in-house function
All tests pass on OS X.
Test Plan:
```
$ bin/lldb-mi --interpreter
(gdb)
-file-exec-and-symbols ~/p/hello
^done
(gdb)
=shlibs-added,shlib-info=[num="1",name="hello",dyld-addr="-",reason="dyld",path="/Users/IliaK/p/hello",loaded_addr="-",dsym-objpath="/Users/IliaK/p/hello.dSYM/Contents/Resources/DWARF/hello"]
-break-insert -f printf
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0xffffffff",func="??",file="??",fullname="??/??",line="0",pending=["printf"],times="0",original-location="printf"}
(gdb)
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0xffffffff",func="??",file="??",fullname="??/??",line="0",pending=["printf"],times="0",original-location="printf"}
-exec-run
^running
...
*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x7fff8a476910",func="printf",args=[],file="??",fullname="??",line="-1"},thread-id="1",stopped-threads="all"
(gdb)
```
Reviewers: abidh, clayborg
Reviewed By: clayborg
Subscribers: lldb-commits, clayborg, abidh
Differential Revision: http://reviews.llvm.org/D8412
llvm-svn: 232734
| -rw-r--r-- | lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py | 4 | ||||
| -rw-r--r-- | lldb/test/tools/lldb-mi/breakpoint/main.cpp | 7 | ||||
| -rw-r--r-- | lldb/test/tools/lldb-mi/control/TestMiExec.py | 5 | ||||
| -rw-r--r-- | lldb/tools/lldb-mi/MICmdCmdBreak.cpp | 2 |
4 files changed, 7 insertions, 11 deletions
diff --git a/lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py b/lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py index c1e4e9e5945..48058eb4e5a 100644 --- a/lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py +++ b/lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py @@ -21,7 +21,7 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase): self.runCmd("-file-exec-and-symbols %s" % self.myexe) self.expect("\^done") - self.runCmd("-break-insert -f g_MyFunction") + self.runCmd("-break-insert -f printf") self.expect("\^done,bkpt={number=\"1\"") self.runCmd("-exec-run") @@ -46,7 +46,7 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase): self.expect("\^running") self.expect("\*stopped,reason=\"breakpoint-hit\"") - self.runCmd("-break-insert g_MyFunction") + self.runCmd("-break-insert printf") self.expect("\^done,bkpt={number=\"2\"") self.runCmd("-exec-continue") diff --git a/lldb/test/tools/lldb-mi/breakpoint/main.cpp b/lldb/test/tools/lldb-mi/breakpoint/main.cpp index 22e2e344951..262ebc1b5f0 100644 --- a/lldb/test/tools/lldb-mi/breakpoint/main.cpp +++ b/lldb/test/tools/lldb-mi/breakpoint/main.cpp @@ -7,14 +7,11 @@ // //===----------------------------------------------------------------------===// -void -g_MyFunction(void) -{ -} +#include <cstdio> int main(int argc, char const *argv[]) { - g_MyFunction(); + printf(""); return 0; // BP_return } diff --git a/lldb/test/tools/lldb-mi/control/TestMiExec.py b/lldb/test/tools/lldb-mi/control/TestMiExec.py index cf067a5a1b6..9c3b1d2348c 100644 --- a/lldb/test/tools/lldb-mi/control/TestMiExec.py +++ b/lldb/test/tools/lldb-mi/control/TestMiExec.py @@ -430,9 +430,8 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): #self.expect("\^error: Frame index 10 is out of range") # Set BP at printf and run to BP - # FIXME: BP at printf not resolved and never hit! - self.runCmd("-interpreter-exec command \"breakpoint set --name printf\"") #FIXME: self.runCmd("-break-insert -f printf") - self.expect("\^done") #FIXME: self.expect("\^done,bkpt={number=\"3\"") + self.runCmd("-break-insert -f printf") + self.expect("\^done,bkpt={number=\"3\"") self.runCmd("-exec-continue") self.expect("\^running") self.expect("\*stopped,reason=\"breakpoint-hit\"") diff --git a/lldb/tools/lldb-mi/MICmdCmdBreak.cpp b/lldb/tools/lldb-mi/MICmdCmdBreak.cpp index 0a4c823b696..a3dc404eacb 100644 --- a/lldb/tools/lldb-mi/MICmdCmdBreak.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdBreak.cpp @@ -232,7 +232,7 @@ CMICmdCmdBreakInsert::Execute(void) m_brkPt = sbTarget.BreakpointCreateByLocation(fileName.c_str(), nFileLine); break; case eBreakPoint_ByName: - m_brkPt = sbTarget.BreakpointCreateByName(m_brkName.c_str(), sbTarget.GetExecutable().GetFilename()); + m_brkPt = sbTarget.BreakpointCreateByName(m_brkName.c_str(), nullptr); break; case eBreakPoint_count: case eBreakPoint_NotDefineYet: |

