<div dir="ltr">That's very strange, I think I need to disable this test temporarily, it looks like it's somehow related to a version mismatch.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Mar 13, 2018 at 1:56 PM <<a href="mailto:douglas.yung@sony.com">douglas.yung@sony.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Zachary,<br>
<br>
A test you added with this commit seems to be causing a failure on one of the bots (<a href="http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/15877/" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/15877/</a>):<br>
<br>
FAIL: LLVM :: tools/llvm-pdbdump/injected-sources.test (36946 of 38828)<br>
******************** TEST 'LLVM :: tools/llvm-pdbdump/injected-sources.test' FAILED ********************<br>
Script:<br>
--<br>
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\llvm-pdbutil.EXE pretty -injected-sources -injected-source-content    C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\test\tools\llvm-pdbdump/Inputs/InjectedSource.pdb | C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\FileCheck.EXE C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\test\tools\llvm-pdbdump\injected-sources.test<br>
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\llvm-pdbutil.EXE pretty -injected-sources -injected-source-content    C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\test\tools\llvm-pdbdump/Inputs/ClassLayoutTest.pdb | C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\FileCheck.EXE --check-prefix=NEGATIVE C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\test\tools\llvm-pdbdump\injected-sources.test<br>
--<br>
Exit Code: 2<br>
<br>
Command Output (stdout):<br>
--<br>
$ "C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\llvm-pdbutil.EXE" "pretty" "-injected-sources" "-injected-source-content" "C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\test\tools\llvm-pdbdump/Inputs/InjectedSource.pdb"<br>
# command stderr:<br>
llvm-pdbutil: DIA Error: Unable to load PDB.  The file has an unrecognized format.  Calling loadDataFromPdb C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\test\tools\llvm-pdbdump/Inputs/InjectedSource.pdb<br>
<br>
<br>
<br>
<br>
error: command failed with exit status: 1<br>
$ "C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\FileCheck.EXE" "C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\test\tools\llvm-pdbdump\injected-sources.test"<br>
# command stderr:<br>
FileCheck error: '-' is empty.<br>
<br>
FileCheck command line:  C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\FileCheck.EXE C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\test\tools\llvm-pdbdump\injected-sources.test<br>
<br>
<br>
error: command failed with exit status: 2<br>
<br>
--<br>
<br>
********************<br>
<br>
Can you take a look?<br>
<br>
Douglas Yung<br>
<br>
> -----Original Message-----<br>
> From: llvm-commits [mailto:<a href="mailto:llvm-commits-bounces@lists.llvm.org" target="_blank">llvm-commits-bounces@lists.llvm.org</a>] On Behalf Of<br>
> Zachary Turner via llvm-commits<br>
> Sent: Tuesday, March 13, 2018 10:46<br>
> To: <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
> Subject: [llvm] r327428 - [PDB] Support dumping injected sources via the DIA<br>
> reader.<br>
><br>
> Author: zturner<br>
> Date: Tue Mar 13 10:46:06 2018<br>
> New Revision: 327428<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=327428&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=327428&view=rev</a><br>
> Log:<br>
> [PDB] Support dumping injected sources via the DIA reader.<br>
><br>
> Injected sources are basically a way to add actual source file content to your<br>
> PDB. Presumably you could use this for shipping your source code with your<br>
> debug information, but in practice I can only find this being used for<br>
> embedding natvis files inside of PDBs.<br>
><br>
> In order to effectively test LLVM's natvis file injection, we need a way to<br>
> dump the injected sources of a PDB in a way that is authoritative (i.e. based<br>
> on Microsoft's understanding of the PDB format, and not LLVM's). To this end,<br>
> I've added support for dumping injected sources via DIA. I made a PDB file<br>
> that used the /natvis option to generate a test case.<br>
><br>
> Differential Revision: <a href="https://reviews.llvm.org/D44405" rel="noreferrer" target="_blank">https://reviews.llvm.org/D44405</a><br>
><br>
> Added:<br>
>     llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h<br>
>     llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h<br>
>     llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAUtils.h<br>
>     llvm/trunk/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h<br>
>     llvm/trunk/lib/DebugInfo/PDB/DIA/DIAEnumInjectedSources.cpp<br>
>     llvm/trunk/lib/DebugInfo/PDB/DIA/DIAInjectedSource.cpp<br>
>     llvm/trunk/test/tools/llvm-pdbdump/Inputs/InjectedSource.pdb   (with<br>
> props)<br>
>     llvm/trunk/test/tools/llvm-pdbdump/injected-sources.test<br>
> Modified:<br>
>     llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASession.h<br>
>     llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSession.h<br>
>     llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeSession.h<br>
>     llvm/trunk/include/llvm/DebugInfo/PDB/PDBExtras.h<br>
>     llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h<br>
>     llvm/trunk/lib/DebugInfo/PDB/CMakeLists.txt<br>
>     llvm/trunk/lib/DebugInfo/PDB/DIA/DIASession.cpp<br>
>     llvm/trunk/lib/DebugInfo/PDB/Native/NativeSession.cpp<br>
>     llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp<br>
>     llvm/trunk/lib/DebugInfo/PDB/PDBInterfaceAnchors.cpp<br>
>     llvm/trunk/tools/llvm-pdbutil/llvm-pdbutil.cpp<br>
><br>
> Added: llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h?rev<br>
> =327428&view=auto<br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h (added)<br>
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h<br>
> +++ Tue Mar 13 10:46:06 2018<br>
> @@ -0,0 +1,40 @@<br>
> +//==- DIAEnumInjectedSources.h - DIA Injected Sources Enumerator -*-<br>
> +C++ -*-==// //<br>
> +//                     The LLVM Compiler Infrastructure<br>
> +//<br>
> +// This file is distributed under the University of Illinois Open<br>
> +Source // License. See LICENSE.TXT for details.<br>
> +//<br>
> +//===------------------------------------------------------------------<br>
> +----===//<br>
> +<br>
> +#ifndef LLVM_DEBUGINFO_PDB_DIA_DIAENUMINJECTEDSOURCES_H<br>
> +#define LLVM_DEBUGINFO_PDB_DIA_DIAENUMINJECTEDSOURCES_H<br>
> +<br>
> +#include "DIASupport.h"<br>
> +#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"<br>
> +#include "llvm/DebugInfo/PDB/IPDBInjectedSource.h"<br>
> +<br>
> +namespace llvm {<br>
> +namespace pdb {<br>
> +class DIASession;<br>
> +<br>
> +class DIAEnumInjectedSources : public<br>
> +IPDBEnumChildren<IPDBInjectedSource> {<br>
> +public:<br>
> +  explicit DIAEnumInjectedSources(<br>
> +      const DIASession &PDBSession,<br>
> +      CComPtr<IDiaEnumInjectedSources> DiaEnumerator);<br>
> +<br>
> +  uint32_t getChildCount() const override;  ChildTypePtr<br>
> + getChildAtIndex(uint32_t Index) const override;  ChildTypePtr<br>
> + getNext() override;  void reset() override;  DIAEnumInjectedSources<br>
> + *clone() const override;<br>
> +<br>
> +private:<br>
> +  const DIASession &Session;<br>
> +  CComPtr<IDiaEnumInjectedSources> Enumerator; }; } // namespace pdb }<br>
> +// namespace llvm<br>
> +<br>
> +#endif // LLVM_DEBUGINFO_PDB_DIA_DIAENUMINJECTEDSOURCES_H<br>
><br>
> Added: llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h?rev=3274<br>
> 28&view=auto<br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h (added)<br>
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h Tue<br>
> +++ Mar 13 10:46:06 2018<br>
> @@ -0,0 +1,40 @@<br>
> +//===- DIAInjectedSource.h - DIA impl for IPDBInjectedSource ----*- C++<br>
> +-*-===// //<br>
> +//                     The LLVM Compiler Infrastructure<br>
> +//<br>
> +// This file is distributed under the University of Illinois Open<br>
> +Source // License. See LICENSE.TXT for details.<br>
> +//<br>
> +//===------------------------------------------------------------------<br>
> +----===//<br>
> +<br>
> +#ifndef LLVM_DEBUGINFO_PDB_DIA_DIAINJECTEDSOURCE_H<br>
> +#define LLVM_DEBUGINFO_PDB_DIA_DIAINJECTEDSOURCE_H<br>
> +<br>
> +#include "DIASupport.h"<br>
> +#include "llvm/DebugInfo/PDB/IPDBInjectedSource.h"<br>
> +<br>
> +namespace llvm {<br>
> +namespace pdb {<br>
> +class DIASession;<br>
> +<br>
> +class DIAInjectedSource : public IPDBInjectedSource {<br>
> +public:<br>
> +  explicit DIAInjectedSource(const DIASession &Session,<br>
> +                             CComPtr<IDiaInjectedSource><br>
> +DiaSourceFile);<br>
> +<br>
> +  uint32_t getCrc32() const override;<br>
> +  uint64_t getCodeByteSize() const override;  std::string getFileName()<br>
> + const override;  std::string getObjectFileName() const override;<br>
> + std::string getVirtualFileName() const override;<br>
> + PDB_SourceCompression getCompression() const override;  std::string<br>
> + getCode() const override;<br>
> +<br>
> +private:<br>
> +  const DIASession &Session;<br>
> +  CComPtr<IDiaInjectedSource> SourceFile; }; } // namespace pdb } //<br>
> +namespace llvm<br>
> +<br>
> +#endif // LLVM_DEBUGINFO_PDB_DIA_DIAINJECTEDSOURCE_H<br>
><br>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASession.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASession.h?rev=327428&r1=3<br>
> 27427&r2=327428&view=diff<br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASession.h (original)<br>
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASession.h Tue Mar 13<br>
> +++ 10:46:06 2018<br>
> @@ -65,6 +65,9 @@ public:<br>
>    std::unique_ptr<IPDBEnumDataStreams> getDebugStreams() const override;<br>
><br>
>    std::unique_ptr<IPDBEnumTables> getEnumTables() const override;<br>
> +<br>
> +  std::unique_ptr<IPDBEnumInjectedSources> getInjectedSources() const<br>
> + override;<br>
> +<br>
>  private:<br>
>    CComPtr<IDiaSession> Session;<br>
>  };<br>
><br>
> Added: llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAUtils.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAUtils.h?rev=327428&view=a<br>
> uto<br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAUtils.h (added)<br>
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAUtils.h Tue Mar 13<br>
> +++ 10:46:06 2018<br>
> @@ -0,0 +1,31 @@<br>
> +//===- DIAUtils.h - Utility functions for working with DIA ------*- C++<br>
> +-*-===// //<br>
> +//                     The LLVM Compiler Infrastructure<br>
> +//<br>
> +// This file is distributed under the University of Illinois Open<br>
> +Source // License. See LICENSE.TXT for details.<br>
> +//<br>
> +//===------------------------------------------------------------------<br>
> +----===//<br>
> +<br>
> +#ifndef LLVM_DEBUGINFO_PDB_DIA_DIAUTILS_H #define<br>
> +LLVM_DEBUGINFO_PDB_DIA_DIAUTILS_H<br>
> +<br>
> +#include "llvm/ADT/ArrayRef.h"<br>
> +#include "llvm/Support/ConvertUTF.h"<br>
> +<br>
> +template <typename Obj><br>
> +std::string invokeBstrMethod(Obj &Object,<br>
> +                             HRESULT (__stdcall Obj::*Func)(BSTR *)) {<br>
> +  CComBSTR Str16;<br>
> +  HRESULT Result = (Object.*Func)(&Str16);<br>
> +  if (S_OK != Result)<br>
> +    return std::string();<br>
> +<br>
> +  std::string Str8;<br>
> +  llvm::ArrayRef<char> StrBytes(reinterpret_cast<char *>(Str16.m_str),<br>
> +                                Str16.ByteLength());<br>
> +  llvm::convertUTF16ToUTF8String(StrBytes, Str8);<br>
> +  return Str8;<br>
> +}<br>
> +<br>
> +#endif // LLVM_DEBUGINFO_PDB_DIA_DIAUTILS_H<br>
><br>
> Added: llvm/trunk/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h?rev=327428&<br>
> view=auto<br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h (added)<br>
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h Tue Mar<br>
> +++ 13 10:46:06 2018<br>
> @@ -0,0 +1,42 @@<br>
> +//===- IPDBInjectedSource.h - base class for PDB injected file --*- C++<br>
> +-*-===// //<br>
> +//                     The LLVM Compiler Infrastructure<br>
> +//<br>
> +// This file is distributed under the University of Illinois Open<br>
> +Source // License. See LICENSE.TXT for details.<br>
> +//<br>
> +//===------------------------------------------------------------------<br>
> +----===//<br>
> +<br>
> +#ifndef LLVM_DEBUGINFO_PDB_IPDBINJECTEDSOURCE_H<br>
> +#define LLVM_DEBUGINFO_PDB_IPDBINJECTEDSOURCE_H<br>
> +<br>
> +#include "PDBTypes.h"<br>
> +#include "llvm/Support/raw_ostream.h"<br>
> +#include <memory><br>
> +#include <string><br>
> +<br>
> +namespace llvm {<br>
> +class raw_ostream;<br>
> +<br>
> +namespace pdb {<br>
> +<br>
> +/// IPDBInjectedSource defines an interface used to represent source<br>
> +files /// which were injected directly into the PDB file during the<br>
> +compilation /// process.  This is used, for example, to add natvis<br>
> +files to a PDB, but /// in theory could be used to add arbitrary source code.<br>
> +class IPDBInjectedSource {<br>
> +public:<br>
> +  virtual ~IPDBInjectedSource();<br>
> +<br>
> +  virtual uint32_t getCrc32() const = 0;<br>
> +  virtual uint64_t getCodeByteSize() const = 0;<br>
> +  virtual std::string getFileName() const = 0;<br>
> +  virtual std::string getObjectFileName() const = 0;<br>
> +  virtual std::string getVirtualFileName() const = 0;<br>
> +  virtual PDB_SourceCompression getCompression() const = 0;<br>
> +  virtual std::string getCode() const = 0; }; } // namespace pdb } //<br>
> +namespace llvm<br>
> +<br>
> +#endif // LLVM_DEBUGINFO_PDB_IPDBINJECTEDSOURCE_H<br>
><br>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSession.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSession.h?rev=327428&r1=3274<br>
> 27&r2=327428&view=diff<br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSession.h (original)<br>
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSession.h Tue Mar 13<br>
> +++ 10:46:06 2018<br>
> @@ -69,6 +69,9 @@ public:<br>
>    virtual std::unique_ptr<IPDBEnumDataStreams> getDebugStreams() const = 0;<br>
><br>
>    virtual std::unique_ptr<IPDBEnumTables> getEnumTables() const = 0;<br>
> +<br>
> +  virtual std::unique_ptr<IPDBEnumInjectedSources><br>
> +  getInjectedSources() const = 0;<br>
>  };<br>
>  }<br>
>  }<br>
><br>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeSession.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeSession.h?rev=32742<br>
> 8&r1=327427&r2=327428&view=diff<br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeSession.h (original)<br>
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeSession.h Tue Mar<br>
> +++ 13 10:46:06 2018<br>
> @@ -85,6 +85,8 @@ public:<br>
><br>
>    std::unique_ptr<IPDBEnumTables> getEnumTables() const override;<br>
><br>
> +  std::unique_ptr<IPDBEnumInjectedSources> getInjectedSources() const<br>
> + override;<br>
> +<br>
>    PDBFile &getPDBFile() { return *Pdb; }<br>
>    const PDBFile &getPDBFile() const { return *Pdb; }<br>
><br>
><br>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBExtras.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBExtras.h?rev=327428&r1=327427<br>
> &r2=327428&view=diff<br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/DebugInfo/PDB/PDBExtras.h (original)<br>
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBExtras.h Tue Mar 13<br>
> +++ 10:46:06 2018<br>
> @@ -34,6 +34,8 @@ raw_ostream &operator<<(raw_ostream &OS,  raw_ostream<br>
> &operator<<(raw_ostream &OS, const PDB_MemberAccess &Access);  raw_ostream<br>
> &operator<<(raw_ostream &OS, const PDB_UdtType &Type);  raw_ostream<br>
> &operator<<(raw_ostream &OS, const PDB_Machine &Machine);<br>
> +raw_ostream &operator<<(raw_ostream &OS,<br>
> +                        const PDB_SourceCompression &Compression);<br>
><br>
>  raw_ostream &operator<<(raw_ostream &OS, const Variant &Value);  raw_ostream<br>
> &operator<<(raw_ostream &OS, const VersionInfo &Version);<br>
><br>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h?rev=327428&r1=327427&<br>
> r2=327428&view=diff<br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h (original)<br>
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h Tue Mar 13 10:46:06<br>
> +++ 2018<br>
> @@ -23,6 +23,7 @@ namespace llvm {<br>
>  namespace pdb {<br>
><br>
>  class IPDBDataStream;<br>
> +class IPDBInjectedSource;<br>
>  class IPDBLineNumber;<br>
>  class IPDBSourceFile;<br>
>  class IPDBTable;<br>
> @@ -65,6 +66,7 @@ using IPDBEnumSourceFiles = IPDBEnumChil  using<br>
> IPDBEnumDataStreams = IPDBEnumChildren<IPDBDataStream>;  using<br>
> IPDBEnumLineNumbers = IPDBEnumChildren<IPDBLineNumber>;  using IPDBEnumTables<br>
> = IPDBEnumChildren<IPDBTable>;<br>
> +using IPDBEnumInjectedSources = IPDBEnumChildren<IPDBInjectedSource>;<br>
><br>
>  /// Specifies which PDB reader implementation is to be used.  Only a value<br>
> /// of PDB_ReaderType::DIA is currently supported, but Native is in the works.<br>
> @@ -133,6 +135,13 @@ enum class PDB_Machine {<br>
>    WceMipsV2 = 0x169<br>
>  };<br>
><br>
> +enum class PDB_SourceCompression {<br>
> +  None,<br>
> +  RunLengthEncoded,<br>
> +  Huffman,<br>
> +  LZ,<br>
> +};<br>
> +<br>
>  /// These values correspond to the CV_call_e enumeration, and are documented<br>
> /// at the following locations:<br>
>  ///   <a href="https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx" rel="noreferrer" target="_blank">https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx</a><br>
><br>
> Modified: llvm/trunk/lib/DebugInfo/PDB/CMakeLists.txt<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/lib/DebugInfo/PDB/CMakeLists.txt?rev=327428&r1=327427&r2=32<br>
> 7428&view=diff<br>
> ==============================================================================<br>
> --- llvm/trunk/lib/DebugInfo/PDB/CMakeLists.txt (original)<br>
> +++ llvm/trunk/lib/DebugInfo/PDB/CMakeLists.txt Tue Mar 13 10:46:06 2018<br>
> @@ -14,11 +14,13 @@ if(LLVM_ENABLE_DIA_SDK)<br>
>    add_pdb_impl_folder(DIA<br>
>      DIA/DIADataStream.cpp<br>
>      DIA/DIAEnumDebugStreams.cpp<br>
> +    DIA/DIAEnumInjectedSources.cpp<br>
>      DIA/DIAEnumLineNumbers.cpp<br>
>      DIA/DIAEnumSourceFiles.cpp<br>
>      DIA/DIAEnumSymbols.cpp<br>
>      DIA/DIAEnumTables.cpp<br>
>      DIA/DIAError.cpp<br>
> +    DIA/DIAInjectedSource.cpp<br>
>      DIA/DIALineNumber.cpp<br>
>      DIA/DIARawSymbol.cpp<br>
>      DIA/DIASession.cpp<br>
><br>
> Added: llvm/trunk/lib/DebugInfo/PDB/DIA/DIAEnumInjectedSources.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/lib/DebugInfo/PDB/DIA/DIAEnumInjectedSources.cpp?rev=327428<br>
> &view=auto<br>
> ==============================================================================<br>
> --- llvm/trunk/lib/DebugInfo/PDB/DIA/DIAEnumInjectedSources.cpp (added)<br>
> +++ llvm/trunk/lib/DebugInfo/PDB/DIA/DIAEnumInjectedSources.cpp Tue Mar<br>
> +++ 13 10:46:06 2018<br>
> @@ -0,0 +1,54 @@<br>
> +//==- DIAEnumSourceFiles.cpp - DIA Source File Enumerator impl ---*-<br>
> +C++ -*-==// //<br>
> +//                     The LLVM Compiler Infrastructure<br>
> +//<br>
> +// This file is distributed under the University of Illinois Open<br>
> +Source // License. See LICENSE.TXT for details.<br>
> +//<br>
> +//===------------------------------------------------------------------<br>
> +----===//<br>
> +<br>
> +#include "llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h"<br>
> +#include "llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h"<br>
> +#include "llvm/DebugInfo/PDB/PDBSymbol.h"<br>
> +<br>
> +using namespace llvm;<br>
> +using namespace llvm::pdb;<br>
> +<br>
> +DIAEnumInjectedSources::DIAEnumInjectedSources(<br>
> +    const DIASession &PDBSession,<br>
> +    CComPtr<IDiaEnumInjectedSources> DiaEnumerator)<br>
> +    : Session(PDBSession), Enumerator(DiaEnumerator) {}<br>
> +<br>
> +uint32_t DIAEnumInjectedSources::getChildCount() const {<br>
> +  LONG Count = 0;<br>
> +  return (S_OK == Enumerator->get_Count(&Count)) ? Count : 0; }<br>
> +<br>
> +std::unique_ptr<IPDBInjectedSource><br>
> +DIAEnumInjectedSources::getChildAtIndex(uint32_t Index) const {<br>
> +  CComPtr<IDiaInjectedSource> Item;<br>
> +  if (S_OK != Enumerator->Item(Index, &Item))<br>
> +    return nullptr;<br>
> +<br>
> +  return std::unique_ptr<IPDBInjectedSource>(<br>
> +      new DIAInjectedSource(Session, Item)); }<br>
> +<br>
> +std::unique_ptr<IPDBInjectedSource> DIAEnumInjectedSources::getNext() {<br>
> +  CComPtr<IDiaInjectedSource> Item;<br>
> +  ULONG NumFetched = 0;<br>
> +  if (S_OK != Enumerator->Next(1, &Item, &NumFetched))<br>
> +    return nullptr;<br>
> +<br>
> +  return std::unique_ptr<IPDBInjectedSource>(<br>
> +      new DIAInjectedSource(Session, Item)); }<br>
> +<br>
> +void DIAEnumInjectedSources::reset() { Enumerator->Reset(); }<br>
> +<br>
> +DIAEnumInjectedSources *DIAEnumInjectedSources::clone() const {<br>
> +  CComPtr<IDiaEnumInjectedSources> EnumeratorClone;<br>
> +  if (S_OK != Enumerator->Clone(&EnumeratorClone))<br>
> +    return nullptr;<br>
> +  return new DIAEnumInjectedSources(Session, EnumeratorClone); }<br>
><br>
> Added: llvm/trunk/lib/DebugInfo/PDB/DIA/DIAInjectedSource.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/lib/DebugInfo/PDB/DIA/DIAInjectedSource.cpp?rev=327428&view<br>
> =auto<br>
> ==============================================================================<br>
> --- llvm/trunk/lib/DebugInfo/PDB/DIA/DIAInjectedSource.cpp (added)<br>
> +++ llvm/trunk/lib/DebugInfo/PDB/DIA/DIAInjectedSource.cpp Tue Mar 13<br>
> +++ 10:46:06 2018<br>
> @@ -0,0 +1,64 @@<br>
> +//===- DIAInjectedSource.cpp - DIA impl for IPDBInjectedSource --*- C++<br>
> +-*-===// //<br>
> +//                     The LLVM Compiler Infrastructure<br>
> +//<br>
> +// This file is distributed under the University of Illinois Open<br>
> +Source // License. See LICENSE.TXT for details.<br>
> +//<br>
> +//===------------------------------------------------------------------<br>
> +----===//<br>
> +<br>
> +#include "llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h"<br>
> +#include "llvm/ADT/ArrayRef.h"<br>
> +#include "llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h"<br>
> +#include "llvm/DebugInfo/PDB/DIA/DIASession.h"<br>
> +#include "llvm/DebugInfo/PDB/DIA/DIAUtils.h"<br>
> +<br>
> +using namespace llvm;<br>
> +using namespace llvm::pdb;<br>
> +<br>
> +DIAInjectedSource::DIAInjectedSource(const DIASession &Session,<br>
> +                                     CComPtr<IDiaInjectedSource><br>
> DiaSourceFile)<br>
> +    : Session(Session), SourceFile(DiaSourceFile) {}<br>
> +<br>
> +uint32_t DIAInjectedSource::getCrc32() const {<br>
> +  DWORD Crc;<br>
> +  return (S_OK == SourceFile->get_crc(&Crc)) ? Crc : 0; }<br>
> +<br>
> +uint64_t DIAInjectedSource::getCodeByteSize() const {<br>
> +  ULONGLONG Size;<br>
> +  return (S_OK == SourceFile->get_length(&Size)) ? Size : 0; }<br>
> +<br>
> +std::string DIAInjectedSource::getFileName() const {<br>
> +  return invokeBstrMethod(*SourceFile,<br>
> +&IDiaInjectedSource::get_filename);<br>
> +}<br>
> +<br>
> +std::string DIAInjectedSource::getObjectFileName() const {<br>
> +  return invokeBstrMethod(*SourceFile,<br>
> +&IDiaInjectedSource::get_objectFilename);<br>
> +}<br>
> +<br>
> +std::string DIAInjectedSource::getVirtualFileName() const {<br>
> +  return invokeBstrMethod(*SourceFile,<br>
> +                          &IDiaInjectedSource::get_virtualFilename);<br>
> +}<br>
> +<br>
> +PDB_SourceCompression DIAInjectedSource::getCompression() const {<br>
> +  DWORD Compression = 0;<br>
> +  if (S_OK != SourceFile->get_sourceCompression(&Compression))<br>
> +    return PDB_SourceCompression::None;<br>
> +  return static_cast<PDB_SourceCompression>(Compression);<br>
> +}<br>
> +<br>
> +std::string DIAInjectedSource::getCode() const {<br>
> +  DWORD DataSize;<br>
> +  if (S_OK != SourceFile->get_source(0, &DataSize, nullptr))<br>
> +    return "";<br>
> +<br>
> +  std::vector<uint8_t> Buffer(DataSize);<br>
> +  if (S_OK != SourceFile->get_source(DataSize, &DataSize, Buffer.data()))<br>
> +    return "";<br>
> +  assert(Buffer.size() == DataSize);<br>
> +  return std::string(reinterpret_cast<const char *>(Buffer.data()),<br>
> +                     Buffer.size());<br>
> +}<br>
><br>
> Modified: llvm/trunk/lib/DebugInfo/PDB/DIA/DIASession.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/lib/DebugInfo/PDB/DIA/DIASession.cpp?rev=327428&r1=327427&r<br>
> 2=327428&view=diff<br>
> ==============================================================================<br>
> --- llvm/trunk/lib/DebugInfo/PDB/DIA/DIASession.cpp (original)<br>
> +++ llvm/trunk/lib/DebugInfo/PDB/DIA/DIASession.cpp Tue Mar 13 10:46:06<br>
> +++ 2018<br>
> @@ -9,6 +9,7 @@<br>
>  #include "llvm/DebugInfo/PDB/DIA/DIASession.h"<br>
>  #include "llvm/ADT/STLExtras.h"<br>
>  #include "llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h"<br>
> +#include "llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h"<br>
>  #include "llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h"<br>
>  #include "llvm/DebugInfo/PDB/DIA/DIAEnumSourceFiles.h"<br>
>  #include "llvm/DebugInfo/PDB/DIA/DIAEnumTables.h"<br>
> @@ -310,3 +311,31 @@ std::unique_ptr<IPDBEnumTables> DIASessi<br>
><br>
>    return llvm::make_unique<DIAEnumTables>(DiaEnumerator);<br>
>  }<br>
> +<br>
> +static CComPtr<IDiaEnumInjectedSources><br>
> +getEnumInjectedSources(IDiaSession &Session) {<br>
> +  CComPtr<IDiaEnumInjectedSources> EIS;<br>
> +  CComPtr<IDiaEnumTables> ET;<br>
> +  CComPtr<IDiaTable> Table;<br>
> +  ULONG Count = 0;<br>
> +<br>
> +  if (Session.getEnumTables(&ET) != S_OK)<br>
> +    return nullptr;<br>
> +<br>
> +  while (ET->Next(1, &Table, &Count) == S_OK && Count == 1) {<br>
> +    // There is only one table that matches the given iid<br>
> +    if (S_OK ==<br>
> +        Table->QueryInterface(__uuidof(IDiaEnumInjectedSources), (void<br>
> **)&EIS))<br>
> +      break;<br>
> +    Table.Release();<br>
> +  }<br>
> +  return EIS;<br>
> +}<br>
> +std::unique_ptr<IPDBEnumInjectedSources><br>
> +DIASession::getInjectedSources() const {<br>
> +  CComPtr<IDiaEnumInjectedSources> Files =<br>
> +getEnumInjectedSources(*Session);<br>
> +  if (!Files)<br>
> +    return nullptr;<br>
> +<br>
> +  return llvm::make_unique<DIAEnumInjectedSources>(*this, Files); }<br>
><br>
> Modified: llvm/trunk/lib/DebugInfo/PDB/Native/NativeSession.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/lib/DebugInfo/PDB/Native/NativeSession.cpp?rev=327428&r1=32<br>
> 7427&r2=327428&view=diff<br>
> ==============================================================================<br>
> --- llvm/trunk/lib/DebugInfo/PDB/Native/NativeSession.cpp (original)<br>
> +++ llvm/trunk/lib/DebugInfo/PDB/Native/NativeSession.cpp Tue Mar 13<br>
> +++ 10:46:06 2018<br>
> @@ -249,3 +249,8 @@ std::unique_ptr<IPDBEnumDataStreams> Nat<br>
> std::unique_ptr<IPDBEnumTables> NativeSession::getEnumTables() const {<br>
>    return nullptr;<br>
>  }<br>
> +<br>
> +std::unique_ptr<IPDBEnumInjectedSources><br>
> +NativeSession::getInjectedSources() const {<br>
> +  return nullptr;<br>
> +}<br>
><br>
> Modified: llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp?rev=327428&r1=327427&r2=327<br>
> 428&view=diff<br>
> ==============================================================================<br>
> --- llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp (original)<br>
> +++ llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp Tue Mar 13 10:46:06 2018<br>
> @@ -254,6 +254,18 @@ raw_ostream &llvm::pdb::operator<<(raw_o<br>
>    return OS;<br>
>  }<br>
><br>
> +raw_ostream &llvm::pdb::operator<<(raw_ostream &OS,<br>
> +                                   const PDB_SourceCompression<br>
> +&Compression) {<br>
> +  switch (Compression) {<br>
> +    CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SourceCompression, None, OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SourceCompression, Huffman, OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SourceCompression, LZ, OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_SourceCompression, RunLengthEncoded,<br>
> "RLE",<br>
> +                               OS)<br>
> +  }<br>
> +  return OS;<br>
> +}<br>
> +<br>
>  raw_ostream &llvm::pdb::operator<<(raw_ostream &OS, const Variant &Value) {<br>
>    switch (Value.Type) {<br>
>      case PDB_VariantType::Bool:<br>
><br>
> Modified: llvm/trunk/lib/DebugInfo/PDB/PDBInterfaceAnchors.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/lib/DebugInfo/PDB/PDBInterfaceAnchors.cpp?rev=327428&r1=327<br>
> 427&r2=327428&view=diff<br>
> ==============================================================================<br>
> --- llvm/trunk/lib/DebugInfo/PDB/PDBInterfaceAnchors.cpp (original)<br>
> +++ llvm/trunk/lib/DebugInfo/PDB/PDBInterfaceAnchors.cpp Tue Mar 13<br>
> +++ 10:46:06 2018<br>
> @@ -12,6 +12,7 @@<br>
>  //===----------------------------------------------------------------------<br>
> ===//<br>
><br>
>  #include "llvm/DebugInfo/PDB/IPDBDataStream.h"<br>
> +#include "llvm/DebugInfo/PDB/IPDBInjectedSource.h"<br>
>  #include "llvm/DebugInfo/PDB/IPDBLineNumber.h"<br>
>  #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"<br>
>  #include "llvm/DebugInfo/PDB/IPDBSession.h"<br>
> @@ -29,3 +30,5 @@ IPDBRawSymbol::~IPDBRawSymbol() = defaul<br>
>  IPDBLineNumber::~IPDBLineNumber() = default;<br>
><br>
>  IPDBTable::~IPDBTable() = default;<br>
> +<br>
> +IPDBInjectedSource::~IPDBInjectedSource() = default;<br>
><br>
> Added: llvm/trunk/test/tools/llvm-pdbdump/Inputs/InjectedSource.pdb<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-</a><br>
> pdbdump/Inputs/InjectedSource.pdb?rev=327428&view=auto<br>
> ==============================================================================<br>
> Binary file - no diff available.<br>
><br>
> Propchange: llvm/trunk/test/tools/llvm-pdbdump/Inputs/InjectedSource.pdb<br>
> ------------------------------------------------------------------------------<br>
>     svn:mime-type = application/octet-stream<br>
><br>
> Added: llvm/trunk/test/tools/llvm-pdbdump/injected-sources.test<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-</a><br>
> pdbdump/injected-sources.test?rev=327428&view=auto<br>
> ==============================================================================<br>
> --- llvm/trunk/test/tools/llvm-pdbdump/injected-sources.test (added)<br>
> +++ llvm/trunk/test/tools/llvm-pdbdump/injected-sources.test Tue Mar 13<br>
> +++ 10:46:06 2018<br>
> @@ -0,0 +1,16 @@<br>
> +; RUN: llvm-pdbutil pretty -injected-sources -injected-source-content \<br>
> +; RUN:   %p/Inputs/InjectedSource.pdb | FileCheck %s<br>
> +; RUN: llvm-pdbutil pretty -injected-sources -injected-source-content \<br>
> +; RUN:   %p/Inputs/ClassLayoutTest.pdb | FileCheck --check-prefix=NEGATIVE %s<br>
> +<br>
> +; CHECK:      ---INJECTED SOURCES---<br>
> +; CHECK-NEXT: d:\sandbox\natvistest\natvistest\test.natvis (220 bytes):<br>
> +obj=<null>, vname=d:\sandbox\natvistest\natvistest\test.natvis,<br>
> +crc=2374979362, compression=None ; CHECK-NEXT: <?xml version="1.0"<br>
> encoding="utf-8"?> ; CHECK-NEXT: <AutoVisualizer<br>
> xmlns="<a href="http://schemas.microsoft.com/vstudio/debugger/natvis/2010" rel="noreferrer" target="_blank">http://schemas.microsoft.com/vstudio/debugger/natvis/2010</a>"><br>
> +; CHECK-NEXT:   <Type Name="Foo"><br>
> +; CHECK-NEXT:     <DisplayString>This is a test</DisplayString><br>
> +; CHECK-NEXT:   </Type><br>
> +; CHECK-NEXT: </AutoVisualizer><br>
> +<br>
> +; NEGATIVE:      ---INJECTED SOURCES---<br>
> +; NEGATIVE-NEXT: There are no injected sources.<br>
><br>
> Modified: llvm/trunk/tools/llvm-pdbutil/llvm-pdbutil.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbutil/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbutil/llvm-</a><br>
> pdbutil.cpp?rev=327428&r1=327427&r2=327428&view=diff<br>
> ==============================================================================<br>
> --- llvm/trunk/tools/llvm-pdbutil/llvm-pdbutil.cpp (original)<br>
> +++ llvm/trunk/tools/llvm-pdbutil/llvm-pdbutil.cpp Tue Mar 13 10:46:06<br>
> +++ 2018<br>
> @@ -45,6 +45,7 @@<br>
>  #include "llvm/DebugInfo/MSF/MSFBuilder.h"<br>
>  #include "llvm/DebugInfo/PDB/GenericError.h"<br>
>  #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"<br>
> +#include "llvm/DebugInfo/PDB/IPDBInjectedSource.h"<br>
>  #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"<br>
>  #include "llvm/DebugInfo/PDB/IPDBSession.h"<br>
>  #include "llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h"<br>
> @@ -147,6 +148,14 @@ cl::list<std::string> InputFilenames(cl:<br>
>                                       cl::desc("<input PDB files>"),<br>
>                                       cl::OneOrMore,<br>
> cl::sub(PrettySubcommand));<br>
><br>
> +cl::opt<bool> InjectedSources("injected-sources",<br>
> +                              cl::desc("Display injected sources"),<br>
> +                              cl::cat(OtherOptions),<br>
> +cl::sub(PrettySubcommand)); cl::opt<bool> ShowInjectedSourceContent(<br>
> +    "injected-source-content",<br>
> +    cl::desc("When displaying an injected source, display the file content"),<br>
> +    cl::cat(OtherOptions), cl::sub(PrettySubcommand));<br>
> +<br>
>  cl::opt<bool> Compilands("compilands", cl::desc("Display compilands"),<br>
>                           cl::cat(TypeCategory), cl::sub(PrettySubcommand));<br>
> cl::opt<bool> Symbols("module-syms", @@ -840,6 +849,62 @@ bool<br>
> opts::pretty::compareDataSymbols(<br>
>    return getTypeLength(*F1) > getTypeLength(*F2);  }<br>
><br>
> +static std::string stringOr(std::string Str, std::string IfEmpty) {<br>
> +  return (Str.empty()) ? IfEmpty : Str; }<br>
> +<br>
> +static void dumpInjectedSources(LinePrinter &Printer, IPDBSession<br>
> +&Session) {<br>
> +  auto Sources = Session.getInjectedSources();<br>
> +  if (0 == Sources->getChildCount()) {<br>
> +    Printer.printLine("There are no injected sources.");<br>
> +    return;<br>
> +  }<br>
> +<br>
> +  while (auto IS = Sources->getNext()) {<br>
> +    Printer.NewLine();<br>
> +    std::string File = stringOr(IS->getFileName(), "<null>");<br>
> +    uint64_t Size = IS->getCodeByteSize();<br>
> +    std::string Obj = stringOr(IS->getObjectFileName(), "<null>");<br>
> +    std::string VFName = stringOr(IS->getVirtualFileName(), "<null>");<br>
> +    uint32_t CRC = IS->getCrc32();<br>
> +<br>
> +    std::string CompressionStr;<br>
> +    llvm::raw_string_ostream Stream(CompressionStr);<br>
> +    Stream << IS->getCompression();<br>
> +    WithColor(Printer, PDB_ColorItem::Path).get() << File;<br>
> +    Printer << " (";<br>
> +    WithColor(Printer, PDB_ColorItem::LiteralValue).get() << Size;<br>
> +    Printer << " bytes): ";<br>
> +    WithColor(Printer, PDB_ColorItem::Keyword).get() << "obj";<br>
> +    Printer << "=";<br>
> +    WithColor(Printer, PDB_ColorItem::Path).get() << Obj;<br>
> +    Printer << ", ";<br>
> +    WithColor(Printer, PDB_ColorItem::Keyword).get() << "vname";<br>
> +    Printer << "=";<br>
> +    WithColor(Printer, PDB_ColorItem::Path).get() << VFName;<br>
> +    Printer << ", ";<br>
> +    WithColor(Printer, PDB_ColorItem::Keyword).get() << "crc";<br>
> +    Printer << "=";<br>
> +    WithColor(Printer, PDB_ColorItem::LiteralValue).get() << CRC;<br>
> +    Printer << ", ";<br>
> +    WithColor(Printer, PDB_ColorItem::Keyword).get() << "compression";<br>
> +    Printer << "=";<br>
> +    WithColor(Printer, PDB_ColorItem::LiteralValue).get() <<<br>
> + Stream.str();<br>
> +<br>
> +    if (!opts::pretty::ShowInjectedSourceContent)<br>
> +      continue;<br>
> +<br>
> +    // Set the indent level to 0 when printing file content.<br>
> +    int Indent = Printer.getIndentLevel();<br>
> +    Printer.Unindent(Indent);<br>
> +<br>
> +    Printer.printLine(IS->getCode());<br>
> +<br>
> +    // Re-indent back to the original level.<br>
> +    Printer.Indent(Indent);<br>
> +  }<br>
> +}<br>
> +<br>
>  static void dumpPretty(StringRef Path) {<br>
>    std::unique_ptr<IPDBSession> Session;<br>
><br>
> @@ -989,6 +1054,19 @@ static void dumpPretty(StringRef Path) {<br>
>    if (opts::pretty::Lines) {<br>
>      Printer.NewLine();<br>
>    }<br>
> +  if (opts::pretty::InjectedSources) {<br>
> +    Printer.NewLine();<br>
> +    WithColor(Printer, PDB_ColorItem::SectionHeader).get()<br>
> +        << "---INJECTED SOURCES---";<br>
> +    AutoIndent Indent1(Printer);<br>
> +<br>
> +    if (ReaderType == PDB_ReaderType::Native)<br>
> +      Printer.printLine(<br>
> +          "Injected sources are not supported with the native reader.");<br>
> +    else<br>
> +      dumpInjectedSources(Printer, *Session);  }<br>
> +<br>
>    outs().flush();<br>
>  }<br>
><br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>