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

2024-10-04 Thread Greg Clayton via lldb-commits
@@ -76,14 +76,19 @@ static_assert(sizeof(ELFLinuxPrStatus) == 112, "sizeof ELFLinuxPrStatus is not correct!"); struct ELFLinuxSigInfo { - int32_t si_signo; - int32_t si_code; + int32_t si_signo; // Order matters for the first 3. int32_t si_errno; + int32_t

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

2024-10-04 Thread Greg Clayton via lldb-commits
@@ -76,14 +76,19 @@ static_assert(sizeof(ELFLinuxPrStatus) == 112, "sizeof ELFLinuxPrStatus is not correct!"); struct ELFLinuxSigInfo { - int32_t si_signo; - int32_t si_code; + int32_t si_signo; // Order matters for the first 3. int32_t si_errno; + int32_t

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

2024-10-04 Thread Greg Clayton via lldb-commits
@@ -556,6 +559,24 @@ Status ELFLinuxSigInfo::Parse(const DataExtractor &data, const ArchSpec &arch) { si_signo = data.GetU32(&offset); si_errno = data.GetU32(&offset); si_code = data.GetU32(&offset); + // 64b ELF have a 4 byte pad. + if (data.GetAddressByteSize() == 8)

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

2024-09-30 Thread Greg Clayton via lldb-commits
@@ -75,16 +75,25 @@ struct ELFLinuxPrStatus { static_assert(sizeof(ELFLinuxPrStatus) == 112, "sizeof ELFLinuxPrStatus is not correct!"); +union ELFSigval { + int sival_int; + void *sival_ptr; +}; + struct ELFLinuxSigInfo { - int32_t si_signo; - int32_t si_co

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

2024-09-30 Thread Greg Clayton via lldb-commits
@@ -75,16 +75,25 @@ struct ELFLinuxPrStatus { static_assert(sizeof(ELFLinuxPrStatus) == 112, "sizeof ELFLinuxPrStatus is not correct!"); +union ELFSigval { + int sival_int; + void *sival_ptr; +}; + struct ELFLinuxSigInfo { - int32_t si_signo; - int32_t si_co

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

2024-09-30 Thread Greg Clayton via lldb-commits
@@ -556,6 +558,34 @@ Status ELFLinuxSigInfo::Parse(const DataExtractor &data, const ArchSpec &arch) { si_signo = data.GetU32(&offset); si_errno = data.GetU32(&offset); si_code = data.GetU32(&offset); + // 64b ELF have a 4 byte pad. + if (data.GetAddressByteSize() == 8)

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

2024-09-30 Thread Greg Clayton via lldb-commits
https://github.com/clayborg requested changes to 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] Fix an integer trunctation issues for the DW_AT_frame_base DWARF loca… (PR #110388)

2024-09-30 Thread Greg Clayton via lldb-commits
https://github.com/clayborg closed https://github.com/llvm/llvm-project/pull/110388 ___ 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] Add breakpoint stop reasons to the minidump. (PR #108448)

2024-09-28 Thread Greg Clayton via lldb-commits
@@ -685,50 +684,42 @@ Status MinidumpFileBuilder::AddExceptions() { Status error; for (const ThreadSP &thread_sp : thread_list) { StopInfoSP stop_info_sp = thread_sp->GetStopInfo(); -bool add_exception = false; -if (stop_info_sp) { - switch (stop_info_sp->G

[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Add breakpoint stop reasons to the minidump. (PR #108448)

2024-09-28 Thread Greg Clayton via lldb-commits
@@ -246,6 +246,8 @@ static_assert(sizeof(Thread) == 48); struct Exception { static constexpr size_t MaxParameters = 15; + static constexpr size_t MaxParameterBytes = MaxParameters * sizeof(uint64_t); + static const uint32_t LLDB_FLAG = 0x8000; clayborg

[Lldb-commits] [lldb] [llvm] [lldb][DWARF] Replace lldb's DWARFDebugArangeSet with llvm's (PR #110058)

2024-09-28 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: LGTM. I will let others comment. https://github.com/llvm/llvm-project/pull/110058 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] Fix an integer trunctation issues for the DW_AT_frame_base DWARF loca… (PR #110388)

2024-09-28 Thread Greg Clayton via lldb-commits
clayborg wrote: Since .dwp files can get large, it is ok for the `.debug_info.dwo` section to exceed 4GB as we can parse the linked list of dwarf units in the `.debug_info.dwo` and ignore the CU and TU indexes which are limited to 4GB. We have work arounds already checked into LLVM's DWARF cod

[Lldb-commits] [lldb] Fix an integer trunctation issues for the DW_AT_frame_base DWARF loca… (PR #110388)

2024-09-28 Thread Greg Clayton via lldb-commits
https://github.com/clayborg created https://github.com/llvm/llvm-project/pull/110388 …tion expression. This patch allows offsets to the DW_AT_frame_base to exceed 4GB. Prior to this, for any .debug_info.dwo offset that exceeded 4GB, we would truncate the offset to the DW_AT_frame_base express

[Lldb-commits] [lldb] [DWARF]Set uuid for symbol file spec (PR #110066)

2024-09-26 Thread Greg Clayton via lldb-commits
clayborg wrote: Change looks good to me, but we should find a way to test. We just need a test file + .dwp file and load that into lldb and force it to try and find the symbols right? Shouldn't require a core file. Then both the executable + .dwp file can be obj2yaml'ed https://github.com/ll

[Lldb-commits] [lldb] Improve type and namespace lookup using parent chain (PR #108907)

2024-09-19 Thread Greg Clayton via lldb-commits
@@ -126,3 +126,62 @@ bool DWARFIndex::GetFullyQualifiedTypeImpl( return callback(die); return true; } + +void DWARFIndex::GetNamespacesWithParents( +ConstString name, llvm::ArrayRef parent_names, clayborg wrote: Instead of just an array of names, we

[Lldb-commits] [lldb] Improve type and namespace lookup using parent chain (PR #108907)

2024-09-19 Thread Greg Clayton via lldb-commits
@@ -126,3 +126,62 @@ bool DWARFIndex::GetFullyQualifiedTypeImpl( return callback(die); return true; } + +void DWARFIndex::GetNamespacesWithParents( +ConstString name, llvm::ArrayRef parent_names, +llvm::function_ref callback) { + GetNamespaces(name, [&](DWARFDIE

[Lldb-commits] [lldb] Improve type and namespace lookup using parent chain (PR #108907)

2024-09-19 Thread Greg Clayton via lldb-commits
@@ -126,3 +126,62 @@ bool DWARFIndex::GetFullyQualifiedTypeImpl( return callback(die); return true; } + +void DWARFIndex::GetNamespacesWithParents( +ConstString name, llvm::ArrayRef parent_names, +llvm::function_ref callback) { + GetNamespaces(name, [&](DWARFDIE

[Lldb-commits] [lldb] Improve type and namespace lookup using parent chain (PR #108907)

2024-09-19 Thread Greg Clayton via lldb-commits
@@ -126,3 +126,62 @@ bool DWARFIndex::GetFullyQualifiedTypeImpl( return callback(die); return true; } + +void DWARFIndex::GetNamespacesWithParents( +ConstString name, llvm::ArrayRef parent_names, +llvm::function_ref callback) { + GetNamespaces(name, [&](DWARFDIE

[Lldb-commits] [lldb] [lldb-dap] Implement value locations for function pointers (PR #104589)

2024-09-18 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,11 @@ +#include + +void greet() { printf("Hello"); } + +int main(void) { + int var1 = 1; + void (*func_ptr)() = &greet; + void (&func_ref)() = greet; + __builtin_printf("break here"); clayborg wrote: We don't need the printf here right? Just put a

[Lldb-commits] [lldb] [lldb-dap] Implement value locations for function pointers (PR #104589)

2024-09-18 Thread Greg Clayton via lldb-commits
@@ -1198,6 +1198,26 @@ std::string VariableDescription::GetResult(llvm::StringRef context) { return description.trim().str(); } +bool HasValueLocation(lldb::SBValue v) { + if (!v.GetType().IsPointerType() && !v.GetType().IsReferenceType()) { +return false; + } ---

[Lldb-commits] [lldb] [lldb-dap] Implement value locations for function pointers (PR #104589)

2024-09-18 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: My only question here is do we really want to do an address resolution for any pointer or reference or can we limit that for only function pointers? I worry a bit about the extra cost for any variable view that has tons of pointers or references as this w

[Lldb-commits] [lldb] [lldb-dap] Implement value locations for function pointers (PR #104589)

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

[Lldb-commits] [lldb] [lldb-dap] Provide `declarationLocation` for variables (PR #102928)

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

[Lldb-commits] [lldb] [LLDB][Minidump] Add a progress bar to minidump (PR #108309)

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

[Lldb-commits] [lldb] [lldb-dap] Support inspecting memory (PR #104317)

2024-09-16 Thread Greg Clayton via lldb-commits
https://github.com/clayborg approved this pull request. Thanks for doing the modification. LGTM https://github.com/llvm/llvm-project/pull/104317 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/l

[Lldb-commits] [lldb] [LLDB][Minidump] Add breakpoint stop reasons to the minidump. (PR #108448)

2024-09-12 Thread Greg Clayton via lldb-commits
@@ -686,16 +692,10 @@ Status MinidumpFileBuilder::AddExceptions() { for (const ThreadSP &thread_sp : thread_list) { StopInfoSP stop_info_sp = thread_sp->GetStopInfo(); bool add_exception = false; -if (stop_info_sp) { - switch (stop_info_sp->GetStopReason()) {

[Lldb-commits] [lldb] [LLDB][Minidump] Add a progress bar to minidump (PR #108309)

2024-09-12 Thread Greg Clayton via lldb-commits
@@ -1132,6 +1138,8 @@ Status MinidumpFileBuilder::AddMemoryList_64( error = AddData(data_up->GetBytes(), bytes_read); if (error.Fail()) return error; + +progress.Increment(); clayborg wrote: Ditto, move before the memory read and add descript

[Lldb-commits] [lldb] [LLDB][Minidump] Add a progress bar to minidump (PR #108309)

2024-09-12 Thread Greg Clayton via lldb-commits
@@ -1024,6 +1027,8 @@ Status MinidumpFileBuilder::AddMemoryList_32( error = AddData(data_up->GetBytes(), bytes_read); if (error.Fail()) return error; + +progress.Increment(); clayborg wrote: might be nice to add detail before the ReadMemory a

[Lldb-commits] [lldb] [LLDB][Minidump] Add a progress bar to minidump (PR #108309)

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

[Lldb-commits] [lldb] [LLDB][Minidump] Add breakpoint stop reasons to the minidump. (PR #108448)

2024-09-12 Thread Greg Clayton via lldb-commits
@@ -686,16 +692,10 @@ Status MinidumpFileBuilder::AddExceptions() { for (const ThreadSP &thread_sp : thread_list) { StopInfoSP stop_info_sp = thread_sp->GetStopInfo(); bool add_exception = false; -if (stop_info_sp) { - switch (stop_info_sp->GetStopReason()) {

[Lldb-commits] [lldb] [LLDB][Minidump] Add breakpoint stop reasons to the minidump. (PR #108448)

2024-09-12 Thread Greg Clayton via lldb-commits
@@ -54,6 +54,13 @@ using namespace lldb; using namespace lldb_private; using namespace llvm::minidump; +// Set of all the stop reasons minidumps will collect. +const std::unordered_set MinidumpFileBuilder::thread_stop_reasons { + lldb::StopReason::eStopReasonException, + ll

[Lldb-commits] [lldb] [LLDB][Minidump] Add breakpoint stop reasons to the minidump. (PR #108448)

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

[Lldb-commits] [lldb] [LLDB] Reapply SBSaveCore Add Memory List (PR #107937)

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

[Lldb-commits] [lldb] [LLDB][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

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

[Lldb-commits] [lldb] [lldb] Do not use LC_FUNCTION_STARTS data to determine symbol size as symbols are created (PR #106791)

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

[Lldb-commits] [lldb] [LLDB][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

2024-09-04 Thread Greg Clayton via lldb-commits
@@ -201,3 +216,12 @@ std::string ScriptSummaryFormat::GetDescription() { } return std::string(sstr.GetString()); } + +std::string ScriptSummaryFormat::GetName() { return m_script_formatter_name; } + +std::string ScriptSummaryFormat::GetSummaryKindName() { + if (!m_python_s

[Lldb-commits] [lldb] [LLDB][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

2024-09-04 Thread Greg Clayton via lldb-commits
@@ -258,6 +258,14 @@ class TypeSummaryImpl { virtual std::string GetDescription() = 0; + /// Get the name of the Type Summary Provider, either a C++ class, a summary + /// string, or a script function name. + virtual std::string GetName() = 0; + + /// Get the name of th

[Lldb-commits] [lldb] [LLDB][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

2024-09-04 Thread Greg Clayton via lldb-commits
@@ -174,6 +176,85 @@ struct StatisticsOptions { std::optional m_include_transcript; }; +/// A class that represents statistics about a TypeSummaryProviders invocations +class SummaryStatistics { +public: + explicit SummaryStatistics(std::string name, std::string impl_type)

[Lldb-commits] [lldb] [LLDB][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

2024-09-04 Thread Greg Clayton via lldb-commits
@@ -174,6 +176,82 @@ struct StatisticsOptions { std::optional m_include_transcript; }; +/// A class that represents statistics about a TypeSummaryProviders invocations +class SummaryStatistics { +public: + explicit SummaryStatistics(std::string name, std::string impl_type)

[Lldb-commits] [lldb] [LLDB][Minidump] Extend the minidump x86_64 registers to include fs_base and gs_base (PR #106767)

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

[Lldb-commits] [lldb] [lldb] Do not use LC_FUNCTION_STARTS data to determine symbol size as symbols are created (PR #106791)

2024-09-03 Thread Greg Clayton via lldb-commits
clayborg wrote: We already have bits that know if the size is synthesize in `lldb_private::Symbol::m_size_is_synthesized` and we have a bit that tracks is the size is valid with `lldb_private::Symbol::m_size_is_valid`. We could accomplish this `size on demand` feature by letting clients subcla

[Lldb-commits] [lldb] [lldb] Do not use LC_FUNCTION_STARTS data to determine symbol size as symbols are created (PR #106791)

2024-09-03 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: All symbol sizes are zero for mach-o symbols unless they come from the debug map as there is no size field in nlist entries. This PR seems to just not do the work of setting the symbol size at all. Does something try to set the symbol sizes later? Does th

[Lldb-commits] [lldb] [lldb] Fix and speedup the `memory find` command (PR #104193)

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

[Lldb-commits] [lldb] Make env and source map dictionaries #95137 (PR #106919)

2024-09-03 Thread Greg Clayton via lldb-commits
clayborg wrote: Can we modify this patch to support both formats? It should be easy to see if "env" is a dictionary, and if it is, use your new code. If it is an array, use the old parsing code. I would like to make sure this change doesn't break anyone that has existing launch configurations.

[Lldb-commits] [lldb] [lldb-dap] Support inspecting memory (PR #104317)

2024-09-03 Thread Greg Clayton via lldb-commits
clayborg wrote: Ping for my comments? https://github.com/llvm/llvm-project/pull/104317 ___ 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 #106799)

2024-09-03 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: We need the `DWARFFormValue::ExtractValue ` to work. We spoke about pointing the `DWARFFormValue::ValueType::data` at the 16 bytes of data and have the `DWARFFormValue::ValueType::value.uval` contain 16 as the length of the data in `DWARFFormValue::ValueT

[Lldb-commits] [lldb] [lldb] Fix and speedup the `memory find` command (PR #104193)

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

[Lldb-commits] [lldb] [LLDB][Minidump] Extend the minidump x86_64 registers to include fs_base and gs_base (PR #106767)

2024-08-30 Thread Greg Clayton via lldb-commits
@@ -473,7 +473,8 @@ GetThreadContext_x86_64(RegisterContext *reg_ctx) { lldb_private::minidump::MinidumpContext_x86_64_Flags::x86_64_Flag | lldb_private::minidump::MinidumpContext_x86_64_Flags::Control | lldb_private::minidump::MinidumpContext_x86_64_Flags::Se

[Lldb-commits] [lldb] [LLDB][Minidump] Extend the minidump x86_64 registers to include fs_base and gs_base (PR #106767)

2024-08-30 Thread Greg Clayton via lldb-commits
@@ -67,6 +67,18 @@ def verify_core_file( self.assertIn(thread_id, stacks_to_registers_map) register_val_list = stacks_to_registers_map[thread_id] frame_register_list = frame.GetRegisters() +# explicitly verify we collected fs and

[Lldb-commits] [lldb] [LLDB][Minidump] Extend the minidump x86_64 registers to include fs_base and gs_base (PR #106767)

2024-08-30 Thread Greg Clayton via lldb-commits
@@ -153,6 +153,10 @@ struct MinidumpContext_x86_64 { llvm::support::ulittle64_t last_branch_from_rip; llvm::support::ulittle64_t last_exception_to_rip; llvm::support::ulittle64_t last_exception_from_rip; + + // These registers are LLDB specific. clayborg

[Lldb-commits] [lldb] [LLDB][DWARF] Add an option to silence unsupported DW_FORM warnings (PR #106609)

2024-08-30 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: Please fix and revert this, we do not want this in open source. Very easy to fix and the warning does nothing to improve the situation and actually will be bad for the product. Happy to discuss over VC and get a real fix in quickly https://github.com/llvm

[Lldb-commits] [lldb] [lldb/linux] Make truncated reads work (PR #106532)

2024-08-29 Thread Greg Clayton via lldb-commits
https://github.com/clayborg approved this pull request. https://github.com/llvm/llvm-project/pull/106532 ___ 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-29 Thread Greg Clayton via lldb-commits
https://github.com/clayborg approved this pull request. 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-29 Thread Greg Clayton via lldb-commits
clayborg wrote: Sorry for the delay, feel free to ping sooner next time! Lets start with this and we can iterate on it! https://github.com/llvm/llvm-project/pull/102111 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/c

[Lldb-commits] [lldb] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)

2024-08-28 Thread Greg Clayton via lldb-commits
clayborg wrote: > I think Greg is saying that if we don't find a local symbol, and don't find > the symbol in the global symbols of the current module, then we should search > all the other modules, but in that case preferring external symbols to > internal since those are the ones that are po

[Lldb-commits] [lldb] [lldb-dap] Support inspecting memory (PR #104317)

2024-08-27 Thread Greg Clayton via lldb-commits
clayborg wrote: Let me know what you think of my idea to always just show the load address of any SBValue. I think that is the best for LLDB, but I am open to opinions. https://github.com/llvm/llvm-project/pull/104317 ___ lldb-commits mailing list lld

[Lldb-commits] [lldb] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)

2024-08-27 Thread Greg Clayton via lldb-commits
clayborg wrote: Don't let us hold this patch up if returning the the original patch that fixes things makes things work if you can't easily get the same functionality from this version of the patch. Will one part of this patch work with the new stuff and the other part not? If so, maybe we all

[Lldb-commits] [lldb] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)

2024-08-27 Thread Greg Clayton via lldb-commits
clayborg wrote: > > What happens if we stop preferring the external symbols over internal ones > > in IRExecutionUnit::FindInSymbols? What tests break? > > It looks like there are no failing tests. We should always prefer symbols from the current module first, probably external first, then fa

[Lldb-commits] [lldb] [lldb] Fix and speedup the `memory find` command (PR #104193)

2024-08-27 Thread Greg Clayton via lldb-commits
@@ -3367,21 +3340,48 @@ lldb::addr_t Process::FindInMemory(lldb::addr_t low, lldb::addr_t high, if (region_size < size) return LLDB_INVALID_ADDRESS; + // See "Boyer-Moore string search algorithm". std::vector bad_char_heuristic(256, size); - ProcessMemoryIterator i

[Lldb-commits] [lldb] [lldb] Fix and speedup the `memory find` command (PR #104193)

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

[Lldb-commits] [lldb] [lldb] Fix and speedup the `memory find` command (PR #104193)

2024-08-27 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: LGTM. I will let others chime in. https://github.com/llvm/llvm-project/pull/104193 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Turn lldb_private::Status into a value type. (PR #106163)

2024-08-27 Thread Greg Clayton via lldb-commits
clayborg wrote: My concerns are addressed, thanks @adrian-prantl https://github.com/llvm/llvm-project/pull/106163 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] Add logs for SymbolFileDWARF::FindTypes (PR #106030)

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

[Lldb-commits] [lldb] [lldb] Turn lldb_private::Status into a value type. (PR #106163)

2024-08-26 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: I worry the assert will kill the LLDB library and cause issues. Can we add a temporary setting that can override this in case it does cause crashes? I really don't want LLDB crashing if we can help it. It will be hard to test all of the error code paths t

[Lldb-commits] [lldb] [lldb][dap] always add column field in StackFrame body (PR #73393)

2024-08-26 Thread Greg Clayton via lldb-commits
clayborg wrote: I wonder if this needs to default to column 1? We might end up adding column zero. ``` /** * Start position of the range covered by the stack frame. It is measured in * UTF-16 code units and the client capability `columnsStartAt1` determines * whether it is 0- or 1-ba

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Add selectable memory regions to SBSaveCore (PR #105442)

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

[Lldb-commits] [lldb] [lldb-dap] Support inspecting memory (PR #104317)

2024-08-26 Thread Greg Clayton via lldb-commits
@@ -1085,6 +1084,17 @@ std::string VariableDescription::GetResult(llvm::StringRef context) { return description.trim().str(); } +std::optional GetMemoryReference(lldb::SBValue v) { + if (!v.GetType().IsPointerType() && !v.GetType().IsArrayType()) +return std::nullopt;

[Lldb-commits] [lldb] Fix dap stacktrace perf issue (PR #104874)

2024-08-22 Thread Greg Clayton via lldb-commits
@@ -3111,17 +3115,20 @@ void request_stackTrace(const llvm::json::Object &request) { // This will always return an invalid thread when // libBacktraceRecording.dylib is not loaded or if there is no extended // backtrace. -lldb::SBThread queue_backtrace_thread =

[Lldb-commits] [lldb] Fix dap stacktrace perf issue (PR #104874)

2024-08-22 Thread Greg Clayton via lldb-commits
clayborg wrote: >From the DAP protocol for "StackTraceRequest", I see this in the response: ``` /** * The total number of frames available in the stack. If omitted or if * `totalFrames` is larger than the available frames, a client is expected * to request frames until a reques

[Lldb-commits] [lldb] Fix dap stacktrace perf issue (PR #104874)

2024-08-22 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: You didn't add the new launch config variable to the package.json. Please add with a new PR with descriptions. https://github.com/llvm/llvm-project/pull/104874 ___ lldb-commits mailing list lldb-commits@lists.llv

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Add selectable memory regions to SBSaveCore (PR #105442)

2024-08-22 Thread Greg Clayton via lldb-commits
@@ -101,6 +103,18 @@ bool SaveCoreOptions::ShouldThreadBeSaved(lldb::tid_t tid) const { return m_threads_to_save.count(tid) > 0; } +bool SaveCoreOptions::HasSpecifiedThreads() const { + return !m_threads_to_save.empty(); +} + +void SaveCoreOptions::AddMemoryRegionToSave(co

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Add selectable memory regions to SBSaveCore (PR #105442)

2024-08-22 Thread Greg Clayton via lldb-commits
@@ -6544,7 +6545,8 @@ static void AddRegion(const MemoryRegionInfo ®ion, bool try_dirty_pages, return; if (try_dirty_pages && AddDirtyPages(region, ranges)) return; - ranges.push_back(CreateCoreFileMemoryRange(region)); + + ranges.Append(region.GetRange().GetRangeB

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Add selectable memory regions to SBSaveCore (PR #105442)

2024-08-22 Thread Greg Clayton via lldb-commits
@@ -80,6 +80,17 @@ class LLDB_API SBSaveCoreOptions { /// \return True if the thread was removed, false if it was not in the list. bool RemoveThread(lldb::SBThread thread); + /// Add a memory region to save in the core file. + /// + /// \param region The memory region t

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Add selectable memory regions to SBSaveCore (PR #105442)

2024-08-22 Thread Greg Clayton via lldb-commits
@@ -6686,9 +6710,12 @@ Status Process::CalculateCoreFileSaveRanges(const SaveCoreOptions &options, if (err.Fail()) return err; - if (ranges.empty()) + if (ranges.IsEmpty()) return Status("no valid address ranges found for core style"); + // Sort the range data

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Add selectable memory regions to SBSaveCore (PR #105442)

2024-08-22 Thread Greg Clayton via lldb-commits
@@ -101,6 +103,18 @@ bool SaveCoreOptions::ShouldThreadBeSaved(lldb::tid_t tid) const { return m_threads_to_save.count(tid) > 0; } +bool SaveCoreOptions::HasSpecifiedThreads() const { + return !m_threads_to_save.empty(); +} + +void SaveCoreOptions::AddMemoryRegionToSave(co

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Add selectable memory regions to SBSaveCore (PR #105442)

2024-08-22 Thread Greg Clayton via lldb-commits
@@ -1222,6 +1222,7 @@ enum SaveCoreStyle { eSaveCoreFull = 1, eSaveCoreDirtyOnly = 2, eSaveCoreStackOnly = 3, + eSaveCoreCustom = 4, clayborg wrote: Should we name this `eSaveCoreCustomOnly`? We should add some header doc for each of these above ones a

[Lldb-commits] [lldb] [LLDB][SBSaveCore] Add selectable memory regions to SBSaveCore (PR #105442)

2024-08-22 Thread Greg Clayton via lldb-commits
@@ -45,7 +45,6 @@ class LLDB_API SBMemoryRegionInfoList { private: friend class SBProcess; - clayborg wrote: revert whitespace only change https://github.com/llvm/llvm-project/pull/105442 ___ lldb-commits mailing

[Lldb-commits] [lldb] Fix dap stacktrace perf issue (PR #104874)

2024-08-21 Thread Greg Clayton via lldb-commits
@@ -3091,17 +3093,20 @@ void request_stackTrace(const llvm::json::Object &request) { // This will always return an invalid thread when // libBacktraceRecording.dylib is not loaded or if there is no extended // backtrace. -lldb::SBThread queue_backtrace_thread =

[Lldb-commits] [lldb] Fix dap stacktrace perf issue (PR #104874)

2024-08-21 Thread Greg Clayton via lldb-commits
@@ -3091,17 +3093,20 @@ void request_stackTrace(const llvm::json::Object &request) { // This will always return an invalid thread when // libBacktraceRecording.dylib is not loaded or if there is no extended // backtrace. -lldb::SBThread queue_backtrace_thread =

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

2024-08-21 Thread Greg Clayton via lldb-commits
https://github.com/clayborg approved this pull request. 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] Disable ThreadPlanSingleThreadTimeout during step over breakpoint (PR #104532)

2024-08-16 Thread Greg Clayton via lldb-commits
@@ -103,6 +103,12 @@ bool ThreadPlanStepOverBreakpoint::ShouldStop(Event *event_ptr) { bool ThreadPlanStepOverBreakpoint::StopOthers() { return true; } +// The ThreadPlanSingleThreadTimeout can interrupt and resume all threads during +// stepping, which may cause them to mi

[Lldb-commits] [lldb] Disable ThreadPlanSingleThreadTimeout during step over breakpoint (PR #104532)

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

[Lldb-commits] [lldb] Disable ThreadPlanSingleThreadTimeout during step over breakpoint (PR #104532)

2024-08-16 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: Seems pretty clean, but we need to get Jim's opinion in case there is a better way to do this that he would prefer. https://github.com/llvm/llvm-project/pull/104532 ___ lldb-commits mailing list lldb-commits@list

[Lldb-commits] [lldb] [lldb-dap] Support inspecting memory (PR #104317)

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

[Lldb-commits] [lldb] [lldb-dap] Support inspecting memory (PR #104317)

2024-08-15 Thread Greg Clayton via lldb-commits
@@ -1085,6 +1084,17 @@ std::string VariableDescription::GetResult(llvm::StringRef context) { return description.trim().str(); } +std::optional GetMemoryReference(lldb::SBValue v) { + if (!v.GetType().IsPointerType() && !v.GetType().IsArrayType()) +return std::nullopt;

[Lldb-commits] [lldb] [lldb-dap] Support inspecting memory (PR #104317)

2024-08-15 Thread Greg Clayton via lldb-commits
@@ -4028,6 +4049,154 @@ void request_disassemble(const llvm::json::Object &request) { response.try_emplace("body", std::move(body)); g_dap.SendJSON(llvm::json::Value(std::move(response))); } + +// "ReadMemoryRequest": { +// "allOf": [ { "$ref": "#/definitions/Request" },

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

2024-08-15 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: Looks good to me. Lets give Pavel a day to respond, if not I will approve. https://github.com/llvm/llvm-project/pull/101086 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[Lldb-commits] [lldb] (lldb) Correctly fix a usage of `PATH_MAX` and unit tests (PR #104502)

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

[Lldb-commits] [lldb] (lldb) Correctly fix a usage of `PATH_MAX` and unit tests (PR #104502)

2024-08-15 Thread Greg Clayton via lldb-commits
@@ -26,6 +27,8 @@ class Platform; class ExecutionContext; class RegisterFlags; +typedef llvm::SmallString<128> PathSmallString; clayborg wrote: I would do 256 as a starting point for paths. https://github.com/llvm/llvm-project/pull/104502 ___

[Lldb-commits] [lldb] (lldb) Fix build break for Windows (`PATH_MAX`) (PR #104493)

2024-08-15 Thread Greg Clayton via lldb-commits
clayborg wrote: Please make a follow up patch to remove the use of PATH_MAX in the SmallString. It isn't needed. Just set the value to 1024 and let the SmallString allocate on the heap if it goes over. https://github.com/llvm/llvm-project/pull/104493 __

[Lldb-commits] [lldb] [LLDB] Reapply #100443 SBSaveCore Thread list (PR #104497)

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

[Lldb-commits] [lldb] [lldb] Add Populate Methods for ELFLinuxPrPsInfo and ELFLinuxPrStatus (PR #104109)

2024-08-15 Thread Greg Clayton via lldb-commits
@@ -318,6 +318,32 @@ Status ELFLinuxPrStatus::Parse(const DataExtractor &data, return error; } +static struct compat_timeval +copy_timespecs(const ProcessInstanceInfo::timespec &oth) { + using sec_t = decltype(compat_timeval::tv_sec); + using usec_t = decltype(compat_timev

[Lldb-commits] [lldb] [lldb] Add Populate Methods for ELFLinuxPrPsInfo and ELFLinuxPrStatus (PR #104109)

2024-08-15 Thread Greg Clayton via lldb-commits
@@ -318,6 +318,32 @@ Status ELFLinuxPrStatus::Parse(const DataExtractor &data, return error; } +static struct compat_timeval +copy_timespecs(const ProcessInstanceInfo::timespec &oth) { + using sec_t = decltype(compat_timeval::tv_sec); + using usec_t = decltype(compat_timev

[Lldb-commits] [lldb] [lldb] Add Populate Methods for ELFLinuxPrPsInfo and ELFLinuxPrStatus (PR #104109)

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

[Lldb-commits] [lldb] [lldb] Add Populate Methods for ELFLinuxPrPsInfo and ELFLinuxPrStatus (PR #104109)

2024-08-15 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: Looks good, just one {} left, see inline comment. https://github.com/llvm/llvm-project/pull/104109 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-com

[Lldb-commits] [lldb] [lldb] Realpath symlinks for breakpoints (PR #102223)

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

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

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

[Lldb-commits] [lldb] Fix single thread stepping timeout race condition (PR #104195)

2024-08-14 Thread Greg Clayton via lldb-commits
@@ -29,10 +29,10 @@ ThreadPlanSingleThreadTimeout::ThreadPlanSingleThreadTimeout( : ThreadPlan(ThreadPlan::eKindSingleThreadTimeout, "Single thread timeout", thread, eVoteNo, eVoteNoOpinion), m_info(info), m_state(State::WaitTimeout) { - // TODO: re

[Lldb-commits] [lldb] [lldb] Add Populate Methods for ELFLinuxPrPsInfo and ELFLinuxPrStatus (PR #104109)

2024-08-14 Thread Greg Clayton via lldb-commits
@@ -318,6 +318,32 @@ Status ELFLinuxPrStatus::Parse(const DataExtractor &data, return error; } +static struct compat_timeval +copy_timespecs(const ProcessInstanceInfo::timespec &oth) { + using sec_t = decltype(compat_timeval::tv_sec); + using usec_t = decltype(compat_timev

[Lldb-commits] [lldb] [lldb] Add Populate Methods for ELFLinuxPrPsInfo and ELFLinuxPrStatus (PR #104109)

2024-08-14 Thread Greg Clayton via lldb-commits
@@ -394,6 +420,107 @@ Status ELFLinuxPrPsInfo::Parse(const DataExtractor &data, return error; } +std::optional +ELFLinuxPrPsInfo::Populate(const lldb::ProcessSP &process_sp) { + ELFLinuxPrPsInfo prpsinfo{}; + prpsinfo.pr_pid = process_sp->GetID(); + ProcessInstanceInfo in

  1   2   3   4   5   6   7   8   9   10   >