[all-commits] [llvm/llvm-project] 9a57d1: [lldb] Allow dumping the state of all scratch Type...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Tue Oct 19 03:05:43 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9a57d1e52680ac05c29d6d0d2cfbaf3b05a5cbce
      https://github.com/llvm/llvm-project/commit/9a57d1e52680ac05c29d6d0d2cfbaf3b05a5cbce
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2021-10-19 (Tue, 19 Oct 2021)

  Changed paths:
    M lldb/include/lldb/Symbol/TypeSystem.h
    M lldb/source/Commands/CommandObjectTarget.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    M lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
    M lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
    M lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
    M lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
    A lldb/test/API/commands/target/dump/Makefile
    A lldb/test/API/commands/target/dump/TestTargetDumpTypeSystem.py
    A lldb/test/API/commands/target/dump/main.cpp

  Log Message:
  -----------
  [lldb] Allow dumping the state of all scratch TypeSystems

This adds the `target dump typesystem'`command which dumps the TypeSystem of the
target itself (aka the 'scratch TypeSystem'). This is similar to `target modules
dump ast` which dumps the AST of lldb::Modules associated with a selected
target.

Unlike `target modules dump ast`, the new command is not a subcommand of `target
modules dump` as it's not touching the modules of a target at all. Also unlike
`target modules dump ast` I tried to keep the implementation language-neutral,
so this patch moves our Clang `Dump` to the `TypeSystem` interface so it will
also dump the state of any future/downstream scratch TypeSystems (e.g., Swift).
That's also why the command just refers to a 'typesystem' instead of an 'ast'
(which is only how Clang is necessarily modelling the internal TypeSystem
state).

The main motivation for this patch is that I need to write some tests that check
for duplicates in the ScratchTypeSystemClang of a target. There is currently no
way to check for this at the moment (beside measuring memory consumption of
course). It's probably also useful for debugging LLDB itself.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D111936




More information about the All-commits mailing list