[Lldb-commits] [PATCH] D53506: [ClangASTContext] Extract VTable pointers from C++ objects
aleksandr.urakov added a comment. Ping! Is it ok to proceed with it? Does anyone have objections? Repository: rLLDB LLDB https://reviews.llvm.org/D53506 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D54135: Add convenience method in FileSystem to check if a path/filespec is a directory.
krytarowski added a comment. Why? We already put a lot of effort into reusing code from LLVM. Repository: rLLDB LLDB https://reviews.llvm.org/D54135 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D54135: Add convenience method in FileSystem to check if a path/filespec is a directory.
JDevlieghere created this revision. JDevlieghere added reviewers: labath, davide. JDevlieghere added a project: LLDB. Herald added subscribers: teemperor, emaste. Replace calls to LLVM's is_directory with calls to LLDB's FileSytem class. For this I introduced a new convenience method that, like the other methods, takes either a path or filespec. Repository: rLLDB LLDB https://reviews.llvm.org/D54135 Files: include/lldb/Host/FileSystem.h source/API/SBPlatform.cpp source/Core/Module.cpp source/Core/ModuleList.cpp source/Host/common/FileSystem.cpp source/Host/common/Symbols.cpp source/Host/macosx/Symbols.cpp source/Host/macosx/objcxx/Host.mm source/Host/macosx/objcxx/HostInfoMacOSX.mm source/Plugins/ExpressionParser/Clang/ClangHost.cpp source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp source/Plugins/Platform/MacOSX/PlatformDarwin.cpp source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp source/Plugins/Process/Darwin/NativeProcessDarwin.cpp source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp source/Plugins/Process/Windows/Common/ProcessWindows.cpp source/Target/TargetList.cpp Index: source/Target/TargetList.cpp === --- source/Target/TargetList.cpp +++ source/Target/TargetList.cpp @@ -364,7 +364,7 @@ char resolved_bundle_exe_path[PATH_MAX]; resolved_bundle_exe_path[0] = '\0'; if (file) { -if (llvm::sys::fs::is_directory(file.GetPath())) +if (FileSystem::Instance().IsDirectory(file)) user_exe_path_is_bundle = true; if (file.IsRelative() && !user_exe_path.empty()) { Index: source/Plugins/Process/Windows/Common/ProcessWindows.cpp === --- source/Plugins/Process/Windows/Common/ProcessWindows.cpp +++ source/Plugins/Process/Windows/Common/ProcessWindows.cpp @@ -254,7 +254,7 @@ namespace fs = llvm::sys::fs; if (working_dir) { FileSystem::Instance().Resolve(working_dir); -if (!fs::is_directory(working_dir.GetPath())) { +if (!FileSystem::Instance().IsDirectory(working_dir)) { result.SetErrorStringWithFormat("No such file or directory: %s", working_dir.GetCString()); return result; Index: source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp === --- source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp +++ source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp @@ -374,10 +374,9 @@ assert(m_monitor == NULL); FileSpec working_dir = launch_info.GetWorkingDirectory(); - namespace fs = llvm::sys::fs; if (working_dir) { FileSystem::Instance().Resolve(working_dir); -if (!fs::is_directory(working_dir.GetPath())) { +if (!FileSystem::Instance().IsDirectory(working_dir.GetPath())) { error.SetErrorStringWithFormat("No such file or directory: %s", working_dir.GetCString()); return error; Index: source/Plugins/Process/Darwin/NativeProcessDarwin.cpp === --- source/Plugins/Process/Darwin/NativeProcessDarwin.cpp +++ source/Plugins/Process/Darwin/NativeProcessDarwin.cpp @@ -65,7 +65,7 @@ FileSpec working_dir(launch_info.GetWorkingDirectory()); if (working_dir) { FileInstance::Instance().Resolve(working_dir); -if (!llvm::sys::fs::is_directory(working_dir.GetPath())) { +if (!FileSystem::Instance().IsDirectory(working_dir)) { error.SetErrorStringWithFormat("No such file or directory: %s", working_dir.GetCString()); return error; Index: source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp === --- source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp +++ source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp @@ -379,7 +379,7 @@ // Add simple directory /Applications/Xcode.app/Contents/Developer/../Symbols FileSpec possible_dir(developer_dir + "/../Symbols"); FileSystem::Instance().Resolve(possible_dir); - if (llvm::sys::fs::is_directory(possible_dir.GetPath())) + if (FileSystem::Instance().IsDirectory(possible_dir)) m_search_directories.push_back(possible_dir); // Add simple directory of the current working directory @@ -396,7 +396,7 @@ for (uint32_t i = 0; i < user_dirs_count; i++) { FileSpec dir = user_dirs.GetFileSpecAtIndex(i); FileSystem::Instance().Resolve(dir); -if (llvm::sys::fs::is_directory(dir.GetPath())) { +if (FileSystem::Instance().IsDirectory(dir)) { m_search_directories.push_back(dir); } } @@ -413,7 +413,7 @@ for (int i = 0; subdirs[i] != nullptr; i++) { FileSpec testdir(dir + subdirs[i]); FileSystem::Instance().Resolve(testdir); -if (llvm::sys::fs::is_directory(testdir.GetPath())) +if (FileSystem::Instance().IsDirectory(testdir))
Re: [Lldb-commits] [lldb] r346186 - [TestVLA] Fix a python decorator.
Thanks!! You could also change the import line to > from lldbsuite.test.decorators import * and leave the decorator as-is. -- adrian > On Nov 5, 2018, at 4:21 PM, Davide Italiano wrote: > > @Adrian, this should be fairly straightforward, but a post-commit > review is always appreciated. > On Mon, Nov 5, 2018 at 4:20 PM Davide Italiano via lldb-commits > wrote: >> >> Author: davide >> Date: Mon Nov 5 16:18:17 2018 >> New Revision: 346186 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=346186=rev >> Log: >> [TestVLA] Fix a python decorator. >> >> Modified: >>lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py >> >> Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py?rev=346186=346185=346186=diff >> == >> --- lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py >> (original) >> +++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py Mon Nov >> 5 16:18:17 2018 >> @@ -1,5 +1,6 @@ >> import lldb >> from lldbsuite.test.lldbtest import * >> +from lldbsuite.test import decorators >> import lldbsuite.test.lldbutil as lldbutil >> >> >> @@ -7,7 +8,7 @@ class TestVLA(TestBase): >> >> mydir = TestBase.compute_mydir(__file__) >> >> -@skipIf(compiler="clang", compiler_version=['<', '8.0']) >> +@decorators.skipIf(compiler="clang", compiler_version=['<', '8.0']) >> def test_vla(self): >> self.build() >> _, process, _, _ = lldbutil.run_to_source_breakpoint( >> >> >> ___ >> lldb-commits mailing list >> lldb-commits@lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r346186 - [TestVLA] Fix a python decorator.
@Adrian, this should be fairly straightforward, but a post-commit review is always appreciated. On Mon, Nov 5, 2018 at 4:20 PM Davide Italiano via lldb-commits wrote: > > Author: davide > Date: Mon Nov 5 16:18:17 2018 > New Revision: 346186 > > URL: http://llvm.org/viewvc/llvm-project?rev=346186=rev > Log: > [TestVLA] Fix a python decorator. > > Modified: > lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py > > Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py?rev=346186=346185=346186=diff > == > --- lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py (original) > +++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py Mon Nov > 5 16:18:17 2018 > @@ -1,5 +1,6 @@ > import lldb > from lldbsuite.test.lldbtest import * > +from lldbsuite.test import decorators > import lldbsuite.test.lldbutil as lldbutil > > > @@ -7,7 +8,7 @@ class TestVLA(TestBase): > > mydir = TestBase.compute_mydir(__file__) > > -@skipIf(compiler="clang", compiler_version=['<', '8.0']) > +@decorators.skipIf(compiler="clang", compiler_version=['<', '8.0']) > def test_vla(self): > self.build() > _, process, _, _ = lldbutil.run_to_source_breakpoint( > > > ___ > lldb-commits mailing list > lldb-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r346186 - [TestVLA] Fix a python decorator.
Author: davide Date: Mon Nov 5 16:18:17 2018 New Revision: 346186 URL: http://llvm.org/viewvc/llvm-project?rev=346186=rev Log: [TestVLA] Fix a python decorator. Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py?rev=346186=346185=346186=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py Mon Nov 5 16:18:17 2018 @@ -1,5 +1,6 @@ import lldb from lldbsuite.test.lldbtest import * +from lldbsuite.test import decorators import lldbsuite.test.lldbutil as lldbutil @@ -7,7 +8,7 @@ class TestVLA(TestBase): mydir = TestBase.compute_mydir(__file__) -@skipIf(compiler="clang", compiler_version=['<', '8.0']) +@decorators.skipIf(compiler="clang", compiler_version=['<', '8.0']) def test_vla(self): self.build() _, process, _, _ = lldbutil.run_to_source_breakpoint( ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D52672: Set stdout/stdin to binary mode on Windows
This revision was automatically updated to reflect the committed changes. Closed by commit rLLDB346174: Set stdout/stdin to binary mode on Windows (authored by lanza, committed by ). Herald added a subscriber: lldb-commits. Changed prior to commit: https://reviews.llvm.org/D52672?vs=168705=172656#toc Repository: rLLDB LLDB https://reviews.llvm.org/D52672 Files: tools/lldb-vscode/VSCode.cpp Index: tools/lldb-vscode/VSCode.cpp === --- tools/lldb-vscode/VSCode.cpp +++ tools/lldb-vscode/VSCode.cpp @@ -14,6 +14,11 @@ #include "VSCode.h" #include "LLDBUtils.h" +#if defined(_WIN32) +#include +#include +#endif + using namespace lldb_vscode; namespace { @@ -39,6 +44,13 @@ focus_tid(LLDB_INVALID_THREAD_ID), sent_terminated_event(false), stop_at_entry(false) { const char *log_file_path = getenv("LLDBVSCODE_LOG"); +#if defined(_WIN32) +// Windows opens stdout and stdin in text mode which converts \n to 13,10 +// while the value is just 10 on Darwin/Linux. Setting the file mode to binary +// fixes this. + assert(_setmode(fileno(stdout), _O_BINARY)); + assert(_setmode(fileno(stdin), _O_BINARY)); +#endif if (log_file_path) log.reset(new std::ofstream(log_file_path)); } Index: tools/lldb-vscode/VSCode.cpp === --- tools/lldb-vscode/VSCode.cpp +++ tools/lldb-vscode/VSCode.cpp @@ -14,6 +14,11 @@ #include "VSCode.h" #include "LLDBUtils.h" +#if defined(_WIN32) +#include +#include +#endif + using namespace lldb_vscode; namespace { @@ -39,6 +44,13 @@ focus_tid(LLDB_INVALID_THREAD_ID), sent_terminated_event(false), stop_at_entry(false) { const char *log_file_path = getenv("LLDBVSCODE_LOG"); +#if defined(_WIN32) +// Windows opens stdout and stdin in text mode which converts \n to 13,10 +// while the value is just 10 on Darwin/Linux. Setting the file mode to binary +// fixes this. + assert(_setmode(fileno(stdout), _O_BINARY)); + assert(_setmode(fileno(stdin), _O_BINARY)); +#endif if (log_file_path) log.reset(new std::ofstream(log_file_path)); } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r346172 - Skip this test on older versions of clang.
Author: adrian Date: Mon Nov 5 14:19:22 2018 New Revision: 346172 URL: http://llvm.org/viewvc/llvm-project?rev=346172=rev Log: Skip this test on older versions of clang. Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py?rev=346172=346171=346172=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py Mon Nov 5 14:19:22 2018 @@ -7,6 +7,7 @@ class TestVLA(TestBase): mydir = TestBase.compute_mydir(__file__) +@skipIf(compiler="clang", compiler_version=['<', '8.0']) def test_vla(self): self.build() _, process, _, _ = lldbutil.run_to_source_breakpoint( ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D51566: Add a relocation to ObjectFileELF::ApplyRelocations and a test
This revision was automatically updated to reflect the committed changes. Closed by commit rLLDB346171: Add a relocation to ObjectFileELF::ApplyRelocations and a test (authored by lanza, committed by ). Herald added a subscriber: lldb-commits. Changed prior to commit: https://reviews.llvm.org/D51566?vs=163617=172654#toc Repository: rLLDB LLDB https://reviews.llvm.org/D51566 Files: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp unittests/ObjectFile/ELF/CMakeLists.txt unittests/ObjectFile/ELF/Inputs/debug-info-relocations.pcm.yaml unittests/ObjectFile/ELF/TestObjectFileELF.cpp Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp === --- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -2703,6 +2703,7 @@ } } else { switch (reloc_type(rel)) { + case R_AARCH64_ABS64: case R_X86_64_64: { symbol = symtab->FindSymbolByID(reloc_symbol(rel)); if (symbol) { @@ -2722,13 +2723,15 @@ if (symbol) { addr_t value = symbol->GetAddressRef().GetFileAddress(); value += ELFRelocation::RelocAddend32(rel); - if ((reloc_type(rel) == R_X86_64_32 && (value <= UINT32_MAX)) || + if ((reloc_type(rel) == R_X86_64_32 && (value > UINT32_MAX)) || (reloc_type(rel) == R_X86_64_32S && - ((int64_t)value <= INT32_MAX && (int64_t)value >= INT32_MIN)) || - (reloc_type(rel) == R_AARCH64_ABS32 && (value <= UINT32_MAX))) { + ((int64_t)value > INT32_MAX && (int64_t)value < INT32_MIN)) || + (reloc_type(rel) == R_AARCH64_ABS32 && + ((int64_t)value > INT32_MAX && (int64_t)value < INT32_MIN))) { Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_MODULES); log->Printf("Failed to apply debug info relocations"); +break; } uint32_t truncated_addr = (value & 0x); DataBufferSP _buffer_sp = debug_data.GetSharedDataBuffer(); Index: unittests/ObjectFile/ELF/TestObjectFileELF.cpp === --- unittests/ObjectFile/ELF/TestObjectFileELF.cpp +++ unittests/ObjectFile/ELF/TestObjectFileELF.cpp @@ -16,6 +16,7 @@ #include "lldb/Core/Section.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/HostInfo.h" +#include "lldb/Utility/DataBufferHeap.h" #include "llvm/ADT/Optional.h" #include "llvm/Support/Compression.h" #include "llvm/Support/FileUtilities.h" @@ -141,3 +142,64 @@ Uuid.SetFromStringRef("1b8a73ac238390e32a7ff4ac8ebe4d6a41ecf5c9", 20); EXPECT_EQ(Spec.GetUUID(), Uuid); } + +#define CHECK_ABS32(offset, addend)\ + ASSERT_EQ((uint32_t)addend, *(uint32_t *)(bytes + offset)) +#define CHECK_ABS64(offset, addend)\ + ASSERT_EQ((uint64_t)addend, *(uint64_t *)(bytes + offset)) + +TEST_F(ObjectFileELFTest, TestAARCH64Relocations) { + std::string yaml = GetInputFilePath("debug-info-relocations.pcm.yaml"); + llvm::SmallString<128> obj; + ASSERT_NO_ERROR(llvm::sys::fs::createTemporaryFile( + "debug-info-relocations-%%", "obj", obj)); + + llvm::FileRemover remover(obj); + llvm::StringRef args[] = {YAML2OBJ, yaml}; + llvm::StringRef obj_ref = obj; + const llvm::Optional redirects[] = {llvm::None, obj_ref, + llvm::None}; + ASSERT_EQ(0, +llvm::sys::ExecuteAndWait(YAML2OBJ, args, llvm::None, redirects)); + uint64_t size; + ASSERT_NO_ERROR(llvm::sys::fs::file_size(obj, size)); + ASSERT_GT(size, 0u); + + ModuleSpec spec{FileSpec(obj)}; + spec.GetSymbolFileSpec().SetFile(obj, FileSpec::Style::native); + auto module_sp = std::make_shared(spec); + + auto objfile = static_cast(module_sp->GetObjectFile()); + SectionList *section_list = objfile->GetSectionList(); + ASSERT_NE(nullptr, section_list); + + auto debug_info_sp = + section_list->FindSectionByName(ConstString(".debug_info")); + ASSERT_NE(nullptr, debug_info_sp); + objfile->RelocateSection(debug_info_sp.get()); + + DataExtractor data; + // length of 0x10 is not needed but length 0x0 crashes + objfile->GetData(0x00, 0x10, data); + DataBufferSP _buffer_sp = data.GetSharedDataBuffer(); + uint8_t *bytes = data_buffer_sp->GetBytes(); + + addr_t debug_info_offset = debug_info_sp->GetFileOffset(); + bytes += debug_info_offset; + + // Sanity check - The first byte from the yaml file is 0x47 + ASSERT_EQ(0x47, *bytes); + + // .rela.debug_info contains 9 relocations: + // 7 R_AARCH64_ABS32 - 2 R_AARCH64_ABS64 + // None have a value. Four have addends. + CHECK_ABS32(0x6, 0); + CHECK_ABS32(0xC, 0); + CHECK_ABS32(0x12, 45); + CHECK_ABS32(0x16, 0); + CHECK_ABS32(0x1A, 55); + CHECK_ABS64(0x1E, 0); + CHECK_ABS64(0x2B, 0); + CHECK_ABS32(0x39, 73); +
[Lldb-commits] [PATCH] D54074: CPlusPlusLanguage: Use new demangler API to implement type substitution
shafik added inline comments. Comment at: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp:336 + llvm::itanium_demangle::Node *parseType() { +if (llvm::StringRef(First, Last - First).startswith(Search)) { + Result += llvm::StringRef(Written, First - Written); Can you just use `numLeft()` here? It would be less opaque. Comment at: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp:337 +if (llvm::StringRef(First, Last - First).startswith(Search)) { + Result += llvm::StringRef(Written, First - Written); + Result += Replace; also `First - Written` is used twice but it is not obvious what the means, naming it via a member function might be helpful. https://reviews.llvm.org/D54074 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D53530: Fix (and improve) the support for C99 variable length array types
aprantl added a comment. Thanks for your patience! Repository: rL LLVM https://reviews.llvm.org/D53530 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D53530: Fix (and improve) the support for C99 variable length array types
This revision was automatically updated to reflect the committed changes. Closed by commit rL346165: Fix (and improve) the support for C99 variable length array types (authored by adrian, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D53530?vs=172390=172639#toc Repository: rL LLVM https://reviews.llvm.org/D53530 Files: lldb/trunk/include/lldb/Symbol/ClangASTContext.h lldb/trunk/include/lldb/Symbol/CompilerType.h lldb/trunk/include/lldb/Symbol/SymbolFile.h lldb/trunk/include/lldb/Symbol/TypeSystem.h lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/Makefile lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/main.c lldb/trunk/source/Core/ValueObjectCast.cpp lldb/trunk/source/Core/ValueObjectChild.cpp lldb/trunk/source/Core/ValueObjectConstResult.cpp lldb/trunk/source/Core/ValueObjectDynamicValue.cpp lldb/trunk/source/Core/ValueObjectMemory.cpp lldb/trunk/source/Core/ValueObjectRegister.cpp lldb/trunk/source/Core/ValueObjectVariable.cpp lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp lldb/trunk/source/Plugins/Language/CPlusPlus/BlockPointer.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h lldb/trunk/source/Symbol/ClangASTContext.cpp lldb/trunk/source/Symbol/CompilerType.cpp lldb/trunk/source/Symbol/Type.cpp lldb/trunk/source/Symbol/Variable.cpp Index: lldb/trunk/source/Core/ValueObjectDynamicValue.cpp === --- lldb/trunk/source/Core/ValueObjectDynamicValue.cpp +++ lldb/trunk/source/Core/ValueObjectDynamicValue.cpp @@ -92,7 +92,8 @@ size_t ValueObjectDynamicValue::CalculateNumChildren(uint32_t max) { const bool success = UpdateValueIfNeeded(false); if (success && m_dynamic_type_info.HasType()) { -auto children_count = GetCompilerType().GetNumChildren(true); +ExecutionContext exe_ctx(GetExecutionContextRef()); +auto children_count = GetCompilerType().GetNumChildren(true, _ctx); return children_count <= max ? children_count : max; } else return m_parent->GetNumChildren(max); Index: lldb/trunk/source/Core/ValueObjectMemory.cpp === --- lldb/trunk/source/Core/ValueObjectMemory.cpp +++ lldb/trunk/source/Core/ValueObjectMemory.cpp @@ -128,8 +128,10 @@ return child_count <= max ? child_count : max; } + ExecutionContext exe_ctx(GetExecutionContextRef()); const bool omit_empty_base_classes = true; - auto child_count = m_compiler_type.GetNumChildren(omit_empty_base_classes); + auto child_count = + m_compiler_type.GetNumChildren(omit_empty_base_classes, _ctx); return child_count <= max ? child_count : max; } Index: lldb/trunk/source/Core/ValueObjectConstResult.cpp === --- lldb/trunk/source/Core/ValueObjectConstResult.cpp +++ lldb/trunk/source/Core/ValueObjectConstResult.cpp @@ -208,7 +208,8 @@ void ValueObjectConstResult::SetByteSize(size_t size) { m_byte_size = size; } size_t ValueObjectConstResult::CalculateNumChildren(uint32_t max) { - auto children_count = GetCompilerType().GetNumChildren(true); + ExecutionContext exe_ctx(GetExecutionContextRef()); + auto children_count = GetCompilerType().GetNumChildren(true, _ctx); return children_count <= max ? children_count : max; } Index: lldb/trunk/source/Core/ValueObjectRegister.cpp === --- lldb/trunk/source/Core/ValueObjectRegister.cpp +++ lldb/trunk/source/Core/ValueObjectRegister.cpp @@ -279,7 +279,8 @@ } size_t ValueObjectRegister::CalculateNumChildren(uint32_t max) { - auto children_count = GetCompilerType().GetNumChildren(true); + ExecutionContext exe_ctx(GetExecutionContextRef()); + auto children_count = GetCompilerType().GetNumChildren(true, _ctx); return children_count <= max ? children_count : max; } Index: lldb/trunk/source/Core/ValueObjectChild.cpp === ---
[Lldb-commits] [lldb] r346165 - Fix (and improve) the support for C99 variable length array types
Author: adrian Date: Mon Nov 5 12:49:07 2018 New Revision: 346165 URL: http://llvm.org/viewvc/llvm-project?rev=346165=rev Log: Fix (and improve) the support for C99 variable length array types Clang recently improved its DWARF support for C VLA types. The DWARF now looks like this: 0x0051: DW_TAG_variable [4] DW_AT_location( fbreg -32 ) DW_AT_name( "__vla_expr" ) DW_AT_type( {0x00d3} ( long unsigned int ) ) DW_AT_artificial( true ) ... 0x00da: DW_TAG_array_type [10] * DW_AT_type( {0x00cc} ( int ) ) 0x00df: DW_TAG_subrange_type [11] DW_AT_type( {0x00e9} ( __ARRAY_SIZE_TYPE__ ) ) DW_AT_count( {0x0051} ) Without this patch LLDB will naively interpret the DIE offset 0x51 as the static size of the array, which is clearly wrong. This patch extends ValueObject::GetNumChildren to query the dynamic properties of incomplete array types. See the testcase for an example: 4 int foo(int a) { 5 int vla[a]; 6 for (int i = 0; i < a; ++i) 7 vla[i] = i; 8 -> 9pause(); // break here 10 return vla[a-1]; 11 } (lldb) fr v vla (int []) vla = ([0] = 0, [1] = 1, [2] = 2, [3] = 3) (lldb) quit rdar://problem/21814005 Differential Revision: https://reviews.llvm.org/D53530 Added: lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/ lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/Makefile lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/main.c Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h lldb/trunk/include/lldb/Symbol/CompilerType.h lldb/trunk/include/lldb/Symbol/SymbolFile.h lldb/trunk/include/lldb/Symbol/TypeSystem.h lldb/trunk/source/Core/ValueObjectCast.cpp lldb/trunk/source/Core/ValueObjectChild.cpp lldb/trunk/source/Core/ValueObjectConstResult.cpp lldb/trunk/source/Core/ValueObjectDynamicValue.cpp lldb/trunk/source/Core/ValueObjectMemory.cpp lldb/trunk/source/Core/ValueObjectRegister.cpp lldb/trunk/source/Core/ValueObjectVariable.cpp lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp lldb/trunk/source/Plugins/Language/CPlusPlus/BlockPointer.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h lldb/trunk/source/Symbol/ClangASTContext.cpp lldb/trunk/source/Symbol/CompilerType.cpp lldb/trunk/source/Symbol/Type.cpp lldb/trunk/source/Symbol/Variable.cpp Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=346165=346164=346165=diff == --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Mon Nov 5 12:49:07 2018 @@ -744,7 +744,8 @@ public: size_t GetTypeBitAlign(lldb::opaque_compiler_type_t type) override; uint32_t GetNumChildren(lldb::opaque_compiler_type_t type, - bool omit_empty_base_classes) override; + bool omit_empty_base_classes, + const ExecutionContext *exe_ctx) override; CompilerType GetBuiltinTypeByName(const ConstString ) override; Modified: lldb/trunk/include/lldb/Symbol/CompilerType.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerType.h?rev=346165=346164=346165=diff == --- lldb/trunk/include/lldb/Symbol/CompilerType.h (original) +++ lldb/trunk/include/lldb/Symbol/CompilerType.h Mon Nov 5 12:49:07 2018 @@ -301,7 +301,8 @@ public: size_t GetTypeBitAlign() const; - uint32_t GetNumChildren(bool omit_empty_base_classes) const; + uint32_t GetNumChildren(bool omit_empty_base_classes, + const ExecutionContext *exe_ctx) const; lldb::BasicType GetBasicTypeEnumeration() const;
[Lldb-commits] [PATCH] D53412: [lldb] Fixed deadlock when SBProcess is Kill()ed and inspected
cameron314 added a comment. Ping? Repository: rLLDB LLDB https://reviews.llvm.org/D53412 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r346162 - Fix the Xcode project for the removal of the Go, Java & OCaml
Author: jingham Date: Mon Nov 5 12:15:27 2018 New Revision: 346162 URL: http://llvm.org/viewvc/llvm-project?rev=346162=rev Log: Fix the Xcode project for the removal of the Go, Java & OCaml plugins. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=346162=346161=346162=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Nov 5 12:15:27 2018 @@ -224,9 +224,6 @@ 945261BF1B9A11FC00BF138D /* CxxStringTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B31B9A11E800BF138D /* CxxStringTypes.cpp */; }; 6D95DC001B9DC057000E318A /* DIERef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D95DBFD1B9DC057000E318A /* DIERef.cpp */; }; 269DDD4A1B8FD1C300D0DBD8 /* DWARFASTParserClang.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 269DDD481B8FD1C300D0DBD8 /* DWARFASTParserClang.cpp */; }; - AE6897281B94F6DE0018845D /* DWARFASTParserGo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE6897261B94F6DE0018845D /* DWARFASTParserGo.cpp */; }; - 6D0F61481C80AAD600A4ECEE /* DWARFASTParserJava.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D0F61441C80AACF00A4ECEE /* DWARFASTParserJava.cpp */; }; - 4CC7C6581D529B950076FF94 /* DWARFASTParserOCaml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CC7C6521D5299140076FF94 /* DWARFASTParserOCaml.cpp */; }; 268900B713353E5F00698AC0 /* DWARFAbbreviationDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89B310F57C5600BB2B04 /* DWARFAbbreviationDeclaration.cpp */; }; 266E829D1B8E542C008FCA06 /* DWARFAttribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266E829C1B8E542C008FCA06 /* DWARFAttribute.cpp */; }; 4CD44D4220B777850003557C /* DWARFBaseDIE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CD44D4020B777850003557C /* DWARFBaseDIE.cpp */; }; @@ -331,14 +328,6 @@ 2689009E13353E4200698AC0 /* GDBRemoteRegisterContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2618EE5D1315B29C001D6D71 /* GDBRemoteRegisterContext.cpp */; }; E7E94ABC1B54961F00D0AE30 /* GDBRemoteSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E73A15A41B548EC500786197 /* GDBRemoteSignals.cpp */; }; 23CB15461D66DA9300EDDDE1 /* GDBRemoteTestUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2370A37F1D66C587000E7BE6 /* GDBRemoteTestUtils.cpp */; }; - AE7F56291B8FE418001377A8 /* GoASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEFFBA7C1AC4835D0087B932 /* GoASTContext.cpp */; }; - AE44FB4C1BB4BB540033EB62 /* GoFormatterFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB4A1BB4BB540033EB62 /* GoFormatterFunctions.cpp */; }; - AE44FB471BB4BB090033EB62 /* GoLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB451BB4BB090033EB62 /* GoLanguage.cpp */; }; - AE44FB3E1BB485960033EB62 /* GoLanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB3D1BB485960033EB62 /* GoLanguageRuntime.cpp */; }; - AE44FB311BB07EB80033EB62 /* GoLexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB2A1BB07DD80033EB62 /* GoLexer.cpp */; }; - AE44FB321BB07EBC0033EB62 /* GoParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB2B1BB07DD80033EB62 /* GoParser.cpp */; }; - 23CB15331D66DA9300EDDDE1 /* GoParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEC6FF9F1BE970A2007882C1 /* GoParserTest.cpp */; }; - AE44FB301BB07EB20033EB62 /* GoUserExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB2C1BB07DD80033EB62 /* GoUserExpression.cpp */; }; 6D95DC011B9DC057000E318A /* HashedNameToDIE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D95DBFE1B9DC057000E318A /* HashedNameToDIE.cpp */; }; 2666ADC81B3CB675001FAFD3 /* HexagonDYLDRendezvous.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2666ADC31B3CB675001FAFD3 /* HexagonDYLDRendezvous.cpp */; }; 58A080B42112AB3800D5580F /* Highlighter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 58A080A92112AA9400D5580F /* Highlighter.cpp */; }; @@ -375,11 +364,6 @@ 942829561A89614C00521B30 /* JSON.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942829551A89614C00521B30 /* JSON.cpp */; }; 8C3BD9A01EF5D1FF0016C343 /* JSONTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8C3BD99F1EF5D1B50016C343 /* JSONTest.cpp */; }; 2660387B211CA90F00329572 /* JSONUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26603875211CA90E00329572
[Lldb-commits] [PATCH] D54060: Remove OCaml debugger plugin
This revision was automatically updated to reflect the committed changes. Closed by commit rL346159: Remove OCaml debugger plugin (authored by JDevlieghere, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D54060?vs=172464=172627#toc Repository: rL LLVM https://reviews.llvm.org/D54060 Files: lldb/trunk/include/lldb/Symbol/OCamlASTContext.h lldb/trunk/source/API/SystemInitializerFull.cpp lldb/trunk/source/Plugins/Language/CMakeLists.txt lldb/trunk/source/Plugins/Language/OCaml/CMakeLists.txt lldb/trunk/source/Plugins/Language/OCaml/OCamlLanguage.cpp lldb/trunk/source/Plugins/Language/OCaml/OCamlLanguage.h lldb/trunk/source/Plugins/SymbolFile/DWARF/CMakeLists.txt lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.h lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h lldb/trunk/source/Symbol/CMakeLists.txt lldb/trunk/source/Symbol/OCamlASTContext.cpp lldb/trunk/tools/lldb-test/SystemInitializerTest.cpp lldb/trunk/unittests/Language/Highlighting/CMakeLists.txt lldb/trunk/unittests/Language/Highlighting/HighlighterTest.cpp Index: lldb/trunk/unittests/Language/Highlighting/HighlighterTest.cpp === --- lldb/trunk/unittests/Language/Highlighting/HighlighterTest.cpp +++ lldb/trunk/unittests/Language/Highlighting/HighlighterTest.cpp @@ -12,7 +12,6 @@ #include "lldb/Core/Highlighter.h" #include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h" -#include "Plugins/Language/OCaml/OCamlLanguage.h" #include "Plugins/Language/ObjC/ObjCLanguage.h" #include "Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h" @@ -32,14 +31,12 @@ CPlusPlusLanguage::Initialize(); ObjCLanguage::Initialize(); ObjCPlusPlusLanguage::Initialize(); - OCamlLanguage::Initialize(); } void HighlighterTest::TearDownTestCase() { CPlusPlusLanguage::Terminate(); ObjCLanguage::Terminate(); ObjCPlusPlusLanguage::Terminate(); - OCamlLanguage::Terminate(); } static std::string getName(lldb::LanguageType type) { Index: lldb/trunk/unittests/Language/Highlighting/CMakeLists.txt === --- lldb/trunk/unittests/Language/Highlighting/CMakeLists.txt +++ lldb/trunk/unittests/Language/Highlighting/CMakeLists.txt @@ -5,5 +5,4 @@ lldbPluginCPlusPlusLanguage lldbPluginObjCLanguage lldbPluginObjCPlusPlusLanguage -lldbPluginOCamlLanguage ) Index: lldb/trunk/tools/lldb-test/SystemInitializerTest.cpp === --- lldb/trunk/tools/lldb-test/SystemInitializerTest.cpp +++ lldb/trunk/tools/lldb-test/SystemInitializerTest.cpp @@ -14,7 +14,6 @@ #include "lldb/Initialization/SystemInitializerCommon.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Symbol/ClangASTContext.h" -#include "lldb/Symbol/OCamlASTContext.h" #include "lldb/Utility/Timer.h" #include "Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h" @@ -46,7 +45,6 @@ #include "Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h" #include "Plugins/JITLoader/GDB/JITLoaderGDB.h" #include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h" -#include "Plugins/Language/OCaml/OCamlLanguage.h" #include "Plugins/Language/ObjC/ObjCLanguage.h" #include "Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h" #include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h" @@ -144,7 +142,6 @@ llvm::InitializeAllDisassemblers(); ClangASTContext::Initialize(); - OCamlASTContext::Initialize(); ABIMacOSX_i386::Initialize(); ABIMacOSX_arm::Initialize(); @@ -192,7 +189,6 @@ CPlusPlusLanguage::Initialize(); ObjCLanguage::Initialize(); ObjCPlusPlusLanguage::Initialize(); - OCamlLanguage::Initialize(); #if defined(_WIN32) ProcessWindows::Initialize(); @@ -247,7 +243,6 @@ PluginManager::Terminate(); ClangASTContext::Terminate(); - OCamlASTContext::Terminate(); ABIMacOSX_i386::Terminate(); ABIMacOSX_arm::Terminate(); @@ -290,7 +285,6 @@ CPlusPlusLanguage::Terminate(); ObjCLanguage::Terminate(); ObjCPlusPlusLanguage::Terminate(); - OCamlLanguage::Terminate(); #if defined(__APPLE__) DynamicLoaderDarwinKernel::Terminate(); Index: lldb/trunk/source/API/SystemInitializerFull.cpp === --- lldb/trunk/source/API/SystemInitializerFull.cpp +++ lldb/trunk/source/API/SystemInitializerFull.cpp @@ -24,7 +24,6 @@ #include "lldb/Initialization/SystemInitializerCommon.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Symbol/ClangASTContext.h" -#include "lldb/Symbol/OCamlASTContext.h" #include "lldb/Utility/Timer.h" #include "Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h" @@ -56,7 +55,6 @@ #include "Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h" #include
[Lldb-commits] [lldb] r346159 - Remove OCaml debugger plugin
Author: jdevlieghere Date: Mon Nov 5 11:34:03 2018 New Revision: 346159 URL: http://llvm.org/viewvc/llvm-project?rev=346159=rev Log: Remove OCaml debugger plugin In January Davide sent an e-mail to the mailing list to suggest removing unmaintained language plugins such as Go and Java. The plan was to have some cool down period to allow users to speak up, however after that the plugins were never actually removed. This patch removes the OCaml debugger plugin. The plugin can be added again in the future if it is mature enough both in terms of testing and maintenance commitment. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2018-January/013171.html Differential revision: https://reviews.llvm.org/D54060 Removed: lldb/trunk/include/lldb/Symbol/OCamlASTContext.h lldb/trunk/source/Plugins/Language/OCaml/CMakeLists.txt lldb/trunk/source/Plugins/Language/OCaml/OCamlLanguage.cpp lldb/trunk/source/Plugins/Language/OCaml/OCamlLanguage.h lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.h lldb/trunk/source/Symbol/OCamlASTContext.cpp Modified: lldb/trunk/source/API/SystemInitializerFull.cpp lldb/trunk/source/Plugins/Language/CMakeLists.txt lldb/trunk/source/Plugins/SymbolFile/DWARF/CMakeLists.txt lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h lldb/trunk/source/Symbol/CMakeLists.txt lldb/trunk/tools/lldb-test/SystemInitializerTest.cpp lldb/trunk/unittests/Language/Highlighting/CMakeLists.txt lldb/trunk/unittests/Language/Highlighting/HighlighterTest.cpp Removed: lldb/trunk/include/lldb/Symbol/OCamlASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/OCamlASTContext.h?rev=346158=auto == --- lldb/trunk/include/lldb/Symbol/OCamlASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/OCamlASTContext.h (removed) @@ -1,314 +0,0 @@ -//===-- OCamlASTContext.h --*- C++ -//-*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===--===// - -#ifndef liblldb_OCamlASTContext_h_ -#define liblldb_OCamlASTContext_h_ - -// C Includes -// C++ Includes -#include -#include -#include -#include -#include - -// Other libraries and framework includes -// Project includes -#include "lldb/Symbol/CompilerType.h" -#include "lldb/Symbol/TypeSystem.h" -#include "lldb/Utility/ConstString.h" - -namespace lldb_private { - -class OCamlASTContext : public TypeSystem { -public: - class OCamlType; - typedef std::map> OCamlTypeMap; - - OCamlASTContext(); - ~OCamlASTContext() override; - - ConstString GetPluginName() override; - - uint32_t GetPluginVersion() override; - - static ConstString GetPluginNameStatic(); - - static lldb::TypeSystemSP CreateInstance(lldb::LanguageType language, - Module *module, Target *target); - - static void EnumerateSupportedLanguages( - std::set _for_types, - std::set _for_expressions); - - static void Initialize(); - - static void Terminate(); - - DWARFASTParser *GetDWARFParser() override; - - void SetAddressByteSize(int byte_size) { m_pointer_byte_size = byte_size; } - - static bool classof(const TypeSystem *ts) { -return ts->getKind() == TypeSystem::eKindOCaml; - } - - ConstString DeclGetName(void *opaque_decl) override { return ConstString(); } - - bool DeclContextIsStructUnionOrClass(void *opaque_decl_ctx) override { -return false; - } - - ConstString DeclContextGetName(void *opaque_decl_ctx) override { -return ConstString(); - } - - ConstString DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) override { -return ConstString(); - } - - bool - DeclContextIsClassMethod(void *opaque_decl_ctx, - lldb::LanguageType *language_ptr, - bool *is_instance_method_ptr, - ConstString *language_object_name_ptr) override { -return false; - } - - bool SupportsLanguage(lldb::LanguageType language) override; - uint32_t GetPointerByteSize() override; - - bool IsArrayType(lldb::opaque_compiler_type_t type, - CompilerType *element_type, uint64_t *size, - bool *is_incomplete) override; - - bool IsAggregateType(lldb::opaque_compiler_type_t type) override; - - bool IsCharType(lldb::opaque_compiler_type_t type) override; - - bool IsCompleteType(lldb::opaque_compiler_type_t type) override; - - bool IsDefined(lldb::opaque_compiler_type_t type) override; - - bool IsFloatingPointType(lldb::opaque_compiler_type_t type, uint32_t , - bool _complex) override; - -
Re: [Lldb-commits] [lldb] r346149 - Add a target modules dump ast command.
r346156. On Mon, Nov 5, 2018 at 11:09 AM Davide Italiano wrote: > On Mon, Nov 5, 2018 at 9:42 AM Zachary Turner via lldb-commits > wrote: > > > > Author: zturner > > Date: Mon Nov 5 09:40:28 2018 > > New Revision: 346149 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=346149=rev > > Log: > > 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. > > > > Zachary, this broke one of our bots > http://lab.llvm.org:8080/green/view/LLDB/job/lldb-cmake-clang-6.0.1/1275/ > > Can you please take a look? > > Thanks, > > -- > Davide > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r346156 - Properly cast from DeclContext to Decl.
Author: zturner Date: Mon Nov 5 11:25:39 2018 New Revision: 346156 URL: http://llvm.org/viewvc/llvm-project?rev=346156=rev Log: Properly cast from DeclContext to Decl. Apparently there's a special procedure for doing this. Not following this silently breaks builds. Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=346156=346155=346156=diff == --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Mon Nov 5 11:25:39 2018 @@ -194,10 +194,9 @@ public: uint32_t GetPointerByteSize() override; - static clang::TranslationUnitDecl * - GetTranslationUnitDecl(clang::ASTContext *ast); + static clang::DeclContext *GetTranslationUnitDecl(clang::ASTContext *ast); - clang::TranslationUnitDecl *GetTranslationUnitDecl() { + clang::DeclContext *GetTranslationUnitDecl() { return GetTranslationUnitDecl(getASTContext()); } Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=346156=346155=346156=diff == --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Mon Nov 5 11:25:39 2018 @@ -1285,7 +1285,7 @@ CompilerType ClangASTContext::GetCString return CompilerType(ast, ast->getPointerType(char_type)); } -clang::TranslationUnitDecl * +clang::DeclContext * ClangASTContext::GetTranslationUnitDecl(clang::ASTContext *ast) { return ast->getTranslationUnitDecl(); } @@ -8966,7 +8966,7 @@ ClangASTContext::ConvertStringToFloatVal #define DEPTH_INCREMENT 2 void ClangASTContext::Dump(Stream ) { - TranslationUnitDecl *tu = GetTranslationUnitDecl(); + Decl *tu = Decl::castFromDeclContext(GetTranslationUnitDecl()); tu->dump(s.AsRawOstream()); } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r346149 - Add a target modules dump ast command.
On Mon, Nov 5, 2018 at 9:42 AM Zachary Turner via lldb-commits wrote: > > Author: zturner > Date: Mon Nov 5 09:40:28 2018 > New Revision: 346149 > > URL: http://llvm.org/viewvc/llvm-project?rev=346149=rev > Log: > 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. > Zachary, this broke one of our bots http://lab.llvm.org:8080/green/view/LLDB/job/lldb-cmake-clang-6.0.1/1275/ Can you please take a look? Thanks, -- Davide ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D54074: CPlusPlusLanguage: Use new demangler API to implement type substitution
erik.pilkington added a comment. Looks good to me too, thanks! https://reviews.llvm.org/D54074 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D54056: Add SetAllowJIT (the SBExpressionOptions equivalent of "expression --allow-jit")
Thanks for doing this! Why do we care about the file name of the test, shouldn't we be using the test class name for everything (that one I did remember to change...) Jim > On Nov 3, 2018, at 11:18 PM, Jan Kratochvil via Phabricator > wrote: > > jankratochvil added a comment. > > In https://reviews.llvm.org/D54056#1286635, @davide wrote: > >> I don't think anybody will look at this until Monday, so if you want a quick >> fix you might consider renaming the test yourself. > > > Checked in as: https://reviews.llvm.org/rLLDB346089 > > > Repository: > rL LLVM > > https://reviews.llvm.org/D54056 > > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D54056: Add SetAllowJIT (the SBExpressionOptions equivalent of "expression --allow-jit")
jingham added a subscriber: aprantl. jingham added a comment. Thanks for doing this! Why do we care about the file name of the test, shouldn't we be using the test class name for everything (that one I did remember to change...) Jim Repository: rL LLVM https://reviews.llvm.org/D54056 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D54072: Add a command to dump a module's clang ast.
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rL346149: Add a target modules dump ast command. (authored by zturner, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D54072?vs=172510=172611#toc Repository: rL LLVM https://reviews.llvm.org/D54072 Files: lldb/trunk/include/lldb/Symbol/ClangASTContext.h lldb/trunk/include/lldb/Symbol/SymbolFile.h lldb/trunk/source/Commands/CommandObjectTarget.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h lldb/trunk/source/Symbol/ClangASTContext.cpp Index: lldb/trunk/source/Symbol/ClangASTContext.cpp === --- lldb/trunk/source/Symbol/ClangASTContext.cpp +++ lldb/trunk/source/Symbol/ClangASTContext.cpp @@ -1285,7 +1285,7 @@ return CompilerType(ast, ast->getPointerType(char_type)); } -clang::DeclContext * +clang::TranslationUnitDecl * ClangASTContext::GetTranslationUnitDecl(clang::ASTContext *ast) { return ast->getTranslationUnitDecl(); } @@ -8965,6 +8965,11 @@ //-- #define DEPTH_INCREMENT 2 +void ClangASTContext::Dump(Stream ) { + TranslationUnitDecl *tu = GetTranslationUnitDecl(); + tu->dump(s.AsRawOstream()); +} + void ClangASTContext::DumpValue( lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s, lldb::Format format, const DataExtractor , Index: lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h === --- lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h +++ lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h @@ -155,6 +155,8 @@ ClangASTContext () { return *m_clang; } ClangASTImporter () { return *m_importer; } + void DumpClangAST(Stream ) override; + private: size_t FindTypesByName(llvm::StringRef name, uint32_t max_matches, TypeMap ); Index: lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp === --- lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp +++ lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp @@ -1391,6 +1391,12 @@ return 0; } +void SymbolFileNativePDB::DumpClangAST(Stream ) { + if (!m_clang) +return; + m_clang->Dump(s); +} + uint32_t SymbolFileNativePDB::FindGlobalVariables( const ConstString , const CompilerDeclContext *parent_decl_ctx, uint32_t max_matches, VariableList ) { Index: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp === --- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp +++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp @@ -1356,6 +1356,14 @@ return types.GetSize(); } +void SymbolFilePDB::DumpClangAST(Stream ) { + auto type_system = GetTypeSystemForLanguage(lldb::eLanguageTypeC_plus_plus); + auto clang = llvm::dyn_cast_or_null(type_system); + if (!clang) +return; + clang->Dump(s); +} + void SymbolFilePDB::FindTypesByRegex( const lldb_private::RegularExpression , uint32_t max_matches, lldb_private::TypeMap ) { Index: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp === --- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp +++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp @@ -967,7 +967,7 @@ return child_context; // Split context and retrieve nested namespaces - auto curr_context = m_ast.GetTranslationUnitDecl(); + clang::DeclContext *curr_context = m_ast.GetTranslationUnitDecl(); std::string::size_type from = 0; while (from < context_size) { auto to = context.find("::", from); Index: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h === --- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h +++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h @@ -169,6 +169,8 @@ const llvm::pdb::IPDBSession () const; + void DumpClangAST(lldb_private::Stream ) override; + private: struct SecContribInfo {
[Lldb-commits] [PATCH] D54072: Add a command to dump a module's clang ast.
zturner added a comment. I updated the patch to not dump color. We can address the color issue in a followup. So for now it just goes to the result object's output stream. Perhaps we can add a `-c` option that ignores the result object's outptu stream (and is documented as doing so), but I'll save that for a followup https://reviews.llvm.org/D54072 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r346149 - Add a target modules dump ast command.
Author: zturner Date: Mon Nov 5 09:40:28 2018 New Revision: 346149 URL: http://llvm.org/viewvc/llvm-project?rev=346149=rev Log: 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 Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h lldb/trunk/include/lldb/Symbol/SymbolFile.h lldb/trunk/source/Commands/CommandObjectTarget.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=346149=346148=346149=diff == --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Mon Nov 5 09:40:28 2018 @@ -194,9 +194,10 @@ public: uint32_t GetPointerByteSize() override; - static clang::DeclContext *GetTranslationUnitDecl(clang::ASTContext *ast); + static clang::TranslationUnitDecl * + GetTranslationUnitDecl(clang::ASTContext *ast); - clang::DeclContext *GetTranslationUnitDecl() { + clang::TranslationUnitDecl *GetTranslationUnitDecl() { return GetTranslationUnitDecl(getASTContext()); } @@ -926,6 +927,8 @@ public: //-- // Dumping types //-- + void Dump(Stream ); + void DumpValue(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s, lldb::Format format, const DataExtractor , lldb::offset_t data_offset, size_t data_byte_size, Modified: lldb/trunk/include/lldb/Symbol/SymbolFile.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolFile.h?rev=346149=346148=346149=diff == --- lldb/trunk/include/lldb/Symbol/SymbolFile.h (original) +++ lldb/trunk/include/lldb/Symbol/SymbolFile.h Mon Nov 5 09:40:28 2018 @@ -161,6 +161,8 @@ public: uint32_t line, bool check_inlines, lldb::SymbolContextItem resolve_scope, SymbolContextList _list); + + virtual void DumpClangAST(Stream ) {} virtual uint32_t FindGlobalVariables(const ConstString , const CompilerDeclContext *parent_decl_ctx, Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=346149=346148=346149=diff == --- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Mon Nov 5 09:40:28 2018 @@ -2227,6 +2227,85 @@ protected: } }; +#pragma mark CommandObjectTargetModulesDumpSections + +//-- +// Clang AST dumping command +//-- + +class CommandObjectTargetModulesDumpClangAST +: public CommandObjectTargetModulesModuleAutoComplete { +public: + CommandObjectTargetModulesDumpClangAST(CommandInterpreter ) + : CommandObjectTargetModulesModuleAutoComplete( +interpreter, "target modules dump ast", +"Dump the clang ast for a given module's symbol file.", +//"target modules dump ast [ ...]") +nullptr) {} + + ~CommandObjectTargetModulesDumpClangAST() override = default; + +protected: + bool DoExecute(Args , CommandReturnObject ) override { +Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get(); +if (target == nullptr) { + result.AppendError("invalid target, create a debug target using the " + "'target create' command"); + result.SetStatus(eReturnStatusFailed); + return false; +} + +const size_t num_modules = target->GetImages().GetSize(); +if (num_modules == 0) { + result.AppendError("the target has no associated executable
[Lldb-commits] [PATCH] D54059: Remove Java debugger plugin
tberghammer added inline comments. Comment at: tools/lldb-test/SystemInitializerTest.cpp:194 SystemRuntimeMacOSX::Initialize(); RenderScriptRuntime::Initialize(); - JavaLanguageRuntime::Initialize(); davide wrote: > Aside, do you know why we have renderscript support? maybe that should go > away too. You should ask Stephen Hines (srhi...@google.com) about that one as he either know what is its status or know who to ask, https://reviews.llvm.org/D54059 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D54059: Remove Java debugger plugin
davide added inline comments. Comment at: tools/lldb-test/SystemInitializerTest.cpp:194 SystemRuntimeMacOSX::Initialize(); RenderScriptRuntime::Initialize(); - JavaLanguageRuntime::Initialize(); Aside, do you know why we have renderscript support? maybe that should go away too. https://reviews.llvm.org/D54059 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D54057: Remove Go debugger plugin
davide accepted this revision. davide added a comment. LGTM. Thanks for picking up the slack. https://reviews.llvm.org/D54057 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D54074: CPlusPlusLanguage: Use new demangler API to implement type substitution
sgraenitz accepted this revision. sgraenitz added a comment. This revision is now accepted and ready to land. Nice. For parameter lists of `reset` and `substitute` indentation could be fixed, but otherwise this looks really good to me. https://reviews.llvm.org/D54074 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D53530: Fix (and improve) the support for C99 variable length array types
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. Thanks for making the changes! https://reviews.llvm.org/D53530 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D54003: Refactor ClangASTContext::AddEnumerationValueToEnumerationType() to remove redundant parameter which can be calculated from other parameter
clayborg added a comment. LGTM. lldbassert to check that AST in "enum_type" is the same as "this" since we now can after switching to CompilerType as arg instead of opaque clang type pointer. Comment at: include/lldb/Symbol/ClangASTContext.h:909 clang::EnumConstantDecl *AddEnumerationValueToEnumerationType( - lldb::opaque_compiler_type_t type, - const CompilerType _qual_type, const Declaration , - const char *name, int64_t enum_value, uint32_t enum_value_bit_size); + const CompilerType enum_type, const Declaration , const char *name, + int64_t enum_value, uint32_t enum_value_bit_size); teemperor wrote: > Can we pass `enum_type` as const ref? CompilerType instances are two pointers. Pretty cheap to copy. Comment at: source/Symbol/ClangASTContext.cpp:8851 clang::EnumConstantDecl *ClangASTContext::AddEnumerationValueToEnumerationType( -lldb::opaque_compiler_type_t type, -const CompilerType _clang_type, const Declaration , -const char *name, int64_t enum_value, uint32_t enum_value_bit_size) { - if (type && enumerator_clang_type.IsValid() && name && name[0]) { -clang::QualType enum_qual_type(GetCanonicalQualType(type)); - -bool is_signed = false; -enumerator_clang_type.IsIntegerType(is_signed); -const clang::Type *clang_type = enum_qual_type.getTypePtr(); -if (clang_type) { - const clang::EnumType *enutype = - llvm::dyn_cast(clang_type); - - if (enutype) { -llvm::APSInt enum_llvm_apsint(enum_value_bit_size, is_signed); -enum_llvm_apsint = enum_value; -clang::EnumConstantDecl *enumerator_decl = -clang::EnumConstantDecl::Create( -*getASTContext(), enutype->getDecl(), clang::SourceLocation(), -name ? ()->Idents.get(name) - : nullptr, // Identifier -ClangUtil::GetQualType(enumerator_clang_type), -nullptr, enum_llvm_apsint); - -if (enumerator_decl) { - enutype->getDecl()->addDecl(enumerator_decl); +const CompilerType enum_type, const Declaration , const char *name, +int64_t enum_value, uint32_t enum_value_bit_size) { teemperor wrote: > (Same as above) Can we have `enum_type` as a const ref? CompilerType instances are two pointers. Pretty cheap to copy. Comment at: source/Symbol/ClangASTContext.cpp:8853 +int64_t enum_value, uint32_t enum_value_bit_size) { + + if (!enum_type || ConstString(name).IsEmpty()) lldbassert that the AST in "enum_type" is the same as "this"? https://reviews.llvm.org/D54003 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D53368: [Symbol] Search symbols with name and type in a symbol file
clayborg added a comment. So it depends on what code was retrieving the symbol table from the object file. Can you detail where this was happening? Repository: rLLDB LLDB https://reviews.llvm.org/D53368 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D51578: Contiguous .debug_info+.debug_types for D32167
clayborg added a comment. Just a few nits, but _very_ close. Comment at: source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h:65 typedef std::vector CompileUnitColl; + typedef std::unordered_map TypeSignatureMap; Use llvm::DenseMap here? Comment at: source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp:797 +DWARFCompileUnit *DWARFUnit::GetAsCompileUnit() { + if (GetUnitDIEOnly().Tag() == DW_TAG_compile_unit) +return static_cast(this); Should this just be "if (GetUnitDIEOnly().Tag() != DW_TAG_type_unit)"? Partial units and many others can be top level DIEs. Repository: rLLDB LLDB https://reviews.llvm.org/D51578 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D54074: CPlusPlusLanguage: Use new demangler API to implement type substitution
labath updated this revision to Diff 172583. labath added a comment. Thanks for the review. I think that creating the new BumpPtrAllocator every call doesn't matter much here, this function get's called only on a few symbols for each evaluated expression. However, it also wasn't too hard to reuse it (at least at the level of FindAlternateFunctionManglings), so I just did that. I also added a simple failure test for this function. https://reviews.llvm.org/D54074 Files: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp Index: unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp === --- unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp +++ unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp @@ -184,4 +184,5 @@ EXPECT_THAT(FindAlternate("_ZN1A1fEx"), Contains("_ZN1A1fEl")); EXPECT_THAT(FindAlternate("_ZN1A1fEy"), Contains("_ZN1A1fEm")); EXPECT_THAT(FindAlternate("_ZN1A1fEai"), Contains("_ZN1A1fEci")); + EXPECT_THAT(FindAlternate("_bogus"), IsEmpty()); } Index: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp === --- source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -21,7 +21,7 @@ // Other libraries and framework includes #include "llvm/ADT/StringRef.h" -#include "llvm/Demangle/Demangle.h" +#include "llvm/Demangle/ItaniumDemangle.h" // Project includes #include "lldb/Core/PluginManager.h" @@ -274,72 +274,74 @@ return false; } -/// Given a mangled function `mangled`, replace all the primitive function type -/// arguments of `search` with type `replace`. -static ConstString SubsPrimitiveParmItanium(llvm::StringRef mangled, -llvm::StringRef search, -llvm::StringRef replace) { - class PrimitiveParmSubs { -llvm::StringRef mangled; -llvm::StringRef search; -llvm::StringRef replace; -ptrdiff_t read_pos; -std::string output; -std::back_insert_iterator writer; +namespace { +class NodeAllocator { + llvm::BumpPtrAllocator Alloc; - public: -PrimitiveParmSubs(llvm::StringRef m, llvm::StringRef s, llvm::StringRef r) -: mangled(m), search(s), replace(r), read_pos(0), - writer(std::back_inserter(output)) {} - -void Substitute(llvm::StringRef tail) { - assert(tail.data() >= mangled.data() && - tail.data() < mangled.data() + mangled.size() && - "tail must point into range of mangled"); - - if (tail.startswith(search)) { -auto reader = mangled.begin() + read_pos; -ptrdiff_t read_len = tail.data() - (mangled.data() + read_pos); - -// First write the unmatched part of the original. Then write the -// replacement string. Finally skip the search string in the original. -writer = std::copy(reader, reader + read_len, writer); -writer = std::copy(replace.begin(), replace.end(), writer); -read_pos += read_len + search.size(); - } -} +public: + void reset() { Alloc.Reset(); } -ConstString Finalize() { - // If we did a substitution, write the remaining part of the original. - if (read_pos > 0) { -writer = std::copy(mangled.begin() + read_pos, mangled.end(), writer); -read_pos = mangled.size(); - } + template T *makeNode(Args &&... args) { +return new (Alloc.Allocate(sizeof(T), alignof(T))) +T(std::forward(args)...); + } - return ConstString(output); -} + void *allocateNodeArray(size_t sz) { +return Alloc.Allocate(sizeof(llvm::itanium_demangle::Node *) * sz, + alignof(llvm::itanium_demangle::Node *)); + } +}; + +/// Given a mangled function `Mangled`, replace all the primitive function type +/// arguments of `Search` with type `Replace`. +class TypeSubstitutor +: public llvm::itanium_demangle::AbstractManglingParser { + const char *Written; + llvm::StringRef Search; + llvm::StringRef Replace; + llvm::SmallString<128> Result; + bool Substituted; + + void reset(llvm::StringRef Mangled, llvm::StringRef Search, + llvm::StringRef Replace) { +AbstractManglingParser::reset(Mangled.begin(), Mangled.end()); +Written = Mangled.begin(); +this->Search = Search; +this->Replace = Replace; +Result.clear(); +Substituted = false; + } -static void Callback(void *context, const char *match) { - ((PrimitiveParmSubs *)context)->Substitute(llvm::StringRef(match)); -} - }; +public: + TypeSubstitutor() : AbstractManglingParser(nullptr, nullptr) {} + + ConstString substitute(llvm::StringRef Mangled, llvm::StringRef From, +llvm::StringRef To) { +Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE); - // The
[Lldb-commits] [PATCH] D54072: Add a command to dump a module's clang ast.
labath added a comment. If it comes down to choosing between colored output going to stderr and plain output going where it should, i'd go with the second option. The way I'd implement this to support both things is approximately this: - add color (`has_colors`, `changeColor` and friends) support to `Stream` class, same as `llvm::raw_ostream`. Apart from solving this problem, this will make the two classes more similar, making eventual llvm transition smoother. - the `raw_ostream` shim in the `Stream` class can just forward the relevant operations - make the colored-ness of StringStream configurable at construction time. When constructing the StringStream holding the command output, we would look at whether the final output supports colors (Raphael, would that be `Debugger.getUseColor()?`) or not, and initialize it appropriately. - as an alternative to previous step, it might be good to check how can look a It may be more work than you're ready to put into this right now, but it would be very cool nonetheless, as it would unlock colored output for all other commands (and I can think of a couple who could use that). The downside here is that this would require duplicating the ansi escape sequence code in raw_fd_ostream. However, I believe we already have a code for handling those, so that can hopefully be reused. https://reviews.llvm.org/D54072 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D54074: CPlusPlusLanguage: Use new demangler API to implement type substitution
sgraenitz added a comment. Hi Pavel, thanks for working on this. The code looks really great. I have no actual concerns about landing it like this. Two minor remarks: - We still have no coverage for substitution failures in `CPlusPlusLanguageTest.cpp` test case `FindAlternateFunctionManglings`. - We create a new `BumpPtrAllocator` for each `TypeSubstitutor::substitute()`, right? Well, the impact on performance is probably on a different order of magnitude than we are concerned about here. > This will allow us to remove the specialized hooks which were added to the > demangler to support this use case. Right, it bridged the time between removing FastDemangle from LLDB and getting the new ManglingParser in LLVM. IIUC this basically means reverting https://reviews.llvm.org/D50586. https://reviews.llvm.org/D54074 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D54060: Remove OCaml debugger plugin
tberghammer added a comment. I have no memory about the history/background of the OCaml plugin but no objection from my side. Repository: rLLDB LLDB https://reviews.llvm.org/D54060 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D54059: Remove Java debugger plugin
tberghammer accepted this revision. tberghammer added a comment. This revision is now accepted and ready to land. LGTM. Thank you for removing it. Comment at: source/Plugins/Process/minidump/MinidumpTypes.h:84 Token = 19, - JavascriptData = 20, SystemMemoryInfo = 21, This is JavaScript and not Java. Also I think this is a constant what is coming from the minidump spec so I would leave it even after we removed Java support from LLDB. Comment at: source/Plugins/Process/minidump/MinidumpTypes.h:155 EDSP = (1 << 7), - Java = (1 << 8), IWMMXT = (1 << 9), I think this is a constant what is coming from the minidump spec so I would leave it even after we removed Java support from LLDB https://reviews.llvm.org/D54059 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D54057: Remove Go debugger plugin
tberghammer added a reviewer: ribrdb. tberghammer accepted this revision. tberghammer added a comment. This revision is now accepted and ready to land. LGTM. Adding Ryan as a reviewer as he was the original implementer but I am not sure if his account (and the linked e-mail) is still active. https://reviews.llvm.org/D54057 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D51578: Contiguous .debug_info+.debug_types for D32167
jankratochvil updated this revision to Diff 172549. Repository: rLLDB LLDB https://reviews.llvm.org/D51578 Files: include/lldb/lldb-forward.h packages/Python/lldbsuite/test/lldbtest.py packages/Python/lldbsuite/test/make/Makefile.rules packages/Python/lldbsuite/test/plugins/builder_base.py packages/Python/lldbsuite/test/test_categories.py source/Plugins/SymbolFile/DWARF/CMakeLists.txt source/Plugins/SymbolFile/DWARF/DIERef.cpp source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp source/Plugins/SymbolFile/DWARF/DWARFFormValue.h source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.cpp source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.h source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp source/Plugins/SymbolFile/DWARF/DWARFUnit.h source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h === --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -242,6 +242,7 @@ const lldb_private::DWARFDataExtractor _debug_aranges_data(); const lldb_private::DWARFDataExtractor _debug_frame_data(); const lldb_private::DWARFDataExtractor _debug_info_data(); + const lldb_private::DWARFDataExtractor _raw_debug_info_data(); const lldb_private::DWARFDataExtractor _debug_line_data(); const lldb_private::DWARFDataExtractor _debug_line_str_data(); const lldb_private::DWARFDataExtractor _debug_macro_data(); @@ -251,7 +252,7 @@ const lldb_private::DWARFDataExtractor _debug_rnglists_data(); const lldb_private::DWARFDataExtractor _debug_str_data(); const lldb_private::DWARFDataExtractor _debug_str_offsets_data(); - const lldb_private::DWARFDataExtractor _debug_types_data(); + const lldb_private::DWARFDataExtractor _raw_debug_types_data(); const lldb_private::DWARFDataExtractor _apple_names_data(); const lldb_private::DWARFDataExtractor _apple_types_data(); const lldb_private::DWARFDataExtractor _apple_namespaces_data(); @@ -329,6 +330,10 @@ void Dump(lldb_private::Stream ) override; + uint64_t get_debug_types_offset() const { +return m_debug_info_concatenated_types_offset; + } + protected: typedef llvm::DenseMap DIEToTypePtr; @@ -475,7 +480,7 @@ DWARFDataSegment m_data_debug_addr; DWARFDataSegment m_data_debug_aranges; DWARFDataSegment m_data_debug_frame; - DWARFDataSegment m_data_debug_info; + DWARFDataSegment m_data_raw_debug_info; DWARFDataSegment m_data_debug_line; DWARFDataSegment m_data_debug_line_str; DWARFDataSegment m_data_debug_macro; @@ -485,13 +490,17 @@ DWARFDataSegment m_data_debug_rnglists; DWARFDataSegment m_data_debug_str; DWARFDataSegment m_data_debug_str_offsets; - DWARFDataSegment m_data_debug_types; + DWARFDataSegment m_data_raw_debug_types; DWARFDataSegment m_data_apple_names; DWARFDataSegment m_data_apple_types; DWARFDataSegment m_data_apple_namespaces; DWARFDataSegment m_data_apple_objc; DWARFDataSegment m_data_gnu_debugaltlink; + llvm::once_flag m_concatenated_data_once; + lldb_private::DWARFDataExtractor m_data_debug_info_concatenated; + uint64_t m_debug_info_concatenated_types_offset; + // The unique pointer items below are generated on demand if and when someone // accesses // them through a non const version of this class. Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp === --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -412,7 +412,7 @@ // when this class parses .o files to // contain the .o file index/ID m_debug_map_module_wp(), m_debug_map_symfile(NULL), m_data_debug_abbrev(), - m_data_debug_aranges(), m_data_debug_frame(), m_data_debug_info(), + m_data_debug_aranges(), m_data_debug_frame(), m_data_raw_debug_info(), m_data_debug_line(), m_data_debug_macro(), m_data_debug_loc(), m_data_debug_ranges(), m_data_debug_rnglists(), m_data_debug_str(), m_data_apple_names(), m_data_apple_types(), m_data_apple_namespaces(), @@ -506,20 +506,6 @@ if (section_list == NULL) return 0; -// On non Apple platforms we might have .debug_types debug info that is -// created by using "-fdebug-types-section". LLDB currently will try to -// load this debug info, but it causes crashes during debugging when types -// are missing since it doesn't know how to parse the info in the -// .debug_types type units. This
[Lldb-commits] [PATCH] D51578: Contiguous .debug_info+.debug_types for D32167
jankratochvil updated this revision to Diff 172548. jankratochvil retitled this revision from "DWARFConcatenatingDataExtractor for D32167" to "Contiguous .debug_info+.debug_types for D32167". jankratochvil edited the summary of this revision. Repository: rLLDB LLDB https://reviews.llvm.org/D51578 Files: include/lldb/lldb-forward.h packages/Python/lldbsuite/test/lldbtest.py packages/Python/lldbsuite/test/make/Makefile.rules packages/Python/lldbsuite/test/plugins/builder_base.py packages/Python/lldbsuite/test/test_categories.py source/Plugins/SymbolFile/DWARF/CMakeLists.txt source/Plugins/SymbolFile/DWARF/DIERef.cpp source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp source/Plugins/SymbolFile/DWARF/DWARFFormValue.h source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.cpp source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.h source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp source/Plugins/SymbolFile/DWARF/DWARFUnit.h source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h === --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -242,6 +242,7 @@ const lldb_private::DWARFDataExtractor _debug_aranges_data(); const lldb_private::DWARFDataExtractor _debug_frame_data(); const lldb_private::DWARFDataExtractor _debug_info_data(); + const lldb_private::DWARFDataExtractor _raw_debug_info_data(); const lldb_private::DWARFDataExtractor _debug_line_data(); const lldb_private::DWARFDataExtractor _debug_line_str_data(); const lldb_private::DWARFDataExtractor _debug_macro_data(); @@ -251,7 +252,7 @@ const lldb_private::DWARFDataExtractor _debug_rnglists_data(); const lldb_private::DWARFDataExtractor _debug_str_data(); const lldb_private::DWARFDataExtractor _debug_str_offsets_data(); - const lldb_private::DWARFDataExtractor _debug_types_data(); + const lldb_private::DWARFDataExtractor _raw_debug_types_data(); const lldb_private::DWARFDataExtractor _apple_names_data(); const lldb_private::DWARFDataExtractor _apple_types_data(); const lldb_private::DWARFDataExtractor _apple_namespaces_data(); @@ -329,6 +330,10 @@ void Dump(lldb_private::Stream ) override; + uint64_t get_debug_types_offset() const { +return m_debug_info_concatenated_types_offset; + } + protected: typedef llvm::DenseMap DIEToTypePtr; @@ -475,7 +480,7 @@ DWARFDataSegment m_data_debug_addr; DWARFDataSegment m_data_debug_aranges; DWARFDataSegment m_data_debug_frame; - DWARFDataSegment m_data_debug_info; + DWARFDataSegment m_data_raw_debug_info; DWARFDataSegment m_data_debug_line; DWARFDataSegment m_data_debug_line_str; DWARFDataSegment m_data_debug_macro; @@ -485,13 +490,17 @@ DWARFDataSegment m_data_debug_rnglists; DWARFDataSegment m_data_debug_str; DWARFDataSegment m_data_debug_str_offsets; - DWARFDataSegment m_data_debug_types; + DWARFDataSegment m_data_raw_debug_types; DWARFDataSegment m_data_apple_names; DWARFDataSegment m_data_apple_types; DWARFDataSegment m_data_apple_namespaces; DWARFDataSegment m_data_apple_objc; DWARFDataSegment m_data_gnu_debugaltlink; + llvm::once_flag m_concatenated_data_once; + lldb_private::DWARFDataExtractor m_data_debug_info_concatenated; + uint64_t m_debug_info_concatenated_types_offset; + // The unique pointer items below are generated on demand if and when someone // accesses // them through a non const version of this class. Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp === --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -412,7 +412,7 @@ // when this class parses .o files to // contain the .o file index/ID m_debug_map_module_wp(), m_debug_map_symfile(NULL), m_data_debug_abbrev(), - m_data_debug_aranges(), m_data_debug_frame(), m_data_debug_info(), + m_data_debug_aranges(), m_data_debug_frame(), m_data_raw_debug_info(), m_data_debug_line(), m_data_debug_macro(), m_data_debug_loc(), m_data_debug_ranges(), m_data_debug_rnglists(), m_data_debug_str(), m_data_apple_names(), m_data_apple_types(), m_data_apple_namespaces(), @@ -506,20 +506,6 @@ if (section_list == NULL) return 0; -// On non Apple platforms we might have .debug_types debug info that is -// created by using "-fdebug-types-section". LLDB currently will try to -