diff options
author | Tatyana Krasnukha <tatyana@synopsys.com> | 2019-05-21 13:22:46 +0000 |
---|---|---|
committer | Tatyana Krasnukha <tatyana@synopsys.com> | 2019-05-21 13:22:46 +0000 |
commit | e0cc56e038df93f5d6aba46776ff23f1e464ee8d (patch) | |
tree | c7bd77ae97b5e692a59d87a1156fc070c2d0ffa3 /lldb | |
parent | d8db224ecb1c629965a67963a346c4e866832311 (diff) | |
download | bcm5719-llvm-e0cc56e038df93f5d6aba46776ff23f1e464ee8d.tar.gz bcm5719-llvm-e0cc56e038df93f5d6aba46776ff23f1e464ee8d.zip |
[lldb-mi] Include full path in the -data-disassemble response
Differential Revision: https://reviews.llvm.org/D59015
Patch by Anton Kolesov <Anton.Kolesov@synopsys.com>
llvm-svn: 361255
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py | 8 | ||||
-rw-r--r-- | lldb/tools/lldb-mi/MICmdCmdData.cpp | 9 |
2 files changed, 16 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py index 5e6b3f20dde..e138851d5cc 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py @@ -56,6 +56,14 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase): "\^done,asm_insns=\[{address=\"0x0*%x\",func-name=\"main\",offset=\"0\",size=\"[1-9]+\",inst=\".+?\"}," % addr) + # Test -data-disassemble with source line information + self.runCmd("-data-disassemble -s %#x -e %#x -- 1" % (addr, addr + 0x10)) + self.expect( + '\^done,asm_insns=\[src_and_asm_line={line="\d+",file="main.cpp",' + 'line_asm_insn=\[{address="0x0*%x",func-name="main",offset="0",size="[1-9]+",inst=".+?"}\],' + 'fullname="%s"}' % + (addr, os.path.abspath("main.cpp")) ) + # Run to hello_world self.runCmd("-break-insert -f hello_world") self.expect("\^done,bkpt={number=\"2\"") diff --git a/lldb/tools/lldb-mi/MICmdCmdData.cpp b/lldb/tools/lldb-mi/MICmdCmdData.cpp index ae54b958d84..e0a16576519 100644 --- a/lldb/tools/lldb-mi/MICmdCmdData.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdData.cpp @@ -401,8 +401,12 @@ bool CMICmdCmdDataDisassemble::Execute() { const MIuint nLine = lineEntry.GetLine(); const char *pFileName = lineEntry.GetFileSpec().GetFilename(); pFileName = (pFileName != nullptr) ? pFileName : pUnknown; + // Get a full path to the file. + char pathBuffer[PATH_MAX]; + lineEntry.GetFileSpec().GetPath(pathBuffer, PATH_MAX); - // MI "src_and_asm_line={line=\"%u\",file=\"%s\",line_asm_insn=[ ]}" + // MI "src_and_asm_line={line=\"%u\",file=\"%s\",line_asm_insn=[ ], + // fullname=\"%s\"}" const CMICmnMIValueConst miValueConst( CMIUtilString::Format("%u", nLine)); const CMICmnMIValueResult miValueResult("line", miValueConst); @@ -413,6 +417,9 @@ bool CMICmdCmdDataDisassemble::Execute() { const CMICmnMIValueList miValueList(miValueTuple); const CMICmnMIValueResult miValueResult3("line_asm_insn", miValueList); miValueTuple2.Add(miValueResult3); + const CMICmnMIValueConst miValueConst5(pathBuffer); + const CMICmnMIValueResult miValueResult5("fullname", miValueConst5); + miValueTuple2.Add(miValueResult5); const CMICmnMIValueResult miValueResult4("src_and_asm_line", miValueTuple2); m_miValueList.Add(miValueResult4); |