[Lldb-commits] [PATCH] D73206: Pass `CompileUnit *` along `DWARFDIE` for DWZ

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 4 05:37:45 PST 2020


jankratochvil updated this revision to Diff 242299.
jankratochvil retitled this revision from "`DWARFASTParserClang::m_decl_ctx_to_die` `DWARFDIE`->`DIERef` for DWZ" to "Pass `CompileUnit *` along `DWARFDIE` for DWZ".
jankratochvil edited the summary of this revision.
jankratochvil added a comment.
Herald added a subscriber: arphaman.
Herald added a reviewer: jdoerfert.

In D73206#1838165 <https://reviews.llvm.org/D73206#1838165>, @labath wrote:

> Whether that needs to be a separate class/struct (std::pair<DWARFUnit, DWARFDIE>?) or just and additional argument to the functions that need it is still not fully clear to me...


I also do not find that clear.

In this code there are:

- 19 `FIXMEindex` - we need to store `DWARFCompileUnit *` into manual/apple/debug_names index, it is storing now `CompileUnit *` but I think that could be fixed + converted at some places
- 11 `FIXMEunused` - I think in these cases (non-DWARF debug info) the `nullptr` is OK for `CompileUnit *` as nobody uses it there
- 3 `FIXMEDeclContext` - those (in fact 2) cases may be tricky, I have tried it <https://people.redhat.com/jkratoch/declcontext.patch> but I started to get lost in it, hopefully solvable
- 1 `FIXMETypeuser_id_t` - it is needed only for `SBModule::GetTypeByID()` and I think one needs to embed the DWZ main CU into `lldb::user_id_t` only in `SBValue::GetID()`. One cannot embed it to all `lldb::user_id_t` instances inside LLDB as then the DWZ main CU needs to be in `DWARFDIE` and that has been denied.

Does this look an acceptable approach to pursue it further?

This patch is applicable on top of non-regressing implementation using the `DWARFDIE::m_main_cu`:

- `git clone -b dwz git://git.jankratochvil.net/lldb`

This patch should only compile, it has no chance to run without crashes so far.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73206/new/

https://reviews.llvm.org/D73206

Files:
  lldb/include/lldb/Symbol/SymbolFile.h
  lldb/source/API/SBModule.cpp
  lldb/source/Expression/DWARFExpression.cpp
  lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
  lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFUnitPair.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFUnitPair.h
  lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
  lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
  lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
  lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
  lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
  lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
  lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
  lldb/source/Symbol/Block.cpp
  lldb/source/Symbol/Function.cpp
  lldb/source/Symbol/Type.cpp
  lldb/source/Symbol/Variable.cpp
  lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73206.242299.patch
Type: text/x-patch
Size: 111869 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200204/a0925450/attachment-0001.bin>


More information about the lldb-commits mailing list