Skip to content

[DWARF] Inheritance DW_TAGs dropped by GC #9828

@SingleAccretion

Description

@SingleAccretion

Reproduction:
1) Compile the following C++ to WASM with -g:

struct Base { int BaseValue; };
struct Derived : public Base { int DerivedValue; };

int main()
{
    Derived x;
    x.BaseValue = 2;
    x.DerivedValue = 1;
    return 0;
}

2) Run under wasmtime+LLDB:

> lldb wasmtime -Ddebug-info -Oopt-level=0 main.wasm
> (lldb) b main
> (lldb) ...
> (lldb) v x.BaseValue

Expected result:

(int) x.BaseValue = 1

Actual result:

error: "BaseValue" is not a member of "(Derived) x"

Cause: DI GC drops correctness-bearing DW_TAG_inheritance DIEs.

Fix incoming...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions