From 4911023fe3fd3a142d1077149fc3bcd9948dece8 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Mon, 5 Nov 2018 17:40:28 +0000 Subject: Add a target modules dump ast command. This is useful for investigating the clang ast as you reconstruct it via by parsing debug info. It can also be used to write tests against. Differential Revision: https://reviews.llvm.org/D54072 llvm-svn: 346149 --- lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp | 6 ++++++ lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'lldb/source/Plugins/SymbolFile/NativePDB') diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp index fab43e928ca..9125dab3caa 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp @@ -1391,6 +1391,12 @@ size_t SymbolFileNativePDB::ParseFunctionBlocks(const SymbolContext &sc) { return 0; } +void SymbolFileNativePDB::DumpClangAST(Stream &s) { + if (!m_clang) + return; + m_clang->Dump(s); +} + uint32_t SymbolFileNativePDB::FindGlobalVariables( const ConstString &name, const CompilerDeclContext *parent_decl_ctx, uint32_t max_matches, VariableList &variables) { diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h index c2b5729d98a..94fa58011fb 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h +++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h @@ -155,6 +155,8 @@ public: ClangASTContext &GetASTContext() { return *m_clang; } ClangASTImporter &GetASTImporter() { return *m_importer; } + void DumpClangAST(Stream &s) override; + private: size_t FindTypesByName(llvm::StringRef name, uint32_t max_matches, TypeMap &types); -- cgit v1.2.3