llvm-project/lldb/source/Plugins/Language
Raphael Isemann a76df78470 [lldb] Make the NSSet formatter faster and less prone to infinite recursion
Right now to get the 'NSSet *` pointer value we first derefence it and then take
the address of the result.

Beside being inefficient this potentially can cause an infinite recursion if the
`pointer` value we get is a pointer of a type that the TypeSystem can't
derefence. If the pointer is for example some form of `void *` that the dynamic
type resolution can't resolve to an actual type, then the `Derefence` call goes
back to asking the formatters how to reference it. If the NSSet formatter then
checks if it's an NSSet variation under the hood then we just end infinitely
often recursion.

In practice this seems to happen with some form of Builtin.RawPointer we get
from a NSDictionary in Swift.

FWIW, no other formatter is doing the same deref->addressOf as here and there
doesn't seem to be any specific reason to do so in the git history (it's just
part of the initial formatter commit)

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D101537
2021-04-29 19:13:43 +02:00
..
CPlusPlus [lldb] Add deref support to libc++ unique_ptr synthetic 2021-02-26 07:39:01 -08:00
ClangCommon lldb: Migrate to MemoryBufferRef for createFileID (after 51d1d585e5) 2020-10-20 13:52:39 -04:00
ObjC [lldb] Make the NSSet formatter faster and less prone to infinite recursion 2021-04-29 19:13:43 +02:00
ObjCPlusPlus [lldb/DataFormatters] Display null C++ pointers as nullptr 2020-11-12 15:24:06 -08:00
CMakeLists.txt Remove OCaml debugger plugin 2018-11-05 19:34:03 +00:00