Stream: git-wasmtime

Topic: wasmtime / Issue #2105 DW_TAG_enumerator gets lost in tra...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2020 at 15:02):

ggreif labeled Issue #2105:

I have a Wasm file with this DIE in the DWARF section:

0x0000002b:   DW_TAG_enumeration_type
                DW_AT_artificial    (true)

0x0000002c:     DW_TAG_enumerator
                  DW_AT_name    ("mon")
                  DW_AT_const_value (0x005316cc)

0x00000035:     DW_TAG_enumerator
                  DW_AT_name    ("tue")
                  DW_AT_const_value (0x00586bc4)

0x0000003e:     DW_TAG_enumerator
                  DW_AT_name    ("wed")
                  DW_AT_const_value (0x005aa496)

0x00000047:     NULL

When I translate with wasm2obj, the DW_TAG_enumerators get stripped, and it ends up as

0x00000067:   DW_TAG_enumeration_type
                DW_AT_artificial    (0x01)

0x00000069:

In this case 0x00000067 is the only enumeration in the output. The corresponding abbreviation for the latter is

[9] DW_TAG_enumeration_type DW_CHILDREN_no
    DW_AT_artificial    DW_FORM_flag

while the former correctly has children

[17] DW_TAG_enumeration_type    DW_CHILDREN_yes
    DW_AT_artificial    DW_FORM_flag_present

Obviously the flag for children has flipped.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2020 at 15:02):

ggreif opened Issue #2105:

I have a Wasm file with this DIE in the DWARF section:

0x0000002b:   DW_TAG_enumeration_type
                DW_AT_artificial    (true)

0x0000002c:     DW_TAG_enumerator
                  DW_AT_name    ("mon")
                  DW_AT_const_value (0x005316cc)

0x00000035:     DW_TAG_enumerator
                  DW_AT_name    ("tue")
                  DW_AT_const_value (0x00586bc4)

0x0000003e:     DW_TAG_enumerator
                  DW_AT_name    ("wed")
                  DW_AT_const_value (0x005aa496)

0x00000047:     NULL

When I translate with wasm2obj, the DW_TAG_enumerators get stripped, and it ends up as

0x00000067:   DW_TAG_enumeration_type
                DW_AT_artificial    (0x01)

0x00000069:

In this case 0x00000067 is the only enumeration in the output. The corresponding abbreviation for the latter is

[9] DW_TAG_enumeration_type DW_CHILDREN_no
    DW_AT_artificial    DW_FORM_flag

while the former correctly has children

[17] DW_TAG_enumeration_type    DW_CHILDREN_yes
    DW_AT_artificial    DW_FORM_flag_present

Obviously the flag for children has flipped.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2020 at 15:03):

ggreif edited Issue #2105:

(For a Wasm file example, see #2078.)

I have a Wasm file with this DIE in the DWARF section:

0x0000002b:   DW_TAG_enumeration_type
                DW_AT_artificial    (true)

0x0000002c:     DW_TAG_enumerator
                  DW_AT_name    ("mon")
                  DW_AT_const_value (0x005316cc)

0x00000035:     DW_TAG_enumerator
                  DW_AT_name    ("tue")
                  DW_AT_const_value (0x00586bc4)

0x0000003e:     DW_TAG_enumerator
                  DW_AT_name    ("wed")
                  DW_AT_const_value (0x005aa496)

0x00000047:     NULL

When I translate with wasm2obj, the DW_TAG_enumerators get stripped, and it ends up as

0x00000067:   DW_TAG_enumeration_type
                DW_AT_artificial    (0x01)

0x00000069:

In this case 0x00000067 is the only enumeration in the output. The corresponding abbreviation for the latter is

[9] DW_TAG_enumeration_type DW_CHILDREN_no
    DW_AT_artificial    DW_FORM_flag

while the former correctly has children

[17] DW_TAG_enumeration_type    DW_CHILDREN_yes
    DW_AT_artificial    DW_FORM_flag_present

Obviously the flag for children has flipped.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2020 at 19:19):

yurydelendik closed Issue #2105:

(For a Wasm file example, see #2078.)

I have a Wasm file with this DIE in the DWARF section:

0x0000002b:   DW_TAG_enumeration_type
                DW_AT_artificial    (true)

0x0000002c:     DW_TAG_enumerator
                  DW_AT_name    ("mon")
                  DW_AT_const_value (0x005316cc)

0x00000035:     DW_TAG_enumerator
                  DW_AT_name    ("tue")
                  DW_AT_const_value (0x00586bc4)

0x0000003e:     DW_TAG_enumerator
                  DW_AT_name    ("wed")
                  DW_AT_const_value (0x005aa496)

0x00000047:     NULL

When I translate with wasm2obj, the DW_TAG_enumerators get stripped, and it ends up as

0x00000067:   DW_TAG_enumeration_type
                DW_AT_artificial    (0x01)

0x00000069:

In this case 0x00000067 is the only enumeration in the output. The corresponding abbreviation for the latter is

[9] DW_TAG_enumeration_type DW_CHILDREN_no
    DW_AT_artificial    DW_FORM_flag

while the former correctly has children

[17] DW_TAG_enumeration_type    DW_CHILDREN_yes
    DW_AT_artificial    DW_FORM_flag_present

Obviously the flag for children has flipped.


Last updated: Nov 22 2024 at 16:03 UTC