llvm-project/lldb/bindings
Raphael Isemann 85bcc1eb2f [lldb] Make SBType::IsTypeComplete more consistent by forcing the loading of definitions
Currently calling SBType::IsTypeComplete returns true for record types if and
only if the underlying record in our internal Clang AST has a definition.

The function however doesn't actually force the loading of any external
definition from debug info, so it currently can return false even if the type is
actually defined in a program's debug info but LLDB hasn't lazily created the
definition yet.

This patch changes the behaviour to always load the definition first so that
IsTypeComplete now consistently returns true if there is a definition in the
module/target.

The motivation for this patch is twofold:

* The API is now arguably more useful for the user which don't know or care
about the internal lazy loading mechanism of LLDB.

* With D101950 there is no longer a good way to ask a Decl for a definition
without automatically pulling in a definition from the ExternalASTSource. The
current behaviour doesn't seem useful enough to justify the necessary
workarounds to preserve it for a time after D101950.

Note that there was a test that used this API to test lazy loading of debug info
but that has been replaced with TestLazyLoading by now (which just dumps the
internal Clang AST state instead).

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D112615
2021-10-30 13:28:27 +02:00
..
interface [lldb] Make SBType::IsTypeComplete more consistent by forcing the loading of definitions 2021-10-30 13:28:27 +02:00
lua [lldb/lua] Supplement Lua bindings for lldb module 2021-10-12 22:10:21 +08:00
python [lldb/Plugins] Add memory region support in ScriptedProcess 2021-10-08 14:54:07 +02:00
CMakeLists.txt [lldb/CMake] Separate CMake code for Lua and Python (NFC) 2020-08-11 09:04:18 -07:00
headers.swig [trace][intel-pt] Create basic SB API 2021-06-17 15:14:47 -07:00
interfaces.swig [trace][intel-pt] Create basic SB API 2021-06-17 15:14:47 -07:00
macros.swig [lldb] Remove nothreadallow from SWIG's __str__ wrappers to work around a Python>=3.7 crash 2020-09-28 10:10:34 +02:00