Bug 1739321 Comment 4 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

The clang bugtracker is down right now since they're in the middle of a failing migration to github. But to record some info:

The DWARF info for the .o file that is relevant to `JSString` contains:
```
<1><48cbf>: Abbrev Number: 43 (DW_TAG_class_type)
    <48cc0>   DW_AT_calling_convention: 4       (pass by ref)
    <48cc1>   DW_AT_name        : (indirect string, offset: 0x6830): JSLinearString
    <48cc5>   DW_AT_byte_size   : 24
    <48cc6>   DW_AT_decl_file   : 25
    <48cc7>   DW_AT_decl_line   : 788
 <2><48cc9>: Abbrev Number: 5 (DW_TAG_inheritance)
    <48cca>   DW_AT_type        : <0x4862b>
    <48cce>   DW_AT_data_member_location: 0
    <48ccf>   DW_AT_accessibility: 1    (public)
    ...
```

so a complete declaration of `JSLinearString`. It is tagged as inheriting from 0x4862b, which is:
```
 <1><4862b>: Abbrev Number: 19 (DW_TAG_class_type)
    <4862c>   DW_AT_name        : (indirect string, offset: 0x44c1): JSString
    <48630>   DW_AT_declaration : 1
 <2><48630>: Abbrev Number: 20 (DW_TAG_subprogram)
    <48631>   DW_AT_linkage_name: (indirect string, offset: 0x2b059): _ZN8JSString23fillWithRepresentativesEP9JSContextN2JS6HandleIPN2js11ArrayObjectEEE
    <48635>   DW_AT_name        : (indirect string, offset: 0x2b0ac): fillWithRepresentatives
    <48639>   DW_AT_decl_file   : 25
    ...
```

Now, I don't know how to read DWARF, but the `DW_AT_declaration` makes it look to me like it's doing a forward/partial declaration of the `JSString` type and not the type itself -- and yet, it's also enumerating fields of it. Which seems a bit weird, but I think the DWARF format version 5 spec says it's ok in section E.2.3.

I have no clue why clang is not emitting the complete declaration of `JSString`. Hopefully I can remember to file a bug once it's possible again.
The clang bugtracker is down right now since they're in the middle of a failing migration to github. But to record some info:

The DWARF info for the .o file that is relevant to `JSString` contains:
```
<1><48cbf>: Abbrev Number: 43 (DW_TAG_class_type)
    <48cc0>   DW_AT_calling_convention: 4       (pass by ref)
    <48cc1>   DW_AT_name        : (indirect string, offset: 0x6830): JSLinearString
    <48cc5>   DW_AT_byte_size   : 24
    <48cc6>   DW_AT_decl_file   : 25
    <48cc7>   DW_AT_decl_line   : 788
 <2><48cc9>: Abbrev Number: 5 (DW_TAG_inheritance)
    <48cca>   DW_AT_type        : <0x4862b>
    <48cce>   DW_AT_data_member_location: 0
    <48ccf>   DW_AT_accessibility: 1    (public)
    ...
```

so a complete declaration of `JSLinearString`. It is tagged as inheriting from 0x4862b, which is:
```
 <1><4862b>: Abbrev Number: 19 (DW_TAG_class_type)
    <4862c>   DW_AT_name        : (indirect string, offset: 0x44c1): JSString
    <48630>   DW_AT_declaration : 1
 <2><48630>: Abbrev Number: 20 (DW_TAG_subprogram)
    <48631>   DW_AT_linkage_name: (indirect string, offset: 0x2b059): _ZN8JSString23fillWithRepresentativesEP9JSContextN2JS6HandleIPN2js11ArrayObjectEEE
    <48635>   DW_AT_name        : (indirect string, offset: 0x2b0ac): fillWithRepresentatives
    <48639>   DW_AT_decl_file   : 25
    ...
```

Now, I don't know how to read DWARF, but the `DW_AT_declaration` makes it look to me like it's doing a forward/partial declaration of the `JSString` type and not the type itself -- and yet, it's also enumerating fields of it. Which seems a bit weird, but I think the DWARF format version 5 spec says it's ok in section E.2.3.

I have no clue why clang is not emitting the defining declaration of `JSString`. Hopefully I can remember to file a bug once it's possible again.
The clang bugtracker is down right now since they're in the middle of a failing migration to github. But to record some info:

The DWARF info for the .o file that is relevant to `JSString` contains:
```
<1><48cbf>: Abbrev Number: 43 (DW_TAG_class_type)
    <48cc0>   DW_AT_calling_convention: 4       (pass by ref)
    <48cc1>   DW_AT_name        : (indirect string, offset: 0x6830): JSLinearString
    <48cc5>   DW_AT_byte_size   : 24
    <48cc6>   DW_AT_decl_file   : 25
    <48cc7>   DW_AT_decl_line   : 788
 <2><48cc9>: Abbrev Number: 5 (DW_TAG_inheritance)
    <48cca>   DW_AT_type        : <0x4862b>
    <48cce>   DW_AT_data_member_location: 0
    <48ccf>   DW_AT_accessibility: 1    (public)
    ...
```

so a complete declaration of `JSLinearString`. It is tagged as inheriting from 0x4862b, which is:
```
 <1><4862b>: Abbrev Number: 19 (DW_TAG_class_type)
    <4862c>   DW_AT_name        : (indirect string, offset: 0x44c1): JSString
    <48630>   DW_AT_declaration : 1
 <2><48630>: Abbrev Number: 20 (DW_TAG_subprogram)
    <48631>   DW_AT_linkage_name: (indirect string, offset: 0x2b059): _ZN8JSString23fillWithRepresentativesEP9JSContextN2JS6HandleIPN2js11ArrayObjectEEE
    <48635>   DW_AT_name        : (indirect string, offset: 0x2b0ac): fillWithRepresentatives
    <48639>   DW_AT_decl_file   : 25
    ...
```

Now, I don't know how to read DWARF, but the `DW_AT_declaration` makes it look to me like it's doing only a non-defining (forward? partial?) declaration of the `JSString` type -- and yet, it's also enumerating fields of it. Which seems a bit weird, but I think the DWARF format version 5 spec says it's ok in section E.2.3.

I have no clue why clang is not emitting the defining declaration of `JSString`. Hopefully I can remember to file a bug once it's possible again.

Back to Bug 1739321 Comment 4