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

2024-11-22 Thread Kazuki Sakamoto via lldb-commits
splhack wrote: @clayborg most likely calling GetModuleSpec is the cause of these failures. ProcessGDBRemote fetches modules from remote. FindBuildId does not have the issue. What do you think? > looks like these changes break `lldb-api::TestLoadUnload.py` test on the LLDB > remote-linux builder

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

2024-11-22 Thread Vladimir Vereschaka via lldb-commits
vvereschaka wrote: Hi @splhack , looks like these changes break `lldb-api::TestLoadUnload.py` test on the LLDB remote-linux builders: * https://lab.llvm.org/buildbot/#/builders/195/builds/1435 * https://lab.llvm.org/staging/#/builders/197/builds/663 https://github.com/llvm/llvm-project/pull/11

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

2024-11-22 Thread Kazuki Sakamoto via lldb-commits
splhack wrote: @vvereschaka let me check 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-22 Thread Kazuki Sakamoto via lldb-commits
https://github.com/splhack closed 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-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] [lldb] Fix ELF core debugging (PR #117070)

2024-11-22 Thread Kazuki Sakamoto 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 Kazuki Sakamoto via lldb-commits
https://github.com/splhack updated https://github.com/llvm/llvm-project/pull/117070 >From 8d9f061d7b5dfe5966f117f5b2740c8acbd87797 Mon Sep 17 00:00:00 2001 From: Kazuki Sakamoto Date: Wed, 20 Nov 2024 13:49:26 -0800 Subject: [PATCH] [lldb] Fix ELF core debugging DynamicLoader does not use Proc

[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 ELF core debugging (PR #117070)

2024-11-21 Thread Kazuki Sakamoto via lldb-commits
https://github.com/splhack updated https://github.com/llvm/llvm-project/pull/117070 >From b93478345fbaa747b44d678207b768948db0a7d6 Mon Sep 17 00:00:00 2001 From: Kazuki Sakamoto Date: Wed, 20 Nov 2024 13:49:26 -0800 Subject: [PATCH] [lldb] Fix ELF core debugging DynamicLoader does not use Proc

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

2024-11-21 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited 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-21 Thread David Spickett via lldb-commits
@@ -224,7 +224,7 @@ Status ProcessElfCore::DoLoadCore() { ArchSpec core_arch(m_core_module_sp->GetArchitecture()); target_arch.MergeFrom(core_arch); GetTarget().SetArchitecture(target_arch); - + DavidSpickett wrote: Keep formatting changes separate, pus

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

2024-11-21 Thread Kazuki Sakamoto via lldb-commits
@@ -224,7 +224,7 @@ Status ProcessElfCore::DoLoadCore() { ArchSpec core_arch(m_core_module_sp->GetArchitecture()); target_arch.MergeFrom(core_arch); GetTarget().SetArchitecture(target_arch); - + splhack wrote: This pull request will be rebased onto #117

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

2024-11-20 Thread via lldb-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 53a6a11e0d51229d341b8906252645cd8a5de796 b285bba80b7b7ad4e351485d59df41f328462867 --e

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

2024-11-20 Thread Kazuki Sakamoto via lldb-commits
https://github.com/splhack edited 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 Kazuki Sakamoto via lldb-commits
https://github.com/splhack updated https://github.com/llvm/llvm-project/pull/117070 >From 6b8f4a824d39ce557230e610a846d316358b4f20 Mon Sep 17 00:00:00 2001 From: Kazuki Sakamoto Date: Wed, 20 Nov 2024 16:20:40 -0800 Subject: [PATCH 1/2] Run clang format. --- lldb/source/Core/DynamicLoader.cpp

[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] [lldb] Fix ELF core debugging (PR #117070)

2024-11-20 Thread Kazuki Sakamoto via lldb-commits
splhack wrote: > The reading of build IDs is tracked in this PR: #117028 will rebase onto #117028 https://github.com/llvm/llvm-project/pull/117070 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

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

2024-11-20 Thread Sim Sun 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 Kazuki Sakamoto 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 Chad Smith via lldb-commits
cs01 wrote: Thank you! Are there any unit tests that can exercise this? Or at least repro steps to generate a core with the elf headers in case any one wants to manually test. https://github.com/llvm/llvm-project/pull/117070 ___ lldb-commits mailing

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

2024-11-20 Thread via lldb-commits
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Kazuki Sakamoto (splhack) Changes Addressing two issues on ELF core debugging 1. ProcessElfCore::FindBuidIdInCoreMemory reads wrong address for ELF header (fixed by @clayborg) 2. DynamicLoader does not use ProcessElfCore NT_FILE entries to

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

2024-11-20 Thread Kazuki Sakamoto via lldb-commits
https://github.com/splhack created https://github.com/llvm/llvm-project/pull/117070 Addressing two issues on ELF core debugging 1. ProcessElfCore::FindBuidIdInCoreMemory reads wrong address for ELF header (fixed by @clayborg) 2. DynamicLoader does not use ProcessElfCore NT_FILE entries to get