[Lldb-commits] [lldb] [lldb-dap] Reuse source object logics (PR #141426)
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-remote-linux-win` running on `as-builder-10` while building `lldb` at step 8 "build-default". Full details are available at: https://lab.llvm.org/buildbot/#/builders/197/builds/6086 Here is the relevant piece of the build log for the reference ``` Step 8 (build-default) failure: cmake (failure) ... 67.798 [216/54/5204]Linking CXX executable bin\llvm-symbolizer.exe 67.804 [214/55/5205]Linking CXX executable bin\bugpoint.exe 67.848 [213/55/5206]Generating ../../bin/llvm-addr2line.exe 67.857 [213/54/5207]Linking CXX static library lib\clangStaticAnalyzerFrontend.lib 67.865 [212/54/5208]Building CXX object tools\lldb\source\Plugins\ExpressionParser\Clang\CMakeFiles\lldbPluginExpressionParserClang.dir\ASTStructExtractor.cpp.obj 67.912 [212/53/5209]Building CXX object tools\lldb\source\Plugins\ExpressionParser\Clang\CMakeFiles\lldbPluginExpressionParserClang.dir\ASTResultSynthesizer.cpp.obj 68.012 [212/52/5210]Building CXX object tools\clang\tools\clang-installapi\CMakeFiles\clang-installapi.dir\ClangInstallAPI.cpp.obj 68.226 [212/51/5211]Building CXX object tools\lldb\source\Plugins\ExpressionParser\Clang\CMakeFiles\lldbPluginExpressionParserClang.dir\ClangModulesDeclVendor.cpp.obj 68.274 [212/50/5212]Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\Variables.cpp.obj 68.304 [212/49/5213]Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\ProtocolUtils.cpp.obj FAILED: tools/lldb/tools/lldb-dap/CMakeFiles/lldbDAP.dir/ProtocolUtils.cpp.obj ccache C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1444~1.352\bin\Hostx64\x64\cl.exe /nologo /TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IC:\buildbot\as-builder-10\lldb-x-aarch64\build\tools\lldb\tools\lldb-dap -IC:\buildbot\as-builder-10\lldb-x-aarch64\llvm-project\lldb\tools\lldb-dap -IC:\buildbot\as-builder-10\lldb-x-aarch64\llvm-project\lldb\include -IC:\buildbot\as-builder-10\lldb-x-aarch64\build\tools\lldb\include -IC:\buildbot\as-builder-10\lldb-x-aarch64\build\include -IC:\buildbot\as-builder-10\lldb-x-aarch64\llvm-project\llvm\include -IC:\Python312\include -IC:\buildbot\as-builder-10\lldb-x-aarch64\llvm-project\llvm\..\clang\include -IC:\buildbot\as-builder-10\lldb-x-aarch64\build\tools\lldb\..\clang\include -D__OPTIMIZE__ /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -wd4251 -wd4275 -w14062 -we4238 /Gw /O2 /Ob2 -MD -wd4018 -wd4068 -wd4150 -wd4201 -wd4251 -wd4521 -wd4530 -wd4589 /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\ProtocolUtils.cpp.obj /Fdtools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\lldbDAP.pdb /FS -c C:\buildbot\as-builder-10\lldb-x-aarch64\llvm-project\lldb\tools\lldb-dap\ProtocolUtils.cpp C:\buildbot\as-builder-10\lldb-x-aarch64\llvm-project\lldb\tools\lldb-dap\ProtocolUtils.cpp(82): error C2065: 'PATH_MAX': undeclared identifier C:\buildbot\as-builder-10\lldb-x-aarch64\llvm-project\lldb\tools\lldb-dap\ProtocolUtils.cpp(84): error C2065: 'PATH_MAX': undeclared identifier 68.343 [212/48/5214]Building CXX object tools\lldb\source\Plugins\ExpressionParser\Clang\CMakeFiles\lldbPluginExpressionParserClang.dir\ClangFunctionCaller.cpp.obj 68.411 [212/47/5215]Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\ProgressEvent.cpp.obj 68.458 [212/46/5216]Building CXX object tools\lldb\source\Plugins\ExpressionParser\Clang\CMakeFiles\lldbPluginExpressionParserClang.dir\ClangExpressionParser.cpp.obj 68.920 [212/45/5217]Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\Breakpoint.cpp.obj 69.031 [212/44/5218]Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\LLDBUtils.cpp.obj 69.125 [212/43/5219]Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\RunInTerminal.cpp.obj 69.645 [212/42/5220]Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\CommandPlugins.cpp.obj 69.671 [212/41/5221]Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\FifoFiles.cpp.obj 70.294 [212/40/5222]Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\SourceBreakpoint.cpp.obj 70.711 [212/39/5223]Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\Handler\AttachRequestHandler.cpp.obj 70.783 [212/38/5224]Building CXX object tools
[Lldb-commits] [lldb] [lldb] Adding const modifier to SBAddress methods (PR #142275)
https://github.com/eronnen created https://github.com/llvm/llvm-project/pull/142275 I don't know if adding `const` specifier is considered breaking the API, but if not it could be useful as it allows for `lldb-dap` to change some objects to `const &` >From 85e5ac0369b3d2cb263b82912af90762545ca496 Mon Sep 17 00:00:00 2001 From: Ely Ronnen Date: Sat, 31 May 2025 12:30:13 +0200 Subject: [PATCH] Adding const modifier to SBAddress methods --- lldb/include/lldb/API/SBAddress.h | 18 +- lldb/include/lldb/API/SBTarget.h | 2 +- lldb/source/API/SBAddress.cpp | 18 +- lldb/source/API/SBTarget.cpp | 2 +- lldb/tools/lldb-dap/JSONUtils.cpp | 4 ++-- lldb/tools/lldb-dap/LLDBUtils.cpp | 2 +- lldb/tools/lldb-dap/LLDBUtils.h | 2 +- lldb/tools/lldb-dap/ProtocolUtils.cpp | 7 --- lldb/tools/lldb-dap/ProtocolUtils.h | 3 ++- 9 files changed, 30 insertions(+), 28 deletions(-) diff --git a/lldb/include/lldb/API/SBAddress.h b/lldb/include/lldb/API/SBAddress.h index 430dad4862dbf..3f58ae7bcfd82 100644 --- a/lldb/include/lldb/API/SBAddress.h +++ b/lldb/include/lldb/API/SBAddress.h @@ -56,7 +56,7 @@ class LLDB_API SBAddress { // will only return valid values if the address has been resolved to a code // or data address using "void SBAddress::SetLoadAddress(...)" or // "lldb::SBAddress SBTarget::ResolveLoadAddress (...)". - lldb::SBSymbolContext GetSymbolContext(uint32_t resolve_scope); + lldb::SBSymbolContext GetSymbolContext(uint32_t resolve_scope) const; // The following functions grab individual objects for a given address and // are less efficient if you want more than one symbol related objects. Use @@ -69,21 +69,21 @@ class LLDB_API SBAddress { // One or more bits from the SymbolContextItem enumerations can be logically // OR'ed together to more efficiently retrieve multiple symbol objects. - lldb::SBSection GetSection(); + lldb::SBSection GetSection() const; - lldb::addr_t GetOffset(); + lldb::addr_t GetOffset() const; - lldb::SBModule GetModule(); + lldb::SBModule GetModule() const; - lldb::SBCompileUnit GetCompileUnit(); + lldb::SBCompileUnit GetCompileUnit() const; - lldb::SBFunction GetFunction(); + lldb::SBFunction GetFunction() const; - lldb::SBBlock GetBlock(); + lldb::SBBlock GetBlock() const; - lldb::SBSymbol GetSymbol(); + lldb::SBSymbol GetSymbol() const; - lldb::SBLineEntry GetLineEntry(); + lldb::SBLineEntry GetLineEntry() const; protected: friend class SBAddressRange; diff --git a/lldb/include/lldb/API/SBTarget.h b/lldb/include/lldb/API/SBTarget.h index 2776a8f9010fe..90df1e8152330 100644 --- a/lldb/include/lldb/API/SBTarget.h +++ b/lldb/include/lldb/API/SBTarget.h @@ -585,7 +585,7 @@ class LLDB_API SBTarget { lldb::addr_t vm_addr); SBSymbolContext ResolveSymbolContextForAddress(const SBAddress &addr, - uint32_t resolve_scope); + uint32_t resolve_scope) const; /// Read target memory. If a target process is running then memory /// is read from here. Otherwise the memory is read from the object diff --git a/lldb/source/API/SBAddress.cpp b/lldb/source/API/SBAddress.cpp index e519f0bcc83c6..f5aef0eef58a3 100644 --- a/lldb/source/API/SBAddress.cpp +++ b/lldb/source/API/SBAddress.cpp @@ -149,7 +149,7 @@ bool SBAddress::OffsetAddress(addr_t offset) { return false; } -lldb::SBSection SBAddress::GetSection() { +lldb::SBSection SBAddress::GetSection() const { LLDB_INSTRUMENT_VA(this); lldb::SBSection sb_section; @@ -158,7 +158,7 @@ lldb::SBSection SBAddress::GetSection() { return sb_section; } -lldb::addr_t SBAddress::GetOffset() { +lldb::addr_t SBAddress::GetOffset() const { LLDB_INSTRUMENT_VA(this); if (m_opaque_up->IsValid()) @@ -200,7 +200,7 @@ bool SBAddress::GetDescription(SBStream &description) { return true; } -SBModule SBAddress::GetModule() { +SBModule SBAddress::GetModule() const { LLDB_INSTRUMENT_VA(this); SBModule sb_module; @@ -209,7 +209,7 @@ SBModule SBAddress::GetModule() { return sb_module; } -SBSymbolContext SBAddress::GetSymbolContext(uint32_t resolve_scope) { +SBSymbolContext SBAddress::GetSymbolContext(uint32_t resolve_scope) const { LLDB_INSTRUMENT_VA(this, resolve_scope); SBSymbolContext sb_sc; @@ -219,7 +219,7 @@ SBSymbolContext SBAddress::GetSymbolContext(uint32_t resolve_scope) { return sb_sc; } -SBCompileUnit SBAddress::GetCompileUnit() { +SBCompileUnit SBAddress::GetCompileUnit() const { LLDB_INSTRUMENT_VA(this); SBCompileUnit sb_comp_unit; @@ -228,7 +228,7 @@ SBCompileUnit SBAddress::GetCompileUnit() { return sb_comp_unit; } -SBFunction SBAddress::GetFunction() { +SBFunction SBAddress::GetFunction() const { LLDB_INSTRUMENT_VA(this); SBFunction sb_function; @@ -237,7 +237,7 @@ SBFunction SBAddress::Get
[Lldb-commits] [lldb] [lldb] Adding const modifier to SBAddress methods (PR #142275)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Ely Ronnen (eronnen) Changes I don't know if adding `const` specifier is considered breaking the API, but if not it could be useful as it allows for `lldb-dap` to change some objects to `const &` --- Full diff: https://github.com/llvm/llvm-project/pull/142275.diff 9 Files Affected: - (modified) lldb/include/lldb/API/SBAddress.h (+9-9) - (modified) lldb/include/lldb/API/SBTarget.h (+1-1) - (modified) lldb/source/API/SBAddress.cpp (+9-9) - (modified) lldb/source/API/SBTarget.cpp (+1-1) - (modified) lldb/tools/lldb-dap/JSONUtils.cpp (+2-2) - (modified) lldb/tools/lldb-dap/LLDBUtils.cpp (+1-1) - (modified) lldb/tools/lldb-dap/LLDBUtils.h (+1-1) - (modified) lldb/tools/lldb-dap/ProtocolUtils.cpp (+4-3) - (modified) lldb/tools/lldb-dap/ProtocolUtils.h (+2-1) ``diff diff --git a/lldb/include/lldb/API/SBAddress.h b/lldb/include/lldb/API/SBAddress.h index 430dad4862dbf..3f58ae7bcfd82 100644 --- a/lldb/include/lldb/API/SBAddress.h +++ b/lldb/include/lldb/API/SBAddress.h @@ -56,7 +56,7 @@ class LLDB_API SBAddress { // will only return valid values if the address has been resolved to a code // or data address using "void SBAddress::SetLoadAddress(...)" or // "lldb::SBAddress SBTarget::ResolveLoadAddress (...)". - lldb::SBSymbolContext GetSymbolContext(uint32_t resolve_scope); + lldb::SBSymbolContext GetSymbolContext(uint32_t resolve_scope) const; // The following functions grab individual objects for a given address and // are less efficient if you want more than one symbol related objects. Use @@ -69,21 +69,21 @@ class LLDB_API SBAddress { // One or more bits from the SymbolContextItem enumerations can be logically // OR'ed together to more efficiently retrieve multiple symbol objects. - lldb::SBSection GetSection(); + lldb::SBSection GetSection() const; - lldb::addr_t GetOffset(); + lldb::addr_t GetOffset() const; - lldb::SBModule GetModule(); + lldb::SBModule GetModule() const; - lldb::SBCompileUnit GetCompileUnit(); + lldb::SBCompileUnit GetCompileUnit() const; - lldb::SBFunction GetFunction(); + lldb::SBFunction GetFunction() const; - lldb::SBBlock GetBlock(); + lldb::SBBlock GetBlock() const; - lldb::SBSymbol GetSymbol(); + lldb::SBSymbol GetSymbol() const; - lldb::SBLineEntry GetLineEntry(); + lldb::SBLineEntry GetLineEntry() const; protected: friend class SBAddressRange; diff --git a/lldb/include/lldb/API/SBTarget.h b/lldb/include/lldb/API/SBTarget.h index 2776a8f9010fe..90df1e8152330 100644 --- a/lldb/include/lldb/API/SBTarget.h +++ b/lldb/include/lldb/API/SBTarget.h @@ -585,7 +585,7 @@ class LLDB_API SBTarget { lldb::addr_t vm_addr); SBSymbolContext ResolveSymbolContextForAddress(const SBAddress &addr, - uint32_t resolve_scope); + uint32_t resolve_scope) const; /// Read target memory. If a target process is running then memory /// is read from here. Otherwise the memory is read from the object diff --git a/lldb/source/API/SBAddress.cpp b/lldb/source/API/SBAddress.cpp index e519f0bcc83c6..f5aef0eef58a3 100644 --- a/lldb/source/API/SBAddress.cpp +++ b/lldb/source/API/SBAddress.cpp @@ -149,7 +149,7 @@ bool SBAddress::OffsetAddress(addr_t offset) { return false; } -lldb::SBSection SBAddress::GetSection() { +lldb::SBSection SBAddress::GetSection() const { LLDB_INSTRUMENT_VA(this); lldb::SBSection sb_section; @@ -158,7 +158,7 @@ lldb::SBSection SBAddress::GetSection() { return sb_section; } -lldb::addr_t SBAddress::GetOffset() { +lldb::addr_t SBAddress::GetOffset() const { LLDB_INSTRUMENT_VA(this); if (m_opaque_up->IsValid()) @@ -200,7 +200,7 @@ bool SBAddress::GetDescription(SBStream &description) { return true; } -SBModule SBAddress::GetModule() { +SBModule SBAddress::GetModule() const { LLDB_INSTRUMENT_VA(this); SBModule sb_module; @@ -209,7 +209,7 @@ SBModule SBAddress::GetModule() { return sb_module; } -SBSymbolContext SBAddress::GetSymbolContext(uint32_t resolve_scope) { +SBSymbolContext SBAddress::GetSymbolContext(uint32_t resolve_scope) const { LLDB_INSTRUMENT_VA(this, resolve_scope); SBSymbolContext sb_sc; @@ -219,7 +219,7 @@ SBSymbolContext SBAddress::GetSymbolContext(uint32_t resolve_scope) { return sb_sc; } -SBCompileUnit SBAddress::GetCompileUnit() { +SBCompileUnit SBAddress::GetCompileUnit() const { LLDB_INSTRUMENT_VA(this); SBCompileUnit sb_comp_unit; @@ -228,7 +228,7 @@ SBCompileUnit SBAddress::GetCompileUnit() { return sb_comp_unit; } -SBFunction SBAddress::GetFunction() { +SBFunction SBAddress::GetFunction() const { LLDB_INSTRUMENT_VA(this); SBFunction sb_function; @@ -237,7 +237,7 @@ SBFunction SBAddress::GetFunction() { return sb_function; } -SBBlock SBAddress::GetBlock() { +SBBlock SBAddress::GetBlock() const {
[Lldb-commits] [lldb] [lldb] Adding const modifier to SBAddress methods (PR #142275)
https://github.com/eronnen updated https://github.com/llvm/llvm-project/pull/142275 >From 7d256c09cd9dbefb35fc852450b38943f5040777 Mon Sep 17 00:00:00 2001 From: Ely Ronnen Date: Sat, 31 May 2025 12:30:13 +0200 Subject: [PATCH] Adding const modifier to SBAddress methods --- lldb/include/lldb/API/SBAddress.h | 18 +- lldb/include/lldb/API/SBTarget.h | 2 +- lldb/source/API/SBAddress.cpp | 18 +- lldb/source/API/SBTarget.cpp | 2 +- lldb/tools/lldb-dap/JSONUtils.cpp | 5 +++-- lldb/tools/lldb-dap/LLDBUtils.cpp | 2 +- lldb/tools/lldb-dap/LLDBUtils.h | 2 +- lldb/tools/lldb-dap/ProtocolUtils.cpp | 7 --- lldb/tools/lldb-dap/ProtocolUtils.h | 3 ++- 9 files changed, 31 insertions(+), 28 deletions(-) diff --git a/lldb/include/lldb/API/SBAddress.h b/lldb/include/lldb/API/SBAddress.h index 430dad4862dbf..3f58ae7bcfd82 100644 --- a/lldb/include/lldb/API/SBAddress.h +++ b/lldb/include/lldb/API/SBAddress.h @@ -56,7 +56,7 @@ class LLDB_API SBAddress { // will only return valid values if the address has been resolved to a code // or data address using "void SBAddress::SetLoadAddress(...)" or // "lldb::SBAddress SBTarget::ResolveLoadAddress (...)". - lldb::SBSymbolContext GetSymbolContext(uint32_t resolve_scope); + lldb::SBSymbolContext GetSymbolContext(uint32_t resolve_scope) const; // The following functions grab individual objects for a given address and // are less efficient if you want more than one symbol related objects. Use @@ -69,21 +69,21 @@ class LLDB_API SBAddress { // One or more bits from the SymbolContextItem enumerations can be logically // OR'ed together to more efficiently retrieve multiple symbol objects. - lldb::SBSection GetSection(); + lldb::SBSection GetSection() const; - lldb::addr_t GetOffset(); + lldb::addr_t GetOffset() const; - lldb::SBModule GetModule(); + lldb::SBModule GetModule() const; - lldb::SBCompileUnit GetCompileUnit(); + lldb::SBCompileUnit GetCompileUnit() const; - lldb::SBFunction GetFunction(); + lldb::SBFunction GetFunction() const; - lldb::SBBlock GetBlock(); + lldb::SBBlock GetBlock() const; - lldb::SBSymbol GetSymbol(); + lldb::SBSymbol GetSymbol() const; - lldb::SBLineEntry GetLineEntry(); + lldb::SBLineEntry GetLineEntry() const; protected: friend class SBAddressRange; diff --git a/lldb/include/lldb/API/SBTarget.h b/lldb/include/lldb/API/SBTarget.h index 2776a8f9010fe..90df1e8152330 100644 --- a/lldb/include/lldb/API/SBTarget.h +++ b/lldb/include/lldb/API/SBTarget.h @@ -585,7 +585,7 @@ class LLDB_API SBTarget { lldb::addr_t vm_addr); SBSymbolContext ResolveSymbolContextForAddress(const SBAddress &addr, - uint32_t resolve_scope); + uint32_t resolve_scope) const; /// Read target memory. If a target process is running then memory /// is read from here. Otherwise the memory is read from the object diff --git a/lldb/source/API/SBAddress.cpp b/lldb/source/API/SBAddress.cpp index e519f0bcc83c6..f5aef0eef58a3 100644 --- a/lldb/source/API/SBAddress.cpp +++ b/lldb/source/API/SBAddress.cpp @@ -149,7 +149,7 @@ bool SBAddress::OffsetAddress(addr_t offset) { return false; } -lldb::SBSection SBAddress::GetSection() { +lldb::SBSection SBAddress::GetSection() const { LLDB_INSTRUMENT_VA(this); lldb::SBSection sb_section; @@ -158,7 +158,7 @@ lldb::SBSection SBAddress::GetSection() { return sb_section; } -lldb::addr_t SBAddress::GetOffset() { +lldb::addr_t SBAddress::GetOffset() const { LLDB_INSTRUMENT_VA(this); if (m_opaque_up->IsValid()) @@ -200,7 +200,7 @@ bool SBAddress::GetDescription(SBStream &description) { return true; } -SBModule SBAddress::GetModule() { +SBModule SBAddress::GetModule() const { LLDB_INSTRUMENT_VA(this); SBModule sb_module; @@ -209,7 +209,7 @@ SBModule SBAddress::GetModule() { return sb_module; } -SBSymbolContext SBAddress::GetSymbolContext(uint32_t resolve_scope) { +SBSymbolContext SBAddress::GetSymbolContext(uint32_t resolve_scope) const { LLDB_INSTRUMENT_VA(this, resolve_scope); SBSymbolContext sb_sc; @@ -219,7 +219,7 @@ SBSymbolContext SBAddress::GetSymbolContext(uint32_t resolve_scope) { return sb_sc; } -SBCompileUnit SBAddress::GetCompileUnit() { +SBCompileUnit SBAddress::GetCompileUnit() const { LLDB_INSTRUMENT_VA(this); SBCompileUnit sb_comp_unit; @@ -228,7 +228,7 @@ SBCompileUnit SBAddress::GetCompileUnit() { return sb_comp_unit; } -SBFunction SBAddress::GetFunction() { +SBFunction SBAddress::GetFunction() const { LLDB_INSTRUMENT_VA(this); SBFunction sb_function; @@ -237,7 +237,7 @@ SBFunction SBAddress::GetFunction() { return sb_function; } -SBBlock SBAddress::GetBlock() { +SBBlock SBAddress::GetBlock() const { LLDB_INSTRUMENT_VA(this); SBBlock sb_block; @@ -
[Lldb-commits] [lldb] [lldb-dap] Synchronously wait for breakpoints resolves in tests (PR #140470)
https://github.com/eronnen closed https://github.com/llvm/llvm-project/pull/140470 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 8160276 - [lldb-dap] Synchronously wait for breakpoints resolves in tests (#140470)
Author: Ely Ronnen Date: 2025-05-31T16:59:46+02:00 New Revision: 81602769d830e6791200e8cc7dd10a3afc32570b URL: https://github.com/llvm/llvm-project/commit/81602769d830e6791200e8cc7dd10a3afc32570b DIFF: https://github.com/llvm/llvm-project/commit/81602769d830e6791200e8cc7dd10a3afc32570b.diff LOG: [lldb-dap] Synchronously wait for breakpoints resolves in tests (#140470) Attempt to improve tests by synchronously waiting for breakpoints to resolve. Not sure if it will fix all the tests but I think it should make the tests more stable Added: Modified: lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setFunctionBreakpoints.py lldb/test/API/tools/lldb-dap/module/TestDAP_module.py lldb/test/API/tools/lldb-dap/terminated-event/TestDAP_terminatedEvent.py Removed: diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py index 4c8c51905e1d0..6b41aef2bb5b8 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py @@ -166,6 +166,7 @@ def __init__( self.initialized = False self.frame_scopes = {} self.init_commands = init_commands +self.resolved_breakpoints = {} @classmethod def encode_content(cls, s: str) -> bytes: @@ -296,6 +297,9 @@ def _handle_recv_packet(self, packet: Optional[ProtocolMessage]) -> bool: # and 'progressEnd' events. Keep these around in case test # cases want to verify them. self.progress_events.append(packet) +elif event == "breakpoint": +# Breakpoint events are sent when a breakpoint is resolved +self._update_verified_breakpoints([body["breakpoint"]]) elif packet_type == "response": if packet["command"] == "disconnect": @@ -309,6 +313,13 @@ def _process_continued(self, all_threads_continued: bool): if all_threads_continued: self.thread_stop_reasons = {} +def _update_verified_breakpoints(self, breakpoints: list[Event]): +for breakpoint in breakpoints: +if "id" in breakpoint: +self.resolved_breakpoints[str(breakpoint["id"])] = breakpoint.get( +"verified", False +) + def send_packet(self, command_dict: Request, set_sequence=True): """Take the "command_dict" python dictionary and encode it as a JSON string and send the contents as a packet to the VSCode debug @@ -454,6 +465,17 @@ def wait_for_breakpoint_events(self, timeout: Optional[float] = None): breakpoint_events.append(event) return breakpoint_events +def wait_for_breakpoints_to_be_verified( +self, breakpoint_ids: list[str], timeout: Optional[float] = None +): +"""Wait for all breakpoints to be verified. Return all unverified breakpoints.""" +while any(id not in self.resolved_breakpoints for id in breakpoint_ids): +breakpoint_event = self.wait_for_event("breakpoint", timeout=timeout) +if breakpoint_event is None: +break + +return [id for id in breakpoint_ids if id not in self.resolved_breakpoints] + def wait_for_exited(self, timeout: Optional[float] = None): event_dict = self.wait_for_event("exited", timeout=timeout) if event_dict is None: @@ -1013,7 +1035,10 @@ def request_setBreakpoints(self, source: Source, line_array, data=None): "type": "request", "arguments": args_dict, } -return self.send_recv(command_dict) +response = self.send_recv(command_dict) +if response["success"]: +self._update_verified_breakpoints(response["body"]["breakpoints"]) +return response def request_setExceptionBreakpoints(self, filters): args_dict = {"filters": filters} @@ -1039,7 +1064,10 @@ def request_setFunctionBreakpoints(self, names, condition=None, hitCondition=Non "type": "request", "arguments": args_dict, } -return self.send_recv(command_dict) +response = self.send_recv(command_dict) +if response["success"]: +self._update_verified_breakpoints(response["body"]["breakpoints"]) +return response def request_dataBreakpointInfo( self, variablesReference, name, frameIndex=0, threadId=None diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py index 91ae55977046b..
[Lldb-commits] [lldb] [lldb-dap] Synchronously wait for breakpoints resolves in tests (PR #140470)
https://github.com/eronnen updated https://github.com/llvm/llvm-project/pull/140470 >From 87cf6aee70458b0e9bbc717ee9a5cf9b91b6242a Mon Sep 17 00:00:00 2001 From: Ely Ronnen Date: Sun, 18 May 2025 20:56:47 +0200 Subject: [PATCH 1/8] [lldb-dap] Attempt to synchronously wait for breakpoints resolve in lldb-dap tests in order to stabilize the tests --- .../test/tools/lldb-dap/dap_server.py | 6 +++-- .../test/tools/lldb-dap/lldbdap_testcase.py | 26 +-- .../breakpoint/TestDAP_setBreakpoints.py | 1 - .../TestDAP_setFunctionBreakpoints.py | 1 - .../tools/lldb-dap/module/TestDAP_module.py | 4 ++- .../TestDAP_terminatedEvent.py| 6 +++-- ...TestGetTargetBreakpointsRequestHandler.cpp | 10 +-- 7 files changed, 43 insertions(+), 11 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py index 4c8c51905e1d0..5b1113f4b1251 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py @@ -1216,7 +1216,7 @@ def request_locations(self, locationReference): } return self.send_recv(command_dict) -def request_testGetTargetBreakpoints(self): +def request_testGetTargetBreakpoints(self, only_resolved=False): """A request packet used in the LLDB test suite to get all currently set breakpoint infos for all breakpoints currently set in the target. @@ -1224,7 +1224,9 @@ def request_testGetTargetBreakpoints(self): command_dict = { "command": "_testGetTargetBreakpoints", "type": "request", -"arguments": {}, +"arguments": { +"onlyResolved": only_resolved, +}, } return self.send_recv(command_dict) diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py index 91ae55977046b..27ce8171da630 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py @@ -49,7 +49,7 @@ def build_and_create_debug_adapter_for_attach(self): self.build_and_create_debug_adapter(dictionary={"EXE": unique_name}) return self.getBuildArtifact(unique_name) -def set_source_breakpoints(self, source_path, lines, data=None): +def set_source_breakpoints(self, source_path, lines, data=None, wait_for_resolve=True): """Sets source breakpoints and returns an array of strings containing the breakpoint IDs ("1", "2") for each breakpoint that was set. Parameter data is array of data objects for breakpoints. @@ -65,6 +65,8 @@ def set_source_breakpoints(self, source_path, lines, data=None): breakpoint_ids = [] for breakpoint in breakpoints: breakpoint_ids.append("%i" % (breakpoint["id"])) +if wait_for_resolve: +self.wait_for_breakpoints_to_resolve(breakpoint_ids, timeout=10) return breakpoint_ids def set_source_breakpoints_assembly(self, source_reference, lines, data=None): @@ -81,7 +83,7 @@ def set_source_breakpoints_assembly(self, source_reference, lines, data=None): breakpoint_ids.append("%i" % (breakpoint["id"])) return breakpoint_ids -def set_function_breakpoints(self, functions, condition=None, hitCondition=None): +def set_function_breakpoints(self, functions, condition=None, hitCondition=None, wait_for_resolve=True): """Sets breakpoints by function name given an array of function names and returns an array of strings containing the breakpoint IDs ("1", "2") for each breakpoint that was set. @@ -95,7 +97,27 @@ def set_function_breakpoints(self, functions, condition=None, hitCondition=None) breakpoint_ids = [] for breakpoint in breakpoints: breakpoint_ids.append("%i" % (breakpoint["id"])) +if wait_for_resolve: +self.wait_for_breakpoints_to_resolve(breakpoint_ids, timeout=10) return breakpoint_ids + +def wait_for_breakpoints_to_resolve(self, breakpoint_ids: list[str], timeout: Optional[float] = None): +unresolved_breakpoints = set(breakpoint_ids) + +# Check already resolved breakpoints +resolved_breakpoints = self.dap_server.request_testGetTargetBreakpoints(only_resolved=True)["body"]["breakpoints"] +for resolved_breakpoint in resolved_breakpoints: +unresolved_breakpoints.discard(str(resolved_breakpoint["id"])) + +while len(unresolved_breakpoints) > 0: +breakpoint_event = self.dap_server.wait_for_event("breakpoint", timeout=timeout) +if breakpoint_event is None: +break + +if breakpoint_event["
[Lldb-commits] [lldb] fix PATH_MAX missing in windows build (PR #142259)
https://github.com/eronnen created https://github.com/llvm/llvm-project/pull/142259 None >From 8f7b6fc7f4bba8b6efe7912557d98c5e9fd634c3 Mon Sep 17 00:00:00 2001 From: Ely Ronnen Date: Sat, 31 May 2025 09:29:01 +0200 Subject: [PATCH] fix PATH_MAX missing in windows build --- lldb/tools/lldb-dap/ProtocolUtils.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lldb/tools/lldb-dap/ProtocolUtils.cpp b/lldb/tools/lldb-dap/ProtocolUtils.cpp index b760a81b73959..4e47c87b73592 100644 --- a/lldb/tools/lldb-dap/ProtocolUtils.cpp +++ b/lldb/tools/lldb-dap/ProtocolUtils.cpp @@ -11,6 +11,7 @@ #include "lldb/API/SBDebugger.h" #include "lldb/API/SBTarget.h" +#include "lldb/Host/PosixApi.h" // Adds PATH_MAX for windows namespace lldb_dap { ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] fix PATH_MAX missing in windows build (PR #142259)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Ely Ronnen (eronnen) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/142259.diff 1 Files Affected: - (modified) lldb/tools/lldb-dap/ProtocolUtils.cpp (+1) ``diff diff --git a/lldb/tools/lldb-dap/ProtocolUtils.cpp b/lldb/tools/lldb-dap/ProtocolUtils.cpp index b760a81b73959..4e47c87b73592 100644 --- a/lldb/tools/lldb-dap/ProtocolUtils.cpp +++ b/lldb/tools/lldb-dap/ProtocolUtils.cpp @@ -11,6 +11,7 @@ #include "lldb/API/SBDebugger.h" #include "lldb/API/SBTarget.h" +#include "lldb/Host/PosixApi.h" // Adds PATH_MAX for windows namespace lldb_dap { `` https://github.com/llvm/llvm-project/pull/142259 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Adding const modifier to SBAddress methods (PR #142275)
https://github.com/eronnen closed https://github.com/llvm/llvm-project/pull/142275 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Avoid creating a temporary instance of std::string (NFC) (PR #142294)
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/142294 GetExceptionBreakpoint takes StringRef to look for a matching breakpoint, so we don't need to create a temporary instance of std::string on our own. >From 9004075793013620dd5bf2aa542b7fbe77415ceb Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 31 May 2025 15:18:33 -0700 Subject: [PATCH] [lldb] Avoid creating a temporary instance of std::string (NFC) GetExceptionBreakpoint takes StringRef to look for a matching breakpoint, so we don't need to create a temporary instance of std::string on our own. --- .../lldb-dap/Handler/SetExceptionBreakpointsRequestHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/tools/lldb-dap/Handler/SetExceptionBreakpointsRequestHandler.cpp b/lldb/tools/lldb-dap/Handler/SetExceptionBreakpointsRequestHandler.cpp index 09d4fea2a9a22..2214833f8a770 100644 --- a/lldb/tools/lldb-dap/Handler/SetExceptionBreakpointsRequestHandler.cpp +++ b/lldb/tools/lldb-dap/Handler/SetExceptionBreakpointsRequestHandler.cpp @@ -76,7 +76,7 @@ void SetExceptionBreakpointsRequestHandler::operator()( for (const auto &value : *filters) { const auto filter = GetAsString(value); -auto *exc_bp = dap.GetExceptionBreakpoint(std::string(filter)); +auto *exc_bp = dap.GetExceptionBreakpoint(filter); if (exc_bp) { exc_bp->SetBreakpoint(); unset_filters.erase(std::string(filter)); ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Avoid creating a temporary instance of std::string (NFC) (PR #142294)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Kazu Hirata (kazutakahirata) Changes GetExceptionBreakpoint takes StringRef to look for a matching breakpoint, so we don't need to create a temporary instance of std::string on our own. --- Full diff: https://github.com/llvm/llvm-project/pull/142294.diff 1 Files Affected: - (modified) lldb/tools/lldb-dap/Handler/SetExceptionBreakpointsRequestHandler.cpp (+1-1) ``diff diff --git a/lldb/tools/lldb-dap/Handler/SetExceptionBreakpointsRequestHandler.cpp b/lldb/tools/lldb-dap/Handler/SetExceptionBreakpointsRequestHandler.cpp index 09d4fea2a9a22..2214833f8a770 100644 --- a/lldb/tools/lldb-dap/Handler/SetExceptionBreakpointsRequestHandler.cpp +++ b/lldb/tools/lldb-dap/Handler/SetExceptionBreakpointsRequestHandler.cpp @@ -76,7 +76,7 @@ void SetExceptionBreakpointsRequestHandler::operator()( for (const auto &value : *filters) { const auto filter = GetAsString(value); -auto *exc_bp = dap.GetExceptionBreakpoint(std::string(filter)); +auto *exc_bp = dap.GetExceptionBreakpoint(filter); if (exc_bp) { exc_bp->SetBreakpoint(); unset_filters.erase(std::string(filter)); `` https://github.com/llvm/llvm-project/pull/142294 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Test all libcxxabi demangler test-cases against TrackingOutputBuffer (PR #137793)
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/137793 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 3b6ff59 - fix PATH_MAX missing in windows build (#142259)
Author: Ely Ronnen Date: 2025-05-31T10:27:44+02:00 New Revision: 3b6ff59d9b137388fe718a624942f9ff6bbde329 URL: https://github.com/llvm/llvm-project/commit/3b6ff59d9b137388fe718a624942f9ff6bbde329 DIFF: https://github.com/llvm/llvm-project/commit/3b6ff59d9b137388fe718a624942f9ff6bbde329.diff LOG: fix PATH_MAX missing in windows build (#142259) Added: Modified: lldb/tools/lldb-dap/ProtocolUtils.cpp Removed: diff --git a/lldb/tools/lldb-dap/ProtocolUtils.cpp b/lldb/tools/lldb-dap/ProtocolUtils.cpp index b760a81b73959..4e47c87b73592 100644 --- a/lldb/tools/lldb-dap/ProtocolUtils.cpp +++ b/lldb/tools/lldb-dap/ProtocolUtils.cpp @@ -11,6 +11,7 @@ #include "lldb/API/SBDebugger.h" #include "lldb/API/SBTarget.h" +#include "lldb/Host/PosixApi.h" // Adds PATH_MAX for windows namespace lldb_dap { ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Test all libcxxabi demangler test-cases against TrackingOutputBuffer (PR #137793)
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-arm-ubuntu` running on `linaro-lldb-arm-ubuntu` while building `lldb` at step 6 "test". Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/16847 Here is the relevant piece of the build log for the reference ``` Step 6 (test) failure: build (failure) ... PASS: lldb-api :: functionalities/breakpoint/breakpoint_on_overload/TestBreakOnOverload.py (310 of 3230) PASS: lldb-api :: functionalities/breakpoint/breakpoint_on_lambda_capture/TestBreakOnLambdaCapture.py (311 of 3230) PASS: lldb-api :: functionalities/breakpoint/breakpoint_reset_upon_run/TestBreakpointResetUponRun.py (312 of 3230) PASS: lldb-api :: functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py (313 of 3230) PASS: lldb-api :: functionalities/breakpoint/breakpoint_with_realpath_and_source_map/TestBreakpoint.py (314 of 3230) PASS: lldb-api :: functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py (315 of 3230) PASS: lldb-api :: functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py (316 of 3230) PASS: lldb-api :: functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py (317 of 3230) UNSUPPORTED: lldb-api :: functionalities/breakpoint/debugbreak/TestDebugBreak.py (318 of 3230) UNRESOLVED: lldb-api :: commands/gui/spawn-threads/TestGuiSpawnThreads.py (319 of 3230) TEST 'lldb-api :: commands/gui/spawn-threads/TestGuiSpawnThreads.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/commands/gui/spawn-threads -p TestGuiSpawnThreads.py -- Exit Code: 1 Command Output (stdout): -- lldb version 21.0.0git (https://github.com/llvm/llvm-project.git revision f669b9c3eca9438d33259aefb8156f977f1df382) clang revision f669b9c3eca9438d33259aefb8156f977f1df382 llvm revision f669b9c3eca9438d33259aefb8156f977f1df382 Skipping the following test categories: ['libc++', 'dsym', 'gmodules', 'debugserver', 'objc'] -- Command Output (stderr): -- FAIL: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_gui (TestGuiSpawnThreads.TestGuiSpawnThreadsTest) == ERROR: test_gui (TestGuiSpawnThreads.TestGuiSpawnThreadsTest) -- Traceback (most recent call last): File "/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py", line 148, in wrapper return func(*args, **kwargs) File "/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/API/commands/gui/spawn-threads/TestGuiSpawnThreads.py", line 44, in test_gui self.child.expect_exact(f"thread #{i + 2}: tid =") File "/usr/local/lib/python3.10/dist-packages/pexpect/spawnbase.py", line 432, in expect_exact return exp.expect_loop(timeout) File "/usr/local/lib/python3.10/dist-packages/pexpect/expect.py", line 181, in expect_loop return self.timeout(e) File "/usr/local/lib/python3.10/dist-packages/pexpect/expect.py", line 144, in timeout raise exc pexpect.exceptions.TIMEOUT: Timeout exceeded. command: /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/lldb args: ['/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/lldb', '--no-lldbinit', '--no-use-colors', '-O', 'settings clear --all', '-O', 'settings set symbols.enable-external-lookup false', '-O', 'settings set target.inherit-tcc true', '-O', 'settings set target.disable-aslr false', '-O', 'settings set target.detach-on-error false', '-O', 'settings set target.auto-apply-fixits false', '-O', 'settings set plugin.process.gdb-remote.packet-timeout 60', '-O', 'settings set
[Lldb-commits] [lldb] fix PATH_MAX missing in windows build (PR #142259)
https://github.com/eronnen closed https://github.com/llvm/llvm-project/pull/142259 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] f669b9c - [lldb][test] Test all libcxxabi demangler test-cases against TrackingOutputBuffer (#137793)
Author: Michael Buch Date: 2025-05-31T09:05:53+01:00 New Revision: f669b9c3eca9438d33259aefb8156f977f1df382 URL: https://github.com/llvm/llvm-project/commit/f669b9c3eca9438d33259aefb8156f977f1df382 DIFF: https://github.com/llvm/llvm-project/commit/f669b9c3eca9438d33259aefb8156f977f1df382.diff LOG: [lldb][test] Test all libcxxabi demangler test-cases against TrackingOutputBuffer (#137793) To test the infrastructure added in https://github.com/llvm/llvm-project/pull/131836 in would be nice to confirm that we can reconstruct all kinds of demangled names. The libcxxabi test-suite already has all those test-cases. This patch copies those test-cases (taken from `libcxxabi/test/test_demangle.pass.cpp`), reconstructs the name like LLDB would when showing backtraces, and confirms that all demangled names can be fully reconstructed. Two open questions: 1. Do we really want a copy of all those test-cases in LLDB? It's unlikely to be kept in sync with the demangler test-suite. It includes 30,000+ test-cases 2. Do we want to turn the `GetDemangledBasename`/`GetDemangledScope`/etc. into public APIs (e.g., on `TrackingOutputBuffer`) so that we can use the exact same method of extraction in the tests? Added: Modified: lldb/unittests/Core/MangledTest.cpp Removed: diff --git a/lldb/unittests/Core/MangledTest.cpp b/lldb/unittests/Core/MangledTest.cpp index ff8ae1b2f3a47..dfdc026521379 100644 --- a/lldb/unittests/Core/MangledTest.cpp +++ b/lldb/unittests/Core/MangledTest.cpp @@ -612,3 +612,66 @@ TEST_P(DemanglingPartsTestFixture, DemanglingParts) { INSTANTIATE_TEST_SUITE_P(DemanglingPartsTests, DemanglingPartsTestFixture, ::testing::ValuesIn(g_demangling_parts_test_cases)); + +struct DemanglingInfoCorrectnessTestCase { + const char *mangled; + const char *demangled; +}; + +DemanglingInfoCorrectnessTestCase g_demangling_correctness_test_cases[] = { +#include "llvm/Testing/Demangle/DemangleTestCases.inc" +}; + +struct DemanglingInfoCorrectnessTestFixutre +: public ::testing::TestWithParam {}; + +TEST_P(DemanglingInfoCorrectnessTestFixutre, Correctness) { + auto [mangled, demangled] = GetParam(); + + llvm::itanium_demangle::ManglingParser Parser( + mangled, mangled + ::strlen(mangled)); + + const auto *Root = Parser.parse(); + + ASSERT_NE(nullptr, Root); + + TrackingOutputBuffer OB; + Root->print(OB); + + // Filter out cases which would never show up in frames. We only care about + // function names. + if (Root->getKind() != + llvm::itanium_demangle::Node::Kind::KFunctionEncoding && + Root->getKind() != llvm::itanium_demangle::Node::Kind::KDotSuffix) +return; + + ASSERT_TRUE(OB.NameInfo.hasBasename()); + + auto tracked_name = llvm::StringRef(OB); + + auto return_left = tracked_name.slice(0, OB.NameInfo.ScopeRange.first); + auto scope = tracked_name.slice(OB.NameInfo.ScopeRange.first, + OB.NameInfo.ScopeRange.second); + auto basename = tracked_name.slice(OB.NameInfo.BasenameRange.first, + OB.NameInfo.BasenameRange.second); + auto template_args = tracked_name.slice(OB.NameInfo.BasenameRange.second, + OB.NameInfo.ArgumentsRange.first); + auto args = tracked_name.slice(OB.NameInfo.ArgumentsRange.first, + OB.NameInfo.ArgumentsRange.second); + auto return_right = tracked_name.slice(OB.NameInfo.ArgumentsRange.second, + OB.NameInfo.QualifiersRange.first); + auto qualifiers = tracked_name.slice(OB.NameInfo.QualifiersRange.first, + OB.NameInfo.QualifiersRange.second); + auto suffix = tracked_name.slice(OB.NameInfo.QualifiersRange.second, + llvm::StringRef::npos); + + auto reconstructed_name = + llvm::join_items("", return_left, scope, basename, template_args, args, + return_right, qualifiers, suffix); + + EXPECT_EQ(reconstructed_name, demangled); +} + +INSTANTIATE_TEST_SUITE_P( +DemanglingInfoCorrectnessTests, DemanglingInfoCorrectnessTestFixutre, +::testing::ValuesIn(g_demangling_correctness_test_cases)); ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb-dap] Reuse source object logics (PR #141426)
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-aarch64-windows` running on `linaro-armv8-windows-msvc-05` while building `lldb` at step 4 "build". Full details are available at: https://lab.llvm.org/buildbot/#/builders/141/builds/9140 Here is the relevant piece of the build log for the reference ``` Step 4 (build) failure: build (failure) ... 570.169 [789/10/5972] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\CommandPlugins.cpp.obj 570.497 [788/10/5973] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\Transport.cpp.obj 571.219 [787/10/5974] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\LLDBUtils.cpp.obj 571.418 [786/10/5975] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\ProgressEvent.cpp.obj 571.430 [785/10/5976] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\FifoFiles.cpp.obj 571.516 [784/10/5977] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\Watchpoint.cpp.obj 571.663 [783/10/5978] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\Handler\ResponseHandler.cpp.obj 571.869 [782/10/5979] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\Handler\BreakpointLocationsHandler.cpp.obj 572.057 [781/10/5980] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\Handler\CancelRequestHandler.cpp.obj 573.116 [780/10/5981] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\ProtocolUtils.cpp.obj FAILED: tools/lldb/tools/lldb-dap/CMakeFiles/lldbDAP.dir/ProtocolUtils.cpp.obj ccache C:\Users\tcwg\scoop\apps\llvm-arm64\current\bin\clang-cl.exe /nologo -TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\tools\lldb\tools\lldb-dap -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\tools\lldb-dap -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\include -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\tools\lldb\include -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\include -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\include -IC:\Users\tcwg\scoop\apps\python\current\include -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\..\clang\include -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\tools\lldb\..\clang\include /DWIN32 /D_WINDOWS /Zc:inline /Zc:__cplusplus /Oi /Brepro /bigobj /permissive- -Werror=unguarded-availability-new /W4 -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported /Gw -Wno-vla-extension /O2 /Ob2 /DNDEBUG -std:c++17 -MD -wd4018 -wd4068 -wd4150 -wd4201 -wd4251 -wd4521 -wd4530 -wd4589 /EHs-c- /GR- /showIncludes /Fotools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\ProtocolUtils.cpp.obj /Fdtools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\lldbDAP.pdb -c -- C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\tools\lldb-dap\ProtocolUtils.cpp C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\tools\lldb-dap\ProtocolUtils.cpp(82,15): error: use of undeclared identifier 'PATH_MAX' 82 | char path[PATH_MAX] = ""; | ^ C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\tools\lldb-dap\ProtocolUtils.cpp(84,51): error: use of undeclared identifier 'PATH_MAX' 84 | lldb::SBFileSpec::ResolvePath(path, path, PATH_MAX)) | ^ 2 errors generated. 573.912 [780/9/5982] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\EventHelper.cpp.obj 574.833 [780/8/5983] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\RunInTerminal.cpp.obj 575.201 [780/7/5984] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\Variables.cpp.obj 575.209 [780/6/5985] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\JSONUtils.cpp.obj 575.582 [780/5/5986] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\SourceBreakpoint.cpp.obj 576.612 [780/4/5987] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\Handler\CompileUnitsRequestHandler.cpp.obj 577.157 [780/3/5988] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\Handler\CompletionsHandler.cpp.obj 577.175 [780/2/5989] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldbDAP.dir\Handler\AttachRequestHandler.cpp.obj
[Lldb-commits] [lldb] [lldb] Adding const modifier to SBAddress methods (PR #142275)
https://github.com/JDevlieghere requested changes to this pull request. Yes, unfortunately this is ABI breaking. The const qualifier is encoded in the mangling (it'll add a `K`). You can confirm this yourself by running `nm` over the liblldb before and after adding the const qualifier https://github.com/llvm/llvm-project/pull/142275 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Adding const modifier to SBAddress methods (PR #142275)
https://github.com/JDevlieghere edited https://github.com/llvm/llvm-project/pull/142275 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python properties to SBBreakpoint(Location) (PR #142215)
https://github.com/JDevlieghere approved this pull request. LGTM. Can you find a test that uses (some of) the old methods and replace them by the properties so these have some coverage? https://github.com/llvm/llvm-project/pull/142215 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][NFC] Remove unused macro ENABLE_MEMORY_CACHING (PR #142231)
https://github.com/JDevlieghere approved this pull request. https://github.com/llvm/llvm-project/pull/142231 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python properties to SBBreakpoint(Location) (PR #142215)
https://github.com/JDevlieghere edited https://github.com/llvm/llvm-project/pull/142215 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python properties to SBBreakpoint(Location) (PR #142215)
https://github.com/kastiglione updated https://github.com/llvm/llvm-project/pull/142215 >From b969aeffa2726ef4e0714bde9de72a5292a8d8fa Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Fri, 30 May 2025 14:11:19 -0700 Subject: [PATCH 1/2] [lldb] Add Python properties to SBBreakpointr(Location) --- lldb/bindings/interface/SBBreakpointExtensions.i| 9 + .../interface/SBBreakpointLocationExtensions.i | 13 + 2 files changed, 22 insertions(+) diff --git a/lldb/bindings/interface/SBBreakpointExtensions.i b/lldb/bindings/interface/SBBreakpointExtensions.i index 6bc781a327778..82fc3ab0e7c04 100644 --- a/lldb/bindings/interface/SBBreakpointExtensions.i +++ b/lldb/bindings/interface/SBBreakpointExtensions.i @@ -50,6 +50,15 @@ STRING_EXTENSION_OUTSIDE(SBBreakpoint) enabled = property(IsEnabled, SetEnabled, doc='''A read/write property that configures whether this breakpoint is enabled or not.''') one_shot = property(IsOneShot, SetOneShot, doc='''A read/write property that configures whether this breakpoint is one-shot (deleted when hit) or not.''') num_locations = property(GetNumLocations, None, doc='''A read only property that returns the count of locations of this breakpoint.''') +auto_continue = property(GetAutoContinue, SetAutoContinue, doc='A read/write property that configures the auto-continue property of this breakpoint.') +condition = property(GetCondition, SetCondition, doc='A read/write property that configures the condition of this breakpoint.') +hit_count = property(GetHitCount, doc='A read only property that returns the hit count of this breakpoint.') +ignore_count = property(GetIgnoreCount, SetIgnoreCount, doc='A read/write property that configures the ignore count of this breakpoint.') +queue_name = property(GetQueueName, SetQueueName, doc='A read/write property that configures the queue name criteria of this breakpoint.') +target = property(GetTarget, doc='A read only property that returns the target of this breakpoint.') +thread_id = property(GetThreadID, SetThreadID, doc='A read/write property that configures the thread id criteria of this breakpoint.') +thread_index = property(GetThreadIndex, SetThreadIndex, doc='A read/write property that configures the thread index criteria of this breakpoint.') +thread_name = property(GetThreadName, SetThreadName, doc='A read/write property that configures the thread name criteria of this breakpoint.') %} #endif } diff --git a/lldb/bindings/interface/SBBreakpointLocationExtensions.i b/lldb/bindings/interface/SBBreakpointLocationExtensions.i index 40027790a5e8d..12c87eb2c0fe6 100644 --- a/lldb/bindings/interface/SBBreakpointLocationExtensions.i +++ b/lldb/bindings/interface/SBBreakpointLocationExtensions.i @@ -7,6 +7,19 @@ STRING_EXTENSION_LEVEL_OUTSIDE(SBBreakpointLocation, lldb::eDescriptionLevelFull # our own equality operator here def __eq__(self, other): return not self.__ne__(other) + +addr = property(GetAddress, doc='A read only property that returns the address of this breakpoint location.') +auto_continue = property(GetAutoContinue, SetAutoContinue, doc='A read/write property that configures the auto-continue property of this breakpoint location.') +breakpoint = property(GetBreakpoint, doc='A read only property that returns the parent breakpoint of this breakpoint location.') +condition = property(GetCondition, SetCondition, doc='A read/write property that configures the condition of this breakpoint location.') +hit_count = property(GetHitCount, doc='A read only property that returns the hit count of this breakpoint location.') +id = property(GetID, doc='A read only property that returns the id of this breakpoint location.') +ignore_count = property(GetIgnoreCount, SetIgnoreCount, doc='A read/write property that configures the ignore count of this breakpoint location.') +load_addr = property(GetLoadAddress, doc='A read only property that returns the load address of this breakpoint location.') +queue_name = property(GetQueueName, SetQueueName, doc='A read/write property that configures the queue name criteria of this breakpoint location.') +thread_id = property(GetThreadID, SetThreadID, doc='A read/write property that configures the thread id criteria of this breakpoint location.') +thread_index = property(GetThreadIndex, SetThreadIndex, doc='A read/write property that configures the thread index criteria of this breakpoint location.') +thread_name = property(GetThreadName, SetThreadName, doc='A read/write property that configures the thread name criteria of this breakpoint location.') %} #endif } >From b8652064283aeb6b3937b0544d0d87e4f14fcb15 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Sat, 31 May 2025 11:25:07 -0700 Subject: [PATCH 2/2] Update some tests to use properties --- .../TestBreakpointIgnoreCount.py
[Lldb-commits] [lldb] [lldb] Add Python properties to SBBreakpoint(Location) (PR #142215)
https://github.com/kastiglione updated https://github.com/llvm/llvm-project/pull/142215 >From b969aeffa2726ef4e0714bde9de72a5292a8d8fa Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Fri, 30 May 2025 14:11:19 -0700 Subject: [PATCH 1/3] [lldb] Add Python properties to SBBreakpointr(Location) --- lldb/bindings/interface/SBBreakpointExtensions.i| 9 + .../interface/SBBreakpointLocationExtensions.i | 13 + 2 files changed, 22 insertions(+) diff --git a/lldb/bindings/interface/SBBreakpointExtensions.i b/lldb/bindings/interface/SBBreakpointExtensions.i index 6bc781a327778..82fc3ab0e7c04 100644 --- a/lldb/bindings/interface/SBBreakpointExtensions.i +++ b/lldb/bindings/interface/SBBreakpointExtensions.i @@ -50,6 +50,15 @@ STRING_EXTENSION_OUTSIDE(SBBreakpoint) enabled = property(IsEnabled, SetEnabled, doc='''A read/write property that configures whether this breakpoint is enabled or not.''') one_shot = property(IsOneShot, SetOneShot, doc='''A read/write property that configures whether this breakpoint is one-shot (deleted when hit) or not.''') num_locations = property(GetNumLocations, None, doc='''A read only property that returns the count of locations of this breakpoint.''') +auto_continue = property(GetAutoContinue, SetAutoContinue, doc='A read/write property that configures the auto-continue property of this breakpoint.') +condition = property(GetCondition, SetCondition, doc='A read/write property that configures the condition of this breakpoint.') +hit_count = property(GetHitCount, doc='A read only property that returns the hit count of this breakpoint.') +ignore_count = property(GetIgnoreCount, SetIgnoreCount, doc='A read/write property that configures the ignore count of this breakpoint.') +queue_name = property(GetQueueName, SetQueueName, doc='A read/write property that configures the queue name criteria of this breakpoint.') +target = property(GetTarget, doc='A read only property that returns the target of this breakpoint.') +thread_id = property(GetThreadID, SetThreadID, doc='A read/write property that configures the thread id criteria of this breakpoint.') +thread_index = property(GetThreadIndex, SetThreadIndex, doc='A read/write property that configures the thread index criteria of this breakpoint.') +thread_name = property(GetThreadName, SetThreadName, doc='A read/write property that configures the thread name criteria of this breakpoint.') %} #endif } diff --git a/lldb/bindings/interface/SBBreakpointLocationExtensions.i b/lldb/bindings/interface/SBBreakpointLocationExtensions.i index 40027790a5e8d..12c87eb2c0fe6 100644 --- a/lldb/bindings/interface/SBBreakpointLocationExtensions.i +++ b/lldb/bindings/interface/SBBreakpointLocationExtensions.i @@ -7,6 +7,19 @@ STRING_EXTENSION_LEVEL_OUTSIDE(SBBreakpointLocation, lldb::eDescriptionLevelFull # our own equality operator here def __eq__(self, other): return not self.__ne__(other) + +addr = property(GetAddress, doc='A read only property that returns the address of this breakpoint location.') +auto_continue = property(GetAutoContinue, SetAutoContinue, doc='A read/write property that configures the auto-continue property of this breakpoint location.') +breakpoint = property(GetBreakpoint, doc='A read only property that returns the parent breakpoint of this breakpoint location.') +condition = property(GetCondition, SetCondition, doc='A read/write property that configures the condition of this breakpoint location.') +hit_count = property(GetHitCount, doc='A read only property that returns the hit count of this breakpoint location.') +id = property(GetID, doc='A read only property that returns the id of this breakpoint location.') +ignore_count = property(GetIgnoreCount, SetIgnoreCount, doc='A read/write property that configures the ignore count of this breakpoint location.') +load_addr = property(GetLoadAddress, doc='A read only property that returns the load address of this breakpoint location.') +queue_name = property(GetQueueName, SetQueueName, doc='A read/write property that configures the queue name criteria of this breakpoint location.') +thread_id = property(GetThreadID, SetThreadID, doc='A read/write property that configures the thread id criteria of this breakpoint location.') +thread_index = property(GetThreadIndex, SetThreadIndex, doc='A read/write property that configures the thread index criteria of this breakpoint location.') +thread_name = property(GetThreadName, SetThreadName, doc='A read/write property that configures the thread name criteria of this breakpoint location.') %} #endif } >From b8652064283aeb6b3937b0544d0d87e4f14fcb15 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Sat, 31 May 2025 11:25:07 -0700 Subject: [PATCH 2/3] Update some tests to use properties --- .../TestBreakpointIgnoreCount.py