[Lldb-commits] [lldb] [lldb] Add 'FindInMemory()' overload for PostMortemProcess. (PR #102536)

2024-08-13 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,83 @@ +//===-- PostMortemProcess.cpp ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[Lldb-commits] [lldb] [lldb] Add 'FindInMemory()' overload for PostMortemProcess. (PR #102536)

2024-08-13 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,83 @@ +//===-- PostMortemProcess.cpp ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

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

2024-08-13 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: I am good with this if Jim and Pavel's issues have been resolved. https://github.com/llvm/llvm-project/pull/102223 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

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

2024-08-13 Thread Greg Clayton via lldb-commits
https://github.com/clayborg requested changes to 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][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

2024-08-13 Thread Greg Clayton via lldb-commits
@@ -258,6 +258,9 @@ class TypeSummaryImpl { virtual std::string GetDescription() = 0; + virtual ConstString GetName() = 0; + virtual ConstString GetImplType() = 0; clayborg wrote: Add header doc for these explaining what they are. https://github.com/llv

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

2024-08-13 Thread Greg Clayton via lldb-commits
@@ -145,15 +148,34 @@ std::string CXXFunctionSummaryFormat::GetDescription() { return std::string(sstr.GetString()); } +ConstString CXXFunctionSummaryFormat::GetName() { + return ConstString(m_description); +} + +ConstString CXXFunctionSummaryFormat::GetImplType() { + retu

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

2024-08-13 Thread Greg Clayton via lldb-commits
@@ -602,7 +602,7 @@ bool ValueObject::GetSummaryAsCString(TypeSummaryImpl *summary_ptr, actual_options.SetLanguage(GetPreferredDisplayLanguage()); // this is a hot path in code and we prefer to avoid setting this string all - // too often also clearing out other inform

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

2024-08-13 Thread Greg Clayton via lldb-commits
@@ -258,6 +258,9 @@ class TypeSummaryImpl { virtual std::string GetDescription() = 0; + virtual ConstString GetName() = 0; + virtual ConstString GetImplType() = 0; + clayborg wrote: We should switch to `std::string` instead of `ConstString.. These object

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

2024-08-13 Thread Greg Clayton via lldb-commits
@@ -174,6 +176,83 @@ struct StatisticsOptions { std::optional m_include_transcript; }; +/// A class that represents statistics about a TypeSummaryProviders invocations +class SummaryStatistics { +public: + SummaryStatistics() = default; + SummaryStatistics(lldb_private::Co

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

2024-08-13 Thread Greg Clayton via lldb-commits
@@ -116,6 +116,9 @@ std::string StringSummaryFormat::GetDescription() { return std::string(sstr.GetString()); } +ConstString StringSummaryFormat::GetName() { return ConstString(m_format_str); } +ConstString StringSummaryFormat::GetImplType() { return ConstString("string");

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

2024-08-13 Thread Greg Clayton via lldb-commits
@@ -174,6 +177,84 @@ struct StatisticsOptions { std::optional m_include_transcript; }; +/// A class that represents statistics about a TypeSummaryProviders invocations +class SummaryStatistics { +public: + explicit SummaryStatistics(lldb_private::ConstString name, +

[Lldb-commits] [lldb] [lldb] Add 'FindInMemory()' overload for PostMortemProcess. (PR #102536)

2024-08-13 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: I vote to leave this PR as is because `VMRangeToFileOffset` is a list of VMRanges that map to file offsets and this list combines entries with consecutive address ranges whose data is consecutive in the core file. And `VMRangeToPermissions` does not break

[Lldb-commits] [lldb] [lldb] Add 'FindInMemory()' overload for PostMortemProcess. (PR #102536)

2024-08-13 Thread Greg Clayton via lldb-commits
clayborg wrote: That being said, if there is something we can do to this PR to make it easy for you (Pavel) to implement this feature, we can make those changes. Like I think it would be fair to change all `PeekMemory/DoPeekMemory` over a virtual `ReadMemory/DoReadMemory` that returns a `DataE

[Lldb-commits] [lldb] [lldb] Add 'FindInMemory()' overload for PostMortemProcess. (PR #102536)

2024-08-14 Thread Greg Clayton via lldb-commits
clayborg wrote: Yes, this is primarily for performance of C++ coroutine detection where we must search memory for magic values. https://github.com/llvm/llvm-project/pull/102536 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.ll

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

2024-08-14 Thread Greg Clayton via lldb-commits
https://github.com/clayborg requested changes to 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][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

2024-08-14 Thread Greg Clayton via lldb-commits
@@ -174,6 +177,86 @@ 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-08-14 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-08-14 Thread Greg Clayton via lldb-commits
@@ -615,7 +615,16 @@ bool ValueObject::GetSummaryAsCString(TypeSummaryImpl *summary_ptr, m_synthetic_value->UpdateValueIfNeeded(); // the summary might depend on // the synthetic children being

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

2024-08-14 Thread Greg Clayton via lldb-commits
@@ -408,3 +410,21 @@ llvm::json::Value DebuggerStats::ReportStatistics( return std::move(global_stats); } + +llvm::json::Value SummaryStatistics::ToJSON() const { + return json::Object{{ + {"name", GetName()}, + {"type", GetSummaryKindName()}, + {"invocationC

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

2024-08-14 Thread Greg Clayton via lldb-commits
clayborg wrote: > Could you please explain to me why we use different rules in symbol lookups? > Namely: > > * > [ClangExpressionDeclMap::GetSymbolAddress](https://github.com/llvm/llvm-project/pull/102835/files#diff-5d2da8306a4f4991885836925979f188658789adc8041c37811c243f2cdca24c) > doesn't s

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

2024-08-14 Thread Greg Clayton via lldb-commits
@@ -174,6 +177,83 @@ 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-08-14 Thread Greg Clayton via lldb-commits
@@ -174,6 +177,83 @@ 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-dap] Support inspecting memory (PR #104317)

2024-08-14 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-14 Thread Greg Clayton via lldb-commits
@@ -1085,6 +1085,19 @@ std::string VariableDescription::GetResult(llvm::StringRef context) { return description.trim().str(); } +lldb::addr_t GetMemoryReference(lldb::SBValue v) { + if (!v.GetType().IsPointerType() && !v.GetType().IsArrayType()) { +return LLDB_INVALID_

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

2024-08-14 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-dap] Support inspecting memory (PR #104317)

2024-08-14 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-dap] Support inspecting memory (PR #104317)

2024-08-14 Thread Greg Clayton via lldb-commits
@@ -1085,6 +1085,19 @@ std::string VariableDescription::GetResult(llvm::StringRef context) { return description.trim().str(); } +lldb::addr_t GetMemoryReference(lldb::SBValue v) { clayborg wrote: If we return a `std::optional` it will clean up the call sit

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

2024-08-14 Thread Greg Clayton via lldb-commits
@@ -3600,8 +3617,12 @@ void request_setVariable(const llvm::json::Object &request) { if (variable.MightHaveChildren()) newVariablesReference = g_dap.variables.InsertExpandableVariable( variable, /*is_permanent=*/false); - body.try_emplace("vari

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

2024-08-14 Thread Greg Clayton via lldb-commits
@@ -1411,6 +1422,10 @@ void request_evaluate(const llvm::json::Object &request) { } else { body.try_emplace("variablesReference", (int64_t)0); } + if (lldb::addr_t addr = GetMemoryReference(value); + addr != LLDB_INVALID_ADDRESS) { +bo

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

2024-08-14 Thread Greg Clayton via lldb-commits
@@ -1253,6 +1274,10 @@ llvm::json::Value CreateVariable(lldb::SBValue v, int64_t variablesReference, else object.try_emplace("variablesReference", (int64_t)0); + if (lldb::addr_t addr = GetMemoryReference(v); addr != LLDB_INVALID_ADDRESS) { +object.try_emplace("me

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

2024-08-14 Thread Greg Clayton via lldb-commits
@@ -411,6 +411,12 @@ struct VariableDescription { std::string GetResult(llvm::StringRef context); }; +/// Get the corresponding `memoryReference` for a value. +/// +/// According to the DAP documentation, the `memoryReference` should +/// refer to the pointee, not to the add

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

2024-08-14 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-dap] Support inspecting memory (PR #104317)

2024-08-14 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-dap] Support inspecting memory (PR #104317)

2024-08-14 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-dap] Support inspecting memory (PR #104317)

2024-08-14 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] 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

[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

[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

[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

[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

[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

[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] 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] 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] [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] [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] 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
@@ -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] 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) 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) 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) 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][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-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] 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] 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] [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] 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][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] [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
@@ -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
@@ -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
@@ -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
@@ -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] 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] 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
@@ -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] [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] [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] 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] 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] 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-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] [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] 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
@@ -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] 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] 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] [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-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] 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] [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/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][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][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][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] 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] 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-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] 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] 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] [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

<    13   14   15   16   17   18   19   20   21   22   >