[Lldb-commits] [lldb] [lldb] deactivate some tests on older SDKs (PR #147768)
Michael137 wrote: Actually just saw that our Intel bots are running a newer OS: ``` 10:03:35 + sw_vers 10:03:35 ProductName: macOS 10:03:35 ProductVersion: 15.1.1 10:03:35 BuildVersion: 24B91 10:03:35 + xcodebuild -version 10:03:39 Xcode 16.2 10:03:39 Build version 16C5031c 10:03:39 + cmake --version 10:03:39 cmake version 3.30.2 ``` So we would still technically get coverage. Though would be nice to have the AS bots testing this too https://github.com/llvm/llvm-project/pull/147768 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] c4cc357 - [Clang][AST][NFC] (`RecordDecl` -> `CXXRecordDecl`)`::isInjectedClassName` (#148195)
Author: Yanzuo Liu Date: 2025-07-12T21:13:30+08:00 New Revision: c4cc3573d144831d2815433646ffcab62cc9ea40 URL: https://github.com/llvm/llvm-project/commit/c4cc3573d144831d2815433646ffcab62cc9ea40 DIFF: https://github.com/llvm/llvm-project/commit/c4cc3573d144831d2815433646ffcab62cc9ea40.diff LOG: [Clang][AST][NFC] (`RecordDecl` -> `CXXRecordDecl`)`::isInjectedClassName` (#148195) Move `RecordDecl::isInjectedClassName` to `CXXRecordDecl::isInjectedClassName`. C language doesn't have the term "injected class name". Co-authored-by: Matheus Izvekov Added: Modified: clang-tools-extra/clangd/CodeComplete.cpp clang-tools-extra/clangd/Quality.cpp clang-tools-extra/clangd/SemanticHighlighting.cpp clang/include/clang/AST/Decl.h clang/include/clang/AST/DeclCXX.h clang/lib/AST/Decl.cpp clang/lib/AST/DeclCXX.cpp clang/lib/Sema/SemaAccess.cpp lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp Removed: diff --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp index 14679fea6ac8a..d5907e3143bf6 100644 --- a/clang-tools-extra/clangd/CodeComplete.cpp +++ b/clang-tools-extra/clangd/CodeComplete.cpp @@ -870,7 +870,7 @@ bool contextAllowsIndex(enum CodeCompletionContext::Kind K) { } static bool isInjectedClass(const NamedDecl &D) { - if (auto *R = dyn_cast_or_null(&D)) + if (auto *R = dyn_cast_or_null(&D)) if (R->isInjectedClassName()) return true; return false; diff --git a/clang-tools-extra/clangd/Quality.cpp b/clang-tools-extra/clangd/Quality.cpp index c1ab63fb22f61..3f630b05c654b 100644 --- a/clang-tools-extra/clangd/Quality.cpp +++ b/clang-tools-extra/clangd/Quality.cpp @@ -258,7 +258,7 @@ static SymbolRelevanceSignals::AccessibleScope computeScope(const NamedDecl *D) { // Injected "Foo" within the class "Foo" has file scope, not class scope. const DeclContext *DC = D->getDeclContext(); - if (auto *R = dyn_cast_or_null(D)) + if (auto *R = dyn_cast_or_null(D)) if (R->isInjectedClassName()) DC = DC->getParent(); // Class constructor should have the same scope as the class. diff --git a/clang-tools-extra/clangd/SemanticHighlighting.cpp b/clang-tools-extra/clangd/SemanticHighlighting.cpp index dc574dcd11703..e6d5cf7053694 100644 --- a/clang-tools-extra/clangd/SemanticHighlighting.cpp +++ b/clang-tools-extra/clangd/SemanticHighlighting.cpp @@ -597,7 +597,7 @@ class HighlightingsBuilder { std::optional scopeModifier(const NamedDecl *D) { const DeclContext *DC = D->getDeclContext(); // Injected "Foo" within the class "Foo" has file scope, not class scope. - if (auto *R = dyn_cast_or_null(D)) + if (auto *R = dyn_cast_or_null(D)) if (R->isInjectedClassName()) DC = DC->getParent(); // Lambda captures are considered function scope, not class scope. diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h index de79a9df29a5b..3d7969cca83fd 100644 --- a/clang/include/clang/AST/Decl.h +++ b/clang/include/clang/AST/Decl.h @@ -4420,21 +4420,6 @@ class RecordDecl : public TagDecl { void reorderDecls(const SmallVectorImpl &Decls); - /// Determines whether this declaration represents the - /// injected class name. - /// - /// The injected class name in C++ is the name of the class that - /// appears inside the class itself. For example: - /// - /// \code - /// struct C { - /// // C is implicitly declared here as a synonym for the class name. - /// }; - /// - /// C::C c; // same as "C c;" - /// \endcode - bool isInjectedClassName() const; - /// Determine whether this record is a class describing a lambda /// function object. bool isLambda() const; diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h index 05cddd024d7cf..77bc3cad72ed9 100644 --- a/clang/include/clang/AST/DeclCXX.h +++ b/clang/include/clang/AST/DeclCXX.h @@ -546,8 +546,7 @@ class CXXRecordDecl : public RecordDecl { } CXXRecordDecl *getMostRecentNonInjectedDecl() { -CXXRecordDecl *Recent = -static_cast(this)->getMostRecentDecl(); +CXXRecordDecl *Recent = getMostRecentDecl(); while (Recent->isInjectedClassName()) { // FIXME: Does injected class name need to be in the redeclarations chain? assert(Recent->getPreviousDecl()); @@ -1889,6 +1888,21 @@ class CXXRecordDecl : public RecordDecl { DL.IsGenericLambda = IsGeneric; } + /// Determines whether this declaration represents the + /// injected class name. + /// + /// The injected class name in C++ is the name of the class that + /// appears inside the class itself. For example: + /// + /// \code + /// struct C { + /// // C is implicitly declared here as a synonym for the class name. + /// }; + /// + /// C::C c; // same as "C c;" + /// \endcode + bo
[Lldb-commits] [clang] [clang-tools-extra] [lldb] [Clang][AST][NFC] (`RecordDecl` -> `CXXRecordDecl`)`::isInjectedClassName` (PR #148195)
https://github.com/zwuis closed https://github.com/llvm/llvm-project/pull/148195 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [clang] [clang-tools-extra] [lldb] [Clang][AST][NFC] (`RecordDecl` -> `CXXRecordDecl`)`::isInjectedClassName` (PR #148195)
zwuis wrote: Thanks for your review. https://github.com/llvm/llvm-project/pull/148195 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [clang] [clang-tools-extra] [lldb] [Clang][AST][NFC] (`RecordDecl` -> `CXXRecordDecl`)`::isInjectedClassName` (PR #148195)
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-x86_64-debian` running on `lldb-x86_64-debian` while building `clang-tools-extra,clang,lldb` at step 6 "test". Full details are available at: https://lab.llvm.org/buildbot/#/builders/162/builds/26685 Here is the relevant piece of the build log for the reference ``` Step 6 (test) failure: build (failure) ... UNSUPPORTED: lldb-shell :: ScriptInterpreter/Lua/partial_statements.test (3076 of 3087) UNSUPPORTED: lldb-shell :: ScriptInterpreter/Python/Crashlog/json.test (3077 of 3087) UNSUPPORTED: lldb-shell :: ScriptInterpreter/Lua/command_script_import.test (3078 of 3087) UNSUPPORTED: lldb-shell :: Commands/command-target-create-resolve-exe.test (3079 of 3087) UNSUPPORTED: lldb-shell :: ScriptInterpreter/Lua/breakpoint_oneline_callback.test (3080 of 3087) UNSUPPORTED: lldb-shell :: ScriptInterpreter/Python/Crashlog/app_specific_backtrace_crashlog.test (3081 of 3087) UNSUPPORTED: lldb-shell :: ScriptInterpreter/Lua/print.test (3082 of 3087) UNSUPPORTED: lldb-shell :: ScriptInterpreter/Python/Crashlog/interactive_crashlog_json.test (3083 of 3087) PASS: lldb-api :: terminal/TestEditlineCompletions.py (3084 of 3087) UNRESOLVED: lldb-api :: tools/lldb-dap/launch/TestDAP_launch.py (3085 of 3087) TEST 'lldb-api :: tools/lldb-dap/launch/TestDAP_launch.py' FAILED Script: -- /usr/bin/python3 /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/./lib --env LLVM_INCLUDE_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/include --env LLVM_TOOLS_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/./bin --arch x86_64 --build-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex --lldb-module-cache-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/lldb --compiler /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/clang --dsymutil /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/dsymutil --make /usr/bin/gmake --llvm-tools-dir /home/worker/2.0.1/lldb-x86_64-debian/build/./bin --lldb-obj-root /home/worker/2.0.1/lldb-x86_64-debian/build/tools/lldb --lldb-libs-dir /home/worker/2.0.1/lldb-x86_64-debian/build/./lib --cmake-build-type Release -t /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/tools/lldb-dap/launch -p TestDAP_launch.py -- Exit Code: 1 Command Output (stdout): -- lldb version 21.0.0git (https://github.com/llvm/llvm-project.git revision c4cc3573d144831d2815433646ffcab62cc9ea40) clang revision c4cc3573d144831d2815433646ffcab62cc9ea40 llvm revision c4cc3573d144831d2815433646ffcab62cc9ea40 Skipping the following test categories: ['libc++', 'msvcstl', 'dsym', 'gmodules', 'debugserver', 'objc'] -- Command Output (stderr): -- Change dir to: /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/tools/lldb-dap/launch runCmd: settings clear --all output: runCmd: settings set symbols.enable-external-lookup false output: runCmd: settings set target.inherit-tcc true output: runCmd: settings set target.disable-aslr false output: runCmd: settings set target.detach-on-error false output: runCmd: settings set target.auto-apply-fixits false ``` https://github.com/llvm/llvm-project/pull/148195 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [clang] [clang-tools-extra] [lldb] [Clang][AST][NFC] (`RecordDecl` -> `CXXRecordDecl`)`::isInjectedClassName` (PR #148195)
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/148195 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [clang] [clang-tools-extra] [lldb] [Clang][AST][NFC] (`RecordDecl` -> `CXXRecordDecl`)`::isInjectedClassName` (PR #148195)
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-arm-ubuntu` running on `linaro-lldb-arm-ubuntu` while building `clang-tools-extra,clang,lldb` at step 6 "test". Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/18898 Here is the relevant piece of the build log for the reference ``` Step 6 (test) failure: build (failure) ... PASS: lldb-shell :: Settings/TestLineMarkerColor.test (1670 of 3331) PASS: lldb-shell :: Settings/TestSettingsWrite.test (1671 of 3331) PASS: lldb-shell :: Settings/TestStopCommandSourceOnError.test (1672 of 3331) PASS: lldb-shell :: Settings/TestFrameFormatName.test (1673 of 3331) PASS: lldb-shell :: Subprocess/clone-follow-child-softbp.test (1674 of 3331) PASS: lldb-shell :: Subprocess/clone-follow-child.test (1675 of 3331) PASS: lldb-shell :: Subprocess/clone-follow-parent-softbp.test (1676 of 3331) PASS: lldb-shell :: Subprocess/clone-follow-parent.test (1677 of 3331) PASS: lldb-shell :: Subprocess/fork-follow-child-softbp.test (1678 of 3331) UNRESOLVED: lldb-api :: tools/lldb-server/TestLldbGdbServer.py (1679 of 3331) TEST 'lldb-api :: tools/lldb-server/TestLldbGdbServer.py' FAILED Script: -- /usr/bin/python3.10 /home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./lib --env LLVM_INCLUDE_DIR=/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/include --env LLVM_TOOLS_DIR=/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin --arch armv8l --build-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lldb-test-build.noindex --lldb-module-cache-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin/lldb --compiler /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin/clang --dsymutil /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin/dsymutil --make /usr/bin/gmake --llvm-tools-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin --lldb-obj-root /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb --lldb-libs-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./lib --cmake-build-type Release /home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/API/tools/lldb-server -p TestLldbGdbServer.py -- Exit Code: 1 Command Output (stdout): -- lldb version 21.0.0git (https://github.com/llvm/llvm-project.git revision c4cc3573d144831d2815433646ffcab62cc9ea40) clang revision c4cc3573d144831d2815433646ffcab62cc9ea40 llvm revision c4cc3573d144831d2815433646ffcab62cc9ea40 Skipping the following test categories: ['libc++', 'msvcstl', 'dsym', 'gmodules', 'debugserver', 'objc'] -- Command Output (stderr): -- UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_Hc_then_Csignal_signals_correct_thread_launch_debugserver (TestLldbGdbServer.LldbGdbServerTestCase) (test case does not fall in any category of interest for this run) PASS: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_Hc_then_Csignal_signals_correct_thread_launch_llgs (TestLldbGdbServer.LldbGdbServerTestCase) PASS: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_Hg_fails_on_another_pid_llgs (TestLldbGdbServer.LldbGdbServerTestCase) PASS: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_Hg_fails_on_minus_one_pid_llgs (TestLldbGdbServer.LldbGdbServerTestCase) PASS: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_Hg_fails_on_zero_pid_llgs (TestLldbGdbServer.LldbGdbServerTestCase) UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_Hg_switches_to_3_threads_launch_debugserver (TestLldbGdbServer.LldbGdbServerTestCase) (test case does not fall in any category of interest for this run) PASS: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_Hg_switches_to_3_threads_launch_llgs (TestLldbGdbServer.LldbGdbServerTestCase) UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_P_and_p_thread_suffix_work_debugserver (TestLldbGdbServer.LldbGdbServerTestCase) (test case does not fall in any category of interest for this run) PASS: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_P_and_p_thread_suffix_work_llgs (TestLldbGdbServer.LldbGdbServerTestCase) UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_P_writes_all_gpr_registers_debugserver (TestLldbGdbServer.LldbGdbServerTestCase) (test case does not fall in any category of interest for this run) PASS: LLDB (/home/tcwg-buildbot/worker/lldb-arm-
[Lldb-commits] [lldb] [lldb][Format] Fall back to old function.name-with-args if language frame format is emtpy (PR #148235)
https://github.com/JDevlieghere approved this pull request. https://github.com/llvm/llvm-project/pull/148235 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] deactivate some tests on older SDKs (PR #147768)
https://github.com/JDevlieghere approved this pull request. > The conclusion was we will upgrade the AS bots on Green Dragon and only then > land this PR. We do want coverage for these since they usually expose Clang > modules related issues. Alright, that sounds good and alleviates my concern. Thank you both! https://github.com/llvm/llvm-project/pull/147768 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add DWARFExpressionEntry and GetExpressionEntryAtAddress() to … (PR #144238)
github-actions[bot] wrote: @UltimateForce21 Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a build, you may receive a report in an email or a comment on this PR. Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues. How to do this, and the rest of the post-merge process, is covered in detail [here](https://llvm.org/docs/MyFirstTypoFix.html#myfirsttypofix-issues-after-landing-your-pr). If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of [LLVM development](https://llvm.org/docs/DeveloperPolicy.html#patch-reversion-policy). You can fix your changes and open a new PR to merge them again. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! https://github.com/llvm/llvm-project/pull/144238 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add DWARFExpressionEntry and GetExpressionEntryAtAddress() to … (PR #144238)
https://github.com/JDevlieghere closed https://github.com/llvm/llvm-project/pull/144238 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 7cb8439 - [lldb] Add DWARFExpressionEntry and GetExpressionEntryAtAddress() to … (#144238)
Author: Abdullah Mohammad Amin Date: 2025-07-12T10:03:54-07:00 New Revision: 7cb84392fd4abb2190c09045d25abc98571a1396 URL: https://github.com/llvm/llvm-project/commit/7cb84392fd4abb2190c09045d25abc98571a1396 DIFF: https://github.com/llvm/llvm-project/commit/7cb84392fd4abb2190c09045d25abc98571a1396.diff LOG: [lldb] Add DWARFExpressionEntry and GetExpressionEntryAtAddress() to … (#144238) This patch introduces a new struct and helper API in `DWARFExpressionList` to expose variable location metadata (base address, end address, and DWARFExpression pointer) for a given PC address. It will be used in later patches to annotate disassembly instructions with source-level variable locations. ## New struct ``` /// Represents one entry in a DWARFExpressionList, with its range and expr. struct DWARFExpressionEntry { lldb::addr_t base; // file‐address start of this location range lldb::addr_t end;// file‐address end of this range (exclusive) const DWARFExpression *expr; // the DWARF expression for this range }; ``` ## New API ``` /// Retrieve the DWARFExpressionEntry covering a particular instruction. /// /// \param func_load_addr /// The load address of the start of the function containing this location list; /// used to translate between file offsets and load addresses. If this is /// LLDB_INVALID_ADDRESS, the stored CU base (m_func_file_addr) is used. /// /// \param load_addr /// The load address of the *current* PC (i.e., the instruction for which /// we want its variable‐location entry). We first convert this back into /// the function’s file‐address space to find the correct DWARF range. /// /// \returns /// On success, an entry whose `[base,end)` covers this PC; else an Error. llvm::Expected GetExpressionEntryAtAddress(lldb::addr_t func_load_addr, lldb::addr_t load_addr) const; ``` ## Rationale LLDB already provides: ``` const DWARFExpression * GetExpressionAtAddress(lldb::addr_t func_load_addr, lldb::addr_t load_addr) const; ``` However, this only returns the DWARF expression itself, without the file‐address start (base) and end (end) of the location range. Those bounds are crucial for: 1) Detecting range beginnings: render a var = annotation exactly when a variable’s live‐range starts. 2) Detecting range continuation: optionally display a “|” on subsequent instructions in the same range. 3) Detecting state changes: know when a variable moves (e.g. from one register to another), becomes a constant, or goes out of scope. These primitives form the foundation for the Rich Disassembler feature proposed for GSoC 25. - Co-authored-by: Jonas Devlieghere Co-authored-by: Adrian Prantl Added: Modified: lldb/include/lldb/Expression/DWARFExpressionList.h lldb/source/Expression/DWARFExpressionList.cpp Removed: diff --git a/lldb/include/lldb/Expression/DWARFExpressionList.h b/lldb/include/lldb/Expression/DWARFExpressionList.h index d8f8ec247ed56..d303ad834b354 100644 --- a/lldb/include/lldb/Expression/DWARFExpressionList.h +++ b/lldb/include/lldb/Expression/DWARFExpressionList.h @@ -9,6 +9,7 @@ #ifndef LLDB_EXPRESSION_DWARFEXPRESSIONLIST_H #define LLDB_EXPRESSION_DWARFEXPRESSIONLIST_H +#include "lldb/Core/AddressRange.h" #include "lldb/Core/Value.h" #include "lldb/Expression/DWARFExpression.h" #include "lldb/Utility/RangeMap.h" @@ -59,6 +60,21 @@ class DWARFExpressionList { lldb::addr_t GetFuncFileAddress() { return m_func_file_addr; } + /// Represents an entry in the DWARFExpressionList with all needed metadata. + struct DWARFExpressionEntry { +/// Represents a DWARF location range in the DWARF unit’s file‐address space +std::optional file_range; ///< None = always-valid single expr +const DWARFExpression *expr; + }; + + /// Returns a DWARFExpressionEntry whose file_range contains the given + /// load‐address. `func_load_addr` is the load‐address of the function + /// start; `load_addr` is the full runtime PC. On success, `expr` is + /// non-null. + std::optional + GetExpressionEntryAtAddress(lldb::addr_t func_load_addr, + lldb::addr_t load_addr) const; + const DWARFExpression *GetExpressionAtAddress(lldb::addr_t func_load_addr, lldb::addr_t load_addr) const; diff --git a/lldb/source/Expression/DWARFExpressionList.cpp b/lldb/source/Expression/DWARFExpressionList.cpp index 04592a1eb7ff4..ef7333518f008 100644 --- a/lldb/source/Expression/DWARFExpressionList.cpp +++ b/lldb/source/Expression/DWARFExpressionList.cpp @@ -7,6 +7,7 @@ //===--===// #include "lldb/Expression/DWARFExpressionList.h" +#include "lldb/Core/AddressRange.h" #include "lldb/Symbol/Function.h" #include "lldb/Target/RegisterC
[Lldb-commits] [lldb] [LLDB] Add formatters for MSVC STL map-like types (PR #148385)
https://github.com/Nerixyz created https://github.com/llvm/llvm-project/pull/148385 This PR adds formatters for `std::map`, `std::set`, `std::multimap`, `std::multiset` as well as their iterators. It's done in one PR because the types are essentially the same (a tree) except for their value type. The iterators are required because of the tests. `MsvcStlTreeIterSyntheticFrontEnd` is based on the libc++ equivalent. As opposed to `std::list`, there aren't that many duplicates, so I didn't create a generic type. For reference, the tree is implemented in https://github.com/microsoft/STL/blob/313964b78a8fd5a52e7965e13781f735bcce13c5/stl/inc/xtree. Towards #24834. >From 6468367e6eb6ab2ac19e7ea939801635a04fa663 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Sat, 12 Jul 2025 18:44:51 +0200 Subject: [PATCH] [LLDB] Add formatters for MSVC STL map-like types --- .../Plugins/Language/CPlusPlus/CMakeLists.txt | 1 + .../Language/CPlusPlus/CPlusPlusLanguage.cpp | 66 ++- .../Plugins/Language/CPlusPlus/MsvcStl.h | 12 + .../Language/CPlusPlus/MsvcStlTree.cpp| 404 ++ .../generic/map/TestDataFormatterStdMap.py| 11 +- .../data-formatter-stl/generic/map/main.cpp | 2 + .../TestDataFormatterGenericMultiMap.py | 18 +- .../TestDataFormatterGenericMultiSet.py | 32 +- .../set/TestDataFormatterGenericSet.py| 38 +- .../data-formatter-stl/generic/set/main.cpp | 6 + 10 files changed, 546 insertions(+), 44 deletions(-) create mode 100644 lldb/source/Plugins/Language/CPlusPlus/MsvcStlTree.cpp diff --git a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt index 296159ea28407..96773b43e3685 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt +++ b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt @@ -34,6 +34,7 @@ add_lldb_library(lldbPluginCPlusPlusLanguage PLUGIN LibStdcppTuple.cpp LibStdcppUniquePointer.cpp MsvcStl.cpp + MsvcStlTree.cpp MsvcStlSmartPointer.cpp MSVCUndecoratedNameParser.cpp diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp index 2db3e6f0ca315..d7bf6783b8d3e 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -1409,7 +1409,7 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { stl_synth_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdVectorSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?map<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::map<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_synth_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); @@ -1419,17 +1419,17 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdDequeSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?set<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::set<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?multimap<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::multimap<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?multiset<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::multiset<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); @@ -1470,15 +1470,15 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { "libstdc++ std::vector summary provider", "^std::(__debug::)?vector<.+>(( )?&)?$", stl_summary_flags, true); - AddCXXSummary( - cpp_category_sp, lldb_private::formatters::ContainerSizeSummaryProvider, - "libstdc++ std::map summary provider", - "^std::(__debug::)?map<.+> >(( )?&)?$", stl_summary_flags, true); + AddCXXSummary(cpp_category_sp, +lldb_private::formatters::ContainerSizeSummaryProvider, +"libstdc++ std::map summary provider", +"^std::__debug::map<.+> >(( )?&)?$", stl_summary_flags, true); - AddCXXSummary( - cpp_category_sp, lldb_private::formatters::ContainerSizeSummaryProvider, - "libstdc++ std::set summary provider",
[Lldb-commits] [lldb] [LLDB] Add formatters for MSVC STL map-like types (PR #148385)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: nerix (Nerixyz) Changes This PR adds formatters for `std::map`, `std::set`, `std::multimap`, `std::multiset` as well as their iterators. It's done in one PR because the types are essentially the same (a tree) except for their value type. The iterators are required because of the tests. `MsvcStlTreeIterSyntheticFrontEnd` is based on the libc++ equivalent. As opposed to `std::list`, there aren't that many duplicates, so I didn't create a generic type. For reference, the tree is implemented in https://github.com/microsoft/STL/blob/313964b78a8fd5a52e7965e13781f735bcce13c5/stl/inc/xtree. Towards #24834. --- Patch is 32.66 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/148385.diff 10 Files Affected: - (modified) lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt (+1) - (modified) lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp (+52-14) - (modified) lldb/source/Plugins/Language/CPlusPlus/MsvcStl.h (+12) - (added) lldb/source/Plugins/Language/CPlusPlus/MsvcStlTree.cpp (+404) - (modified) lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/map/TestDataFormatterStdMap.py (+10-1) - (modified) lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/map/main.cpp (+2) - (modified) lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/TestDataFormatterGenericMultiMap.py (+11-7) - (modified) lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multiset/TestDataFormatterGenericMultiSet.py (+21-11) - (modified) lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/set/TestDataFormatterGenericSet.py (+27-11) - (modified) lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/set/main.cpp (+6) ``diff diff --git a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt index 296159ea28407..96773b43e3685 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt +++ b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt @@ -34,6 +34,7 @@ add_lldb_library(lldbPluginCPlusPlusLanguage PLUGIN LibStdcppTuple.cpp LibStdcppUniquePointer.cpp MsvcStl.cpp + MsvcStlTree.cpp MsvcStlSmartPointer.cpp MSVCUndecoratedNameParser.cpp diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp index 2db3e6f0ca315..d7bf6783b8d3e 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -1409,7 +1409,7 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { stl_synth_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdVectorSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?map<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::map<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_synth_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); @@ -1419,17 +1419,17 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdDequeSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?set<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::set<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?multimap<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::multimap<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?multiset<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::multiset<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); @@ -1470,15 +1470,15 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { "libstdc++ std::vector summary provider", "^std::(__debug::)?vector<.+>(( )?&)?$", stl_summary_flags, true); - AddCXXSummary( - cpp_category_sp, lldb_private::formatters::ContainerSizeSummaryProvider, - "libstdc++ std::map summary provider", - "^std::(__debug::)?map<.+> >(( )?&)?$", stl_summary_flags, true); + AddCXXSummary(cpp_category_sp, +lldb_private::formatters:
[Lldb-commits] [lldb] [LLDB] Add formatters for MSVC STL map-like types (PR #148385)
https://github.com/Nerixyz updated https://github.com/llvm/llvm-project/pull/148385 >From 87e2769ae03af331b5affadf238032bcaad361e6 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Sat, 12 Jul 2025 18:44:51 +0200 Subject: [PATCH] [LLDB] Add formatters for MSVC STL map-like types --- .../Plugins/Language/CPlusPlus/CMakeLists.txt | 1 + .../Language/CPlusPlus/CPlusPlusLanguage.cpp | 66 ++- .../Plugins/Language/CPlusPlus/MsvcStl.h | 12 + .../Language/CPlusPlus/MsvcStlTree.cpp| 407 ++ .../generic/map/TestDataFormatterStdMap.py| 11 +- .../data-formatter-stl/generic/map/main.cpp | 2 + .../TestDataFormatterGenericMultiMap.py | 18 +- .../TestDataFormatterGenericMultiSet.py | 32 +- .../set/TestDataFormatterGenericSet.py| 38 +- .../data-formatter-stl/generic/set/main.cpp | 6 + 10 files changed, 549 insertions(+), 44 deletions(-) create mode 100644 lldb/source/Plugins/Language/CPlusPlus/MsvcStlTree.cpp diff --git a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt index 296159ea28407..96773b43e3685 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt +++ b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt @@ -34,6 +34,7 @@ add_lldb_library(lldbPluginCPlusPlusLanguage PLUGIN LibStdcppTuple.cpp LibStdcppUniquePointer.cpp MsvcStl.cpp + MsvcStlTree.cpp MsvcStlSmartPointer.cpp MSVCUndecoratedNameParser.cpp diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp index 2db3e6f0ca315..d7bf6783b8d3e 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -1409,7 +1409,7 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { stl_synth_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdVectorSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?map<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::map<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_synth_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); @@ -1419,17 +1419,17 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdDequeSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?set<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::set<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?multimap<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::multimap<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?multiset<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::multiset<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); @@ -1470,15 +1470,15 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { "libstdc++ std::vector summary provider", "^std::(__debug::)?vector<.+>(( )?&)?$", stl_summary_flags, true); - AddCXXSummary( - cpp_category_sp, lldb_private::formatters::ContainerSizeSummaryProvider, - "libstdc++ std::map summary provider", - "^std::(__debug::)?map<.+> >(( )?&)?$", stl_summary_flags, true); + AddCXXSummary(cpp_category_sp, +lldb_private::formatters::ContainerSizeSummaryProvider, +"libstdc++ std::map summary provider", +"^std::__debug::map<.+> >(( )?&)?$", stl_summary_flags, true); - AddCXXSummary( - cpp_category_sp, lldb_private::formatters::ContainerSizeSummaryProvider, - "libstdc++ std::set summary provider", - "^std::(__debug::)?set<.+> >(( )?&)?$", stl_summary_flags, true); + AddCXXSummary(cpp_category_sp, +lldb_private::formatters::ContainerSizeSummaryProvider, +"libstdc++ std::set summary provider", +"^std::__debug::set<.+> >(( )?&)?$", stl_summary_flags, true); AddCXXSummary( cpp_category_sp, lldb_private::formatters::ContainerSizeSummaryProvider, @@ -1488,12 +1488,12 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { AddCXXSummary( cpp_category_sp, lldb_private::formatters::Co
[Lldb-commits] [lldb] [LLDB] Add formatters for MSVC STL map-like types (PR #148385)
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff HEAD~1 HEAD --extensions h,cpp -- lldb/source/Plugins/Language/CPlusPlus/MsvcStlTree.cpp lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp lldb/source/Plugins/Language/CPlusPlus/MsvcStl.h lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/map/main.cpp lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/set/main.cpp `` View the diff from clang-format here. ``diff diff --git a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlTree.cpp b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlTree.cpp index 0530a3c30..ddf6c27a3 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlTree.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlTree.cpp @@ -58,7 +58,7 @@ public: if (!m_entry_sp) return m_entry_sp; return m_entry_sp->GetSyntheticChildAtOffset( - m_entry_sp->GetProcessSP()->GetAddressByteSize(), +m_entry_sp->GetProcessSP()->GetAddressByteSize(), m_entry_sp->GetCompilerType(), true); } @@ -132,7 +132,8 @@ private: } size_t steps = 0; MapEntry pnode(m_entry.parent()); -while(!pnode.is_nil() && m_entry.value() == MapEntry(pnode.right()).value()) { +while (!pnode.is_nil() && + m_entry.value() == MapEntry(pnode.right()).value()) { m_entry = pnode; steps++; if (steps > m_max_depth) { @@ -144,7 +145,8 @@ private: m_entry = std::move(pnode); } - /// Mimicks MSVC STL's _Min() algorithm (finding the leftmost node in the subtree). + /// Mimicks MSVC STL's _Min() algorithm (finding the leftmost node in the + /// subtree). MapEntry tree_min(MapEntry pnode) { if (pnode.is_nullptr()) return MapEntry(); @@ -195,7 +197,7 @@ private: /// \param[in] max_depth The maximum search depth after which we stop trying /// to find the node for. /// - /// \returns On success, returns the ValueObjectSP corresponding to the + /// \returns On success, returns the ValueObjectSP corresponding to the /// _Tree_node's _Myval member. /// On failure, nullptr is returned. ValueObjectSP GetValueAt(size_t idx, size_t max_depth); @@ -208,7 +210,8 @@ private: class MsvcStlTreeIterSyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: - MsvcStlTreeIterSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp): SyntheticChildrenFrontEnd(*valobj_sp) {} + MsvcStlTreeIterSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp) + : SyntheticChildrenFrontEnd(*valobj_sp) {} llvm::Expected CalculateNumChildren() override { if (!m_inner_sp) @@ -230,9 +233,7 @@ public: return m_inner_sp->GetIndexOfChildWithName(name); } - lldb::ValueObjectSP GetSyntheticValue() override { -return m_inner_sp; - } + lldb::ValueObjectSP GetSyntheticValue() override { return m_inner_sp; } private: ValueObjectSP m_inner_sp; @@ -248,8 +249,8 @@ lldb_private::formatters::MsvcStlTreeSyntheticFrontEnd:: Update(); } -llvm::Expected lldb_private::formatters:: -MsvcStlTreeSyntheticFrontEnd::CalculateNumChildren() { +llvm::Expected +lldb_private::formatters::MsvcStlTreeSyntheticFrontEnd::CalculateNumChildren() { if (m_count != UINT32_MAX) return m_count; @@ -324,7 +325,8 @@ lldb_private::formatters::MsvcStlTreeSyntheticFrontEnd::Update() { m_count = UINT32_MAX; m_tree = m_begin_node = nullptr; m_iterators.clear(); - m_tree = m_backend.GetChildAtNamePath({"_Mypair", "_Myval2", "_Myval2"}).get(); + m_tree = + m_backend.GetChildAtNamePath({"_Mypair", "_Myval2", "_Myval2"}).get(); if (!m_tree) return lldb::ChildCacheState::eRefetch; @@ -333,8 +335,9 @@ lldb_private::formatters::MsvcStlTreeSyntheticFrontEnd::Update() { return lldb::ChildCacheState::eRefetch; } -llvm::Expected lldb_private::formatters::MsvcStlTreeSyntheticFrontEnd:: -GetIndexOfChildWithName(ConstString name) { +llvm::Expected +lldb_private::formatters::MsvcStlTreeSyntheticFrontEnd::GetIndexOfChildWithName( +ConstString name) { auto optional_idx = formatters::ExtractIndexFromString(name.GetCString()); if (!optional_idx) { return llvm::createStringError("Type has no child named '%s'", @@ -361,12 +364,12 @@ bool formatters::IsMsvcStlTreeIter(ValueObject &valobj) { return valobj.GetChildMemberWithName("_Ptr") != nullptr; } -bool formatters::MsvcStlTreeIterSummaryProvider(ValueObject &valobj, Stream &stream, -const TypeSummaryOptions &options) { - auto valobj_sp = valobj.GetNonSyntheticValue(); - if (!valobj_sp) -return false; -auto node_sp = valobj_sp->GetChildMemberWithName("_Ptr"); +bool f
[Lldb-commits] [lldb] [LLDB] Add formatters for MSVC STL map-like types (PR #148385)
https://github.com/Nerixyz updated https://github.com/llvm/llvm-project/pull/148385 >From 64982c79003c95c41d5e7c2b40c7ac67c29b1c78 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Sat, 12 Jul 2025 18:44:51 +0200 Subject: [PATCH] [LLDB] Add formatters for MSVC STL map-like types --- .../Plugins/Language/CPlusPlus/CMakeLists.txt | 1 + .../Language/CPlusPlus/CPlusPlusLanguage.cpp | 66 ++- .../Plugins/Language/CPlusPlus/MsvcStl.h | 12 + .../Language/CPlusPlus/MsvcStlTree.cpp| 407 ++ .../generic/map/TestDataFormatterStdMap.py| 11 +- .../data-formatter-stl/generic/map/main.cpp | 2 + .../TestDataFormatterGenericMultiMap.py | 18 +- .../TestDataFormatterGenericMultiSet.py | 32 +- .../set/TestDataFormatterGenericSet.py| 33 +- .../data-formatter-stl/generic/set/main.cpp | 2 +- 10 files changed, 539 insertions(+), 45 deletions(-) create mode 100644 lldb/source/Plugins/Language/CPlusPlus/MsvcStlTree.cpp diff --git a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt index 296159ea28407..96773b43e3685 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt +++ b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt @@ -34,6 +34,7 @@ add_lldb_library(lldbPluginCPlusPlusLanguage PLUGIN LibStdcppTuple.cpp LibStdcppUniquePointer.cpp MsvcStl.cpp + MsvcStlTree.cpp MsvcStlSmartPointer.cpp MSVCUndecoratedNameParser.cpp diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp index 2db3e6f0ca315..d7bf6783b8d3e 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -1409,7 +1409,7 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { stl_synth_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdVectorSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?map<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::map<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_synth_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); @@ -1419,17 +1419,17 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdDequeSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?set<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::set<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?multimap<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::multimap<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?multiset<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::multiset<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); @@ -1470,15 +1470,15 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { "libstdc++ std::vector summary provider", "^std::(__debug::)?vector<.+>(( )?&)?$", stl_summary_flags, true); - AddCXXSummary( - cpp_category_sp, lldb_private::formatters::ContainerSizeSummaryProvider, - "libstdc++ std::map summary provider", - "^std::(__debug::)?map<.+> >(( )?&)?$", stl_summary_flags, true); + AddCXXSummary(cpp_category_sp, +lldb_private::formatters::ContainerSizeSummaryProvider, +"libstdc++ std::map summary provider", +"^std::__debug::map<.+> >(( )?&)?$", stl_summary_flags, true); - AddCXXSummary( - cpp_category_sp, lldb_private::formatters::ContainerSizeSummaryProvider, - "libstdc++ std::set summary provider", - "^std::(__debug::)?set<.+> >(( )?&)?$", stl_summary_flags, true); + AddCXXSummary(cpp_category_sp, +lldb_private::formatters::ContainerSizeSummaryProvider, +"libstdc++ std::set summary provider", +"^std::__debug::set<.+> >(( )?&)?$", stl_summary_flags, true); AddCXXSummary( cpp_category_sp, lldb_private::formatters::ContainerSizeSummaryProvider, @@ -1488,12 +1488,12 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { AddCXXSummary( cpp_category_sp, lldb_private::formatters::C
[Lldb-commits] [lldb] [LLDB] Add formatters for MSVC STL map-like types (PR #148385)
https://github.com/Nerixyz updated https://github.com/llvm/llvm-project/pull/148385 >From 31e031a33bb80d8e752bcbdf235db6ac35a382bf Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Sat, 12 Jul 2025 18:44:51 +0200 Subject: [PATCH] [LLDB] Add formatters for MSVC STL map-like types --- .../Plugins/Language/CPlusPlus/CMakeLists.txt | 1 + .../Language/CPlusPlus/CPlusPlusLanguage.cpp | 66 ++- .../Plugins/Language/CPlusPlus/MsvcStl.h | 12 + .../Language/CPlusPlus/MsvcStlTree.cpp| 407 ++ .../generic/map/TestDataFormatterStdMap.py| 11 +- .../data-formatter-stl/generic/map/main.cpp | 2 + .../TestDataFormatterGenericMultiMap.py | 18 +- .../TestDataFormatterGenericMultiSet.py | 32 +- .../set/TestDataFormatterGenericSet.py| 33 +- .../data-formatter-stl/generic/set/main.cpp | 1 + 10 files changed, 539 insertions(+), 44 deletions(-) create mode 100644 lldb/source/Plugins/Language/CPlusPlus/MsvcStlTree.cpp diff --git a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt index 296159ea28407..96773b43e3685 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt +++ b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt @@ -34,6 +34,7 @@ add_lldb_library(lldbPluginCPlusPlusLanguage PLUGIN LibStdcppTuple.cpp LibStdcppUniquePointer.cpp MsvcStl.cpp + MsvcStlTree.cpp MsvcStlSmartPointer.cpp MSVCUndecoratedNameParser.cpp diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp index 2db3e6f0ca315..d7bf6783b8d3e 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -1409,7 +1409,7 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { stl_synth_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdVectorSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?map<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::map<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_synth_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); @@ -1419,17 +1419,17 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdDequeSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?set<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::set<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?multimap<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::multimap<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); cpp_category_sp->AddTypeSynthetic( - "^std::(__debug::)?multiset<.+> >(( )?&)?$", eFormatterMatchRegex, + "^std::__debug::multiset<.+> >(( )?&)?$", eFormatterMatchRegex, SyntheticChildrenSP(new ScriptedSyntheticChildren( stl_deref_flags, "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider"))); @@ -1470,15 +1470,15 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { "libstdc++ std::vector summary provider", "^std::(__debug::)?vector<.+>(( )?&)?$", stl_summary_flags, true); - AddCXXSummary( - cpp_category_sp, lldb_private::formatters::ContainerSizeSummaryProvider, - "libstdc++ std::map summary provider", - "^std::(__debug::)?map<.+> >(( )?&)?$", stl_summary_flags, true); + AddCXXSummary(cpp_category_sp, +lldb_private::formatters::ContainerSizeSummaryProvider, +"libstdc++ std::map summary provider", +"^std::__debug::map<.+> >(( )?&)?$", stl_summary_flags, true); - AddCXXSummary( - cpp_category_sp, lldb_private::formatters::ContainerSizeSummaryProvider, - "libstdc++ std::set summary provider", - "^std::(__debug::)?set<.+> >(( )?&)?$", stl_summary_flags, true); + AddCXXSummary(cpp_category_sp, +lldb_private::formatters::ContainerSizeSummaryProvider, +"libstdc++ std::set summary provider", +"^std::__debug::set<.+> >(( )?&)?$", stl_summary_flags, true); AddCXXSummary( cpp_category_sp, lldb_private::formatters::ContainerSizeSummaryProvider, @@ -1488,12 +1488,12 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { AddCXXSummary( cpp_category_sp, lldb_private::formatters::Co
[Lldb-commits] [lldb] [lldb] Implement RISCV function unwinding using instruction emulation (PR #147434)
https://github.com/satyajanga updated https://github.com/llvm/llvm-project/pull/147434 >From d14ca454a5ec044a5cb0083327f5151aedbe20cc Mon Sep 17 00:00:00 2001 From: satya janga Date: Mon, 7 Jul 2025 17:20:50 -0700 Subject: [PATCH 1/2] Address gaps in RISCV function unwinding --- .../RISCV/EmulateInstructionRISCV.cpp | 20 +++ .../RISCV/EmulateInstructionRISCV.h | 11 ++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp b/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp index 2adde02aca3a1..90537587c0b23 100644 --- a/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp +++ b/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp @@ -1899,4 +1899,24 @@ RISCVSingleStepBreakpointLocationsPredictor::HandleAtomicSequence( return bp_addrs; } +bool EmulateInstructionRISCV::CreateFunctionEntryUnwind( +UnwindPlan &unwind_plan) { + unwind_plan.Clear(); + unwind_plan.SetRegisterKind(eRegisterKindLLDB); + + UnwindPlan::Row row; + + // Our previous Call Frame Address is the stack pointer + row.GetCFAValue().SetIsRegisterPlusOffset(gpr_sp_riscv, 0); + row.SetRegisterLocationToSame(gpr_fp_riscv, /*must_replace=*/false); + + unwind_plan.AppendRow(std::move(row)); + unwind_plan.SetSourceName("EmulateInstructionRISCV"); + unwind_plan.SetSourcedFromCompiler(eLazyBoolNo); + unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolYes); + unwind_plan.SetUnwindPlanForSignalTrap(eLazyBoolNo); + unwind_plan.SetReturnAddressRegister(gpr_ra_riscv); + return true; +} + } // namespace lldb_private diff --git a/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.h b/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.h index 3578a4ab03053..f5692efb03bd9 100644 --- a/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.h +++ b/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.h @@ -57,11 +57,12 @@ class EmulateInstructionRISCV : public EmulateInstruction { static bool SupportsThisInstructionType(InstructionType inst_type) { switch (inst_type) { -case eInstructionTypeAny: -case eInstructionTypePCModifying: +case lldb_private::eInstructionTypeAny: +case lldb_private::eInstructionTypePrologueEpilogue: return true; -case eInstructionTypePrologueEpilogue: -case eInstructionTypeAll: + +case lldb_private::eInstructionTypePCModifying: +case lldb_private::eInstructionTypeAll: return false; } llvm_unreachable("Fully covered switch above!"); @@ -94,6 +95,8 @@ class EmulateInstructionRISCV : public EmulateInstruction { std::optional GetRegisterInfo(lldb::RegisterKind reg_kind, uint32_t reg_num) override; + bool CreateFunctionEntryUnwind(UnwindPlan &unwind_plan) override; + std::optional ReadInstructionAt(lldb::addr_t addr); std::optional Decode(uint32_t inst); bool Execute(DecodeResult inst, bool ignore_cond); >From af707a0951a95ec99532b59db2f119a629089f28 Mon Sep 17 00:00:00 2001 From: satya janga Date: Sat, 12 Jul 2025 11:58:40 -0700 Subject: [PATCH 2/2] test commit --- lldb/source/Host/posix/MainLoopPosix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Host/posix/MainLoopPosix.cpp b/lldb/source/Host/posix/MainLoopPosix.cpp index 19a7128fbe407..8e37dc3a6e9e8 100644 --- a/lldb/source/Host/posix/MainLoopPosix.cpp +++ b/lldb/source/Host/posix/MainLoopPosix.cpp @@ -217,7 +217,7 @@ MainLoopPosix::MainLoopPosix() { O_NONBLOCK); assert(result == 0); UNUSED_IF_ASSERT_DISABLED(result); - + // simple commit const int interrupt_pipe_fd = m_interrupt_pipe.GetReadFileDescriptor(); m_read_fds.insert( {interrupt_pipe_fd, [interrupt_pipe_fd](MainLoopBase &loop) { ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Implement RISCV function unwinding using instruction emulation (PR #147434)
https://github.com/satyajanga updated https://github.com/llvm/llvm-project/pull/147434 >From d14ca454a5ec044a5cb0083327f5151aedbe20cc Mon Sep 17 00:00:00 2001 From: satya janga Date: Mon, 7 Jul 2025 17:20:50 -0700 Subject: [PATCH] Address gaps in RISCV function unwinding --- .../RISCV/EmulateInstructionRISCV.cpp | 20 +++ .../RISCV/EmulateInstructionRISCV.h | 11 ++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp b/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp index 2adde02aca3a1..90537587c0b23 100644 --- a/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp +++ b/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp @@ -1899,4 +1899,24 @@ RISCVSingleStepBreakpointLocationsPredictor::HandleAtomicSequence( return bp_addrs; } +bool EmulateInstructionRISCV::CreateFunctionEntryUnwind( +UnwindPlan &unwind_plan) { + unwind_plan.Clear(); + unwind_plan.SetRegisterKind(eRegisterKindLLDB); + + UnwindPlan::Row row; + + // Our previous Call Frame Address is the stack pointer + row.GetCFAValue().SetIsRegisterPlusOffset(gpr_sp_riscv, 0); + row.SetRegisterLocationToSame(gpr_fp_riscv, /*must_replace=*/false); + + unwind_plan.AppendRow(std::move(row)); + unwind_plan.SetSourceName("EmulateInstructionRISCV"); + unwind_plan.SetSourcedFromCompiler(eLazyBoolNo); + unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolYes); + unwind_plan.SetUnwindPlanForSignalTrap(eLazyBoolNo); + unwind_plan.SetReturnAddressRegister(gpr_ra_riscv); + return true; +} + } // namespace lldb_private diff --git a/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.h b/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.h index 3578a4ab03053..f5692efb03bd9 100644 --- a/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.h +++ b/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.h @@ -57,11 +57,12 @@ class EmulateInstructionRISCV : public EmulateInstruction { static bool SupportsThisInstructionType(InstructionType inst_type) { switch (inst_type) { -case eInstructionTypeAny: -case eInstructionTypePCModifying: +case lldb_private::eInstructionTypeAny: +case lldb_private::eInstructionTypePrologueEpilogue: return true; -case eInstructionTypePrologueEpilogue: -case eInstructionTypeAll: + +case lldb_private::eInstructionTypePCModifying: +case lldb_private::eInstructionTypeAll: return false; } llvm_unreachable("Fully covered switch above!"); @@ -94,6 +95,8 @@ class EmulateInstructionRISCV : public EmulateInstruction { std::optional GetRegisterInfo(lldb::RegisterKind reg_kind, uint32_t reg_num) override; + bool CreateFunctionEntryUnwind(UnwindPlan &unwind_plan) override; + std::optional ReadInstructionAt(lldb::addr_t addr); std::optional Decode(uint32_t inst); bool Execute(DecodeResult inst, bool ignore_cond); ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 8afab75 - [lldb][Format] Fall back to old function.name-with-args if language frame format is emtpy (#148235)
Author: Michael Buch Date: 2025-07-12T22:41:21+01:00 New Revision: 8afab759d471b60863b8304e39bf6a8b415221dc URL: https://github.com/llvm/llvm-project/commit/8afab759d471b60863b8304e39bf6a8b415221dc DIFF: https://github.com/llvm/llvm-project/commit/8afab759d471b60863b8304e39bf6a8b415221dc.diff LOG: [lldb][Format] Fall back to old function.name-with-args if language frame format is emtpy (#148235) There is currently no way to prevent `${function.name-with-args}` from using the `plugin.cplusplus.display.function-name-format` setting. Even if the setting is set to an empty string. As a way to disable formatting by language plugin, this patch makes it so `plugin.cplusplus.display.function-name-format` falls back to the old way of printing `${function.name-with-args}`. Even if we didn't want to add a fallback, making the setting an empty string shouldn't really "succeed". Added: lldb/test/Shell/Settings/TestCxxFrameFormatEmpty.test Modified: lldb/source/Core/FormatEntity.cpp Removed: diff --git a/lldb/source/Core/FormatEntity.cpp b/lldb/source/Core/FormatEntity.cpp index ca389bc88cf79..370b51e726ec2 100644 --- a/lldb/source/Core/FormatEntity.cpp +++ b/lldb/source/Core/FormatEntity.cpp @@ -1280,7 +1280,9 @@ static bool FormatFunctionNameForLanguage(Stream &s, return false; FormatEntity::Entry format = language_plugin->GetFunctionNameFormat(); - if (!format) + + // Bail on invalid or empty format. + if (!format || format == FormatEntity::Entry(Entry::Type::Root)) return false; StreamString name_stream; diff --git a/lldb/test/Shell/Settings/TestCxxFrameFormatEmpty.test b/lldb/test/Shell/Settings/TestCxxFrameFormatEmpty.test new file mode 100644 index 0..0a6d2723ded34 --- /dev/null +++ b/lldb/test/Shell/Settings/TestCxxFrameFormatEmpty.test @@ -0,0 +1,32 @@ +# XFAIL: target-windows + +# Test that setting plugin.cplusplus.display.function-name-format +# to an empty string disables the "format by language" part of +# ${function.name-with-args}. + +# RUN: split-file %s %t +# RUN: %clang_host -g -gdwarf %t/main.cpp -o %t.out +# RUN: %lldb -x -b -s %t/commands.input %t.out -o exit 2>&1 \ +# RUN: | FileCheck %s + +#--- main.cpp +namespace ns::ns2 { +void custom(int x) {} +void bar() { custom(5); } +} + +int main(int argc, char const *argv[]) { +ns::ns2::bar(); +return 0; +} + +#--- commands.input +settings set plugin.cplusplus.display.function-name-format "" +settings set -f frame-format "custom-frame '${function.name-with-args}'\n" +break set -l 2 -f main.cpp + +run +bt + +# CHECK: custom-frame 'ns::ns2::custom(x=5)' +# CHECK: custom-frame 'ns::ns2::bar()' ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Format] Fall back to old function.name-with-args if language frame format is emtpy (PR #148235)
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/148235 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb-dap] persistent assembly breakpoints (PR #148061)
https://github.com/eronnen edited https://github.com/llvm/llvm-project/pull/148061 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits