31using namespace llvm::dwarf;
49 if (sc_parent_tag == DW_TAG_compile_unit ||
50 sc_parent_tag == DW_TAG_partial_unit) {
52 }
else if (!sc.
function && sc_parent_die) {
53 symbol_context_scope =
55 if (symbol_context_scope ==
nullptr)
58 symbol_context_scope = sc.
module_sp.get();
61 if (symbol_context_scope !=
nullptr)
62 type_sp->SetSymbolContextScope(symbol_context_scope);
71 *type_is_new_ptr =
false;
79 dwarf->GetObjectFile()->GetModule()->LogMessage(
81 "DWARFASTParserFortran::ParseTypeFromDWARF (die = 0x%8.8x) %s name"
92 return type_ptr->shared_from_this();
98 *type_is_new_ptr =
true;
101 const char *type_name_cstr =
nullptr;
107 llvm::dwarf::TypeKind encoding =
static_cast<llvm::dwarf::TypeKind
>(0x00);
110 case DW_TAG_base_type: {
113 uint64_t bit_size = 0;
114 for (
size_t idx = 0; idx < attributes.
Size(); idx++) {
121 if (type_name_cstr && type_name_cstr[0] !=
'\0')
122 type_name.
SetString(llvm::StringRef(type_name_cstr).upper());
128 encoding =
static_cast<llvm::dwarf::TypeKind
>(form_value.
Unsigned());
130 case DW_AT_byte_size:
131 bit_size = form_value.
Unsigned() * 8;
142 compiler_type =
m_ast.CreateBaseType(encoding, bit_size, type_name);
144 dwarf->MakeType(die.
GetID(), type_name, llvm::divideCeil(bit_size, 8),
152 dwarf->GetObjectFile()->GetModule()->LogMessage(
153 log,
"[{0:x16}]: unhandled type tag {1:x4} ({2})", die.
GetOffset(),
162 dwarf->GetDIEToType()[die.
GetDIE()] = type_sp.get();
This file defines the DWARF AST parser for the Fortran language.
#define DIE_IS_BEING_PARSED
bool CompleteTypeFromDWARF(const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::Type *type, const lldb_private::CompilerType &compiler_type) override
lldb_private::Function * ParseFunctionFromDWARF(lldb_private::CompileUnit &comp_unit, const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::AddressRanges ranges) override
DWARFASTParserFortran(lldb_private::TypeSystemFortran &m_ast)
lldb_private::TypeSystemFortran & m_ast
~DWARFASTParserFortran() override
lldb::TypeSP UpdateSymbolContextScopeForType(const lldb_private::SymbolContext &sc, const lldb_private::plugin::dwarf::DWARFDIE &die, lldb::TypeSP type_sp)
If type_sp is valid, calculate and set its symbol context scope, and update the type list for its bac...
lldb::TypeSP ParseTypeFromDWARF(const lldb_private::SymbolContext &sc, const lldb_private::plugin::dwarf::DWARFDIE &die, bool *type_is_new_ptr) override
Block * FindBlockByID(lldb::user_id_t block_id)
A class that describes a compilation unit.
Generic representation of a type in a programming language.
A uniqued constant string class.
void SetCString(const char *cstr)
Set the C string value.
void SetString(llvm::StringRef s)
A class that describes the declaration location of a lldb object.
A class that describes a function.
Block & GetBlock(bool can_create)
Get accessor for the block list.
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
Defines a symbol context baton that can be handed other debug core functions.
Function * function
The Function for a given query.
lldb::ModuleSP module_sp
The Module for a given query.
CompileUnit * comp_unit
The CompileUnit for a given query.
@ eEncodingIsUID
This type is the type whose UID is m_encoding_uid.
DWARFASTParser(Kind kind)
dw_attr_t AttributeAtIndex(uint32_t i) const
bool ExtractFormValueAtIndex(uint32_t i, DWARFFormValue &form_value) const
DWARFAttributes GetAttributes(Recurse recurse=Recurse::yes) const
SymbolFileDWARF * GetDWARF() const
dw_offset_t GetOffset() const
lldb::user_id_t GetID() const
void GetName(Stream &s) const
DWARFDIE GetDIE(dw_offset_t die_offset) const
static DWARFDIE GetParentSymbolContextDIE(const DWARFDIE &die)
llvm::dwarf::Tag dw_tag_t
llvm::StringRef DW_TAG_value_to_name(dw_tag_t tag)
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
std::shared_ptr< lldb_private::Type > TypeSP