[Lldb-commits] [lldb] [LLDB] Add AST node classes, functions, etc. for Data Inspection Lang… (PR #95738)

2024-06-24 Thread Michael Buch via lldb-commits
@@ -0,0 +1,165 @@ +(* LLDB Debug Expressions, a subset of C++ *) +(* Insired by https://www.nongnu.org/hcb *) + +expression = assignment_expression ; + +assignment_expression = conditional_expression +logical_or_expression assignment_operator assignment_ex

[Lldb-commits] [lldb] [LLDB] Add AST node classes, functions, etc. for Data Inspection Lang… (PR #95738)

2024-06-24 Thread Michael Buch via lldb-commits
@@ -0,0 +1,165 @@ +(* LLDB Debug Expressions, a subset of C++ *) +(* Insired by https://www.nongnu.org/hcb *) + +expression = assignment_expression ; + +assignment_expression = conditional_expression +logical_or_expression assignment_operator assignment_ex

[Lldb-commits] [lldb] [LLDB] Add AST node classes, functions, etc. for Data Inspection Lang… (PR #95738)

2024-06-24 Thread Michael Buch via lldb-commits
@@ -0,0 +1,165 @@ +(* LLDB Debug Expressions, a subset of C++ *) +(* Insired by https://www.nongnu.org/hcb *) + +expression = assignment_expression ; + +assignment_expression = conditional_expression +logical_or_expression assignment_operator assignment_ex

[Lldb-commits] [lldb] [LLDB] Add AST node classes, functions, etc. for Data Inspection Lang… (PR #95738)

2024-06-24 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/95738 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [LLDB] Add AST node classes, functions, etc. for Data Inspection Lang… (PR #95738)

2024-06-24 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/95738 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb/DWARF] Optimize DIEToType handling (PR #96308)

2024-06-24 Thread Michael Buch via lldb-commits
https://github.com/Michael137 approved this pull request. Nice, this is much more understandable, thanks! https://github.com/llvm/llvm-project/pull/96308 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[Lldb-commits] [lldb] [lldb/DWARF] Remove parsing recursion when searching for definition DIEs (PR #96484)

2024-06-24 Thread Michael Buch via lldb-commits
https://github.com/Michael137 approved this pull request. Makes sense to me Do we make sure that the type lookup map is updated so we don't re-parse when calling `ParseTypeFromDWARF` with either the declaration or the definition DIE? https://github.com/llvm/llvm-project/pull/96484 _

[Lldb-commits] [lldb] [lldb/DWARF] Remove parsing recursion when searching for definition DIEs (PR #96484)

2024-06-24 Thread Michael Buch via lldb-commits
Michael137 wrote: Latest update LGTM https://github.com/llvm/llvm-project/pull/96484 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Support new libc++ __compressed_pair layout (PR #96538)

2024-06-24 Thread Michael Buch via lldb-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/96538 This patch is in preparation for the `__compressed_pair` refactor in https://github.com/llvm/llvm-project/pull/76756. This gets the formatter tests to at least pass. Currently in draft because there's still

[Lldb-commits] [lldb] [lldb][LibCxx] Move incorrect nullptr check (PR #96635)

2024-06-25 Thread Michael Buch via lldb-commits
https://github.com/Michael137 ready_for_review https://github.com/llvm/llvm-project/pull/96635 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][LibCxx] Move incorrect nullptr check (PR #96635)

2024-06-25 Thread Michael Buch via lldb-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/96635 Found this while skimming this code. Don't have a reproducible test case for this but the nullptr check should clearly occur before we try to dereference `location_sp`. >From 87edb6b9ba8b48e1bcddd2d73314cdb8

[Lldb-commits] [lldb] [lldb][LibCxx] Move incorrect nullptr check (PR #96635)

2024-06-25 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/96635 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][LibCxx] Move incorrect nullptr check (PR #96635)

2024-06-25 Thread Michael Buch via lldb-commits
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/96635 ___ 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-12 Thread Michael Buch 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-12 Thread Michael Buch 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-12 Thread Michael Buch 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-12 Thread Michael Buch 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-12 Thread Michael Buch 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-12 Thread Michael Buch 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-12 Thread Michael Buch via lldb-commits
@@ -25,6 +26,7 @@ namespace lldb_private { using StatsClock = std::chrono::high_resolution_clock; using StatsTimepoint = std::chrono::time_point; +using Duration = std::chrono::duration; Michael137 wrote: Is this used anywhere? https://github.com/llvm/llvm-p

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

2024-08-12 Thread Michael Buch 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-12 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited 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-12 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited 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-12 Thread Michael Buch via lldb-commits
@@ -918,3 +920,24 @@ def test_order_of_options_do_not_matter(self): debug_stats_1, f"The order of options '{options[0]}' and '{options[1]}' should not matter", ) + +def test_summary_statistics_providers(self): +""" +

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

2024-08-12 Thread Michael Buch via lldb-commits
@@ -1,7 +1,13 @@ // Test that the lldb command `statistics` works. +#include + +void foo() { + std::string str = "hello world"; Michael137 wrote: instead of relying on `std::string` formatter should we add a type summary for a dummy type? And test against tha

[Lldb-commits] [lldb] [lldb] Avoid calling DataLayout constructor accepting Module pointer (NFC) (PR #102839)

2024-08-12 Thread Michael Buch via lldb-commits
https://github.com/Michael137 approved this pull request. Lifetimes look correct to me, thanks! https://github.com/llvm/llvm-project/pull/102839 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/l

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

2024-08-12 Thread Michael Buch 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-12 Thread Michael Buch via lldb-commits
Michael137 wrote: Stats around this area could definitely be interesting to explore! 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] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)

2024-08-12 Thread Michael Buch via lldb-commits
https://github.com/Michael137 commented: Generally, makes sense to me. Out of curiosity, could you provide some context around where/how this came up? The ideal version of this would be a version of `FindFunctions`/`FindSymbolsWithNameAndType` that took a `ModuleSP` hint (aka where to search

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

2024-08-12 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/102835 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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

2024-08-12 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/102835 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][DWARFASTParser] Don't pass CompilerType by non-const reference in the DWARFASTParserClang APIs (PR #103245)

2024-08-13 Thread Michael Buch via lldb-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/103245 The `CompilerType` is just a wrapper around two pointers, and there is no usage of the `CompilerType` where those are expected to change underneath the caller. To make the interface more straightforward to r

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

2024-08-13 Thread Michael Buch via lldb-commits
Michael137 wrote: > Oh, wait a sec. I actually changed the behavior of the > `IRExecutionUnit::FindInSymbols`. It used to exit early if the function was > found in `module_sp`, but now we will always scan through the whole > ModuleList. And we can't change the behavior of the > `ModuleList::F

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

2024-08-13 Thread Michael Buch via lldb-commits
Michael137 wrote: > > Oh, wait a sec. I actually changed the behavior of the > > `IRExecutionUnit::FindInSymbols`. It used to exit early if the function was > > found in `module_sp`, but now we will always scan through the whole > > ModuleList. And we can't change the behavior of the > > `Mod

[Lldb-commits] [lldb] [lldb][DWARFASTParser] Don't pass CompilerType by non-const reference in the DWARFASTParserClang APIs (PR #103245)

2024-08-13 Thread Michael Buch via lldb-commits
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/103245 ___ 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 Michael Buch 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][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

2024-08-14 Thread Michael Buch 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][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

2024-08-14 Thread Michael Buch 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-14 Thread Michael Buch via lldb-commits
@@ -258,6 +258,9 @@ class TypeSummaryImpl { virtual std::string GetDescription() = 0; + virtual ConstString GetName() = 0; + virtual ConstString GetImplType() = 0; Michael137 wrote: Could we use something more descriptive for the name? My expectation fro

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

2024-08-14 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited 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 Michael Buch via lldb-commits
https://github.com/Michael137 edited 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 Michael Buch 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][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

2024-08-14 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited 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 Michael Buch via lldb-commits
@@ -615,7 +615,15 @@ 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 Michael Buch via lldb-commits
@@ -25,6 +26,7 @@ namespace lldb_private { using StatsClock = std::chrono::high_resolution_clock; using StatsTimepoint = std::chrono::time_point; +using Duration = std::chrono::duration; Michael137 wrote: If it's unused in this PR, I'd rather remove it here.

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

2024-08-14 Thread Michael Buch 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 Michael Buch 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 Michael Buch via lldb-commits
@@ -0,0 +1,35 @@ +// Test that the lldb command `statistics` works. Michael137 wrote: All this lock-talk makes me think we should have a test that exercises accessing the summary stats map from multiple threads. That way TSAN will help us in the test-suite. ht

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

2024-08-15 Thread Michael Buch via lldb-commits
Michael137 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)

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

2024-08-15 Thread Michael Buch 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-15 Thread Michael Buch 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-15 Thread Michael Buch 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][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

2024-08-15 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited 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] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)

2024-08-19 Thread Michael Buch via lldb-commits
https://github.com/Michael137 commented: Haven't thoroughly reviewed the latest callback-based approach but wonder if it is just more straightforward to keep the original plan of adding a`search_hint` to the `FindFunctions` APIs, and add a flag to `ModuleFunctionSearchOptions` that indicates w

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

2024-08-19 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/102835 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] c7a54bf - [lldb][ASTUtils] Remove unused SemaSourceWithPriorities::addSource API

2024-08-19 Thread Michael Buch via lldb-commits
Author: Michael Buch Date: 2024-08-19T16:19:44+01:00 New Revision: c7a54bfd1d25330199c96dd0a46cef1644b1b1ce URL: https://github.com/llvm/llvm-project/commit/c7a54bfd1d25330199c96dd0a46cef1644b1b1ce DIFF: https://github.com/llvm/llvm-project/commit/c7a54bfd1d25330199c96dd0a46cef1644b1b1ce.diff

[Lldb-commits] [lldb] [lldb][ClangExpressionParser] Don't leak memory when multiplexing ExternalASTSources (PR #104799)

2024-08-19 Thread Michael Buch via lldb-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/104799 When we use `SemaSourceWithPriorities` as the `ASTContext`s ExternalASTSource, we allocate a `ClangASTSourceProxy` (via `CreateProxy`) and two `ExternalASTSourceWrapper`. Then we push these sources into a ve

[Lldb-commits] [lldb] [lldb][ClangExpressionParser] Don't leak memory when multiplexing ExternalASTSources (PR #104799)

2024-08-19 Thread Michael Buch via lldb-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/104799 >From 0c23c427f7154dabadbca65f64973ec2dbe365d9 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Mon, 19 Aug 2024 15:40:07 +0100 Subject: [PATCH 1/2] [lldb][ClangExpressionParser] Don't leak memory when mult

[Lldb-commits] [lldb] [lldb][ClangExpressionParser] Don't leak memory when multiplexing ExternalASTSources (PR #104799)

2024-08-19 Thread Michael Buch via lldb-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/104799 >From 0c23c427f7154dabadbca65f64973ec2dbe365d9 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Mon, 19 Aug 2024 15:40:07 +0100 Subject: [PATCH 1/4] [lldb][ClangExpressionParser] Don't leak memory when mult

[Lldb-commits] [lldb] [lldb][ClangExpressionParser] Don't leak memory when multiplexing ExternalASTSources (PR #104799)

2024-08-19 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/104799 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][ClangExpressionParser] Don't leak memory when multiplexing ExternalASTSources (PR #104799)

2024-08-19 Thread Michael Buch via lldb-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/104799 >From 0c23c427f7154dabadbca65f64973ec2dbe365d9 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Mon, 19 Aug 2024 15:40:07 +0100 Subject: [PATCH 1/5] [lldb][ClangExpressionParser] Don't leak memory when mult

[Lldb-commits] [lldb] [lldb][ClangExpressionParser] Don't leak memory when multiplexing ExternalASTSources (PR #104799)

2024-08-19 Thread Michael Buch via lldb-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/104799 >From 0c23c427f7154dabadbca65f64973ec2dbe365d9 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Mon, 19 Aug 2024 15:40:07 +0100 Subject: [PATCH 1/6] [lldb][ClangExpressionParser] Don't leak memory when mult

[Lldb-commits] [lldb] [lldb][ClangExpressionParser] Implement ExternalSemaSource::ReadUndefinedButUsed (PR #104817)

2024-08-19 Thread Michael Buch via lldb-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/104817 While parsing an expression, Clang tries to diagnose usage of decls (with possibly non-external linkage) for which it hasn't been provided with a definition. This is the case, e.g., for functions with parame

[Lldb-commits] [lldb] [lldb][ClangExpressionParser] Implement ExternalSemaSource::ReadUndefinedButUsed (PR #104817)

2024-08-19 Thread Michael Buch via lldb-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/104817 >From 4bb7f6495a2fbf46e01b9f01c46d335d2b680afd Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Mon, 19 Aug 2024 17:39:44 +0100 Subject: [PATCH 1/2] [lldb][ClangExpressionParser] Implement ExternalSemaSourc

[Lldb-commits] [lldb] [lldb][ClangExpressionParser] Don't leak memory when multiplexing ExternalASTSources (PR #104799)

2024-08-19 Thread Michael Buch via lldb-commits
@@ -1224,15 +1224,15 @@ ClangExpressionParser::ParseInternal(DiagnosticManager &diagnostic_manager, clang::ExternalASTSource *ast_source = decl_map->CreateProxy(); if (ast_context.getExternalSource()) { - auto module_wrapper = + auto *module_wrapper =

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

2024-08-19 Thread Michael Buch via lldb-commits
@@ -175,6 +177,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][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

2024-08-19 Thread Michael Buch via lldb-commits
@@ -615,7 +615,19 @@ 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-19 Thread Michael Buch 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][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

2024-08-19 Thread Michael Buch via lldb-commits
@@ -0,0 +1,35 @@ +// Test that the lldb command `statistics` works. Michael137 wrote: Not aware of anything like this off-the-top. We'd want a test that access the same `Target` from multiple threads and formats types. Maybe having some callback tied to several

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

2024-08-19 Thread Michael Buch via lldb-commits
@@ -175,6 +177,82 @@ struct StatisticsOptions { std::optional m_include_transcript; }; +/// A class that represents statistics about a TypeSummaryProviders invocations Michael137 wrote: Can you put a note here that all members of this class need to be acces

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

2024-08-19 Thread Michael Buch via lldb-commits
@@ -175,6 +177,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][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

2024-08-19 Thread Michael Buch via lldb-commits
@@ -615,7 +615,19 @@ 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-19 Thread Michael Buch via lldb-commits
@@ -175,6 +177,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][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

2024-08-19 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited 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-19 Thread Michael Buch via lldb-commits
@@ -175,6 +177,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][ClangExpressionParser] Implement ExternalSemaSource::ReadUndefinedButUsed (PR #104817)

2024-08-20 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/104817 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][ClangExpressionParser] Don't leak memory when multiplexing ExternalASTSources (PR #104799)

2024-08-20 Thread Michael Buch via lldb-commits
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/104799 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][ClangExpressionParser] Implement ExternalSemaSource::ReadUndefinedButUsed (PR #104817)

2024-08-20 Thread Michael Buch via lldb-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/104817 >From 4bb7f6495a2fbf46e01b9f01c46d335d2b680afd Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Mon, 19 Aug 2024 17:39:44 +0100 Subject: [PATCH 1/3] [lldb][ClangExpressionParser] Implement ExternalSemaSourc

[Lldb-commits] [lldb] [lldb][ClangExpressionParser] Implement ExternalSemaSource::ReadUndefinedButUsed (PR #104817)

2024-08-20 Thread Michael Buch via lldb-commits
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/104817 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] 8d712b4 - [lldb][test] XFAIL TestAnonNamespaceParamFunc.cpp on Windows

2024-08-20 Thread Michael Buch via lldb-commits
Author: Michael Buch Date: 2024-08-20T23:30:08+01:00 New Revision: 8d712b4e3f14fe0102a5065cbd5b758dc997b529 URL: https://github.com/llvm/llvm-project/commit/8d712b4e3f14fe0102a5065cbd5b758dc997b529 DIFF: https://github.com/llvm/llvm-project/commit/8d712b4e3f14fe0102a5065cbd5b758dc997b529.diff

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

2024-08-23 Thread Michael Buch via lldb-commits
https://github.com/Michael137 approved this pull request. LGTM (left some minor comments) 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-co

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

2024-08-23 Thread Michael Buch via lldb-commits
@@ -145,15 +148,27 @@ std::string CXXFunctionSummaryFormat::GetDescription() { return std::string(sstr.GetString()); } +std::string CXXFunctionSummaryFormat::GetName() { return m_description; } + +std::string CXXFunctionSummaryFormat::GetSummaryKindName() { return "c++"; } +

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

2024-08-23 Thread Michael Buch via lldb-commits
@@ -0,0 +1,64 @@ +#include "lldb/DataFormatters/TypeSummary.h" +#include "lldb/Target/Statistics.h" +#include "lldb/Utility/Stream.h" +#include "lldb/lldb-forward.h" +#include "lldb/lldb-private-enumerations.h" +#include "lldb/lldb-private.h" +#include "llvm/Testing/Support/Error.

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

2024-08-23 Thread Michael Buch via lldb-commits
@@ -145,15 +148,27 @@ std::string CXXFunctionSummaryFormat::GetDescription() { return std::string(sstr.GetString()); } +std::string CXXFunctionSummaryFormat::GetName() { return m_description; } + +std::string CXXFunctionSummaryFormat::GetSummaryKindName() { return "c++"; } +

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

2024-08-23 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited 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] Add frame recognizers for libc++ `std::invoke` (PR #105695)

2024-08-23 Thread Michael Buch via lldb-commits
@@ -53,10 +54,32 @@ class LibCXXFrameRecognizer : public StackFrameRecognizer { public: LibCXXFrameRecognizer() - : m_hidden_function_regex( -R"(^std::__1::(__function.*::operator\(\)|__invoke))" -R"((\[.*\])?)"// ABI tag. -R"(( c

[Lldb-commits] [lldb] [lldb] Add frame recognizers for libc++ `std::invoke` (PR #105695)

2024-08-23 Thread Michael Buch via lldb-commits
@@ -81,8 +105,9 @@ CPPLanguageRuntime::CPPLanguageRuntime(Process *process) if (process) process->GetTarget().GetFrameRecognizerManager().AddRecognizer( StackFrameRecognizerSP(new LibCXXFrameRecognizer()), {}, -std::make_shared("^std::__1::"), -/*f

[Lldb-commits] [lldb] [lldb] Add frame recognizers for libc++ `std::invoke` (PR #105695)

2024-08-23 Thread Michael Buch via lldb-commits
@@ -1049,7 +1049,7 @@ let Command = "thread backtrace" in { def thread_backtrace_extended : Option<"extended", "e">, Group<1>, Arg<"Boolean">, Desc<"Show the extended backtrace, if available">; def thread_backtrace_unfiltered : Option<"unfiltered", "u">, Group<1>, - Desc

[Lldb-commits] [lldb] [lldb] Add frame recognizers for libc++ `std::invoke` (PR #105695)

2024-08-23 Thread Michael Buch via lldb-commits
@@ -145,6 +167,17 @@ StackFrameRecognizerManager::GetRecognizerForFrame(StackFrameSP frame) { if (!entry.module_regexp->Execute(module_name.GetStringRef())) continue; +ConstString function_name = [&]() { + switch (entry.mangling_preference) { + cas

[Lldb-commits] [lldb] [lldb] Support frame recognizer regexp on mangled names. (PR #105756)

2024-08-23 Thread Michael Buch via lldb-commits
@@ -927,6 +928,32 @@ class CommandObjectFrameRecognizerClear : public CommandObjectParsed { } }; +static void +PrintRecognizerDetails(Stream &strm, const std::string &module, + llvm::ArrayRef symbols, + Mangled::NamePreference pre

[Lldb-commits] [lldb] [lldb] Add frame recognizers for libc++ `std::invoke` (PR #105695)

2024-08-23 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/105695 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Add frame recognizers for libc++ `std::invoke` (PR #105695)

2024-08-23 Thread Michael Buch via lldb-commits
@@ -145,6 +167,17 @@ StackFrameRecognizerManager::GetRecognizerForFrame(StackFrameSP frame) { if (!entry.module_regexp->Execute(module_name.GetStringRef())) continue; +ConstString function_name = [&]() { + switch (entry.mangling_preference) { + cas

[Lldb-commits] [lldb] [lldb] Add frame recognizers for libc++ `std::invoke` (PR #105695)

2024-08-23 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/105695 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] 2847020 - [lldb][TypeSystemClang][NFC] Log failure to InitBuiltinTypes

2024-08-25 Thread Michael Buch via lldb-commits
Author: Michael Buch Date: 2024-08-25T10:08:45+01:00 New Revision: 2847020dbd9b8f932ee564651ec72ce15fa37d07 URL: https://github.com/llvm/llvm-project/commit/2847020dbd9b8f932ee564651ec72ce15fa37d07 DIFF: https://github.com/llvm/llvm-project/commit/2847020dbd9b8f932ee564651ec72ce15fa37d07.diff

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

2024-08-25 Thread Michael Buch via lldb-commits
https://github.com/Michael137 approved this pull request. I found this useful in the past, so LGTM, thanks! We also seem to have lost the counterpart log message which tells us whether we found something or not: ``` GetObjectFile()->GetModule()->LogMessage( log, "Sym

[Lldb-commits] [lldb] [lldb] Add frame recognizers for libc++ `std::invoke` (PR #105695)

2024-08-25 Thread Michael Buch via lldb-commits
https://github.com/Michael137 approved this pull request. LGTM (with some minor comments). I'd wait for @adrian-prantl to also review this https://github.com/llvm/llvm-project/pull/105695 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https:

[Lldb-commits] [lldb] [lldb] Add frame recognizers for libc++ `std::invoke` (PR #105695)

2024-08-25 Thread Michael Buch via lldb-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/105695 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Add frame recognizers for libc++ `std::invoke` (PR #105695)

2024-08-25 Thread Michael Buch via lldb-commits
@@ -196,8 +197,8 @@ AbortWithPayloadFrameRecognizer::RecognizeFrame(lldb::StackFrameSP frame_sp) { abort_dict_sp->AddStringItem(reason_key, reason_string); abort_dict_sp->AddIntegerItem(flags_key, flags_val); - // This will overwrite the abort_with_payload information in

[Lldb-commits] [lldb] [lldb] Add frame recognizers for libc++ `std::invoke` (PR #105695)

2024-08-25 Thread Michael Buch via lldb-commits
@@ -0,0 +1,43 @@ +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class LibCxxStdFunctionRecognizerTestCase(TestBase): +NO_DEBUG_INFO_TESTCASE = True + +@add_test_categories(["libc++"]) +

[Lldb-commits] [lldb] [lldb] Add frame recognizers for libc++ `std::invoke` (PR #105695)

2024-08-25 Thread Michael Buch via lldb-commits
@@ -0,0 +1,40 @@ +#include +#include + +void print_num(int i) { + // break here + std::cout << i << '\n'; Michael137 wrote: no need to print to `std::cout` anywhere in the test imo. Also, we usually try to avoid breakpoints on comments. So wrapping them in s

<    1   2   3   4   5   6   7   8   9   10   >