[Lldb-commits] [lldb] Improve performance of .debug_names lookups when DW_IDX_parent attributes are used (PR #91808)

Alexander Yermolovich via lldb-commits lldb-commits at lists.llvm.org
Wed May 29 17:57:12 PDT 2024


ayermolo wrote:

I have another question. 
For the same example.
I see:

```
Name 4 {
      Hash: 0x2F94396D
      String: 0x00000049 "_Z9get_statev"
      Entry @ 0x112 {
        Abbrev: 0x2
        Tag: DW_TAG_subprogram
        DW_IDX_die_offset: 0x00000023
        DW_IDX_parent: <parent not indexed>
      }
...      
Name 8 {
      Hash: 0x2B607
      String: 0x00000041 "B"
      Entry @ 0x13b {
        Abbrev: 0x7
        Tag: DW_TAG_namespace
        DW_IDX_type_unit: 0x00
        DW_IDX_die_offset: 0x00000025
        DW_IDX_parent: Entry @ 0x112
      }
```

This seems like a bug no?
Looks like it's confusing

```
0x00000023:   DW_TAG_namespace
                DW_AT_name  ("A")
```
In TU 0
With Subprogram at the same (relative offset) in the CU

```
0x0000006a: Compile Unit: length = 0x0000005c, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x000000ca)
...
0x0000008d:   DW_TAG_subprogram
```

I think it should be pointing to:

```
String: 0x00000023 "A"
      Entry @ 0x11e {
        Abbrev: 0x4
        Tag: DW_TAG_namespace
        DW_IDX_type_unit: 0x00
        DW_IDX_die_offset: 0x00000023
        DW_IDX_parent: <parent not indexed>
      }
```




https://github.com/llvm/llvm-project/pull/91808


More information about the lldb-commits mailing list