[Lldb-commits] [lldb] [lldb] Remove some unused code in SymbolFileDWARF::ResolveFunction (PR #123206)

2025-01-29 Thread Greg Clayton via lldb-commits
https://github.com/clayborg approved this pull request. Want to add a [NFC] to the title as well? https://github.com/llvm/llvm-project/pull/123206 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[Lldb-commits] [lldb] [LLDB-DAP] SBDebugger don't prefix title on progress updates (PR #124648)

2025-01-27 Thread Greg Clayton via lldb-commits
@@ -44,12 +44,16 @@ class ProgressEventData : public EventData { uint64_t GetCompleted() const { return m_completed; } uint64_t GetTotal() const { return m_total; } std::string GetMessage() const { -std::string message = m_title; -if (!m_details.empty()) { -

[Lldb-commits] [lldb] [LLDB-DAP] SBDebugger don't prefix title on progress updates (PR #124648)

2025-01-27 Thread Greg Clayton via lldb-commits
@@ -44,12 +44,16 @@ class ProgressEventData : public EventData { uint64_t GetCompleted() const { return m_completed; } uint64_t GetTotal() const { return m_total; } std::string GetMessage() const { -std::string message = m_title; -if (!m_details.empty()) { -

[Lldb-commits] [lldb] [LLDB-DAP] SBDebugger don't prefix title on progress updates (PR #124648)

2025-01-27 Thread Greg Clayton via lldb-commits
@@ -44,12 +44,16 @@ class ProgressEventData : public EventData { uint64_t GetCompleted() const { return m_completed; } uint64_t GetTotal() const { return m_total; } std::string GetMessage() const { -std::string message = m_title; -if (!m_details.empty()) { -

[Lldb-commits] [lldb] [LLDB-DAP] SBDebugger don't prefix title on progress updates (PR #124648)

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

[Lldb-commits] [lldb] [LLDB][NFC] Calculate the region size of an in memory image if size isn't specified (PR #123148)

2025-01-22 Thread Greg Clayton via lldb-commits
clayborg wrote: > The reason this code looks the way it does is that we've had crashes when > trying to read corrupted elf files from memory, where we load the size of the > elf file from the process memory, find that out that it's size is 935872395 > GB, try to allocate a host buffer of that

[Lldb-commits] [lldb] [LLDB] Make the thread list for SBSaveCoreOptions iterable (PR #122541)

2025-01-16 Thread Greg Clayton via lldb-commits
https://github.com/clayborg approved this pull request. https://github.com/llvm/llvm-project/pull/122541 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [LLDB][NFC] Calculate the region size of an in memory image if size isn't specified (PR #123148)

2025-01-15 Thread Greg Clayton via lldb-commits
https://github.com/clayborg created https://github.com/llvm/llvm-project/pull/123148 This patch cleans up some code and allows users to not have to specify a size and now get a more realistic value when reading modules from memory. This patch is in preparation for starting to have the dynamic

[Lldb-commits] [lldb] [lldb] Fix std::unordered_* synthetic children when typedefs are used. (PR #123125)

2025-01-15 Thread Greg Clayton via lldb-commits
https://github.com/clayborg closed https://github.com/llvm/llvm-project/pull/123125 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fix std::unordered_* synthetic children when typedefs are used. (PR #123125)

2025-01-15 Thread Greg Clayton via lldb-commits
https://github.com/clayborg created https://github.com/llvm/llvm-project/pull/123125 There was a bug in both the GNU and libc++ library synthetic child providers when a typedef was used in the type of the variable. Previous code was looking at the top level typename to try and determine if std

[Lldb-commits] [lldb] [lldb] Fix std::unordered_* synthetic children when typedefs are used. (PR #123125)

2025-01-15 Thread Greg Clayton via lldb-commits
clayborg wrote: Going to give others time to give feedback before merging. https://github.com/llvm/llvm-project/pull/123125 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][NFC] Make the target's SectionLoadList private. (PR #113278)

2025-01-14 Thread Greg Clayton via lldb-commits
https://github.com/clayborg closed https://github.com/llvm/llvm-project/pull/113278 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [llvm] Debuginfod cache use index cache settings and include real file name (PR #120814)

2025-01-10 Thread Greg Clayton via lldb-commits
@@ -141,6 +142,25 @@ SymbolLocator *SymbolLocatorDebuginfod::CreateInstance() { return new SymbolLocatorDebuginfod(); } +static llvm::StringRef getFileName(const ModuleSpec &module_spec, + std::string url_path) { + // Check if the URL path

[Lldb-commits] [lldb] [llvm] Debuginfod cache use index cache settings and include real file name (PR #120814)

2025-01-10 Thread Greg Clayton via lldb-commits
@@ -141,6 +142,25 @@ SymbolLocator *SymbolLocatorDebuginfod::CreateInstance() { return new SymbolLocatorDebuginfod(); } +static llvm::StringRef getFileName(const ModuleSpec &module_spec, + std::string url_path) { + // Check if the URL path

[Lldb-commits] [lldb] [llvm] Debuginfod cache use index cache settings and include real file name (PR #120814)

2025-01-10 Thread Greg Clayton via lldb-commits
@@ -154,21 +174,29 @@ GetFileForModule(const ModuleSpec &module_spec, // Grab LLDB's Debuginfod overrides from the // plugin.symbol-locator.debuginfod.* settings. PluginProperties &plugin_props = GetGlobalPluginProperties(); - llvm::Expected cache_path_or_err = plugin_pr

[Lldb-commits] [lldb] [llvm] Debuginfod cache use index cache settings and include real file name (PR #120814)

2025-01-10 Thread Greg Clayton via lldb-commits
https://github.com/clayborg approved this pull request. Just fix removing {} from single line if statements. https://github.com/llvm/llvm-project/pull/120814 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[Lldb-commits] [lldb] [llvm] Debuginfod cache use index cache settings and include real file name (PR #120814)

2025-01-10 Thread Greg Clayton via lldb-commits
https://github.com/clayborg edited https://github.com/llvm/llvm-project/pull/120814 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [LLDB] Make the thread list for SBSaveCoreOptions iterable (PR #122541)

2025-01-10 Thread Greg Clayton via lldb-commits
@@ -56,7 +57,7 @@ class SaveCoreOptions { std::optional m_file; std::optional m_style; lldb::ProcessSP m_process_sp; - std::unordered_set m_threads_to_save; + std::unordered_map m_threads_to_save; clayborg wrote: You can remove this change right? You c

[Lldb-commits] [lldb] [LLDB] Make the thread list for SBSaveCoreOptions iterable (PR #122541)

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

[Lldb-commits] [lldb] [LLDB] Make the thread list for SBSaveCoreOptions iterable (PR #122541)

2025-01-10 Thread Greg Clayton via lldb-commits
@@ -47,6 +46,9 @@ class SaveCoreOptions { void AddMemoryRegionToSave(const lldb_private::MemoryRegionInfo ®ion); + std::optional GetThreadAtIndex(uint32_t idx) const; clayborg wrote: We don't need optional if `lldb::ThreadSP` is what is returned, just ret

[Lldb-commits] [lldb] [LLDB] Make the thread list for SBSaveCoreOptions iterable (PR #122541)

2025-01-10 Thread Greg Clayton via lldb-commits
@@ -111,6 +111,21 @@ class LLDB_API SBSaveCoreOptions { /// style specific regions. SBError AddMemoryRegionToSave(const SBMemoryRegionInfo ®ion); + /// Get the number of Threads to be saved + /// + /// \returns + /// The count of Threads to be saved. + uint32_t Get

[Lldb-commits] [lldb] [LLDB] Make the thread list for SBSaveCoreOptions iterable (PR #122541)

2025-01-10 Thread Greg Clayton via lldb-commits
@@ -87,12 +87,33 @@ Status SaveCoreOptions::AddThread(lldb::ThreadSP thread_sp) { m_process_sp = thread_sp->GetProcess(); } - m_threads_to_save.insert(thread_sp->GetID()); + m_threads_to_save.insert({thread_sp->GetID(), thread_sp}); + m_thread_indexes.push_back(threa

[Lldb-commits] [lldb] [LLDB] Make the thread list for SBSaveCoreOptions iterable (PR #122541)

2025-01-10 Thread Greg Clayton via lldb-commits
@@ -100,6 +100,19 @@ SBSaveCoreOptions::AddMemoryRegionToSave(const SBMemoryRegionInfo ®ion) { return SBError(); } +uint32_t lldb::SBSaveCoreOptions::GetNumThreads() const { + LLDB_INSTRUMENT_VA(this); + return m_opaque_up->GetNumThreads(); +} + +SBThread SBSaveCoreOption

[Lldb-commits] [lldb] [LLDB] Make the thread list for SBSaveCoreOptions iterable (PR #122541)

2025-01-10 Thread Greg Clayton via lldb-commits
@@ -111,6 +111,21 @@ class LLDB_API SBSaveCoreOptions { /// style specific regions. SBError AddMemoryRegionToSave(const SBMemoryRegionInfo ®ion); + /// Get the number of Threads to be saved + /// + /// \returns + /// The count of Threads to be saved. + uint32_t Get

[Lldb-commits] [lldb] [LLDB] Make the thread list for SBSaveCoreOptions iterable (PR #122541)

2025-01-10 Thread Greg Clayton via lldb-commits
@@ -56,8 +58,10 @@ class SaveCoreOptions { std::optional m_file; std::optional m_style; lldb::ProcessSP m_process_sp; - std::unordered_set m_threads_to_save; + std::unordered_map m_threads_to_save; clayborg wrote: Not sure if we need this complexity of

[Lldb-commits] [lldb] [LLDB] Make the thread list for SBSaveCoreOptions iterable (PR #122541)

2025-01-10 Thread Greg Clayton via lldb-commits
@@ -87,12 +87,33 @@ Status SaveCoreOptions::AddThread(lldb::ThreadSP thread_sp) { m_process_sp = thread_sp->GetProcess(); } - m_threads_to_save.insert(thread_sp->GetID()); + m_threads_to_save.insert({thread_sp->GetID(), thread_sp}); + m_thread_indexes.push_back(threa

[Lldb-commits] [lldb] [LLDB] Make the thread list for SBSaveCoreOptions iterable (PR #122541)

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

[Lldb-commits] [lldb] [lldb] Use the first address range as the function address (PR #122440)

2025-01-10 Thread Greg Clayton via lldb-commits
@@ -428,7 +428,7 @@ class Function : public UserID, public SymbolContextScope { /// The section offset based address for this function. Function(CompileUnit *comp_unit, lldb::user_id_t func_uid, lldb::user_id_t func_type_uid, const Mangled &mangled, -

[Lldb-commits] [lldb] [lldb] Use the first address range as the function address (PR #122440)

2025-01-10 Thread Greg Clayton via lldb-commits
@@ -2393,10 +2393,29 @@ Function *DWARFASTParserClang::ParseFunctionFromDWARF( assert(func_type == nullptr || func_type != DIE_IS_BEING_PARSED); const user_id_t func_user_id = die.GetID(); + +// The base address of the scope for any of the debugging information +

[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Make workaround for the Dynamic loader issue (PR #120166)

2025-01-07 Thread Greg Clayton via lldb-commits
@@ -89,8 +89,11 @@ Status MinidumpFileBuilder::AddHeaderAndCalculateDirectories() { "Failed to fill in header and directory " "sections. Written / Expected (%" PRIx64 " / %" PRIx64 ")", new_offset, m_saved_data_size); - return error; + if (error.Fai

[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Make workaround for the Dynamic loader issue (PR #120166)

2025-01-07 Thread Greg Clayton via lldb-commits
@@ -89,8 +89,11 @@ Status MinidumpFileBuilder::AddHeaderAndCalculateDirectories() { "Failed to fill in header and directory " "sections. Written / Expected (%" PRIx64 " / %" PRIx64 ")", new_offset, m_saved_data_size); - return error; + if (error.Fai

[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Make workaround for the Dynamic loader issue (PR #120166)

2025-01-07 Thread Greg Clayton via lldb-commits
@@ -89,8 +89,11 @@ Status MinidumpFileBuilder::AddHeaderAndCalculateDirectories() { "Failed to fill in header and directory " "sections. Written / Expected (%" PRIx64 " / %" PRIx64 ")", new_offset, m_saved_data_size); - return error; + if (error.Fai

[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Make workaround for the Dynamic loader issue (PR #120166)

2025-01-07 Thread Greg Clayton via lldb-commits
@@ -89,8 +89,11 @@ Status MinidumpFileBuilder::AddHeaderAndCalculateDirectories() { "Failed to fill in header and directory " "sections. Written / Expected (%" PRIx64 " / %" PRIx64 ")", new_offset, m_saved_data_size); - return error; + if (error.Fai

[Lldb-commits] [lldb] Bugfix: Not showing the synthetic children of values behind pointers (PR #117755)

2024-12-09 Thread Greg Clayton via lldb-commits
clayborg wrote: > @clayborg Thank you, Greg! Lots of that info is not described anywhere, no > wonder I missed it. Let me try your fixes in my provider, and I will get back > to you. > > By some reason my provider works in CLI lldb, but not in lldb-dap, but I will > check if your suggestions

[Lldb-commits] [lldb] [LLDB] Add SBProgress so Python scripts can also report progress (PR #119052)

2024-12-09 Thread Greg Clayton via lldb-commits
clayborg wrote: I think the patch seems good as it is without needing to differentiate really. What are we gaining by hiding something that is trying to report progress that can take some time? Wouldn't we want to know this in a sys diagnose situation? If a python command runs for a long time,

[Lldb-commits] [lldb] Bugfix: Not showing the synthetic children of values behind pointers (PR #117755)

2024-12-06 Thread Greg Clayton via lldb-commits
clayborg wrote: Another thing that might not be abvious is that an instance of this class lives as long as the variable lives so as you are stepping in the same function, we will create one synthetic python instance per raw `lldb.SBValue`. This is why the `def update(self):` function is so imp

[Lldb-commits] [lldb] Bugfix: Not showing the synthetic children of values behind pointers (PR #117755)

2024-12-06 Thread Greg Clayton via lldb-commits
clayborg wrote: the `def update(self):` is a mandatory function that is automatically called for you by the LLDB python synthetic child provider when a variable needs to be updated, so you can't rename it. Since you renamed that to be `extract_entries`, your synthetic child provider will never

[Lldb-commits] [lldb] Bugfix: Not showing the synthetic children of values behind pointers (PR #117755)

2024-12-06 Thread Greg Clayton via lldb-commits
clayborg wrote: You also are overwriting the original `lldb.SBValue` with the statement `self.valobj = self.valobj.Dereference()` here: ``` def extract_entries(self): if self.valobj.type.is_pointer: self.valobj = self.valobj.Dereference() ``` You never want to do this bec

[Lldb-commits] [lldb] Bugfix: Not showing the synthetic children of values behind pointers (PR #117755)

2024-12-06 Thread Greg Clayton via lldb-commits
clayborg wrote: You don't have a "def update(self):" method in your data formatter. This is what causes the values to be refetched. I think if you rename "extract_entries" to be named "update" it will fix your synthetic child provider. https://github.com/llvm/llvm-project/pull/117755

[Lldb-commits] [lldb] [lldb] Add lookup by name to SBValue through new member property (PR #118814)

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

[Lldb-commits] [lldb] [lldb] Add lookup by name to SBValue through new member property (PR #118814)

2024-12-06 Thread Greg Clayton via lldb-commits
@@ -29,6 +29,19 @@ STRING_EXTENSION_OUTSIDE(SBValue) '''An accessor function that returns a children_access() object which allows lazy member variable access from a lldb.SBValue object.''' return self.children_access (self) +def get_member_acce

[Lldb-commits] [lldb] [lldb] Add a per-CU API to read the SDK (PR #119022)

2024-12-06 Thread Greg Clayton via lldb-commits
@@ -473,6 +473,32 @@ class Platform : public PluginInterface { LLVM_PRETTY_FUNCTION, GetName())); } + /// Search CU for the SDK path the CUs was compiled against. + /// + /// \param[in] unit The CU + /// + /// \returns A parsed XcodeSDK object if s

[Lldb-commits] [lldb] [lldb] Add lookup by name to SBValue.child (PR #118814)

2024-12-06 Thread Greg Clayton via lldb-commits
@@ -23,6 +23,13 @@ STRING_EXTENSION_OUTSIDE(SBValue) if -count <= key < count: key %= count return self.sbvalue.GetChildAtIndex(key) +elif isinstance(key, str): +if child :=

[Lldb-commits] [lldb] [lldb] Reduce the frequency of DWARF index progress reporting (PR #118953)

2024-12-06 Thread Greg Clayton via lldb-commits
clayborg wrote: And the Progress class can check if the an optional instance variable that contains the minimum time has a value and avoid taking the mutex to keep things faster even when building this into the Progress class? https://github.com/llvm/llvm-project/pull/118953 __

[Lldb-commits] [lldb] [lldb] Reduce the frequency of DWARF index progress reporting (PR #118953)

2024-12-06 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: Can we build this feature into the Progress class by calling an accessor? Something like: ``` Progress progress("Manually indexing DWARF", module_desc.GetData(), total_progress); progress.SetMinimumNotificationTime(std::chrono::milliseconds(10)); ``` Then

[Lldb-commits] [lldb] [lldb][NFC] Make the target's SectionLoadList private. (PR #113278)

2024-12-05 Thread Greg Clayton via lldb-commits
https://github.com/clayborg updated https://github.com/llvm/llvm-project/pull/113278 >From dab763afbe46a59020ae10530c062e9420f45605 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Tue, 22 Oct 2024 01:16:40 -0700 Subject: [PATCH 1/3] Make the target's SectionLoadList private. Lots of code aro

[Lldb-commits] [lldb] Add 'FindFirstSymbolWithNameAndType()' to ModuleList. (PR #117777)

2024-12-03 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: This would be easy to test if we expose this via the public API in `SBTarget`. We don't expose a FindFirstSymbolWithNameAndType, but we can expose maybe: ``` lldb::SBSymbol SBTarget::FindFirstSymbol(const char *name, lldb::SymbolType type = eSymbolTypeAny)

[Lldb-commits] [lldb] [lldb] Fix the DWARF index cache when index is partial. (PR #118390)

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

[Lldb-commits] [lldb] Bugfix: Not showing the synthetic children of values behind pointers (PR #117755)

2024-12-02 Thread Greg Clayton via lldb-commits
clayborg wrote: You should be able to debug lldb and step through the code that tries to get the synthetic child provider for the type and watch if fail. You can also step through the C++ example code from my screen shot and see how it is working to see what is going wrong and how the two thin

[Lldb-commits] [lldb] [lldb] Fix the DWARF index cache when index is partial. (PR #118390)

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

[Lldb-commits] [lldb] Bugfix: Not showing the synthetic children of values behind pointers (PR #117755)

2024-12-02 Thread Greg Clayton via lldb-commits
clayborg wrote: Can you post a copy of a the python code for the synthetic child provider you are creating and also how you are registering it with LLDB? https://github.com/llvm/llvm-project/pull/117755 ___ lldb-commits mailing list lldb-commits@lists

[Lldb-commits] [lldb] Fix the DWARF index cache when index is partial. (PR #118390)

2024-12-02 Thread Greg Clayton via lldb-commits
https://github.com/clayborg created https://github.com/llvm/llvm-project/pull/118390 The ManualDWARFIndex class can create a index cache if the LLDB index cache is enabled. This used to save the index to the same file, regardless of wether the cache was a full index (no .debug_names) or a part

[Lldb-commits] [lldb] Bugfix: Not showing the synthetic children of values behind pointers (PR #117755)

2024-12-02 Thread Greg Clayton via lldb-commits
clayborg wrote: https://github.com/user-attachments/assets/b7dbb80c-5f7d-4dd8-a0db-d0b8fe10cf21";> Still works inside of a structure. Anything else I can try? https://github.com/llvm/llvm-project/pull/117755 ___ lldb-commits mailing list lldb-commits@

[Lldb-commits] [lldb] Bugfix: Not showing the synthetic children of values behind pointers (PR #117755)

2024-11-26 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: None of this should be needed. If we have a child value that is a pointer to a synthetic value, and we expand that value, we should be showing the synthetic children via the standard LLDB APIs. In LLDB way back in the beginning, when we would expand a po

[Lldb-commits] [lldb] Fix return value of 'PluginManager::RegisterPlugin()'. (PR #114120)

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

[Lldb-commits] [lldb] [lldb] Fix ELF core debugging (PR #117070)

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

[Lldb-commits] [lldb] Make SBMemoryRegionInfoList iterable with Python SWIG (PR #117358)

2024-11-22 Thread Greg Clayton via lldb-commits
@@ -7,7 +7,12 @@ def __iter__(self): '''Iterate over all the memory regions in a lldb.SBMemoryRegionInfoList object.''' - return lldb_iter(self, 'GetSize', 'GetMemoryRegionAtIndex') + import lldb + size = self.GetSize() + region = lldb.SBMemoryRe

[Lldb-commits] [lldb] Make SBMemoryRegionInfoList iterable with Python SWIG (PR #117358)

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

[Lldb-commits] [lldb] [lldb] Fix ELF core debugging (PR #117070)

2024-11-22 Thread Greg Clayton via lldb-commits
@@ -286,6 +286,22 @@ void ProcessElfCore::UpdateBuildIdForNTFileEntries() { } } +bool ProcessElfCore::GetModuleSpec(const FileSpec &module_file_spec, + const ArchSpec &arch, + ModuleSpec &module_spec) { + m

[Lldb-commits] [lldb] [lldb] Fix ELF core debugging (PR #117070)

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

[Lldb-commits] [lldb] [lldb] Fix loading UUIDs from ELF headers. (PR #117028)

2024-11-21 Thread Greg Clayton via lldb-commits
clayborg wrote: > I'm a bit confused as to how we have a core file but also things are moved in > memory. > > Can you give an explanation of how this occurs? Please add it to the PR > description. Will do. > Also, tests? (which is partly why I ask how this occurs) Tests are hard to create a

[Lldb-commits] [lldb] [lldb] Fix loading UUIDs from ELF headers. (PR #117028)

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

[Lldb-commits] [lldb] [lldb] Fix loading UUIDs from ELF headers. (PR #117028)

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

[Lldb-commits] [lldb] [lldb] Fix ELF core debugging (PR #117070)

2024-11-20 Thread Greg Clayton via lldb-commits
@@ -97,6 +97,9 @@ class ProcessElfCore : public lldb_private::PostMortemProcess { bool GetProcessInfo(lldb_private::ProcessInstanceInfo &info) override; + // Returns the gnu uuid from matched NT_FILE entry + lldb_private::UUID FindBuildId(const llvm::StringRef path) over

[Lldb-commits] [lldb] [lldb] Fix ELF core debugging (PR #117070)

2024-11-20 Thread Greg Clayton via lldb-commits
@@ -157,6 +157,10 @@ DynamicLoader::GetSectionListFromModule(const ModuleSP module) const { ModuleSP DynamicLoader::FindModuleViaTarget(const FileSpec &file) { Target &target = m_process->GetTarget(); ModuleSpec module_spec(file, target.GetArchitecture()); + if (UUID uuid

[Lldb-commits] [lldb] [lldb] Fix ELF core debugging (PR #117070)

2024-11-20 Thread Greg Clayton via lldb-commits
@@ -281,6 +281,13 @@ void ProcessElfCore::UpdateBuildIdForNTFileEntries() { } } +UUID ProcessElfCore::FindBuildId(const llvm::StringRef path) { clayborg wrote: Change to overrite `GetModuleSpec` instead. https://github.com/llvm/llvm-project/pull/117070 ___

[Lldb-commits] [lldb] [lldb] Fix ELF core debugging (PR #117070)

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

[Lldb-commits] [lldb] [lldb] Fix ELF core debugging (PR #117070)

2024-11-20 Thread Greg Clayton via lldb-commits
@@ -1380,6 +1380,8 @@ class Process : public std::enable_shared_from_this, virtual bool GetProcessInfo(ProcessInstanceInfo &info); + virtual lldb_private::UUID FindBuildId(const llvm::StringRef path); + clayborg wrote: There is already a function in Proc

[Lldb-commits] [lldb] [lldb] Fix ELF core debugging (PR #117070)

2024-11-20 Thread Greg Clayton via lldb-commits
@@ -6080,6 +6080,11 @@ bool Process::GetProcessInfo(ProcessInstanceInfo &info) { return platform_sp->GetProcessInfo(GetID(), info); } +lldb_private::UUID Process::FindBuildId(const llvm::StringRef path) { + lldb_private::UUID invalid_uuid; + return invalid_uuid; +} + -

[Lldb-commits] [lldb] [lldb] Fix ELF core debugging (PR #117070)

2024-11-20 Thread Greg Clayton via lldb-commits
@@ -1034,7 +1041,8 @@ UUID ProcessElfCore::FindBuidIdInCoreMemory(lldb::addr_t address) { std::vector note_bytes; note_bytes.resize(program_header.p_memsz); -byte_read = ReadMemory(program_header.p_vaddr, note_bytes.data(), +const lldb::addr_t program_header_v

[Lldb-commits] [lldb] [lldb] Fix ELF core debugging (PR #117070)

2024-11-20 Thread Greg Clayton via lldb-commits
clayborg wrote: The reading of build IDs is tracked in this PR: https://github.com/llvm/llvm-project/pull/117028 https://github.com/llvm/llvm-project/pull/117070 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[Lldb-commits] [lldb] Fix loading UUIDs from ELF headers. (PR #117028)

2024-11-20 Thread Greg Clayton via lldb-commits
https://github.com/clayborg updated https://github.com/llvm/llvm-project/pull/117028 >From 37eccb509ea6468879cf530c6952aab7adec4001 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Wed, 20 Nov 2024 10:55:12 -0800 Subject: [PATCH 1/2] Fix loading UUIDs from ELF headers. A previous patch added

[Lldb-commits] [lldb] Fix loading UUIDs from ELF headers. (PR #117028)

2024-11-20 Thread Greg Clayton via lldb-commits
https://github.com/clayborg created https://github.com/llvm/llvm-project/pull/117028 A previous patch added the ability to load UUID from ELF headers using the program header and finding PT_NOTE entries. The fix would attempt to read the data for the PT_NOTE from memory, but it didn't slide th

[Lldb-commits] [lldb] Add support for reading the dynamic symbol table from PT_DYNAMIC (PR #116689)

2024-11-18 Thread Greg Clayton via lldb-commits
clayborg wrote: @labath Your suggestion to use the commands in my test fails on `buildkite/github-pull-requests/linux-linux-x64` with: ``` RUN: at line 6: /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-5wwkv-1/llvm-project/github-pull-requests/build/bin/llvm-mc -triple=x86_64-pc-linux -fil

[Lldb-commits] [lldb] Add support for reading the dynamic symbol table from PT_DYNAMIC (PR #116689)

2024-11-18 Thread Greg Clayton via lldb-commits
https://github.com/clayborg updated https://github.com/llvm/llvm-project/pull/116689 >From 4dbb6fe631926bdcdcb89d981a457dd7599bffad Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Mon, 18 Nov 2024 12:11:56 -0800 Subject: [PATCH 1/5] Add support for reading the dynamic symbol table from PT_DY

[Lldb-commits] [lldb] Add support for reading the dynamic symbol table from PT_DYNAMIC (PR #116689)

2024-11-18 Thread Greg Clayton via lldb-commits
clayborg wrote: @labath I fixed by removing use of `-z nosectionheader` and then ran llvm-strip as a separate step to ensure the section headers are removed. https://github.com/llvm/llvm-project/pull/116689 ___ lldb-commits mailing list lldb-commits@l

[Lldb-commits] [lldb] Add support for reading the dynamic symbol table from PT_DYNAMIC (PR #116689)

2024-11-18 Thread Greg Clayton via lldb-commits
https://github.com/clayborg updated https://github.com/llvm/llvm-project/pull/116689 >From 4dbb6fe631926bdcdcb89d981a457dd7599bffad Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Mon, 18 Nov 2024 12:11:56 -0800 Subject: [PATCH 1/4] Add support for reading the dynamic symbol table from PT_DY

[Lldb-commits] [lldb] Add support for reading the dynamic symbol table from PT_DYNAMIC (PR #116689)

2024-11-18 Thread Greg Clayton via lldb-commits
https://github.com/clayborg updated https://github.com/llvm/llvm-project/pull/116689 >From 4dbb6fe631926bdcdcb89d981a457dd7599bffad Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Mon, 18 Nov 2024 12:11:56 -0800 Subject: [PATCH 1/3] Add support for reading the dynamic symbol table from PT_DY

[Lldb-commits] [lldb] Add support for reading the dynamic symbol table from PT_DYNAMIC (PR #116689)

2024-11-18 Thread Greg Clayton via lldb-commits
https://github.com/clayborg updated https://github.com/llvm/llvm-project/pull/116689 >From 4dbb6fe631926bdcdcb89d981a457dd7599bffad Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Mon, 18 Nov 2024 12:11:56 -0800 Subject: [PATCH 1/2] Add support for reading the dynamic symbol table from PT_DY

[Lldb-commits] [lldb] Add support for reading the dynamic symbol table from PT_DYNAMIC (PR #116689)

2024-11-18 Thread Greg Clayton via lldb-commits
https://github.com/clayborg created https://github.com/llvm/llvm-project/pull/116689 Resubmissions of https://github.com/llvm/llvm-project/pull/112596 with buildbot fixes. Allow LLDB to parse the dynamic symbol table from an ELF file or memory image in an ELF file that has no section headers.

[Lldb-commits] [lldb] Add support for reading the dynamic symbol table from PT_DYNAMIC (PR #112596)

2024-11-18 Thread Greg Clayton via lldb-commits
clayborg wrote: > I have reverted this change with > [f14e1a8](https://github.com/llvm/llvm-project/commit/f14e1a8597f83fa5bbc78befcb7059144d58ff5c) I found the issue and have a fix. https://github.com/llvm/llvm-project/pull/112596 ___ lldb-commits m

[Lldb-commits] [lldb] Add support for reading the dynamic symbol table from PT_DYNAMIC (PR #112596)

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

[Lldb-commits] [lldb] [LLDB][ProcessELFCore] Add Description to ProcessELFCore/ELFThread stop reasons (PR #110065)

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

[Lldb-commits] [lldb] [LLDB] Finish implementing support for DW_FORM_data16 (PR #113508)

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

[Lldb-commits] [lldb] Add support for reading the dynamic symbol table from PT_DYNAMIC (PR #112596)

2024-10-30 Thread Greg Clayton via lldb-commits
https://github.com/clayborg updated https://github.com/llvm/llvm-project/pull/112596 >From 0ff6ba499bcb04581cf5b77780f769bee05e4aef Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Sat, 28 Sep 2024 15:05:37 -0700 Subject: [PATCH 1/3] Add support for reading the dynamic symbol table from progr

[Lldb-commits] [lldb] Improve namespace lookup using .debug_names parent chain (PR #110062)

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

[Lldb-commits] [lldb] Fix statistics dump to report per-target (PR #113723)

2024-10-28 Thread Greg Clayton via lldb-commits
@@ -1600,6 +1600,15 @@ bool Module::MergeArchitecture(const ArchSpec &arch_spec) { return SetArchitecture(merged_arch); } +void Module::ResetStatistics() { + m_symtab_parse_time.reset(); + m_symtab_index_time.reset(); + SymbolFile *sym_file = GetSymbolFile(); + if (sym_

[Lldb-commits] [lldb] Fix statistics dump to report per-target (PR #113723)

2024-10-28 Thread Greg Clayton via lldb-commits
@@ -101,6 +101,9 @@ class LLDB_API SBTarget { /// A SBStructuredData with the statistics collected. lldb::SBStructuredData GetStatistics(SBStatisticsOptions options); + /// Reset the statistics collected for this target. clayborg wrote: Document this

[Lldb-commits] [lldb] Fix statistics dump to report per-target (PR #113723)

2024-10-28 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: So this patch seems to just clear the module + symbol file stats, not any breakpoint resolve times, etc. https://github.com/llvm/llvm-project/pull/113723 ___ lldb-commits mailing list lldb-commits@lists.llvm.org

[Lldb-commits] [lldb] Fix statistics dump to report per-target (PR #113723)

2024-10-28 Thread Greg Clayton via lldb-commits
@@ -426,6 +426,8 @@ class LLDB_API SBDebugger { SBTypeSynthetic GetSyntheticForType(SBTypeNameSpecifier); + void ResetStatistics(); clayborg wrote: Add a header doc comment for this to document what this will do: - clear all stats for all modules in all t

[Lldb-commits] [lldb] Fix statistics dump to report per-target (PR #113723)

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

[Lldb-commits] [lldb] Fix statistics dump to report per-target (PR #113723)

2024-10-25 Thread Greg Clayton via lldb-commits
@@ -1667,6 +1667,12 @@ SBTypeSynthetic SBDebugger::GetSyntheticForType(SBTypeNameSpecifier type_name) { DataVisualization::GetSyntheticForType(type_name.GetSP())); } +void SBDebugger::ResetStatistics() { clayborg wrote: Should we add a `void SBTarget::

[Lldb-commits] [lldb] Fix statistics dump to report per-target (PR #113723)

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

[Lldb-commits] [lldb] Fix statistics dump to report per-target (PR #113723)

2024-10-25 Thread Greg Clayton via lldb-commits
@@ -318,6 +318,9 @@ class SymbolFileDWARF : public SymbolFileCommon { StatsDuration &GetDebugInfoParseTimeRef() { return m_parse_time; } + void ResetDebugInfoParseTime() override { m_parse_time.reset(); } + void ResetDebugInfoIndexTime() override; + clayb

[Lldb-commits] [lldb] Fix statistics dump to report per-target (PR #113723)

2024-10-25 Thread Greg Clayton via lldb-commits
@@ -236,6 +236,27 @@ void TargetStats::IncreaseSourceRealpathCompatibleCount(uint32_t count) { bool DebuggerStats::g_collecting_stats = false; +void DebuggerStats::ResetStatistics(Debugger &debugger, Target *target) { + const uint64_t num_modules = target != nullptr +

[Lldb-commits] [lldb] Fix statistics dump to report per-target (PR #113723)

2024-10-25 Thread Greg Clayton via lldb-commits
@@ -422,6 +422,13 @@ class SymbolFile : public PluginInterface { /// hasn't been indexed yet, or a valid duration if it has. virtual StatsDuration::Duration GetDebugInfoIndexTime() { return {}; } + /// Reset the time taken to parse the debug information. + virtual void R

[Lldb-commits] [lldb] Fix statistics dump to report per-target (PR #113723)

2024-10-25 Thread Greg Clayton via lldb-commits
@@ -422,6 +422,13 @@ class SymbolFile : public PluginInterface { /// hasn't been indexed yet, or a valid duration if it has. virtual StatsDuration::Duration GetDebugInfoIndexTime() { return {}; } + /// Reset the time taken to parse the debug information. + virtual void R

[Lldb-commits] [lldb] Fix statistics dump to report per-target (PR #113723)

2024-10-25 Thread Greg Clayton via lldb-commits
@@ -789,6 +789,7 @@ void Debugger::Destroy(DebuggerSP &debugger_sp) { (*debugger_sp->GetAsyncErrorStream()) << result.GetErrorData() << '\n'; } + DebuggerStats::ResetStatistics(*debugger_sp, nullptr); clayborg wrote: We probably don't need to call th

[Lldb-commits] [lldb] Fix statistics dump to report per-target (PR #113723)

2024-10-25 Thread Greg Clayton via lldb-commits
@@ -236,6 +236,27 @@ void TargetStats::IncreaseSourceRealpathCompatibleCount(uint32_t count) { bool DebuggerStats::g_collecting_stats = false; +void DebuggerStats::ResetStatistics(Debugger &debugger, Target *target) { + const uint64_t num_modules = target != nullptr +

[Lldb-commits] [lldb] Fix statistics dump to report per-target (PR #113723)

2024-10-25 Thread Greg Clayton via lldb-commits
@@ -182,6 +182,9 @@ class SymbolFileOnDemand : public lldb_private::SymbolFile { lldb_private::StatsDuration::Duration GetDebugInfoParseTime() override; lldb_private::StatsDuration::Duration GetDebugInfoIndexTime() override; + void ResetDebugInfoParseTime() override; + v

  1   2   3   4   5   6   7   8   9   10   >