[all-commits] [llvm/llvm-project] e84751: [lldb] Add basic support to Rust enums in TypeSyst...

Vladimir Makaev via All-commits all-commits at lists.llvm.org
Wed Aug 16 18:35:30 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e84751a21561c5b1d5673cdff8e22ac4cf2f5dc2
  Author: Vladimir Makaev <vmakaev at gmail.com>
  Date:   2023-08-17 (Thu, 17 Aug 2023)

  Changed paths:
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
    A lldb/test/API/lang/rust/enum-structs/RustEnumValue.py
    A lldb/test/API/lang/rust/enum-structs/TestRustEnumStructs.py
    A lldb/test/API/lang/rust/enum-structs/main.rs
    A lldb/test/API/lang/rust/enum-structs/main.yaml

  Log Message:
  [lldb] Add basic support to Rust enums in TypeSystemClang

LLDB doesn't yet have a TypeSystemRust implemented however it is used to debug Rust applications. Most of the types map well enough to Clang types and there are python formatters implemented to display those types reasonably well in a debugger.

However, Rust enums are completely ignored by LLDB as Clang never emits DW_TAG_variant_part inside DW_TAG_structure_type

This diff adds a parser for DW_TAG_variant_part (Rust-only) that creates a matching valid Clang declaration to the Rust enum. As long as there is enough information and all fields have correct offsets synthetic/summary providers can be implemented to display it correctly when debugging Rust code

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

More information about the All-commits mailing list