[Lldb-commits] [PATCH] D54221: Add setting to require hardware breakpoints.
labath added a comment. In https://reviews.llvm.org/D54221#1290638, @JDevlieghere wrote: > In https://reviews.llvm.org/D54221#1290572, @labath wrote: > > > I recall something about linux on arm having a magic unmodifiable (even by > > ptrace) page of memory, so this could be useful there too. However, it's > > not clear to me how a user is going to figure out that he needs to enable > > this setting. Would it make sense to automatically try setting a hardware > > breakpoint if software breakpoint fails? > > > My main concern would be that hardware breakpoints are a limited resource and > not something we want to make transparent to the user, because it's only a > matter of time before it fails. That is true, but on the other hand, you would only use hw breakpoints on those pieces of memory where you really need to instead of everywhere, which means (at least for the use case I have in mind) it be used very rarely. Of course, we would have to be careful do differentiate between reasons why setting a sw breakpoint failed (is it because the memory is RO, or some other reason like there is no memory at that address). However, with this approach, it's still not clear to me how will the user know that he has to enable this setting? Will he get some sort of an error pointing here when the sw breakpoint fails? Or will you just enable this setting by default for targets where you know this is an issue? https://reviews.llvm.org/D54221 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D54335: [CMake] Fix: add_host_subdirectory source/Host/macosx
teemperor accepted this revision. teemperor added a comment. This revision is now accepted and ready to land. LGTM, sorry for that! https://reviews.llvm.org/D54335 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D54272: Extract construction of DataBufferLLVM into FileSystem
labath accepted this revision. labath added a comment. This revision is now accepted and ready to land. Looks fine to me, I'd just ask you to consider shortening the method names a bit. Comment at: include/lldb/Host/FileSystem.h:119-122 + CreateDataBufferFromPath(const llvm::Twine &path, uint64_t size = 0, + uint64_t offset = 0); + std::shared_ptr + CreateDataBufferFromPath(const FileSpec &file_spec, uint64_t size = 0, Can we streamline these names? I don't think the `FromPath` part brings anything here when the method is on the filesystem class, as it's completely natural and expected for those methods to take paths. Maybe just `CreateDataBuffer` or `ToDataBuffer` Repository: rLLDB LLDB https://reviews.llvm.org/D54272 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r346466 - Revert "[FileSystem] Make use of FS in TildeExpressionResolver"
I think the right way to resolve this would be to move "StandardTildeExpressionResolver" into the host module. The non-standard TildeExpressionResolver is just an abstract class, so it does not need the filesystem. This way, anyone wanting to use the resolver can just depend on the interface, and the concrete class may not even have to be a public one as it the FileSystem can just vend the interface. Although, at this point it's a question whether we need the resolver class in the first place. It was introduced so we could mock/test resolution of paths with usernames in them. However that is something you will also need to do for the repro feature, so it may make sense to fold everything into the Filesystem class. On 09/11/18 02:59, Jonas Devlieghere via lldb-commits wrote: > Author: jdevlieghere > Date: Thu Nov 8 17:59:28 2018 > New Revision: 346466 > > URL: http://llvm.org/viewvc/llvm-project?rev=346466&view=rev > Log: > Revert "[FileSystem] Make use of FS in TildeExpressionResolver" > > The whole point of this change was making it possible to resolve paths > without depending on the FileSystem, which is not what I did here. Not > sure what I was thinking... > > Modified: > lldb/trunk/include/lldb/Host/FileSystem.h > lldb/trunk/include/lldb/Utility/TildeExpressionResolver.h > lldb/trunk/source/Commands/CommandCompletions.cpp > lldb/trunk/source/Host/common/FileSystem.cpp > lldb/trunk/source/Target/TargetList.cpp > lldb/trunk/source/Utility/TildeExpressionResolver.cpp > lldb/trunk/unittests/Host/FileSystemTest.cpp > lldb/trunk/unittests/Interpreter/TestCompletion.cpp > lldb/trunk/unittests/TestingSupport/MockTildeExpressionResolver.cpp > lldb/trunk/unittests/TestingSupport/MockTildeExpressionResolver.h > lldb/trunk/unittests/Utility/TildeExpressionResolverTest.cpp > > Modified: lldb/trunk/include/lldb/Host/FileSystem.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileSystem.h?rev=346466&r1=346465&r2=346466&view=diff > == > --- lldb/trunk/include/lldb/Host/FileSystem.h (original) > +++ lldb/trunk/include/lldb/Host/FileSystem.h Thu Nov 8 17:59:28 2018 > @@ -132,8 +132,7 @@ public: >void *callback_baton); > >std::error_code GetRealPath(const llvm::Twine &path, > - llvm::SmallVectorImpl &output, > - bool expand_tilde) const; > + llvm::SmallVectorImpl &output) const; > > private: >static llvm::Optional &InstanceImpl(); > > Modified: lldb/trunk/include/lldb/Utility/TildeExpressionResolver.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/TildeExpressionResolver.h?rev=346466&r1=346465&r2=346466&view=diff > == > --- lldb/trunk/include/lldb/Utility/TildeExpressionResolver.h (original) > +++ lldb/trunk/include/lldb/Utility/TildeExpressionResolver.h Thu Nov 8 > 17:59:28 2018 > @@ -18,10 +18,8 @@ template class SmallVectorI > } > > namespace lldb_private { > -class FileSystem; > class TildeExpressionResolver { > public: > - TildeExpressionResolver(FileSystem &fs) : m_fs(fs) {} >virtual ~TildeExpressionResolver(); > >/// Resolve a Tilde Expression contained according to bash rules. > @@ -54,20 +52,14 @@ public: >/// the username portion with the matched result. >bool ResolveFullPath(llvm::StringRef Expr, > llvm::SmallVectorImpl &Output); > - > -protected: > - FileSystem &m_fs; > }; > > class StandardTildeExpressionResolver : public TildeExpressionResolver { > public: > - StandardTildeExpressionResolver(FileSystem &fs) > - : TildeExpressionResolver(fs) {} > - >bool ResolveExact(llvm::StringRef Expr, > llvm::SmallVectorImpl &Output) override; >bool ResolvePartial(llvm::StringRef Expr, llvm::StringSet<> &Output) > override; > }; > -} // namespace lldb_private > +} > > #endif // #ifndef LLDB_UTILITY_TILDE_EXPRESSION_RESOLVER_H > > Modified: lldb/trunk/source/Commands/CommandCompletions.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandCompletions.cpp?rev=346466&r1=346465&r2=346466&view=diff > == > --- lldb/trunk/source/Commands/CommandCompletions.cpp (original) > +++ lldb/trunk/source/Commands/CommandCompletions.cpp Thu Nov 8 17:59:28 2018 > @@ -231,7 +231,7 @@ static int DiskFilesOrDirectories(const > static int DiskFilesOrDirectories(CompletionRequest &request, >bool only_directories) { >request.SetWordComplete(false); > - StandardTildeExpressionResolver resolver(FileSystem::Instance()); > + StandardTildeExpressionResolver resolver; >StringList matches; >DiskFilesOrDirectories(
[Lldb-commits] [lldb] r346598 - Extract construction of DataBufferLLVM into FileSystem
Author: jdevlieghere Date: Sat Nov 10 14:44:06 2018 New Revision: 346598 URL: http://llvm.org/viewvc/llvm-project?rev=346598&view=rev Log: Extract construction of DataBufferLLVM into FileSystem This moves construction of data buffers into the FileSystem class. Like some of the previous refactorings we don't translate the path yet because the functionality hasn't been landed in LLVM yet. Differential revision: https://reviews.llvm.org/D54272 Modified: lldb/trunk/include/lldb/Host/FileSystem.h lldb/trunk/include/lldb/Utility/DataBufferLLVM.h lldb/trunk/source/API/SBSection.cpp lldb/trunk/source/Commands/CommandObjectMemory.cpp lldb/trunk/source/Core/SourceManager.cpp lldb/trunk/source/Host/common/FileSystem.cpp lldb/trunk/source/Host/common/Host.cpp lldb/trunk/source/Host/linux/Host.cpp lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp lldb/trunk/source/Plugins/Process/minidump/ProcessMinidump.cpp lldb/trunk/source/Symbol/ObjectFile.cpp lldb/trunk/source/Utility/DataBufferLLVM.cpp lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp Modified: lldb/trunk/include/lldb/Host/FileSystem.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileSystem.h?rev=346598&r1=346597&r2=346598&view=diff == --- lldb/trunk/include/lldb/Host/FileSystem.h (original) +++ lldb/trunk/include/lldb/Host/FileSystem.h Sat Nov 10 14:44:06 2018 @@ -11,6 +11,7 @@ #define liblldb_Host_FileSystem_h #include "lldb/Host/File.h" +#include "lldb/Utility/DataBufferLLVM.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Status.h" @@ -94,6 +95,12 @@ public: bool IsDirectory(const llvm::Twine &path) const; /// @} + /// Returns whether the given path is local to the file system. + /// @{ + bool IsLocal(const FileSpec &file_spec) const; + bool IsLocal(const llvm::Twine &path) const; + /// @} + /// Make the given file path absolute. /// @{ std::error_code MakeAbsolute(llvm::SmallVectorImpl &path) const; @@ -106,6 +113,16 @@ public: void Resolve(FileSpec &file_spec); /// @} + Create memory buffer from path. + /// @{ + std::shared_ptr CreateDataBuffer(const llvm::Twine &path, + uint64_t size = 0, + uint64_t offset = 0); + std::shared_ptr CreateDataBuffer(const FileSpec &file_spec, + uint64_t size = 0, + uint64_t offset = 0); + /// @} + /// Call into the Host to see if it can help find the file. bool ResolveExecutableLocation(FileSpec &file_spec); Modified: lldb/trunk/include/lldb/Utility/DataBufferLLVM.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/DataBufferLLVM.h?rev=346598&r1=346597&r2=346598&view=diff == --- lldb/trunk/include/lldb/Utility/DataBufferLLVM.h (original) +++ lldb/trunk/include/lldb/Utility/DataBufferLLVM.h Sat Nov 10 14:44:06 2018 @@ -23,16 +23,11 @@ class Twine; namespace lldb_private { +class FileSystem; class DataBufferLLVM : public DataBuffer { public: ~DataBufferLLVM(); - static std::shared_ptr - CreateSliceFromPath(const llvm::Twine &Path, uint64_t Size, uint64_t Offset); - - static std::shared_ptr - CreateFromPath(const llvm::Twine &Path); - uint8_t *GetBytes() override; const uint8_t *GetBytes() const override; lldb::offset_t GetByteSize() const override; @@ -40,6 +35,7 @@ public: char *GetChars() { return reinterpret_cast(GetBytes()); } private: + friend FileSystem; /// Construct a DataBufferLLVM from \p Buffer. \p Buffer must be a valid /// pointer. explicit DataBufferLLVM(std::unique_ptr Buffer); Modified: lldb/trunk/source/API/SBSection.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBSection.cpp?rev=346598&r1=346597&r2=346598&view=diff == --- lldb/trunk/source/API/SBSection.cpp (original) +++ lldb/trunk/source/API/SBSection.cpp Sat Nov 10 14:44:06 2018 @@ -14,7 +14,6 @@ #include "lldb/Core/Section.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Utility/DataBuffer.h" -#include "lldb/Utility/DataBufferLLVM.h" #include "lldb/Utility/DataExtractor.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/StreamString.h" @@ -166,7 +165,7 @@ SBData SBSection::GetSectionDa
[Lldb-commits] [PATCH] D54272: Extract construction of DataBufferLLVM into FileSystem
This revision was automatically updated to reflect the committed changes. Closed by commit rL346598: Extract construction of DataBufferLLVM into FileSystem (authored by JDevlieghere, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D54272?vs=173216&id=173531#toc Repository: rL LLVM https://reviews.llvm.org/D54272 Files: lldb/trunk/include/lldb/Host/FileSystem.h lldb/trunk/include/lldb/Utility/DataBufferLLVM.h lldb/trunk/source/API/SBSection.cpp lldb/trunk/source/Commands/CommandObjectMemory.cpp lldb/trunk/source/Core/SourceManager.cpp lldb/trunk/source/Host/common/FileSystem.cpp lldb/trunk/source/Host/common/Host.cpp lldb/trunk/source/Host/linux/Host.cpp lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp lldb/trunk/source/Plugins/Process/minidump/ProcessMinidump.cpp lldb/trunk/source/Symbol/ObjectFile.cpp lldb/trunk/source/Utility/DataBufferLLVM.cpp lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp Index: lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp === --- lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp +++ lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp @@ -16,9 +16,9 @@ #include "Plugins/Process/minidump/RegisterContextMinidump_x86_64.h" #include "TestingSupport/TestUtilities.h" +#include "lldb/Host/FileSystem.h" #include "lldb/Target/MemoryRegionInfo.h" #include "lldb/Utility/ArchSpec.h" -#include "lldb/Utility/DataBufferLLVM.h" #include "lldb/Utility/DataExtractor.h" #include "lldb/Utility/FileSpec.h" #include "llvm/ADT/ArrayRef.h" @@ -38,9 +38,13 @@ class MinidumpParserTest : public testing::Test { public: + void SetUp() override { FileSystem::Initialize(); } + + void TearDown() override { FileSystem::Terminate(); } + void SetUpData(const char *minidump_filename) { std::string filename = GetInputFilePath(minidump_filename); -auto BufferPtr = DataBufferLLVM::CreateSliceFromPath(filename, -1, 0); +auto BufferPtr = FileSystem::Instance().CreateDataBuffer(filename, -1, 0); ASSERT_NE(BufferPtr, nullptr); llvm::Optional optional_parser = MinidumpParser::Create(BufferPtr); @@ -54,7 +58,7 @@ void InvalidMinidump(const char *minidump_filename, uint64_t load_size) { std::string filename = GetInputFilePath(minidump_filename); auto BufferPtr = -DataBufferLLVM::CreateSliceFromPath(filename, load_size, 0); +FileSystem::Instance().CreateDataBuffer(filename, load_size, 0); ASSERT_NE(BufferPtr, nullptr); llvm::Optional optional_parser = @@ -89,7 +93,7 @@ // after the thread count. SetUpData("thread-list-not-padded.dmp"); llvm::ArrayRef thread_list; - + thread_list = parser->GetThreads(); ASSERT_EQ(2UL, thread_list.size()); EXPECT_EQ(0x11223344UL, thread_list[0].thread_id); Index: lldb/trunk/source/API/SBSection.cpp === --- lldb/trunk/source/API/SBSection.cpp +++ lldb/trunk/source/API/SBSection.cpp @@ -14,7 +14,6 @@ #include "lldb/Core/Section.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Utility/DataBuffer.h" -#include "lldb/Utility/DataBufferLLVM.h" #include "lldb/Utility/DataExtractor.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/StreamString.h" @@ -166,7 +165,7 @@ else file_size = 0; } - auto data_buffer_sp = DataBufferLLVM::CreateSliceFromPath( + auto data_buffer_sp = FileSystem::Instance().CreateDataBuffer( objfile->GetFileSpec().GetPath(), file_size, file_offset); if (data_buffer_sp && data_buffer_sp->GetByteSize() > 0) { DataExtractorSP data_extractor_sp( Index: lldb/trunk/source/Core/SourceManager.cpp === --- lldb/trunk/source/Core/SourceManager.cpp +++ lldb/trunk/source/Core/SourceManager.cpp @@ -442,7 +442,7 @@ } if (m_mod_time != llvm::sys::TimePoint<>()) -m_data_sp = DataBufferLLVM::CreateFromPath(m_file_spec.GetPath()); +m_data_sp = FileSystem::Instance().CreateDataBuffer(m_file_spec); } uint32_t SourceManager::File::GetLineOffset(uint32_t line) { @@ -520,7 +520,7 @@ if (curr_mod_time != llvm::sys::TimePoint<>() && m_mod_time != curr_mod_time) { m_mod_time = curr_mod_time; -m_data_sp = DataBufferLLVM::CreateFromPath(m_file_spec.GetPath()); +m_data_sp = FileSystem::Instance().CreateDataBuffer(m_file_spec); m_offsets.clear
[Lldb-commits] [lldb] r346599 - Add missing include
Author: jdevlieghere Date: Sat Nov 10 14:54:44 2018 New Revision: 346599 URL: http://llvm.org/viewvc/llvm-project?rev=346599&view=rev Log: Add missing include Modified: lldb/trunk/source/Host/linux/Host.cpp Modified: lldb/trunk/source/Host/linux/Host.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/Host.cpp?rev=346599&r1=346598&r2=346599&view=diff == --- lldb/trunk/source/Host/linux/Host.cpp (original) +++ lldb/trunk/source/Host/linux/Host.cpp Sat Nov 10 14:54:44 2018 @@ -28,6 +28,7 @@ #include "lldb/Utility/Log.h" #include "lldb/Utility/Status.h" +#include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Host/linux/Support.h" ___ 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 173533. 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 &get_debug_aranges_data(); const lldb_private::DWARFDataExtractor &get_debug_frame_data(); const lldb_private::DWARFDataExtractor &get_debug_info_data(); + const lldb_private::DWARFDataExtractor &get_raw_debug_info_data(); const lldb_private::DWARFDataExtractor &get_debug_line_data(); const lldb_private::DWARFDataExtractor &get_debug_line_str_data(); const lldb_private::DWARFDataExtractor &get_debug_macro_data(); @@ -251,7 +252,7 @@ const lldb_private::DWARFDataExtractor &get_debug_rnglists_data(); const lldb_private::DWARFDataExtractor &get_debug_str_data(); const lldb_private::DWARFDataExtractor &get_debug_str_offsets_data(); - const lldb_private::DWARFDataExtractor &get_debug_types_data(); + const lldb_private::DWARFDataExtractor &get_raw_debug_types_data(); const lldb_private::DWARFDataExtractor &get_apple_names_data(); const lldb_private::DWARFDataExtractor &get_apple_types_data(); const lldb_private::DWARFDataExtractor &get_apple_namespaces_data(); @@ -331,6 +332,10 @@ void DumpClangAST(lldb_private::Stream &s) override; + uint64_t get_debug_types_offset() const { +return m_debug_info_concatenated_types_offset; + } + protected: typedef llvm::DenseMap DIEToTypePtr; @@ -477,7 +482,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; @@ -487,13 +492,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
[Lldb-commits] [PATCH] D51578: Contiguous .debug_info+.debug_types for D32167
jankratochvil marked 2 inline comments as done. jankratochvil added a comment. There is a `_dwarf` -> `_dwarf_type_units` regression for: `-f TestCppTypeLookup.test_namespace_only_dwarf_type_units` ./bin/clang -o 1 ../llvm-git/tools/lldb/packages/Python/lldbsuite/test/lang/cpp/type_lookup/main.cpp -g -fdebug-types-section;./bin/lldb -o 'settings set target.experimental.inject-local-vars false' -o 'target create "./1"' -o 'b 66' -o r -o 'p *((in_contains_type *)&i)' Expected: (lldb) p *((in_contains_type *)&i) error: use of undeclared identifier 'in_contains_type' error: expected expression Actual: (lldb) p *((in_contains_type *)&i) (in_contains_type) $0 = (aaa = 123) I will check it more. Comment at: source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h:65 typedef std::vector CompileUnitColl; + typedef std::unordered_map TypeSignatureMap; clayborg wrote: > Use llvm::DenseMap here? Yes, I agree that is a good idea - changed it (BTW this is your part of the patch). Comment at: source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp:797 +DWARFCompileUnit *DWARFUnit::GetAsCompileUnit() { + if (GetUnitDIEOnly().Tag() == DW_TAG_compile_unit) +return static_cast(this); clayborg wrote: > Should this just be "if (GetUnitDIEOnly().Tag() != DW_TAG_type_unit)"? > Partial units and many others can be top level DIEs. When you ask then I disagree. Currently `GetAsCompileUnit()` is used only for checking `DW_TAG_partial_unit::DW_AT_name` (from D11003) which is never present in files by DWZ tool. DWZ tool never puts DIEs referencing any code into `DW_TAG_partial_unit` so D11003 should not be needed; although DWZ intentionally sometimes uses `DW_TAG_partial_unit::DW_AT_stmt_list` but I haven't found when/how it could be useful. //> many others// Top level DIEs can be according to DWARF-5 7.5 just `DW_TAG_compile_unit`, `DW_TAG_partial_unit` or `DW_TAG_type_unit`. So personally I would keep `GetAsCompileUnit()` to do what its name exactly says. 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] D51578: Contiguous .debug_info+.debug_types for D32167
jankratochvil updated this revision to Diff 173535. jankratochvil marked 2 inline comments as done. 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 &get_debug_aranges_data(); const lldb_private::DWARFDataExtractor &get_debug_frame_data(); const lldb_private::DWARFDataExtractor &get_debug_info_data(); + const lldb_private::DWARFDataExtractor &get_raw_debug_info_data(); const lldb_private::DWARFDataExtractor &get_debug_line_data(); const lldb_private::DWARFDataExtractor &get_debug_line_str_data(); const lldb_private::DWARFDataExtractor &get_debug_macro_data(); @@ -251,7 +252,7 @@ const lldb_private::DWARFDataExtractor &get_debug_rnglists_data(); const lldb_private::DWARFDataExtractor &get_debug_str_data(); const lldb_private::DWARFDataExtractor &get_debug_str_offsets_data(); - const lldb_private::DWARFDataExtractor &get_debug_types_data(); + const lldb_private::DWARFDataExtractor &get_raw_debug_types_data(); const lldb_private::DWARFDataExtractor &get_apple_names_data(); const lldb_private::DWARFDataExtractor &get_apple_types_data(); const lldb_private::DWARFDataExtractor &get_apple_namespaces_data(); @@ -331,6 +332,10 @@ void DumpClangAST(lldb_private::Stream &s) override; + uint64_t get_debug_types_offset() const { +return m_debug_info_concatenated_types_offset; + } + protected: typedef llvm::DenseMap DIEToTypePtr; @@ -477,7 +482,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; @@ -487,13 +492,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 typ
[Lldb-commits] [PATCH] D54385: Remove comments after header includes.
vsk accepted this revision as: vsk. vsk added a comment. This revision is now accepted and ready to land. Thanks, lgtm. Repository: rLLDB LLDB https://reviews.llvm.org/D54385 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits