SingleAccretion opened issue #9512:
Reproduction:
; main.cpp #include "someclass.h" int main() { return SomeClass::Main(); } ; someclass.h class SomeClass { public: int SomeMemberVariable; static int Main() { int x = 1; int y = SomeFunc(x); return y; } static int SomeFunc(int y) { int s = SeparateFunction(); int z = y + 1; return z + s; } static int SeparateFunction(); }; ; satellite.cpp #include "someclass.h" int SomeClass::SeparateFunction() { SomeClass x = SomeClass(); return x.SomeMemberVariable; }> & $env:WASI_SDK_PATH/bin/clang main.cpp satellite.cpp -o main.wasm -g3 -target wasm32-unknown-wasip2 > lldb wasmtime -Ccache=n -Ddebug-info -Oopt-level=0 main.wasm > (lldb) b Main > (lldb) b SeparateFunction > (lldb) r Main > (lldb) p x + x ; While broken in Main > (lldb) c > (lldb) p x.SomeMemberVariableExpected result: evaluation succeeds.
Actual result:
(lldb) p x.SomeMemberVariable warning: (x86_64) JIT(0x1550de50e60)(0x000001550de50e60) 0x000002a4: DW_AT_specification(0x0000000000000291) has no decl (lldb) error: <lldb wrapper prefix>:45:11: use of undeclared identifier '$__lldb_local_vars' 45 | using $__lldb_local_vars::x; | ^ error: <user expression 1>:1:1: use of undeclared identifier 'x' 1 | x.SomeMemberVariable | ^The tentative root case of this is that debug info translation discards
DW_AT_declarationDIEs for the member functions, leading to the two CUs (that both haveSomeClasstype DIEs) diverging (and LLDB ultimately ultimately caching information from the one first accessed, heremain.cpp).
SingleAccretion edited issue #9512:
Reproduction:
; main.cpp #include "someclass.h" int main() { return SomeClass::Main(); } ; someclass.h class SomeClass { public: int SomeMemberVariable; static int Main() { int x = 1; int y = SomeFunc(x); return y; } static int SomeFunc(int y) { int s = SeparateFunction(); int z = y + 1; return z + s; } static int SeparateFunction(); }; ; satellite.cpp #include "someclass.h" int SomeClass::SeparateFunction() { SomeClass x = SomeClass(); return x.SomeMemberVariable; }> & $env:WASI_SDK_PATH/bin/clang main.cpp satellite.cpp -o main.wasm -g3 -target wasm32-unknown-wasip2 > lldb wasmtime -Ccache=n -Ddebug-info -Oopt-level=0 main.wasm > (lldb) b Main > (lldb) b SeparateFunction > (lldb) r > (lldb) p x + x ; While broken in Main > (lldb) c > (lldb) p x.SomeMemberVariableExpected result: evaluation succeeds.
Actual result:
(lldb) p x.SomeMemberVariable warning: (x86_64) JIT(0x1550de50e60)(0x000001550de50e60) 0x000002a4: DW_AT_specification(0x0000000000000291) has no decl (lldb) error: <lldb wrapper prefix>:45:11: use of undeclared identifier '$__lldb_local_vars' 45 | using $__lldb_local_vars::x; | ^ error: <user expression 1>:1:1: use of undeclared identifier 'x' 1 | x.SomeMemberVariable | ^The tentative root case of this is that debug info translation discards
DW_AT_declarationDIEs for the member functions, leading to the two CUs (that both haveSomeClasstype DIEs) diverging (and LLDB ultimately ultimately caching information from the one first accessed, heremain.cpp).
SingleAccretion edited issue #9512:
Reproduction:
; main.cpp #include "someclass.h" int main() { return SomeClass::Main(); } ; someclass.h class SomeClass { public: int SomeMemberVariable; static int Main() { int x = 1; int y = SomeFunc(x); return y; } static int SomeFunc(int y) { int s = SeparateFunction(); int z = y + 1; return z + s; } static int SeparateFunction(); }; ; satellite.cpp #include "someclass.h" int SomeClass::SeparateFunction() { SomeClass x = SomeClass(); return x.SomeMemberVariable; }> & $env:WASI_SDK_PATH/bin/clang main.cpp satellite.cpp -o main.wasm -g3 -target wasm32-unknown-wasip2 > lldb wasmtime -Ccache=n -Ddebug-info -Oopt-level=0 main.wasm > (lldb) b Main > (lldb) b SeparateFunction > (lldb) r > (lldb) p x + x ; While broken in Main > (lldb) c > (lldb) p x.SomeMemberVariableExpected result: evaluation succeeds.
Actual result:
(lldb) p x.SomeMemberVariable warning: (x86_64) JIT(0x1550de50e60)(0x000001550de50e60) 0x000002a4: DW_AT_specification(0x0000000000000291) has no decl (lldb) error: <lldb wrapper prefix>:45:11: use of undeclared identifier '$__lldb_local_vars' 45 | using $__lldb_local_vars::x; | ^ error: <user expression 1>:1:1: use of undeclared identifier 'x' 1 | x.SomeMemberVariable | ^The tentative root case of this is that debug info translation discards
DW_AT_declarationDIEs for the member functions, leading to the two CUs (that both haveSomeClasstype DIEs) diverging (and LLDB ultimately caching information from the one first accessed, heremain.cpp).
alexcrichton added the wasmtime:debugging label to Issue #9512.
alexcrichton closed issue #9512:
Reproduction:
; main.cpp #include "someclass.h" int main() { return SomeClass::Main(); } ; someclass.h class SomeClass { public: int SomeMemberVariable; static int Main() { int x = 1; int y = SomeFunc(x); return y; } static int SomeFunc(int y) { int s = SeparateFunction(); int z = y + 1; return z + s; } static int SeparateFunction(); }; ; satellite.cpp #include "someclass.h" int SomeClass::SeparateFunction() { SomeClass x = SomeClass(); return x.SomeMemberVariable; }> & $env:WASI_SDK_PATH/bin/clang main.cpp satellite.cpp -o main.wasm -g3 -target wasm32-unknown-wasip2 > lldb wasmtime -Ccache=n -Ddebug-info -Oopt-level=0 main.wasm > (lldb) b Main > (lldb) b SeparateFunction > (lldb) r > (lldb) p x + x ; While broken in Main > (lldb) c > (lldb) p x.SomeMemberVariableExpected result: evaluation succeeds.
Actual result:
(lldb) p x.SomeMemberVariable warning: (x86_64) JIT(0x1550de50e60)(0x000001550de50e60) 0x000002a4: DW_AT_specification(0x0000000000000291) has no decl (lldb) error: <lldb wrapper prefix>:45:11: use of undeclared identifier '$__lldb_local_vars' 45 | using $__lldb_local_vars::x; | ^ error: <user expression 1>:1:1: use of undeclared identifier 'x' 1 | x.SomeMemberVariable | ^The tentative root case of this is that debug info translation discards
DW_AT_declarationDIEs for the member functions, leading to the two CUs (that both haveSomeClasstype DIEs) diverging (and LLDB ultimately caching information from the one first accessed, heremain.cpp).
Last updated: Dec 06 2025 at 06:05 UTC