[Lldb-commits] [PATCH] D12115: [LLDB-MI] Fix -data-info-line when Windows filenames are used.
Dawn Perchik via lldb-commits
lldb-commits at lists.llvm.org
Tue Aug 18 13:52:23 PDT 2015
dawn created this revision.
dawn added reviewers: abidh, ki.stfu, brucem.
dawn added a subscriber: lldb-commits.
dawn set the repository for this revision to rL LLVM.
This fixes -data-info-line to parse the filename and line correctly when LineEntry doesn't have the optional column number and the filename contains a Windows drive letter.
Repository:
rL LLVM
http://reviews.llvm.org/D12115
Files:
tools/lldb-mi/MICmdCmdData.cpp
Index: tools/lldb-mi/MICmdCmdData.cpp
===================================================================
--- tools/lldb-mi/MICmdCmdData.cpp
+++ tools/lldb-mi/MICmdCmdData.cpp
@@ -1754,8 +1754,15 @@
const size_t nFileStartPos = rLine.find_first_not_of(' ', nEndAddressEndPos + 2);
const size_t nFileOrLineEndPos = rLine.rfind(':');
const size_t nFileOrLineStartPos = rLine.rfind(':', nFileOrLineEndPos - 1);
- const size_t nFileEndPos = nFileStartPos < nFileOrLineStartPos ? nFileOrLineStartPos : nFileOrLineEndPos;
- const size_t nFileLen = nFileEndPos - nFileStartPos;
+ size_t nFileEndPos = nFileStartPos < nFileOrLineStartPos ? nFileOrLineStartPos : nFileOrLineEndPos;
+ size_t nFileLen = nFileEndPos - nFileStartPos;
+ if ((nFileLen == 1) && ((rLine.at(nFileEndPos + 1) == '\\') || (rLine.at(nFileEndPos + 1) == '/')))
+ {
+ // The filename contains a Windows drive letter; recalculate
+ // nFileEndPos and nFileLen to account for it.
+ nFileEndPos = nFileOrLineEndPos;
+ nFileLen = nFileEndPos - nFileStartPos;
+ }
const CMIUtilString strFile(rLine.substr(nFileStartPos, nFileLen).c_str());
const CMICmnMIValueConst miValueConst3(strFile);
const CMICmnMIValueResult miValueResult3("file", miValueConst3);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12115.32448.patch
Type: text/x-patch
Size: 1426 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150818/24cc70db/attachment.bin>
More information about the lldb-commits
mailing list