[Lldb-commits] [PATCH] D90413: [nfc] [lldb] Align `user_id_t` format to the current `DIERef` format

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 29 11:44:06 PDT 2020


jankratochvil created this revision.
jankratochvil added a reviewer: labath.
jankratochvil added a project: LLDB.
Herald added a subscriber: JDevlieghere.
jankratochvil requested review of this revision.

Current `user_id_t` format is:
`63{isDebugTypes} 62..32{dwo || 7fffffff} 31..0 {die_offset}`
while current `DIERef` format is (I have made up the bit positions but the field widths do match):
`63{m_section==isDebugTypes} 62{m_dwo_num_valid} 61..32{m_dwo_num} 31..0 {m_die_offset}`

Proposing to change `user_id_t` to:
`63{isDebugTypes} 62{dwo_is_valid} 61..32{dwo; 0 if !valid} 31..0 {die_offset}`

There is no benefit of having 31-bits wide `dwo_num` in `user_id_t` when it gets converted to 30-bits width in `DIERef`.

This patch is for future DWZ patchset which extends the `dwo_is_valid` bit into a 2-bit field (normal, DWO, DWZ, DWZcommon) so that both `user_id_t` and `DIERef` can be changed then the same way.

It would be best to somehow unify `user_id_t` and `DIERef` but I do not plan to do that. `user_id_t` should probably remain a number for the Python API compatibility while there still needs to be some class with all the methods to access it.

`SymbolFileDWARF::GetDwpSymbolFile()` and `SymbolFileDWARF::GetDIE` use 0x3fffffff for DWP but that does not clash:
formerly:

- 31bits32..62:0x7fffffff = normal unit / not any DWO
- 31bits32..62:0x3fffffff = DWP
- 31bits32..62:others = DWO unit number

after this patch:

- bit62=0 30bits32..61:any = normal unit / not any DWO
- bit62=1 30bits32..61:0x3fffffff = DWP
- bit62=1 30bits32..61:others = DWO unit number


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90413

Files:
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/test/Shell/SymbolFile/DWARF/DW_AT_low_pc-addrx.s
  lldb/test/Shell/SymbolFile/DWARF/array-sizes.s
  lldb/test/Shell/SymbolFile/DWARF/debug-types-address-ranges.s
  lldb/test/Shell/SymbolFile/DWARF/debug-types-dwarf5.s
  lldb/test/Shell/SymbolFile/DWARF/debug_ranges-missing-section.s
  lldb/test/Shell/SymbolFile/DWARF/debug_ranges.s
  lldb/test/Shell/SymbolFile/DWARF/debug_rnglists-dwo.s
  lldb/test/Shell/SymbolFile/DWARF/debug_rnglists.s
  lldb/test/Shell/SymbolFile/DWARF/dwarf5_locations.s
  lldb/test/Shell/SymbolFile/DWARF/dwp-debug-types.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90413.301700.patch
Type: text/x-patch
Size: 10413 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20201029/06adea89/attachment-0001.bin>


More information about the lldb-commits mailing list