9#include "clang/AST/DeclCXX.h"
22 static llvm::once_flag g_once_flag;
23 llvm::call_once(g_once_flag, []() {
25 GetPluginDescriptionStatic(), CreateInstance);
33 return std::make_shared<RegisterTypeBuilderClang>(target);
46 std::string register_type_name =
"__lldb_register_fields_";
47 register_type_name += name;
50 type_system->GetTypeForIdentifier<clang::CXXRecordDecl>(
61 fields_type = type_system->CreateRecordType(
63 register_type_name, llvm::to_underlying(clang::TagTypeKind::Struct),
65 type_system->StartTagDeclarationDefinition(fields_type);
70 type_system->AddFieldToRecordType(fields_type, field.GetName(),
72 field.GetSizeInBits());
75 type_system->CompleteTagDeclarationDefinition(fields_type);
77 type_system->SetIsPacked(fields_type);
#define LLDB_PLUGIN_DEFINE(PluginName)
Generic representation of a type in a programming language.
std::optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
const std::vector< Field > & GetFields() const
RegisterTypeBuilderClang(Target &target)
CompilerType GetRegisterType(const std::string &name, const lldb_private::RegisterFlags &flags, uint32_t byte_size) override
static lldb::RegisterTypeBuilderSP CreateInstance(Target &target)
static lldb::TypeSystemClangSP GetForTarget(Target &target, std::optional< IsolatedASTKind > ast_kind=DefaultAST, bool create_on_demand=true)
Returns the scratch TypeSystemClang for the given target.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::RegisterTypeBuilder > RegisterTypeBuilderSP
@ eLanguageTypeC
Non-standardized C, such as K&R.
@ eEncodingUint
unsigned integer
std::shared_ptr< lldb_private::TypeSystemClang > TypeSystemClangSP