[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -53,6 +53,30 @@ class LLDB_API SBSaveCoreOptions { /// \return The output file spec. SBFileSpec GetOutputFile() const; + /// Add a thread to save in the core file. + /// + /// \param thread_id The thread ID to save. + void AddThread(lldb::tid_t thread_id); -

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
https://github.com/clayborg edited https://github.com/llvm/llvm-project/pull/100443 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -32,12 +33,21 @@ class SaveCoreOptions { void SetOutputFile(lldb_private::FileSpec file); const std::optional GetOutputFile() const; + void AddThread(lldb::tid_t tid); + bool RemoveThread(lldb::tid_t tid); + size_t GetNumThreads() const; + int64_t GetThreadAtIndex(s

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -53,6 +53,30 @@ class LLDB_API SBSaveCoreOptions { /// \return The output file spec. SBFileSpec GetOutputFile() const; + /// Add a thread to save in the core file. + /// + /// \param thread_id The thread ID to save. + void AddThread(lldb::tid_t thread_id); + + ///

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -46,8 +46,59 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +void SaveCoreOptions::AddThread(lldb::tid_t tid) { + if (m_threads_to_save.count(tid) == 0) +m_threads_to_save.emplace(tid); +} + +bool SaveCoreOptions::RemoveThread(lldb::tid_t tid) { + if (

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -46,8 +46,59 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +void SaveCoreOptions::AddThread(lldb::tid_t tid) { + if (m_threads_to_save.count(tid) == 0) +m_threads_to_save.emplace(tid); clayborg wrote: No need to check the count, and n

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -46,8 +46,59 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +void SaveCoreOptions::AddThread(lldb::tid_t tid) { + if (m_threads_to_save.count(tid) == 0) +m_threads_to_save.emplace(tid); +} + +bool SaveCoreOptions::RemoveThread(lldb::tid_t tid) { + if (

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -53,6 +53,30 @@ class LLDB_API SBSaveCoreOptions { /// \return The output file spec. SBFileSpec GetOutputFile() const; + /// Add a thread to save in the core file. + /// + /// \param thread_id The thread ID to save. + void AddThread(lldb::tid_t thread_id); + + ///

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -46,8 +46,59 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +void SaveCoreOptions::AddThread(lldb::tid_t tid) { + if (m_threads_to_save.count(tid) == 0) +m_threads_to_save.emplace(tid); +} + +bool SaveCoreOptions::RemoveThread(lldb::tid_t tid) { + if (

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -46,8 +46,59 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +void SaveCoreOptions::AddThread(lldb::tid_t tid) { + if (m_threads_to_save.count(tid) == 0) +m_threads_to_save.emplace(tid); +} + +bool SaveCoreOptions::RemoveThread(lldb::tid_t tid) { + if (

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -32,12 +33,21 @@ class SaveCoreOptions { void SetOutputFile(lldb_private::FileSpec file); const std::optional GetOutputFile() const; + void AddThread(lldb::tid_t tid); + bool RemoveThread(lldb::tid_t tid); + size_t GetNumThreads() const; + int64_t GetThreadAtIndex(s

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -46,8 +46,59 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +void SaveCoreOptions::AddThread(lldb::tid_t tid) { + if (m_threads_to_save.count(tid) == 0) +m_threads_to_save.emplace(tid); +} + +bool SaveCoreOptions::RemoveThread(lldb::tid_t tid) { + if (

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
https://github.com/clayborg requested changes to this pull request. https://github.com/llvm/llvm-project/pull/100443 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -6622,7 +6623,7 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp, LC_THREAD_data.SetByteOrder(byte_order); } for (uint32_t thread_idx = 0; thread_idx < num_threads; ++thread_idx) { - ThreadSP thread_sp(thread_list.GetThr

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -32,12 +33,24 @@ class SaveCoreOptions { void SetOutputFile(lldb_private::FileSpec file); const std::optional GetOutputFile() const; + Status SetProcess(lldb::ProcessSP process_sp); + + Status AddThread(lldb_private::Thread *thread); + bool RemoveThread(lldb_private:

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -6608,8 +6608,9 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp, mach_header.ncmds = segment_load_commands.size(); mach_header.flags = 0; mach_header.reserved = 0; -ThreadList &thread_list = process_sp->GetThreadList(); -

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -46,8 +48,79 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +Status SaveCoreOptions::SetProcess(lldb::ProcessSP process_sp) { + Status error; + if (!process_sp) { +ClearProcessSpecificData(); +m_process_sp = std::nullopt; clayborg

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -602,17 +603,17 @@ Status MinidumpFileBuilder::AddThreadList() { return error; llvm::support::ulittle32_t thread_count = - static_cast(thread_list.GetSize()); + static_cast(thread_list.size()); m_data.AppendData(&thread_count, sizeof(llvm::support::ulittl

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -46,8 +48,79 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +Status SaveCoreOptions::SetProcess(lldb::ProcessSP process_sp) { + Status error; + if (!process_sp) { +ClearProcessSpecificData(); +m_process_sp = std::nullopt; +return error; + } +

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -46,8 +48,79 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +Status SaveCoreOptions::SetProcess(lldb::ProcessSP process_sp) { + Status error; + if (!process_sp) { +ClearProcessSpecificData(); +m_process_sp = std::nullopt; +return error; + } +

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -53,6 +54,26 @@ class LLDB_API SBSaveCoreOptions { /// \return The output file spec. SBFileSpec GetOutputFile() const; + /// Set the process to save, or unset if supplied with a null process. + /// + /// \param process The process to save. + /// \return Success if p

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -46,8 +48,79 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +Status SaveCoreOptions::SetProcess(lldb::ProcessSP process_sp) { + Status error; + if (!process_sp) { +ClearProcessSpecificData(); +m_process_sp = std::nullopt; +return error; + } +

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -46,8 +48,79 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +Status SaveCoreOptions::SetProcess(lldb::ProcessSP process_sp) { + Status error; + if (!process_sp) { +ClearProcessSpecificData(); +m_process_sp = std::nullopt; +return error; + } +

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -6730,7 +6731,7 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp, StructuredData::ArraySP threads( std::make_shared()); for (uint32_t thread_idx = 0; thread_idx < num_threads; ++thread_idx) { - ThreadSP thread_sp(threa

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-24 Thread Greg Clayton via lldb-commits
@@ -602,17 +603,17 @@ Status MinidumpFileBuilder::AddThreadList() { return error; llvm::support::ulittle32_t thread_count = - static_cast(thread_list.GetSize()); + static_cast(thread_list.size()); m_data.AppendData(&thread_count, sizeof(llvm::support::ulittl

[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-07-25 Thread Greg Clayton via lldb-commits
@@ -158,7 +158,7 @@ class LLDB_API SBProcess { lldb::SBError Destroy(); - lldb::SBError Continue(); + lldb::SBError Continue(RunDirection direction = RunDirection::eRunForward); clayborg wrote: @jimingham: do you want all process control function to rema

[Lldb-commits] [lldb] [lldb] Tolerate multiple compile units with the same DWO ID (PR #100577)

2024-07-25 Thread Greg Clayton via lldb-commits
@@ -170,7 +170,7 @@ class DWARFUnit : public UserID { /// both cases correctly and avoids crashes. DWARFCompileUnit *GetSkeletonUnit(); - void SetSkeletonUnit(DWARFUnit *skeleton_unit); + bool LinkToSkeletonUnit(DWARFUnit &skeleton_unit); clayborg wrote:

[Lldb-commits] [lldb] [lldb] Tolerate multiple compile units with the same DWO ID (PR #100577)

2024-07-25 Thread Greg Clayton via lldb-commits
@@ -718,13 +720,11 @@ DWARFCompileUnit *DWARFUnit::GetSkeletonUnit() { return llvm::dyn_cast_or_null(m_skeleton_unit); } -void DWARFUnit::SetSkeletonUnit(DWARFUnit *skeleton_unit) { - // If someone is re-setting the skeleton compile unit backlink, make sure - // it is sett

[Lldb-commits] [lldb] [lldb] Refactor TypeQuery::ContextMatches (PR #99305)

2024-07-26 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: My main questions is do we actually use wildcards a lot? In normal type query matches, we can ask for exact matches where everything is specified, or the user types some string like `a::b::iterator` where we don't know what any of the items are. If exact

[Lldb-commits] [lldb] [lldb] Tolerate multiple compile units with the same DWO ID (PR #100577)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -170,7 +170,7 @@ class DWARFUnit : public UserID { /// both cases correctly and avoids crashes. DWARFCompileUnit *GetSkeletonUnit(); - void SetSkeletonUnit(DWARFUnit *skeleton_unit); + bool LinkToSkeletonUnit(DWARFUnit &skeleton_unit); clayborg wrote:

[Lldb-commits] [lldb] [lldb] Tolerate multiple compile units with the same DWO ID (PR #100577)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -718,13 +720,11 @@ DWARFCompileUnit *DWARFUnit::GetSkeletonUnit() { return llvm::dyn_cast_or_null(m_skeleton_unit); } -void DWARFUnit::SetSkeletonUnit(DWARFUnit *skeleton_unit) { - // If someone is re-setting the skeleton compile unit backlink, make sure - // it is sett

[Lldb-commits] [lldb] [lldb] Tolerate multiple compile units with the same DWO ID (PR #100577)

2024-07-26 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: All changes look good as is, just one inline question about maybe not setting the error if we detect the .dwo files are both empty (if it is possible to do). https://github.com/llvm/llvm-project/pull/100577 ___ l

[Lldb-commits] [lldb] [lldb] Tolerate multiple compile units with the same DWO ID (PR #100577)

2024-07-26 Thread Greg Clayton via lldb-commits
https://github.com/clayborg edited https://github.com/llvm/llvm-project/pull/100577 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Tolerate multiple compile units with the same DWO ID (PR #100577)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -97,12 +97,14 @@ void DWARFUnit::ExtractUnitDIEIfNeeded() { *m_dwo_id, m_first_die.GetOffset())); return; // Can't fetch the compile unit from the dwo file. } - // If the skeleton compile unit gets its unit DIE parsed first, then this - // will fill in the DW

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -6621,29 +6624,28 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp, LC_THREAD_data.SetAddressByteSize(addr_byte_size); LC_THREAD_data.SetByteOrder(byte_order); } -for (uint32_t thread_idx = 0; thread_idx < num_threads;

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -53,6 +54,27 @@ class LLDB_API SBSaveCoreOptions { /// \return The output file spec. SBFileSpec GetOutputFile() const; + /// Set the process to save, or unset if supplied with a null process. + /// + /// \param process The process to save. + /// \return Success if p

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -46,8 +48,79 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +Status SaveCoreOptions::SetProcess(lldb::ProcessSP process_sp) { + Status error; + if (!process_sp) { +ClearProcessSpecificData(); +m_process_sp = nullptr; clayborg wrote

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -6668,6 +6676,18 @@ Status Process::CalculateCoreFileSaveRanges(lldb::SaveCoreStyle core_style, return Status(); // Success! } +std::vector +Process::CalculateCoreFileThreadList(const SaveCoreOptions &core_options) { + std::vector thread_list; + for (const auto &thread

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -46,8 +48,79 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +Status SaveCoreOptions::SetProcess(lldb::ProcessSP process_sp) { + Status error; + if (!process_sp) { +ClearProcessSpecificData(); +m_process_sp = nullptr; +return error; + } + + if

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -6729,8 +6731,7 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp, std::make_shared()); StructuredData::ArraySP threads( std::make_shared()); -for (uint32_t thread_idx = 0; thread_idx < num_threads; ++thread_idx) { -

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -53,6 +54,27 @@ class LLDB_API SBSaveCoreOptions { /// \return The output file spec. SBFileSpec GetOutputFile() const; + /// Set the process to save, or unset if supplied with a null process. clayborg wrote: change `null process` to a `default constru

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -6621,29 +6624,28 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp, LC_THREAD_data.SetAddressByteSize(addr_byte_size); LC_THREAD_data.SetByteOrder(byte_order); } -for (uint32_t thread_idx = 0; thread_idx < num_threads;

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -46,8 +48,79 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +Status SaveCoreOptions::SetProcess(lldb::ProcessSP process_sp) { + Status error; + if (!process_sp) { +ClearProcessSpecificData(); +m_process_sp = nullptr; +return error; + } + + if

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -46,8 +48,79 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +Status SaveCoreOptions::SetProcess(lldb::ProcessSP process_sp) { + Status error; + if (!process_sp) { +ClearProcessSpecificData(); +m_process_sp = nullptr; +return error; + } + + if

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -46,8 +48,79 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +Status SaveCoreOptions::SetProcess(lldb::ProcessSP process_sp) { + Status error; + if (!process_sp) { +ClearProcessSpecificData(); +m_process_sp = nullptr; +return error; + } + + if

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -46,8 +46,59 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +void SaveCoreOptions::AddThread(lldb::tid_t tid) { + if (m_threads_to_save.count(tid) == 0) +m_threads_to_save.emplace(tid); +} + +bool SaveCoreOptions::RemoveThread(lldb::tid_t tid) { + if (

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -6608,8 +6610,9 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp, mach_header.ncmds = segment_load_commands.size(); mach_header.flags = 0; mach_header.reserved = 0; -ThreadList &thread_list = process_sp->GetThreadList(); -

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-07-26 Thread Greg Clayton via lldb-commits
@@ -26,3 +26,14 @@ def test_default_corestyle_behavior(self): """Test that the default core style is unspecified.""" options = lldb.SBSaveCoreOptions() self.assertEqual(options.GetStyle(), lldb.eSaveCoreUnspecified) + +def test_adding_and_removing_th

[Lldb-commits] [lldb] Improve ObjectFileELF files ability to load from memory. (PR #100900)

2024-07-27 Thread Greg Clayton via lldb-commits
https://github.com/clayborg created https://github.com/llvm/llvm-project/pull/100900 This is the first part in improving ELF core files in LLDB. This first patch teaches LLDB to get as much data as possible from an in memory ELF image where we don't have section headers mapped into the process

[Lldb-commits] [lldb] Improve ObjectFileELF files ability to load from memory. (PR #100900)

2024-07-27 Thread Greg Clayton via lldb-commits
clayborg wrote: If anyone knows any ELF file experts, please add them as reviewers https://github.com/llvm/llvm-project/pull/100900 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [LLDB] Improve ObjectFileELF files ability to load from memory. (PR #100900)

2024-07-29 Thread Greg Clayton via lldb-commits
clayborg wrote: ok, I will break this up to make it easier to review. https://github.com/llvm/llvm-project/pull/100900 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Fix ProcessMinidump::GetMemoryRegions to include 64b regions when /proc/pid maps are missing. (PR #101086)

2024-07-29 Thread Greg Clayton via lldb-commits
https://github.com/clayborg edited https://github.com/llvm/llvm-project/pull/101086 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Fix ProcessMinidump::GetMemoryRegions to include 64b regions when /proc/pid maps are missing. (PR #101086)

2024-07-29 Thread Greg Clayton via lldb-commits
@@ -104,6 +105,25 @@ using ModuleListStream = detail::ListStream; using ThreadListStream = detail::ListStream; using MemoryListStream = detail::ListStream; +/// Memory64ListStream minidump stream. +struct Memory64ListStream : public Stream { + std::vector Entries; + yaml::B

[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Fix ProcessMinidump::GetMemoryRegions to include 64b regions when /proc/pid maps are missing. (PR #101086)

2024-07-29 Thread Greg Clayton via lldb-commits
https://github.com/clayborg requested changes to this pull request. There must be some minidump yaml tests somewhere. We should add some to test the YAML support. Also need to test for multiple MemoryDescriptor_64 entries in a file using your new YAML. https://github.com/llvm/llvm-project/pull

[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Fix ProcessMinidump::GetMemoryRegions to include 64b regions when /proc/pid maps are missing. (PR #101086)

2024-07-29 Thread Greg Clayton via lldb-commits
@@ -154,3 +155,17 @@ MinidumpFile::create(MemoryBufferRef Source) { return std::unique_ptr( new MinidumpFile(Source, Hdr, *ExpectedStreams, std::move(StreamMap))); } + +Expected> MinidumpFile::getMemory64List() const { + Expected MemoryList64 = getMemoryList64Header()

[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Fix ProcessMinidump::GetMemoryRegions to include 64b regions when /proc/pid maps are missing. (PR #101086)

2024-07-29 Thread Greg Clayton via lldb-commits
@@ -154,3 +155,17 @@ MinidumpFile::create(MemoryBufferRef Source) { return std::unique_ptr( new MinidumpFile(Source, Hdr, *ExpectedStreams, std::move(StreamMap))); } + +Expected> MinidumpFile::getMemory64List() const { + Expected MemoryList64 = getMemoryList64Header()

[Lldb-commits] [lldb] Impove ObjectFileELF's .dynamic parsing and usage. (PR #101237)

2024-07-30 Thread Greg Clayton via lldb-commits
https://github.com/clayborg created https://github.com/llvm/llvm-project/pull/101237 This patch improves the ability of a ObjectFileELF instance to read the .dynamic section. It adds the ability to read the .dynamic section from a ELF file that is read from memory, cleans up the usage of the .

[Lldb-commits] [lldb] [LLDB] Improve ObjectFileELF files ability to load from memory. (PR #100900)

2024-07-30 Thread Greg Clayton via lldb-commits
https://github.com/clayborg closed https://github.com/llvm/llvm-project/pull/100900 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [LLDB] Improve ObjectFileELF files ability to load from memory. (PR #100900)

2024-07-30 Thread Greg Clayton via lldb-commits
clayborg wrote: I am going to split this up. New PR with just .dynamic changes is here: https://github.com/llvm/llvm-project/pull/101237 https://github.com/llvm/llvm-project/pull/100900 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https:/

[Lldb-commits] [lldb] [LLDB] Impove ObjectFileELF's .dynamic parsing and usage. (PR #101237)

2024-07-30 Thread Greg Clayton via lldb-commits
https://github.com/clayborg updated https://github.com/llvm/llvm-project/pull/101237 >From 6ef64acd518afe8bdc42c5042f35c857be96e3b4 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Tue, 30 Jul 2024 13:37:44 -0700 Subject: [PATCH 1/2] Impove ObjectFileELF's .dynamic parsing and usage. This pat

[Lldb-commits] [clang] [lldb] [llvm] [cmake][llvm] Limit the number of Xcode schemes created by default (PR #101243)

2024-07-30 Thread Greg Clayton via lldb-commits
clayborg wrote: Can we add a cmake settings that allows users to add custom target names that will be added? I would love to use this for my common projects like: ``` -DCMAKE_LLVM_XCODE_TARGETS=lldb;llvm-dwarfdump;llvm-gsymutil;lld ``` And it would add those top level targets? https://github.co

[Lldb-commits] [clang] [lldb] [llvm] [cmake][llvm] Limit the number of Xcode schemes created by default (PR #101243)

2024-07-30 Thread Greg Clayton via lldb-commits
clayborg wrote: Great! That will be very useful. https://github.com/llvm/llvm-project/pull/101243 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [clang] [lldb] [llvm] [cmake][llvm] Limit the number of Xcode schemes created by default (PR #101243)

2024-07-30 Thread Greg Clayton via lldb-commits
@@ -1423,3 +1423,11 @@ endif() if (LLVM_INCLUDE_UTILS AND LLVM_INCLUDE_TOOLS) add_subdirectory(utils/llvm-locstats) endif() + +if (XCODE) + set(LLVM_XCODE_EXTRA_TARGET_SCHEMES "" CACHE STRING "Specifies an extra list of targets to turn into schemes") claybo

[Lldb-commits] [lldb] [llvm] [Obj2Yaml] Add support for minidump generation with 64b memory ranges. (PR #101272)

2024-07-30 Thread Greg Clayton via lldb-commits
@@ -136,6 +136,22 @@ static size_t layout(BlobAllocator &File, MinidumpYAML::ExceptionStream &S) { return DataEnd; } +static size_t layout(BlobAllocator &File, MinidumpYAML::Memory64ListStream &S) { + size_t BaseRVA = File.tell() + sizeof(minidump::Memory64ListHeader); --

[Lldb-commits] [lldb] [llvm] [Obj2Yaml] Add support for minidump generation with 64b memory ranges. (PR #101272)

2024-07-30 Thread Greg Clayton via lldb-commits
@@ -336,3 +336,51 @@ TEST(MinidumpYAML, ExceptionStream_ExtraParameter) { 0xab, 0xad, 0xca, 0xfe}), *ExpectedContext); } + +TEST(MinidumpYAML, MemoryRegion_64bit) { + SmallString<0> Storage; + auto ExpectedFile = toBinary(Storage, R"

[Lldb-commits] [lldb] [llvm] [Obj2Yaml] Add support for minidump generation with 64b memory ranges. (PR #101272)

2024-07-30 Thread Greg Clayton via lldb-commits
@@ -336,3 +336,51 @@ TEST(MinidumpYAML, ExceptionStream_ExtraParameter) { 0xab, 0xad, 0xca, 0xfe}), *ExpectedContext); } + +TEST(MinidumpYAML, MemoryRegion_64bit) { + SmallString<0> Storage; + auto ExpectedFile = toBinary(Storage, R"

[Lldb-commits] [lldb] [llvm] [Obj2Yaml] Add support for minidump generation with 64b memory ranges. (PR #101272)

2024-07-30 Thread Greg Clayton via lldb-commits
@@ -152,15 +165,15 @@ class MinidumpFile : public Binary { } /// Return a slice of the given data array, with bounds checking. - static Expected> getDataSlice(ArrayRef Data, - size_t Offset, size_t Size); + static Expected

[Lldb-commits] [lldb] [llvm] [Obj2Yaml] Add support for minidump generation with 64b memory ranges. (PR #101272)

2024-07-30 Thread Greg Clayton via lldb-commits
clayborg wrote: Does look like this is working correctly: ``` $ minidump.py /tmp/md.dmp MINIDUMP_HEADER: Signature = 0x504d444d Version= 0xa793 NumberOfStreams= 0x0001 StreamDirectoryRva = 0x0020 CheckSum = 0x TimeDateStamp = 0x

[Lldb-commits] [lldb] [llvm] [Obj2Yaml] Add support for minidump generation with 64b memory ranges. (PR #101272)

2024-07-30 Thread Greg Clayton via lldb-commits
clayborg wrote: ``` 0x07fcf081828b - 0x07fcf0818283 = 8 (from MemoryRanges[0]) and there are only 5 bytes in the file's hexdump ``` So the data for MemoryRanges[1] will be off since it will think it starts at: ``` BaseRva + 8 = 0x5c + 8 = 0x0064 ``` And that points to the last 2 byte

[Lldb-commits] [lldb] [llvm] [Obj2Yaml] Add support for minidump generation with 64b memory ranges. (PR #101272)

2024-07-30 Thread Greg Clayton via lldb-commits
clayborg wrote: So the BaseRVA does look good, the memory range is being set to 8 bytes instead of 5 for each data. https://github.com/llvm/llvm-project/pull/101272 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[Lldb-commits] [lldb] [lldb] Allow mapping object file paths (PR #101361)

2024-07-31 Thread Greg Clayton via lldb-commits
https://github.com/clayborg approved this pull request. Looks good! This will be very useful for core files. https://github.com/llvm/llvm-project/pull/101361 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[Lldb-commits] [lldb] [LLDB] Impove ObjectFileELF's .dynamic parsing and usage. (PR #101237)

2024-08-01 Thread Greg Clayton via lldb-commits
@@ -3664,7 +3730,27 @@ llvm::ArrayRef ObjectFileELF::ProgramHeaders() { } DataExtractor ObjectFileELF::GetSegmentData(const ELFProgramHeader &H) { - return DataExtractor(m_data, H.p_offset, H.p_filesz); + // Try and read the program header from our cached m_data which can c

[Lldb-commits] [lldb] [LLDB] Impove ObjectFileELF's .dynamic parsing and usage. (PR #101237)

2024-08-01 Thread Greg Clayton via lldb-commits
@@ -3704,3 +3790,83 @@ ObjectFileELF::MapFileDataWritable(const FileSpec &file, uint64_t Size, return FileSystem::Instance().CreateWritableDataBuffer(file.GetPath(), Size, Offset); } + +std::optional ObjectFileELF::Get

[Lldb-commits] [lldb] [LLDB] Impove ObjectFileELF's .dynamic parsing and usage. (PR #101237)

2024-08-01 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,58 @@ +// REQUIRES: system-linux, native clayborg wrote: Adding support for memory ELF files is my primary concern with this patch as you know. Testing that in memory ELF files work as well as they can and that we can find the DT_DEBUG is the primary

[Lldb-commits] [lldb] [LLDB] Impove ObjectFileELF's .dynamic parsing and usage. (PR #101237)

2024-08-01 Thread Greg Clayton via lldb-commits
@@ -384,6 +392,9 @@ class ObjectFileELF : public lldb_private::ObjectFile { /// ELF dependent module dump routine. void DumpDependentModules(lldb_private::Stream *s); + /// ELF dump the .dynamic section + void DumpELFDynamic(lldb_private::Stream *s); cla

[Lldb-commits] [lldb] [LLDB] Impove ObjectFileELF's .dynamic parsing and usage. (PR #101237)

2024-08-01 Thread Greg Clayton via lldb-commits
https://github.com/clayborg updated https://github.com/llvm/llvm-project/pull/101237 >From f0cd3ef613b2da145b14a3d79d6810cc19e9b198 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Tue, 30 Jul 2024 13:37:44 -0700 Subject: [PATCH 1/3] Impove ObjectFileELF's .dynamic parsing and usage. This pat

[Lldb-commits] [lldb] [LLDB] Impove ObjectFileELF's .dynamic parsing and usage. (PR #101237)

2024-08-01 Thread Greg Clayton via lldb-commits
https://github.com/clayborg updated https://github.com/llvm/llvm-project/pull/101237 >From f0cd3ef613b2da145b14a3d79d6810cc19e9b198 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Tue, 30 Jul 2024 13:37:44 -0700 Subject: [PATCH 1/4] Impove ObjectFileELF's .dynamic parsing and usage. This pat

[Lldb-commits] [lldb] [llvm] [Obj2Yaml] Add support for minidump generation with 64b memory ranges. (PR #101272)

2024-08-01 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: Code looks fine to me now. I will let Pavel give the final OK as I don't know much about the YAML layering in LLVM. https://github.com/llvm/llvm-project/pull/101272 ___ lldb-commits mailing list lldb-commits@list

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-08-01 Thread Greg Clayton via lldb-commits
@@ -10,6 +10,7 @@ #define LLDB_API_SBSAVECOREOPTIONS_H #include "lldb/API/SBDefines.h" +#include "lldb/API/SBThread.h" clayborg wrote: probably should include SBProcess.h here as well since we are using it. https://github.com/llvm/llvm-project/pull/100443 __

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-08-01 Thread Greg Clayton via lldb-commits
https://github.com/clayborg requested changes to this pull request. https://github.com/llvm/llvm-project/pull/100443 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-08-01 Thread Greg Clayton via lldb-commits
@@ -9,6 +9,8 @@ #include "lldb/API/SBSaveCoreOptions.h" #include "lldb/API/SBError.h" #include "lldb/API/SBFileSpec.h" +#include "lldb/API/SBProcess.h" +#include "lldb/API/SBThread.h" clayborg wrote: remove these, they are in the `SBSaveCoreOptions.h` header f

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-08-01 Thread Greg Clayton via lldb-commits
@@ -46,8 +48,83 @@ SaveCoreOptions::GetOutputFile() const { return m_file; } +Status SaveCoreOptions::SetProcess(lldb::ProcessSP process_sp) { + Status error; + if (!process_sp) { +ClearProcessSpecificData(); +m_process_sp.reset(); +return error; + } + + if (

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-08-01 Thread Greg Clayton via lldb-commits
@@ -255,6 +256,8 @@ class LLDB_API SBThread { lldb::ExecutionContextRefSP m_opaque_sp; + lldb::ThreadSP get_sp() const; clayborg wrote: Rename to GetSP to match what is in SBProcess. I saw code below that calls these accessors in lldb/source/API/SBSaveCo

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-08-02 Thread Greg Clayton via lldb-commits
@@ -32,13 +33,25 @@ class SaveCoreOptions { void SetOutputFile(lldb_private::FileSpec file); const std::optional GetOutputFile() const; + Status SetProcess(lldb::ProcessSP process_sp); + + Status AddThread(lldb::ThreadSP thread_sp); + bool RemoveThread(lldb::ThreadSP th

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-08-02 Thread Greg Clayton via lldb-commits
https://github.com/clayborg edited https://github.com/llvm/llvm-project/pull/100443 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Implement a selectable threadlist for Core Options. (PR #100443)

2024-08-02 Thread Greg Clayton via lldb-commits
https://github.com/clayborg approved this pull request. Do the variable rename and all good https://github.com/llvm/llvm-project/pull/100443 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Fix bug where default values are not propagated. (PR #101770)

2024-08-02 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: Might actually be nice to make the SaveCoreOptions non const. Why? Because clients could see what the settings were set to if a plug-in modifies or overrides certain settings. https://github.com/llvm/llvm-project/pull/101770 __

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Fix bug where default values are not propagated. (PR #101770)

2024-08-02 Thread Greg Clayton via lldb-commits
https://github.com/clayborg approved this pull request. https://github.com/llvm/llvm-project/pull/101770 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Fix bug where default values are not propagated. (PR #101770)

2024-08-05 Thread Greg Clayton via lldb-commits
clayborg wrote: > @hokein Can you share the build command you got to trigger the above msan > error? I'm having trouble reproducing your issue And was your build using msan? or just a regular build? I can see a msan build fail to create a core file due to it crashing, and then you might see th

[Lldb-commits] [lldb] [lldb/Plugins] Introduce Scripted Platform Plugin (PR #99814)

2024-08-05 Thread Greg Clayton via lldb-commits
@@ -29,3 +29,15 @@ and executable type. If the architecture or executable type do not match, a suitable platform will be found automatically." ) lldb::SBPlatform; + +%feature("docstring", " +Create a platform instance using a specific platform plugin name, debugger, +script n

[Lldb-commits] [lldb] [lldb/Plugins] Introduce Scripted Platform Plugin (PR #99814)

2024-08-05 Thread Greg Clayton via lldb-commits
@@ -180,7 +184,19 @@ class CommandObjectPlatformSelect : public CommandObjectParsed { m_interpreter, ArchSpec(), select, error, platform_arch)); if (platform_sp) { GetDebugger().GetPlatformList().SetSelectedPlatform(platform_sp); - + Opti

[Lldb-commits] [lldb] [lldb/Plugins] Introduce Scripted Platform Plugin (PR #99814)

2024-08-05 Thread Greg Clayton via lldb-commits
@@ -100,6 +99,9 @@ class LLDB_API SBPlatform { SBPlatform(const char *platform_name); + SBPlatform(const char *platform_name, const SBDebugger &debugger, + const char *script_name, const SBStructuredData &dict); + clayborg wrote: is `script_na

[Lldb-commits] [lldb] [lldb/Plugins] Introduce Scripted Platform Plugin (PR #99814)

2024-08-05 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,108 @@ +""" +Test python scripted platform in lldb +""" + +import os, shutil + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil +from lldbsuite.test import lldbtest + + +class ScriptedPlatf

[Lldb-commits] [lldb] [lldb/Plugins] Introduce Scripted Platform Plugin (PR #99814)

2024-08-05 Thread Greg Clayton via lldb-commits
@@ -111,6 +111,7 @@ class SBStructuredData { protected: friend class SBAttachInfo; friend class SBLaunchInfo; + friend class SBPlatform; friend class SBDebugger; friend class SBTarget; friend class SBProcess; clayborg wrote: We keep friending new

[Lldb-commits] [lldb] [lldb/Plugins] Introduce Scripted Platform Plugin (PR #99814)

2024-08-05 Thread Greg Clayton via lldb-commits
@@ -6,20 +6,27 @@ class MyScriptedPlatform(ScriptedPlatform): def __init__(self, exe_ctx, args): -self.processes = {} - -proc = {} -proc["name"] = "a.out" -proc["arch"] = "arm64-apple-macosx" -proc["pid"] = 420 -proc["parent"

[Lldb-commits] [lldb] Make sure that a `Progress` "completed" update is always reported at destruction (PR #102097)

2024-08-05 Thread Greg Clayton via lldb-commits
clayborg wrote: Was this why we saw some Swift progress dialogs hanging around forever? Looks ok to me. @JDevlieghere feel free to add any more reviewers that have been working on progress dialogs. https://github.com/llvm/llvm-project/pull/102097 ___

[Lldb-commits] [lldb] [LLDB] Impove ObjectFileELF's .dynamic parsing and usage. (PR #101237)

2024-08-05 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,58 @@ +// REQUIRES: system-linux, native clayborg wrote: I added a test with an on disk file https://github.com/llvm/llvm-project/pull/101237 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https:/

[Lldb-commits] [lldb] [lldb] Better matching of types in anonymous namespaces (PR #102111)

2024-08-07 Thread Greg Clayton via lldb-commits
https://github.com/clayborg edited https://github.com/llvm/llvm-project/pull/102111 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Better matching of types in anonymous namespaces (PR #102111)

2024-08-07 Thread Greg Clayton via lldb-commits
@@ -134,6 +134,20 @@ bool TypeQuery::ContextMatches( if (ctx == ctx_end) return false; // Pattern too long. +if (ctx->kind == CompilerContextKind::Namespace && ctx->name.IsEmpty()) { clayborg wrote: Do we need to check for `"(anonymous namespace

[Lldb-commits] [lldb] [lldb] Better matching of types in anonymous namespaces (PR #102111)

2024-08-07 Thread Greg Clayton via lldb-commits
@@ -440,12 +440,6 @@ static void GetTypeLookupContextImpl(DWARFDIE die, continue; } -// If there is no name, then there is no need to look anything up for this -// DIE. -const char *name = die.GetName(); -if (!name || !name[0]) - return; - --

<    8   9   10   11   12   13   14   15   16   17   >