[Lldb-commits] [PATCH] D59015: [lldb-mi] Include full path in the -data-disassemble response

Anton Kolesov via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 6 01:51:47 PST 2019


anton.kolesov created this revision.
anton.kolesov added a project: LLDB.
Herald added subscribers: lldb-commits, abidh, ki.stfu.

Simple "file" might not be enough for Eclipse CDT to find the file,
therefore it is preferable for -data-disassemble response to include full
absolute file path in the "fullname" field, similarly to how it is
implemented in the CMICmnLLDBDebugSessionInfo::GetFrameInfo() function.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D59015

Files:
  lldb/tools/lldb-mi/MICmdCmdData.cpp


Index: lldb/tools/lldb-mi/MICmdCmdData.cpp
===================================================================
--- lldb/tools/lldb-mi/MICmdCmdData.cpp
+++ lldb/tools/lldb-mi/MICmdCmdData.cpp
@@ -415,8 +415,12 @@
       const MIuint nLine = lineEntry.GetLine();
       const char *pFileName = lineEntry.GetFileSpec().GetFilename();
       pFileName = (pFileName != nullptr) ? pFileName : pUnknown;
+      // Get a full path to the file.
+      static char pPathBuffer[PATH_MAX];
+      lineEntry.GetFileSpec().GetPath(pPathBuffer, sizeof(pPathBuffer));
 
-      // 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);
@@ -427,6 +431,9 @@
       const CMICmnMIValueList miValueList(miValueTuple);
       const CMICmnMIValueResult miValueResult3("line_asm_insn", miValueList);
       miValueTuple2.Add(miValueResult3);
+      const CMICmnMIValueConst miValueConst5(pPathBuffer);
+      const CMICmnMIValueResult miValueResult5("fullname", miValueConst5);
+      miValueTuple2.Add(miValueResult5);
       const CMICmnMIValueResult miValueResult4("src_and_asm_line",
                                                miValueTuple2);
       m_miValueList.Add(miValueResult4);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59015.189459.patch
Type: text/x-patch
Size: 1448 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190306/0e71b2a1/attachment.bin>


More information about the lldb-commits mailing list