[all-commits] [llvm/llvm-project] 8b80e8: [lldb] Disable looking at pointee types to find sy...

aeubanks via All-commits all-commits at lists.llvm.org
Mon Nov 21 09:30:57 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8b80e8ee1fca660a5ea58cf701c2af8bba0dd89b
      https://github.com/llvm/llvm-project/commit/8b80e8ee1fca660a5ea58cf701c2af8bba0dd89b
  Author: Arthur Eubanks <aeubanks at google.com>
  Date:   2022-11-21 (Mon, 21 Nov 2022)

  Changed paths:
    M lldb/source/Core/ValueObject.cpp
    A lldb/test/API/lang/cpp/incomplete-stl-types/Makefile
    A lldb/test/API/lang/cpp/incomplete-stl-types/TestStlIncompleteTypes.py
    A lldb/test/API/lang/cpp/incomplete-stl-types/f.cpp
    A lldb/test/API/lang/cpp/incomplete-stl-types/main.cpp

  Log Message:
  -----------
  [lldb] Disable looking at pointee types to find synthetic value for non-ObjC

After D134378, we started seeing crashes with incomplete types (in the
context of shared libraries).

When trying to print a `std::vector<int> &` with only debug info for a
declaration, we now try to use the formatter after D134378. With an
incomplete type, this somehow goes into infinite recursion with the
frames

```
lldb_private::ValueObject::Dereference
lldb_private::ValueObjectSynthetic::CreateSynthFilter
lldb_private::ValueObjectSynthetic::ValueObjectSynthetic
lldb_private::ValueObject::CalculateSyntheticValue
lldb_private::ValueObject::HasSyntheticValue
```

This has to do with `FrontEndWantsDereference` that some STL formatters
set, causing recursion between the formatter (which tries to dereference),
and dereferencing (which wants to know if there's a formatter to avoid dereferencing).

The reason this only started appearing after D134378 was because
previously with incomplete types, for names with `<`, lldb would attempt
to parse template parameter DIEs, which were empty, then create an empty
`ClassTemplateSpecializationDecl` which overrode the name used to lookup
a formatter in `FormattersMatchData()` to not include template
parameters (e.g. `std::vector<> &`). After D134378 we don't create a
`ClassTemplateSpecializationDecl` when there are no template parameters
and the name to lookup a formatter is the original name (e.g.
`std::vector<int> &`).

The code to try harder with incomplete child compiler types was added in
D79554 for ObjC purposes.

Reviewed By: labath

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




More information about the All-commits mailing list