forked from OSchip/llvm-project
[SymbolFile] Make ParseCompileUnitXXX accept a CompileUnit&.
Previously all of these functions accepted a SymbolContext&. While a CompileUnit is one member of a SymbolContext, there are also many others, and by passing such a monolithic parameter in this way it makes the requirements and assumptions of the API unclear for both callers as well as implementors. All these methods need is a CompileUnit. By limiting the parameter type in this way, we simplify the code as well as make it self-documenting for both implementers and users. Differential Revision: https://reviews.llvm.org/D56564 llvm-svn: 350943
This commit is contained in:
parent
3a50a9fe74
commit
863f8c18b9
|
@ -125,22 +125,19 @@ public:
|
||||||
virtual uint32_t GetNumCompileUnits() = 0;
|
virtual uint32_t GetNumCompileUnits() = 0;
|
||||||
virtual lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) = 0;
|
virtual lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) = 0;
|
||||||
|
|
||||||
virtual lldb::LanguageType
|
virtual lldb::LanguageType ParseLanguage(CompileUnit &comp_unit) = 0;
|
||||||
ParseCompileUnitLanguage(const SymbolContext &sc) = 0;
|
virtual size_t ParseFunctions(CompileUnit &comp_unit) = 0;
|
||||||
virtual size_t ParseCompileUnitFunctions(const SymbolContext &sc) = 0;
|
virtual bool ParseLineTable(CompileUnit &comp_unit) = 0;
|
||||||
virtual bool ParseCompileUnitLineTable(const SymbolContext &sc) = 0;
|
virtual bool ParseDebugMacros(CompileUnit &comp_unit) = 0;
|
||||||
virtual bool ParseCompileUnitDebugMacros(const SymbolContext &sc) = 0;
|
virtual bool ParseSupportFiles(CompileUnit &comp_unit,
|
||||||
virtual bool ParseCompileUnitSupportFiles(const SymbolContext &sc,
|
FileSpecList &support_files) = 0;
|
||||||
FileSpecList &support_files) = 0;
|
virtual size_t ParseTypes(CompileUnit &comp_unit) = 0;
|
||||||
virtual bool
|
virtual bool ParseIsOptimized(CompileUnit &comp_unit) { return false; }
|
||||||
ParseCompileUnitIsOptimized(const lldb_private::SymbolContext &sc) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
virtual bool
|
virtual bool
|
||||||
ParseImportedModules(const SymbolContext &sc,
|
ParseImportedModules(const SymbolContext &sc,
|
||||||
std::vector<ConstString> &imported_modules) = 0;
|
std::vector<ConstString> &imported_modules) = 0;
|
||||||
virtual size_t ParseFunctionBlocks(const SymbolContext &sc) = 0;
|
virtual size_t ParseFunctionBlocks(const SymbolContext &sc) = 0;
|
||||||
virtual size_t ParseTypesForCompileUnit(CompileUnit &comp_unit) = 0;
|
|
||||||
virtual size_t ParseVariablesForContext(const SymbolContext &sc) = 0;
|
virtual size_t ParseVariablesForContext(const SymbolContext &sc) = 0;
|
||||||
virtual Type *ResolveTypeUID(lldb::user_id_t type_uid) = 0;
|
virtual Type *ResolveTypeUID(lldb::user_id_t type_uid) = 0;
|
||||||
|
|
||||||
|
|
|
@ -46,26 +46,26 @@ public:
|
||||||
|
|
||||||
virtual void Dump(Stream *s);
|
virtual void Dump(Stream *s);
|
||||||
|
|
||||||
virtual lldb::LanguageType ParseCompileUnitLanguage(const SymbolContext &sc);
|
virtual lldb::LanguageType ParseLanguage(CompileUnit &comp_unit);
|
||||||
|
|
||||||
virtual size_t ParseCompileUnitFunctions(const SymbolContext &sc);
|
virtual size_t ParseFunctions(CompileUnit &comp_unit);
|
||||||
|
|
||||||
virtual bool ParseCompileUnitLineTable(const SymbolContext &sc);
|
virtual bool ParseLineTable(CompileUnit &comp_unit);
|
||||||
|
|
||||||
virtual bool ParseCompileUnitDebugMacros(const SymbolContext &sc);
|
virtual bool ParseDebugMacros(CompileUnit &comp_unit);
|
||||||
|
|
||||||
virtual bool ParseCompileUnitSupportFiles(const SymbolContext &sc,
|
virtual bool ParseSupportFiles(CompileUnit &comp_unit,
|
||||||
FileSpecList &support_files);
|
FileSpecList &support_files);
|
||||||
|
|
||||||
virtual bool ParseCompileUnitIsOptimized(const SymbolContext &sc);
|
virtual bool ParseIsOptimized(CompileUnit &comp_unit);
|
||||||
|
|
||||||
|
virtual size_t ParseTypes(CompileUnit &comp_unit);
|
||||||
|
|
||||||
virtual bool ParseImportedModules(const SymbolContext &sc,
|
virtual bool ParseImportedModules(const SymbolContext &sc,
|
||||||
std::vector<ConstString> &imported_modules);
|
std::vector<ConstString> &imported_modules);
|
||||||
|
|
||||||
virtual size_t ParseFunctionBlocks(const SymbolContext &sc);
|
virtual size_t ParseFunctionBlocks(const SymbolContext &sc);
|
||||||
|
|
||||||
virtual size_t ParseTypesForCompileUnit(CompileUnit &comp_unit);
|
|
||||||
|
|
||||||
virtual size_t ParseVariablesForContext(const SymbolContext &sc);
|
virtual size_t ParseVariablesForContext(const SymbolContext &sc);
|
||||||
|
|
||||||
virtual Type *ResolveTypeUID(lldb::user_id_t type_uid);
|
virtual Type *ResolveTypeUID(lldb::user_id_t type_uid);
|
||||||
|
|
|
@ -365,23 +365,23 @@ void Module::ParseAllDebugSymbols() {
|
||||||
|
|
||||||
for (size_t cu_idx = 0; cu_idx < num_comp_units; cu_idx++) {
|
for (size_t cu_idx = 0; cu_idx < num_comp_units; cu_idx++) {
|
||||||
sc.comp_unit = symbols->GetCompileUnitAtIndex(cu_idx).get();
|
sc.comp_unit = symbols->GetCompileUnitAtIndex(cu_idx).get();
|
||||||
if (sc.comp_unit) {
|
if (!sc.comp_unit)
|
||||||
sc.function = nullptr;
|
continue;
|
||||||
|
|
||||||
|
symbols->ParseVariablesForContext(sc);
|
||||||
|
|
||||||
|
symbols->ParseFunctions(*sc.comp_unit);
|
||||||
|
|
||||||
|
sc.comp_unit->ForeachFunction([&sc, &symbols](const FunctionSP &f) {
|
||||||
|
sc.function = f.get();
|
||||||
|
symbols->ParseFunctionBlocks(sc);
|
||||||
|
// Parse the variables for this function and all its blocks
|
||||||
symbols->ParseVariablesForContext(sc);
|
symbols->ParseVariablesForContext(sc);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
symbols->ParseCompileUnitFunctions(sc);
|
// Parse all types for this compile unit
|
||||||
|
symbols->ParseTypes(*sc.comp_unit);
|
||||||
sc.comp_unit->ForeachFunction([&sc, &symbols](const FunctionSP &f) {
|
|
||||||
sc.function = f.get();
|
|
||||||
symbols->ParseFunctionBlocks(sc);
|
|
||||||
// Parse the variables for this function and all its blocks
|
|
||||||
symbols->ParseVariablesForContext(sc);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Parse all types for this compile unit
|
|
||||||
symbols->ParseTypesForCompileUnit(*sc.comp_unit);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -328,9 +328,7 @@ SearchFilter::DoCUIteration(const ModuleSP &module_sp,
|
||||||
SymbolVendor *sym_vendor = module_sp->GetSymbolVendor();
|
SymbolVendor *sym_vendor = module_sp->GetSymbolVendor();
|
||||||
if (!sym_vendor)
|
if (!sym_vendor)
|
||||||
continue;
|
continue;
|
||||||
SymbolContext sym_ctx;
|
if (!sym_vendor->ParseFunctions(*cu_sp))
|
||||||
cu_sp->CalculateSymbolContext(&sym_ctx);
|
|
||||||
if (!sym_vendor->ParseCompileUnitFunctions(sym_ctx))
|
|
||||||
continue;
|
continue;
|
||||||
// If we got any functions, use ForeachFunction to do the iteration.
|
// If we got any functions, use ForeachFunction to do the iteration.
|
||||||
cu_sp->ForeachFunction([&](const FunctionSP &func_sp) {
|
cu_sp->ForeachFunction([&](const FunctionSP &func_sp) {
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
class DWARFDIE;
|
class DWARFDIE;
|
||||||
namespace lldb_private {
|
namespace lldb_private {
|
||||||
|
class CompileUnit;
|
||||||
class ExecutionContext;
|
class ExecutionContext;
|
||||||
}
|
}
|
||||||
class SymbolFileDWARF;
|
class SymbolFileDWARF;
|
||||||
|
@ -32,7 +33,7 @@ public:
|
||||||
bool *type_is_new_ptr) = 0;
|
bool *type_is_new_ptr) = 0;
|
||||||
|
|
||||||
virtual lldb_private::Function *
|
virtual lldb_private::Function *
|
||||||
ParseFunctionFromDWARF(const lldb_private::SymbolContext &sc,
|
ParseFunctionFromDWARF(lldb_private::CompileUnit &comp_unit,
|
||||||
const DWARFDIE &die) = 0;
|
const DWARFDIE &die) = 0;
|
||||||
|
|
||||||
virtual bool
|
virtual bool
|
||||||
|
|
|
@ -415,8 +415,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
|
||||||
|
|
||||||
if (!clang_type &&
|
if (!clang_type &&
|
||||||
(encoding_data_type == Type::eEncodingIsPointerUID ||
|
(encoding_data_type == Type::eEncodingIsPointerUID ||
|
||||||
encoding_data_type == Type::eEncodingIsTypedefUID) &&
|
encoding_data_type == Type::eEncodingIsTypedefUID)) {
|
||||||
sc.comp_unit != NULL) {
|
|
||||||
if (tag == DW_TAG_pointer_type) {
|
if (tag == DW_TAG_pointer_type) {
|
||||||
DWARFDIE target_die = die.GetReferencedDIE(DW_AT_type);
|
DWARFDIE target_die = die.GetReferencedDIE(DW_AT_type);
|
||||||
|
|
||||||
|
@ -552,9 +551,8 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
|
||||||
if (attributes.ExtractFormValueAtIndex(i, form_value)) {
|
if (attributes.ExtractFormValueAtIndex(i, form_value)) {
|
||||||
switch (attr) {
|
switch (attr) {
|
||||||
case DW_AT_decl_file:
|
case DW_AT_decl_file:
|
||||||
decl.SetFile(
|
decl.SetFile(sc.comp_unit->GetSupportFiles().GetFileSpecAtIndex(
|
||||||
sc.comp_unit->GetSupportFiles().GetFileSpecAtIndex(
|
form_value.Unsigned()));
|
||||||
form_value.Unsigned()));
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DW_AT_decl_line:
|
case DW_AT_decl_line:
|
||||||
|
@ -1295,10 +1293,10 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
|
||||||
|
|
||||||
if (die.HasChildren()) {
|
if (die.HasChildren()) {
|
||||||
bool skip_artificial = true;
|
bool skip_artificial = true;
|
||||||
ParseChildParameters(sc, containing_decl_ctx, die, skip_artificial,
|
ParseChildParameters(*sc.comp_unit, containing_decl_ctx, die,
|
||||||
is_static, is_variadic, has_template_params,
|
skip_artificial, is_static, is_variadic,
|
||||||
function_param_types, function_param_decls,
|
has_template_params, function_param_types,
|
||||||
type_quals);
|
function_param_decls, type_quals);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ignore_containing_context = false;
|
bool ignore_containing_context = false;
|
||||||
|
@ -2558,7 +2556,7 @@ protected:
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Function *DWARFASTParserClang::ParseFunctionFromDWARF(const SymbolContext &sc,
|
Function *DWARFASTParserClang::ParseFunctionFromDWARF(CompileUnit &comp_unit,
|
||||||
const DWARFDIE &die) {
|
const DWARFDIE &die) {
|
||||||
DWARFRangeList func_ranges;
|
DWARFRangeList func_ranges;
|
||||||
const char *name = NULL;
|
const char *name = NULL;
|
||||||
|
@ -2619,9 +2617,9 @@ Function *DWARFASTParserClang::ParseFunctionFromDWARF(const SymbolContext &sc,
|
||||||
|
|
||||||
clang::DeclContext *containing_decl_ctx =
|
clang::DeclContext *containing_decl_ctx =
|
||||||
GetClangDeclContextContainingDIE(die, nullptr);
|
GetClangDeclContextContainingDIE(die, nullptr);
|
||||||
ParseChildParameters(sc, containing_decl_ctx, die, true, is_static,
|
ParseChildParameters(comp_unit, containing_decl_ctx, die, true,
|
||||||
is_variadic, has_template_params, param_types,
|
is_static, is_variadic, has_template_params,
|
||||||
param_decls, type_quals);
|
param_types, param_decls, type_quals);
|
||||||
sstr << "(";
|
sstr << "(";
|
||||||
for (size_t i = 0; i < param_types.size(); i++) {
|
for (size_t i = 0; i < param_types.size(); i++) {
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
|
@ -2642,7 +2640,7 @@ Function *DWARFASTParserClang::ParseFunctionFromDWARF(const SymbolContext &sc,
|
||||||
std::unique_ptr<Declaration> decl_ap;
|
std::unique_ptr<Declaration> decl_ap;
|
||||||
if (decl_file != 0 || decl_line != 0 || decl_column != 0)
|
if (decl_file != 0 || decl_line != 0 || decl_column != 0)
|
||||||
decl_ap.reset(new Declaration(
|
decl_ap.reset(new Declaration(
|
||||||
sc.comp_unit->GetSupportFiles().GetFileSpecAtIndex(decl_file),
|
comp_unit.GetSupportFiles().GetFileSpecAtIndex(decl_file),
|
||||||
decl_line, decl_column));
|
decl_line, decl_column));
|
||||||
|
|
||||||
SymbolFileDWARF *dwarf = die.GetDWARF();
|
SymbolFileDWARF *dwarf = die.GetDWARF();
|
||||||
|
@ -2653,7 +2651,7 @@ Function *DWARFASTParserClang::ParseFunctionFromDWARF(const SymbolContext &sc,
|
||||||
|
|
||||||
if (dwarf->FixupAddress(func_range.GetBaseAddress())) {
|
if (dwarf->FixupAddress(func_range.GetBaseAddress())) {
|
||||||
const user_id_t func_user_id = die.GetID();
|
const user_id_t func_user_id = die.GetID();
|
||||||
func_sp.reset(new Function(sc.comp_unit,
|
func_sp.reset(new Function(&comp_unit,
|
||||||
func_user_id, // UserID is the DIE offset
|
func_user_id, // UserID is the DIE offset
|
||||||
func_user_id, func_name, func_type,
|
func_user_id, func_name, func_type,
|
||||||
func_range)); // first address range
|
func_range)); // first address range
|
||||||
|
@ -2661,7 +2659,7 @@ Function *DWARFASTParserClang::ParseFunctionFromDWARF(const SymbolContext &sc,
|
||||||
if (func_sp.get() != NULL) {
|
if (func_sp.get() != NULL) {
|
||||||
if (frame_base.IsValid())
|
if (frame_base.IsValid())
|
||||||
func_sp->GetFrameBaseExpression() = frame_base;
|
func_sp->GetFrameBaseExpression() = frame_base;
|
||||||
sc.comp_unit->AddFunction(func_sp);
|
comp_unit.AddFunction(func_sp);
|
||||||
return func_sp.get();
|
return func_sp.get();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3310,7 +3308,7 @@ bool DWARFASTParserClang::ParseChildMembers(
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t DWARFASTParserClang::ParseChildParameters(
|
size_t DWARFASTParserClang::ParseChildParameters(
|
||||||
const SymbolContext &sc, clang::DeclContext *containing_decl_ctx,
|
CompileUnit &comp_unit, clang::DeclContext *containing_decl_ctx,
|
||||||
const DWARFDIE &parent_die, bool skip_artificial, bool &is_static,
|
const DWARFDIE &parent_die, bool skip_artificial, bool &is_static,
|
||||||
bool &is_variadic, bool &has_template_params,
|
bool &is_variadic, bool &has_template_params,
|
||||||
std::vector<CompilerType> &function_param_types,
|
std::vector<CompilerType> &function_param_types,
|
||||||
|
@ -3342,7 +3340,7 @@ size_t DWARFASTParserClang::ParseChildParameters(
|
||||||
if (attributes.ExtractFormValueAtIndex(i, form_value)) {
|
if (attributes.ExtractFormValueAtIndex(i, form_value)) {
|
||||||
switch (attr) {
|
switch (attr) {
|
||||||
case DW_AT_decl_file:
|
case DW_AT_decl_file:
|
||||||
decl.SetFile(sc.comp_unit->GetSupportFiles().GetFileSpecAtIndex(
|
decl.SetFile(comp_unit.GetSupportFiles().GetFileSpecAtIndex(
|
||||||
form_value.Unsigned()));
|
form_value.Unsigned()));
|
||||||
break;
|
break;
|
||||||
case DW_AT_decl_line:
|
case DW_AT_decl_line:
|
||||||
|
|
|
@ -22,6 +22,9 @@
|
||||||
#include "lldb/Symbol/ClangASTContext.h"
|
#include "lldb/Symbol/ClangASTContext.h"
|
||||||
#include "lldb/Symbol/ClangASTImporter.h"
|
#include "lldb/Symbol/ClangASTImporter.h"
|
||||||
|
|
||||||
|
namespace lldb_private {
|
||||||
|
class CompileUnit;
|
||||||
|
}
|
||||||
class DWARFDebugInfoEntry;
|
class DWARFDebugInfoEntry;
|
||||||
class DWARFDIECollection;
|
class DWARFDIECollection;
|
||||||
class SymbolFileDWARF;
|
class SymbolFileDWARF;
|
||||||
|
@ -38,7 +41,7 @@ public:
|
||||||
bool *type_is_new_ptr) override;
|
bool *type_is_new_ptr) override;
|
||||||
|
|
||||||
lldb_private::Function *
|
lldb_private::Function *
|
||||||
ParseFunctionFromDWARF(const lldb_private::SymbolContext &sc,
|
ParseFunctionFromDWARF(lldb_private::CompileUnit &comp_unit,
|
||||||
const DWARFDIE &die) override;
|
const DWARFDIE &die) override;
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -89,7 +92,7 @@ protected:
|
||||||
lldb_private::ClangASTImporter::LayoutInfo &layout_info);
|
lldb_private::ClangASTImporter::LayoutInfo &layout_info);
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
ParseChildParameters(const lldb_private::SymbolContext &sc,
|
ParseChildParameters(lldb_private::CompileUnit &comp_unit,
|
||||||
clang::DeclContext *containing_decl_ctx,
|
clang::DeclContext *containing_decl_ctx,
|
||||||
const DWARFDIE &parent_die, bool skip_artificial,
|
const DWARFDIE &parent_die, bool skip_artificial,
|
||||||
bool &is_static, bool &is_variadic,
|
bool &is_static, bool &is_variadic,
|
||||||
|
|
|
@ -885,8 +885,8 @@ CompUnitSP SymbolFileDWARF::ParseCompileUnitAtIndex(uint32_t cu_idx) {
|
||||||
return cu_sp;
|
return cu_sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
Function *SymbolFileDWARF::ParseCompileUnitFunction(const SymbolContext &sc,
|
Function *SymbolFileDWARF::ParseFunction(CompileUnit &comp_unit,
|
||||||
const DWARFDIE &die) {
|
const DWARFDIE &die) {
|
||||||
ASSERT_MODULE_LOCK(this);
|
ASSERT_MODULE_LOCK(this);
|
||||||
if (die.IsValid()) {
|
if (die.IsValid()) {
|
||||||
TypeSystem *type_system =
|
TypeSystem *type_system =
|
||||||
|
@ -895,7 +895,7 @@ Function *SymbolFileDWARF::ParseCompileUnitFunction(const SymbolContext &sc,
|
||||||
if (type_system) {
|
if (type_system) {
|
||||||
DWARFASTParser *dwarf_ast = type_system->GetDWARFParser();
|
DWARFASTParser *dwarf_ast = type_system->GetDWARFParser();
|
||||||
if (dwarf_ast)
|
if (dwarf_ast)
|
||||||
return dwarf_ast->ParseFunctionFromDWARF(sc, die);
|
return dwarf_ast->ParseFunctionFromDWARF(comp_unit, die);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -909,22 +909,19 @@ bool SymbolFileDWARF::FixupAddress(Address &addr) {
|
||||||
// This is a normal DWARF file, no address fixups need to happen
|
// This is a normal DWARF file, no address fixups need to happen
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
lldb::LanguageType
|
lldb::LanguageType SymbolFileDWARF::ParseLanguage(CompileUnit &comp_unit) {
|
||||||
SymbolFileDWARF::ParseCompileUnitLanguage(const SymbolContext &sc) {
|
|
||||||
ASSERT_MODULE_LOCK(this);
|
ASSERT_MODULE_LOCK(this);
|
||||||
assert(sc.comp_unit);
|
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(&comp_unit);
|
||||||
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
|
|
||||||
if (dwarf_cu)
|
if (dwarf_cu)
|
||||||
return dwarf_cu->GetLanguageType();
|
return dwarf_cu->GetLanguageType();
|
||||||
else
|
else
|
||||||
return eLanguageTypeUnknown;
|
return eLanguageTypeUnknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t SymbolFileDWARF::ParseCompileUnitFunctions(const SymbolContext &sc) {
|
size_t SymbolFileDWARF::ParseFunctions(CompileUnit &comp_unit) {
|
||||||
ASSERT_MODULE_LOCK(this);
|
ASSERT_MODULE_LOCK(this);
|
||||||
assert(sc.comp_unit);
|
|
||||||
size_t functions_added = 0;
|
size_t functions_added = 0;
|
||||||
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
|
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(&comp_unit);
|
||||||
if (dwarf_cu) {
|
if (dwarf_cu) {
|
||||||
DWARFDIECollection function_dies;
|
DWARFDIECollection function_dies;
|
||||||
const size_t num_functions =
|
const size_t num_functions =
|
||||||
|
@ -932,8 +929,8 @@ size_t SymbolFileDWARF::ParseCompileUnitFunctions(const SymbolContext &sc) {
|
||||||
size_t func_idx;
|
size_t func_idx;
|
||||||
for (func_idx = 0; func_idx < num_functions; ++func_idx) {
|
for (func_idx = 0; func_idx < num_functions; ++func_idx) {
|
||||||
DWARFDIE die = function_dies.GetDIEAtIndex(func_idx);
|
DWARFDIE die = function_dies.GetDIEAtIndex(func_idx);
|
||||||
if (sc.comp_unit->FindFunctionByUID(die.GetID()).get() == NULL) {
|
if (comp_unit.FindFunctionByUID(die.GetID()).get() == NULL) {
|
||||||
if (ParseCompileUnitFunction(sc, die))
|
if (ParseFunction(comp_unit, die))
|
||||||
++functions_added;
|
++functions_added;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -942,11 +939,10 @@ size_t SymbolFileDWARF::ParseCompileUnitFunctions(const SymbolContext &sc) {
|
||||||
return functions_added;
|
return functions_added;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFileDWARF::ParseCompileUnitSupportFiles(
|
bool SymbolFileDWARF::ParseSupportFiles(CompileUnit &comp_unit,
|
||||||
const SymbolContext &sc, FileSpecList &support_files) {
|
FileSpecList &support_files) {
|
||||||
ASSERT_MODULE_LOCK(this);
|
ASSERT_MODULE_LOCK(this);
|
||||||
assert(sc.comp_unit);
|
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(&comp_unit);
|
||||||
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
|
|
||||||
if (dwarf_cu) {
|
if (dwarf_cu) {
|
||||||
const DWARFBaseDIE cu_die = dwarf_cu->GetUnitDIEOnly();
|
const DWARFBaseDIE cu_die = dwarf_cu->GetUnitDIEOnly();
|
||||||
|
|
||||||
|
@ -958,9 +954,9 @@ bool SymbolFileDWARF::ParseCompileUnitSupportFiles(
|
||||||
if (stmt_list != DW_INVALID_OFFSET) {
|
if (stmt_list != DW_INVALID_OFFSET) {
|
||||||
// All file indexes in DWARF are one based and a file of index zero is
|
// All file indexes in DWARF are one based and a file of index zero is
|
||||||
// supposed to be the compile unit itself.
|
// supposed to be the compile unit itself.
|
||||||
support_files.Append(*sc.comp_unit);
|
support_files.Append(comp_unit);
|
||||||
return DWARFDebugLine::ParseSupportFiles(
|
return DWARFDebugLine::ParseSupportFiles(
|
||||||
sc.comp_unit->GetModule(), get_debug_line_data(), cu_comp_dir,
|
comp_unit.GetModule(), get_debug_line_data(), cu_comp_dir,
|
||||||
stmt_list, support_files, dwarf_cu);
|
stmt_list, support_files, dwarf_cu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -968,10 +964,9 @@ bool SymbolFileDWARF::ParseCompileUnitSupportFiles(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFileDWARF::ParseCompileUnitIsOptimized(
|
bool SymbolFileDWARF::ParseIsOptimized(CompileUnit &comp_unit) {
|
||||||
const lldb_private::SymbolContext &sc) {
|
|
||||||
ASSERT_MODULE_LOCK(this);
|
ASSERT_MODULE_LOCK(this);
|
||||||
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
|
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(&comp_unit);
|
||||||
if (dwarf_cu)
|
if (dwarf_cu)
|
||||||
return dwarf_cu->GetIsOptimized();
|
return dwarf_cu->GetIsOptimized();
|
||||||
return false;
|
return false;
|
||||||
|
@ -1057,13 +1052,12 @@ static void ParseDWARFLineTableCallback(dw_offset_t offset,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFileDWARF::ParseCompileUnitLineTable(const SymbolContext &sc) {
|
bool SymbolFileDWARF::ParseLineTable(CompileUnit &comp_unit) {
|
||||||
ASSERT_MODULE_LOCK(this);
|
ASSERT_MODULE_LOCK(this);
|
||||||
assert(sc.comp_unit);
|
if (comp_unit.GetLineTable() != NULL)
|
||||||
if (sc.comp_unit->GetLineTable() != NULL)
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
|
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(&comp_unit);
|
||||||
if (dwarf_cu) {
|
if (dwarf_cu) {
|
||||||
const DWARFBaseDIE dwarf_cu_die = dwarf_cu->GetUnitDIEOnly();
|
const DWARFBaseDIE dwarf_cu_die = dwarf_cu->GetUnitDIEOnly();
|
||||||
if (dwarf_cu_die) {
|
if (dwarf_cu_die) {
|
||||||
|
@ -1071,7 +1065,7 @@ bool SymbolFileDWARF::ParseCompileUnitLineTable(const SymbolContext &sc) {
|
||||||
dwarf_cu_die.GetAttributeValueAsUnsigned(DW_AT_stmt_list,
|
dwarf_cu_die.GetAttributeValueAsUnsigned(DW_AT_stmt_list,
|
||||||
DW_INVALID_OFFSET);
|
DW_INVALID_OFFSET);
|
||||||
if (cu_line_offset != DW_INVALID_OFFSET) {
|
if (cu_line_offset != DW_INVALID_OFFSET) {
|
||||||
std::unique_ptr<LineTable> line_table_ap(new LineTable(sc.comp_unit));
|
std::unique_ptr<LineTable> line_table_ap(new LineTable(&comp_unit));
|
||||||
if (line_table_ap.get()) {
|
if (line_table_ap.get()) {
|
||||||
ParseDWARFLineTableCallbackInfo info;
|
ParseDWARFLineTableCallbackInfo info;
|
||||||
info.line_table = line_table_ap.get();
|
info.line_table = line_table_ap.get();
|
||||||
|
@ -1106,10 +1100,10 @@ bool SymbolFileDWARF::ParseCompileUnitLineTable(const SymbolContext &sc) {
|
||||||
// are not linked. We need to link the line table and convert the
|
// are not linked. We need to link the line table and convert the
|
||||||
// addresses that are relative to the .o file into addresses for
|
// addresses that are relative to the .o file into addresses for
|
||||||
// the main executable.
|
// the main executable.
|
||||||
sc.comp_unit->SetLineTable(
|
comp_unit.SetLineTable(
|
||||||
debug_map_symfile->LinkOSOLineTable(this, line_table_ap.get()));
|
debug_map_symfile->LinkOSOLineTable(this, line_table_ap.get()));
|
||||||
} else {
|
} else {
|
||||||
sc.comp_unit->SetLineTable(line_table_ap.release());
|
comp_unit.SetLineTable(line_table_ap.release());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1141,11 +1135,10 @@ SymbolFileDWARF::ParseDebugMacros(lldb::offset_t *offset) {
|
||||||
return debug_macros_sp;
|
return debug_macros_sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFileDWARF::ParseCompileUnitDebugMacros(const SymbolContext &sc) {
|
bool SymbolFileDWARF::ParseDebugMacros(CompileUnit &comp_unit) {
|
||||||
ASSERT_MODULE_LOCK(this);
|
ASSERT_MODULE_LOCK(this);
|
||||||
assert(sc.comp_unit);
|
|
||||||
|
|
||||||
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
|
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(&comp_unit);
|
||||||
if (dwarf_cu == nullptr)
|
if (dwarf_cu == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1161,7 +1154,7 @@ bool SymbolFileDWARF::ParseCompileUnitDebugMacros(const SymbolContext &sc) {
|
||||||
if (sect_offset == DW_INVALID_OFFSET)
|
if (sect_offset == DW_INVALID_OFFSET)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
sc.comp_unit->SetDebugMacros(ParseDebugMacros(§_offset));
|
comp_unit.SetDebugMacros(ParseDebugMacros(§_offset));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1583,7 +1576,7 @@ bool SymbolFileDWARF::GetFunction(const DWARFDIE &die, SymbolContext &sc) {
|
||||||
|
|
||||||
sc.function = sc.comp_unit->FindFunctionByUID(die.GetID()).get();
|
sc.function = sc.comp_unit->FindFunctionByUID(die.GetID()).get();
|
||||||
if (sc.function == NULL)
|
if (sc.function == NULL)
|
||||||
sc.function = ParseCompileUnitFunction(sc, die);
|
sc.function = ParseFunction(*sc.comp_unit, die);
|
||||||
|
|
||||||
if (sc.function) {
|
if (sc.function) {
|
||||||
sc.module_sp = sc.function->CalculateSymbolContextModule();
|
sc.module_sp = sc.function->CalculateSymbolContextModule();
|
||||||
|
@ -1846,7 +1839,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const Address &so_addr,
|
||||||
sc.function =
|
sc.function =
|
||||||
sc.comp_unit->FindFunctionByUID(function_die.GetID()).get();
|
sc.comp_unit->FindFunctionByUID(function_die.GetID()).get();
|
||||||
if (sc.function == NULL)
|
if (sc.function == NULL)
|
||||||
sc.function = ParseCompileUnitFunction(sc, function_die);
|
sc.function = ParseFunction(*sc.comp_unit, function_die);
|
||||||
|
|
||||||
if (sc.function && (resolve_scope & eSymbolContextBlock))
|
if (sc.function && (resolve_scope & eSymbolContextBlock))
|
||||||
block_die = function_die.LookupDeepestBlock(file_vm_addr);
|
block_die = function_die.LookupDeepestBlock(file_vm_addr);
|
||||||
|
@ -1987,7 +1980,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const FileSpec &file_spec,
|
||||||
.get();
|
.get();
|
||||||
if (sc.function == NULL)
|
if (sc.function == NULL)
|
||||||
sc.function =
|
sc.function =
|
||||||
ParseCompileUnitFunction(sc, function_die);
|
ParseFunction(*sc.comp_unit, function_die);
|
||||||
|
|
||||||
if (sc.function &&
|
if (sc.function &&
|
||||||
(resolve_scope & eSymbolContextBlock))
|
(resolve_scope & eSymbolContextBlock))
|
||||||
|
@ -3149,7 +3142,7 @@ size_t SymbolFileDWARF::ParseFunctionBlocks(const SymbolContext &sc) {
|
||||||
return functions_added;
|
return functions_added;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t SymbolFileDWARF::ParseTypesForCompileUnit(CompileUnit &comp_unit) {
|
size_t SymbolFileDWARF::ParseTypes(CompileUnit &comp_unit) {
|
||||||
ASSERT_MODULE_LOCK(this);
|
ASSERT_MODULE_LOCK(this);
|
||||||
size_t types_added = 0;
|
size_t types_added = 0;
|
||||||
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(&comp_unit);
|
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(&comp_unit);
|
||||||
|
|
|
@ -107,23 +107,20 @@ public:
|
||||||
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
|
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
|
||||||
|
|
||||||
lldb::LanguageType
|
lldb::LanguageType
|
||||||
ParseCompileUnitLanguage(const lldb_private::SymbolContext &sc) override;
|
ParseLanguage(lldb_private::CompileUnit &comp_unit) override;
|
||||||
|
|
||||||
size_t
|
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override;
|
||||||
ParseCompileUnitFunctions(const lldb_private::SymbolContext &sc) override;
|
|
||||||
|
|
||||||
bool
|
bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override;
|
||||||
ParseCompileUnitLineTable(const lldb_private::SymbolContext &sc) override;
|
|
||||||
|
|
||||||
bool
|
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override;
|
||||||
ParseCompileUnitDebugMacros(const lldb_private::SymbolContext &sc) override;
|
|
||||||
|
|
||||||
bool ParseCompileUnitSupportFiles(
|
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit,
|
||||||
const lldb_private::SymbolContext &sc,
|
lldb_private::FileSpecList &support_files) override;
|
||||||
lldb_private::FileSpecList &support_files) override;
|
|
||||||
|
|
||||||
bool
|
bool ParseIsOptimized(lldb_private::CompileUnit &comp_unit) override;
|
||||||
ParseCompileUnitIsOptimized(const lldb_private::SymbolContext &sc) override;
|
|
||||||
|
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override;
|
||||||
|
|
||||||
bool ParseImportedModules(
|
bool ParseImportedModules(
|
||||||
const lldb_private::SymbolContext &sc,
|
const lldb_private::SymbolContext &sc,
|
||||||
|
@ -131,9 +128,6 @@ public:
|
||||||
|
|
||||||
size_t ParseFunctionBlocks(const lldb_private::SymbolContext &sc) override;
|
size_t ParseFunctionBlocks(const lldb_private::SymbolContext &sc) override;
|
||||||
|
|
||||||
size_t
|
|
||||||
ParseTypesForCompileUnit(lldb_private::CompileUnit &comp_unit) override;
|
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
ParseVariablesForContext(const lldb_private::SymbolContext &sc) override;
|
ParseVariablesForContext(const lldb_private::SymbolContext &sc) override;
|
||||||
|
|
||||||
|
@ -362,9 +356,8 @@ protected:
|
||||||
|
|
||||||
bool GetFunction(const DWARFDIE &die, lldb_private::SymbolContext &sc);
|
bool GetFunction(const DWARFDIE &die, lldb_private::SymbolContext &sc);
|
||||||
|
|
||||||
lldb_private::Function *
|
lldb_private::Function *ParseFunction(lldb_private::CompileUnit &comp_unit,
|
||||||
ParseCompileUnitFunction(const lldb_private::SymbolContext &sc,
|
const DWARFDIE &die);
|
||||||
const DWARFDIE &die);
|
|
||||||
|
|
||||||
size_t ParseFunctionBlocks(const lldb_private::SymbolContext &sc,
|
size_t ParseFunctionBlocks(const lldb_private::SymbolContext &sc,
|
||||||
lldb_private::Block *parent_block,
|
lldb_private::Block *parent_block,
|
||||||
|
|
|
@ -488,7 +488,12 @@ ObjectFile *SymbolFileDWARFDebugMap::GetObjectFileByOSOIndex(uint32_t oso_idx) {
|
||||||
|
|
||||||
SymbolFileDWARF *
|
SymbolFileDWARF *
|
||||||
SymbolFileDWARFDebugMap::GetSymbolFile(const SymbolContext &sc) {
|
SymbolFileDWARFDebugMap::GetSymbolFile(const SymbolContext &sc) {
|
||||||
CompileUnitInfo *comp_unit_info = GetCompUnitInfo(sc);
|
return GetSymbolFile(*sc.comp_unit);
|
||||||
|
}
|
||||||
|
|
||||||
|
SymbolFileDWARF *
|
||||||
|
SymbolFileDWARFDebugMap::GetSymbolFile(const CompileUnit &comp_unit) {
|
||||||
|
CompileUnitInfo *comp_unit_info = GetCompUnitInfo(comp_unit);
|
||||||
if (comp_unit_info)
|
if (comp_unit_info)
|
||||||
return GetSymbolFileByCompUnitInfo(comp_unit_info);
|
return GetSymbolFileByCompUnitInfo(comp_unit_info);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -596,9 +601,14 @@ CompUnitSP SymbolFileDWARFDebugMap::ParseCompileUnitAtIndex(uint32_t cu_idx) {
|
||||||
|
|
||||||
SymbolFileDWARFDebugMap::CompileUnitInfo *
|
SymbolFileDWARFDebugMap::CompileUnitInfo *
|
||||||
SymbolFileDWARFDebugMap::GetCompUnitInfo(const SymbolContext &sc) {
|
SymbolFileDWARFDebugMap::GetCompUnitInfo(const SymbolContext &sc) {
|
||||||
|
return GetCompUnitInfo(*sc.comp_unit);
|
||||||
|
}
|
||||||
|
|
||||||
|
SymbolFileDWARFDebugMap::CompileUnitInfo *
|
||||||
|
SymbolFileDWARFDebugMap::GetCompUnitInfo(const CompileUnit &comp_unit) {
|
||||||
const uint32_t cu_count = GetNumCompileUnits();
|
const uint32_t cu_count = GetNumCompileUnits();
|
||||||
for (uint32_t i = 0; i < cu_count; ++i) {
|
for (uint32_t i = 0; i < cu_count; ++i) {
|
||||||
if (sc.comp_unit == m_compile_unit_infos[i].compile_unit_sp.get())
|
if (comp_unit == m_compile_unit_infos[i].compile_unit_sp.get())
|
||||||
return &m_compile_unit_infos[i];
|
return &m_compile_unit_infos[i];
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -616,50 +626,46 @@ size_t SymbolFileDWARFDebugMap::GetCompUnitInfosForModule(
|
||||||
}
|
}
|
||||||
|
|
||||||
lldb::LanguageType
|
lldb::LanguageType
|
||||||
SymbolFileDWARFDebugMap::ParseCompileUnitLanguage(const SymbolContext &sc) {
|
SymbolFileDWARFDebugMap::ParseLanguage(CompileUnit &comp_unit) {
|
||||||
SymbolFileDWARF *oso_dwarf = GetSymbolFile(sc);
|
SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
|
||||||
if (oso_dwarf)
|
if (oso_dwarf)
|
||||||
return oso_dwarf->ParseCompileUnitLanguage(sc);
|
return oso_dwarf->ParseLanguage(comp_unit);
|
||||||
return eLanguageTypeUnknown;
|
return eLanguageTypeUnknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t
|
size_t SymbolFileDWARFDebugMap::ParseFunctions(CompileUnit &comp_unit) {
|
||||||
SymbolFileDWARFDebugMap::ParseCompileUnitFunctions(const SymbolContext &sc) {
|
SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
|
||||||
SymbolFileDWARF *oso_dwarf = GetSymbolFile(sc);
|
|
||||||
if (oso_dwarf)
|
if (oso_dwarf)
|
||||||
return oso_dwarf->ParseCompileUnitFunctions(sc);
|
return oso_dwarf->ParseFunctions(comp_unit);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFileDWARFDebugMap::ParseCompileUnitLineTable(
|
bool SymbolFileDWARFDebugMap::ParseLineTable(CompileUnit &comp_unit) {
|
||||||
const SymbolContext &sc) {
|
SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
|
||||||
SymbolFileDWARF *oso_dwarf = GetSymbolFile(sc);
|
|
||||||
if (oso_dwarf)
|
if (oso_dwarf)
|
||||||
return oso_dwarf->ParseCompileUnitLineTable(sc);
|
return oso_dwarf->ParseLineTable(comp_unit);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFileDWARFDebugMap::ParseCompileUnitDebugMacros(
|
bool SymbolFileDWARFDebugMap::ParseDebugMacros(CompileUnit &comp_unit) {
|
||||||
const SymbolContext &sc) {
|
SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
|
||||||
SymbolFileDWARF *oso_dwarf = GetSymbolFile(sc);
|
|
||||||
if (oso_dwarf)
|
if (oso_dwarf)
|
||||||
return oso_dwarf->ParseCompileUnitDebugMacros(sc);
|
return oso_dwarf->ParseDebugMacros(comp_unit);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFileDWARFDebugMap::ParseCompileUnitSupportFiles(
|
bool SymbolFileDWARFDebugMap::ParseSupportFiles(CompileUnit &comp_unit,
|
||||||
const SymbolContext &sc, FileSpecList &support_files) {
|
FileSpecList &support_files) {
|
||||||
SymbolFileDWARF *oso_dwarf = GetSymbolFile(sc);
|
SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
|
||||||
if (oso_dwarf)
|
if (oso_dwarf)
|
||||||
return oso_dwarf->ParseCompileUnitSupportFiles(sc, support_files);
|
return oso_dwarf->ParseSupportFiles(comp_unit, support_files);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFileDWARFDebugMap::ParseCompileUnitIsOptimized(
|
bool SymbolFileDWARFDebugMap::ParseIsOptimized(CompileUnit &comp_unit) {
|
||||||
const lldb_private::SymbolContext &sc) {
|
SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
|
||||||
SymbolFileDWARF *oso_dwarf = GetSymbolFile(sc);
|
|
||||||
if (oso_dwarf)
|
if (oso_dwarf)
|
||||||
return oso_dwarf->ParseCompileUnitIsOptimized(sc);
|
return oso_dwarf->ParseIsOptimized(comp_unit);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -678,13 +684,10 @@ size_t SymbolFileDWARFDebugMap::ParseFunctionBlocks(const SymbolContext &sc) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t
|
size_t SymbolFileDWARFDebugMap::ParseTypes(CompileUnit &comp_unit) {
|
||||||
SymbolFileDWARFDebugMap::ParseTypesForCompileUnit(CompileUnit &comp_unit) {
|
SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
|
||||||
SymbolContext sc;
|
|
||||||
sc.comp_unit = &comp_unit;
|
|
||||||
SymbolFileDWARF *oso_dwarf = GetSymbolFile(sc);
|
|
||||||
if (oso_dwarf)
|
if (oso_dwarf)
|
||||||
return oso_dwarf->ParseTypesForCompileUnit(comp_unit);
|
return oso_dwarf->ParseTypes(comp_unit);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,25 +56,26 @@ public:
|
||||||
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
|
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
|
||||||
|
|
||||||
lldb::LanguageType
|
lldb::LanguageType
|
||||||
ParseCompileUnitLanguage(const lldb_private::SymbolContext &sc) override;
|
ParseLanguage(lldb_private::CompileUnit &comp_unit) override;
|
||||||
size_t
|
|
||||||
ParseCompileUnitFunctions(const lldb_private::SymbolContext &sc) override;
|
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override;
|
||||||
bool
|
|
||||||
ParseCompileUnitLineTable(const lldb_private::SymbolContext &sc) override;
|
bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override;
|
||||||
bool
|
|
||||||
ParseCompileUnitDebugMacros(const lldb_private::SymbolContext &sc) override;
|
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override;
|
||||||
bool ParseCompileUnitSupportFiles(
|
|
||||||
const lldb_private::SymbolContext &sc,
|
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit,
|
||||||
lldb_private::FileSpecList &support_files) override;
|
lldb_private::FileSpecList &support_files) override;
|
||||||
bool
|
|
||||||
ParseCompileUnitIsOptimized(const lldb_private::SymbolContext &sc) override;
|
bool ParseIsOptimized(lldb_private::CompileUnit &comp_unit) override;
|
||||||
|
|
||||||
|
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override;
|
||||||
|
|
||||||
bool ParseImportedModules(
|
bool ParseImportedModules(
|
||||||
const lldb_private::SymbolContext &sc,
|
const lldb_private::SymbolContext &sc,
|
||||||
std::vector<lldb_private::ConstString> &imported_modules) override;
|
std::vector<lldb_private::ConstString> &imported_modules) override;
|
||||||
size_t ParseFunctionBlocks(const lldb_private::SymbolContext &sc) override;
|
size_t ParseFunctionBlocks(const lldb_private::SymbolContext &sc) override;
|
||||||
size_t
|
size_t
|
||||||
ParseTypesForCompileUnit(lldb_private::CompileUnit &comp_unit) override;
|
|
||||||
size_t
|
|
||||||
ParseVariablesForContext(const lldb_private::SymbolContext &sc) override;
|
ParseVariablesForContext(const lldb_private::SymbolContext &sc) override;
|
||||||
|
|
||||||
lldb_private::Type *ResolveTypeUID(lldb::user_id_t type_uid) override;
|
lldb_private::Type *ResolveTypeUID(lldb::user_id_t type_uid) override;
|
||||||
|
@ -199,6 +200,7 @@ protected:
|
||||||
bool GetFileSpecForSO(uint32_t oso_idx, lldb_private::FileSpec &file_spec);
|
bool GetFileSpecForSO(uint32_t oso_idx, lldb_private::FileSpec &file_spec);
|
||||||
|
|
||||||
CompileUnitInfo *GetCompUnitInfo(const lldb_private::SymbolContext &sc);
|
CompileUnitInfo *GetCompUnitInfo(const lldb_private::SymbolContext &sc);
|
||||||
|
CompileUnitInfo *GetCompUnitInfo(const lldb_private::CompileUnit &comp_unit);
|
||||||
|
|
||||||
size_t GetCompUnitInfosForModule(const lldb_private::Module *oso_module,
|
size_t GetCompUnitInfosForModule(const lldb_private::Module *oso_module,
|
||||||
std::vector<CompileUnitInfo *> &cu_infos);
|
std::vector<CompileUnitInfo *> &cu_infos);
|
||||||
|
@ -216,6 +218,7 @@ protected:
|
||||||
uint32_t GetCompUnitInfoIndex(const CompileUnitInfo *comp_unit_info);
|
uint32_t GetCompUnitInfoIndex(const CompileUnitInfo *comp_unit_info);
|
||||||
|
|
||||||
SymbolFileDWARF *GetSymbolFile(const lldb_private::SymbolContext &sc);
|
SymbolFileDWARF *GetSymbolFile(const lldb_private::SymbolContext &sc);
|
||||||
|
SymbolFileDWARF *GetSymbolFile(const lldb_private::CompileUnit &comp_unit);
|
||||||
|
|
||||||
SymbolFileDWARF *GetSymbolFileByCompUnitInfo(CompileUnitInfo *comp_unit_info);
|
SymbolFileDWARF *GetSymbolFileByCompUnitInfo(CompileUnitInfo *comp_unit_info);
|
||||||
|
|
||||||
|
|
|
@ -882,13 +882,8 @@ lldb::CompUnitSP SymbolFileNativePDB::ParseCompileUnitAtIndex(uint32_t index) {
|
||||||
return GetOrCreateCompileUnit(item);
|
return GetOrCreateCompileUnit(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
lldb::LanguageType
|
lldb::LanguageType SymbolFileNativePDB::ParseLanguage(CompileUnit &comp_unit) {
|
||||||
SymbolFileNativePDB::ParseCompileUnitLanguage(const SymbolContext &sc) {
|
PdbSymUid uid(comp_unit.GetID());
|
||||||
// What fields should I expect to be filled out on the SymbolContext? Is it
|
|
||||||
// safe to assume that `sc.comp_unit` is valid?
|
|
||||||
if (!sc.comp_unit)
|
|
||||||
return lldb::eLanguageTypeUnknown;
|
|
||||||
PdbSymUid uid(sc.comp_unit->GetID());
|
|
||||||
lldbassert(uid.kind() == PdbSymUidKind::Compiland);
|
lldbassert(uid.kind() == PdbSymUidKind::Compiland);
|
||||||
|
|
||||||
CompilandIndexItem *item =
|
CompilandIndexItem *item =
|
||||||
|
@ -902,15 +897,13 @@ SymbolFileNativePDB::ParseCompileUnitLanguage(const SymbolContext &sc) {
|
||||||
|
|
||||||
void SymbolFileNativePDB::AddSymbols(Symtab &symtab) { return; }
|
void SymbolFileNativePDB::AddSymbols(Symtab &symtab) { return; }
|
||||||
|
|
||||||
size_t SymbolFileNativePDB::ParseCompileUnitFunctions(const SymbolContext &sc) {
|
size_t SymbolFileNativePDB::ParseFunctions(CompileUnit &comp_unit) {
|
||||||
lldbassert(sc.comp_unit);
|
PdbSymUid uid{comp_unit.GetID()};
|
||||||
|
|
||||||
PdbSymUid uid{sc.comp_unit->GetID()};
|
|
||||||
lldbassert(uid.kind() == PdbSymUidKind::Compiland);
|
lldbassert(uid.kind() == PdbSymUidKind::Compiland);
|
||||||
uint16_t modi = uid.asCompiland().modi;
|
uint16_t modi = uid.asCompiland().modi;
|
||||||
CompilandIndexItem &cii = m_index->compilands().GetOrCreateCompiland(modi);
|
CompilandIndexItem &cii = m_index->compilands().GetOrCreateCompiland(modi);
|
||||||
|
|
||||||
size_t count = sc.comp_unit->GetNumFunctions();
|
size_t count = comp_unit.GetNumFunctions();
|
||||||
const CVSymbolArray &syms = cii.m_debug_stream.getSymbolArray();
|
const CVSymbolArray &syms = cii.m_debug_stream.getSymbolArray();
|
||||||
for (auto iter = syms.begin(); iter != syms.end(); ++iter) {
|
for (auto iter = syms.begin(); iter != syms.end(); ++iter) {
|
||||||
if (iter->kind() != S_LPROC32 && iter->kind() != S_GPROC32)
|
if (iter->kind() != S_LPROC32 && iter->kind() != S_GPROC32)
|
||||||
|
@ -918,10 +911,10 @@ size_t SymbolFileNativePDB::ParseCompileUnitFunctions(const SymbolContext &sc) {
|
||||||
|
|
||||||
PdbCompilandSymId sym_id{modi, iter.offset()};
|
PdbCompilandSymId sym_id{modi, iter.offset()};
|
||||||
|
|
||||||
FunctionSP func = GetOrCreateFunction(sym_id, *sc.comp_unit);
|
FunctionSP func = GetOrCreateFunction(sym_id, comp_unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t new_count = sc.comp_unit->GetNumFunctions();
|
size_t new_count = comp_unit.GetNumFunctions();
|
||||||
lldbassert(new_count >= count);
|
lldbassert(new_count >= count);
|
||||||
return new_count - count;
|
return new_count - count;
|
||||||
}
|
}
|
||||||
|
@ -1037,18 +1030,17 @@ static void TerminateLineSequence(LineTable &table,
|
||||||
table.InsertSequence(seq.release());
|
table.InsertSequence(seq.release());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFileNativePDB::ParseCompileUnitLineTable(const SymbolContext &sc) {
|
bool SymbolFileNativePDB::ParseLineTable(CompileUnit &comp_unit) {
|
||||||
// Unfortunately LLDB is set up to parse the entire compile unit line table
|
// Unfortunately LLDB is set up to parse the entire compile unit line table
|
||||||
// all at once, even if all it really needs is line info for a specific
|
// all at once, even if all it really needs is line info for a specific
|
||||||
// function. In the future it would be nice if it could set the sc.m_function
|
// function. In the future it would be nice if it could set the sc.m_function
|
||||||
// member, and we could only get the line info for the function in question.
|
// member, and we could only get the line info for the function in question.
|
||||||
lldbassert(sc.comp_unit);
|
PdbSymUid cu_id(comp_unit.GetID());
|
||||||
PdbSymUid cu_id(sc.comp_unit->GetID());
|
|
||||||
lldbassert(cu_id.kind() == PdbSymUidKind::Compiland);
|
lldbassert(cu_id.kind() == PdbSymUidKind::Compiland);
|
||||||
CompilandIndexItem *cci =
|
CompilandIndexItem *cci =
|
||||||
m_index->compilands().GetCompiland(cu_id.asCompiland().modi);
|
m_index->compilands().GetCompiland(cu_id.asCompiland().modi);
|
||||||
lldbassert(cci);
|
lldbassert(cci);
|
||||||
auto line_table = llvm::make_unique<LineTable>(sc.comp_unit);
|
auto line_table = llvm::make_unique<LineTable>(&comp_unit);
|
||||||
|
|
||||||
// This is basically a copy of the .debug$S subsections from all original COFF
|
// This is basically a copy of the .debug$S subsections from all original COFF
|
||||||
// object files merged together with address relocations applied. We are
|
// object files merged together with address relocations applied. We are
|
||||||
|
@ -1110,20 +1102,18 @@ bool SymbolFileNativePDB::ParseCompileUnitLineTable(const SymbolContext &sc) {
|
||||||
if (line_table->GetSize() == 0)
|
if (line_table->GetSize() == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
sc.comp_unit->SetLineTable(line_table.release());
|
comp_unit.SetLineTable(line_table.release());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFileNativePDB::ParseCompileUnitDebugMacros(const SymbolContext &sc) {
|
bool SymbolFileNativePDB::ParseDebugMacros(CompileUnit &comp_unit) {
|
||||||
// PDB doesn't contain information about macros
|
// PDB doesn't contain information about macros
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFileNativePDB::ParseCompileUnitSupportFiles(
|
bool SymbolFileNativePDB::ParseSupportFiles(CompileUnit &comp_unit,
|
||||||
const SymbolContext &sc, FileSpecList &support_files) {
|
FileSpecList &support_files) {
|
||||||
lldbassert(sc.comp_unit);
|
PdbSymUid cu_id(comp_unit.GetID());
|
||||||
|
|
||||||
PdbSymUid cu_id(sc.comp_unit->GetID());
|
|
||||||
lldbassert(cu_id.kind() == PdbSymUidKind::Compiland);
|
lldbassert(cu_id.kind() == PdbSymUidKind::Compiland);
|
||||||
CompilandIndexItem *cci =
|
CompilandIndexItem *cci =
|
||||||
m_index->compilands().GetCompiland(cu_id.asCompiland().modi);
|
m_index->compilands().GetCompiland(cu_id.asCompiland().modi);
|
||||||
|
@ -1274,7 +1264,7 @@ size_t SymbolFileNativePDB::FindTypesByName(llvm::StringRef name,
|
||||||
return match_count;
|
return match_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t SymbolFileNativePDB::ParseTypesForCompileUnit(CompileUnit &comp_unit) {
|
size_t SymbolFileNativePDB::ParseTypes(CompileUnit &comp_unit) {
|
||||||
// Only do the full type scan the first time.
|
// Only do the full type scan the first time.
|
||||||
if (m_done_full_type_scan)
|
if (m_done_full_type_scan)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -82,16 +82,18 @@ public:
|
||||||
|
|
||||||
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
|
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
|
||||||
|
|
||||||
lldb::LanguageType ParseCompileUnitLanguage(const SymbolContext &sc) override;
|
lldb::LanguageType
|
||||||
|
ParseLanguage(lldb_private::CompileUnit &comp_unit) override;
|
||||||
|
|
||||||
size_t ParseCompileUnitFunctions(const SymbolContext &sc) override;
|
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override;
|
||||||
|
|
||||||
bool ParseCompileUnitLineTable(const SymbolContext &sc) override;
|
bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override;
|
||||||
|
|
||||||
bool ParseCompileUnitDebugMacros(const SymbolContext &sc) override;
|
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override;
|
||||||
|
|
||||||
bool ParseCompileUnitSupportFiles(const SymbolContext &sc,
|
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit,
|
||||||
FileSpecList &support_files) override;
|
FileSpecList &support_files) override;
|
||||||
|
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override;
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ParseImportedModules(const SymbolContext &sc,
|
ParseImportedModules(const SymbolContext &sc,
|
||||||
|
@ -104,8 +106,6 @@ public:
|
||||||
uint32_t max_matches,
|
uint32_t max_matches,
|
||||||
VariableList &variables) override;
|
VariableList &variables) override;
|
||||||
|
|
||||||
size_t
|
|
||||||
ParseTypesForCompileUnit(lldb_private::CompileUnit &comp_unit) override;
|
|
||||||
size_t ParseVariablesForContext(const SymbolContext &sc) override;
|
size_t ParseVariablesForContext(const SymbolContext &sc) override;
|
||||||
|
|
||||||
void AddSymbols(Symtab &symtab) override;
|
void AddSymbols(Symtab &symtab) override;
|
||||||
|
|
|
@ -267,14 +267,8 @@ lldb::CompUnitSP SymbolFilePDB::ParseCompileUnitAtIndex(uint32_t index) {
|
||||||
return ParseCompileUnitForUID(compiland_up->getSymIndexId(), index);
|
return ParseCompileUnitForUID(compiland_up->getSymIndexId(), index);
|
||||||
}
|
}
|
||||||
|
|
||||||
lldb::LanguageType
|
lldb::LanguageType SymbolFilePDB::ParseLanguage(CompileUnit &comp_unit) {
|
||||||
SymbolFilePDB::ParseCompileUnitLanguage(const lldb_private::SymbolContext &sc) {
|
auto compiland_up = GetPDBCompilandByUID(comp_unit.GetID());
|
||||||
// What fields should I expect to be filled out on the SymbolContext? Is it
|
|
||||||
// safe to assume that `sc.comp_unit` is valid?
|
|
||||||
if (!sc.comp_unit)
|
|
||||||
return lldb::eLanguageTypeUnknown;
|
|
||||||
|
|
||||||
auto compiland_up = GetPDBCompilandByUID(sc.comp_unit->GetID());
|
|
||||||
if (!compiland_up)
|
if (!compiland_up)
|
||||||
return lldb::eLanguageTypeUnknown;
|
return lldb::eLanguageTypeUnknown;
|
||||||
auto details = compiland_up->findOneChild<PDBSymbolCompilandDetails>();
|
auto details = compiland_up->findOneChild<PDBSymbolCompilandDetails>();
|
||||||
|
@ -283,12 +277,10 @@ SymbolFilePDB::ParseCompileUnitLanguage(const lldb_private::SymbolContext &sc) {
|
||||||
return TranslateLanguage(details->getLanguage());
|
return TranslateLanguage(details->getLanguage());
|
||||||
}
|
}
|
||||||
|
|
||||||
lldb_private::Function *SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc(
|
lldb_private::Function *
|
||||||
const PDBSymbolFunc &pdb_func, const lldb_private::SymbolContext &sc) {
|
SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc(const PDBSymbolFunc &pdb_func,
|
||||||
lldbassert(sc.comp_unit && sc.module_sp.get());
|
CompileUnit &comp_unit) {
|
||||||
|
if (FunctionSP result = comp_unit.FindFunctionByUID(pdb_func.getSymIndexId()))
|
||||||
if (FunctionSP result =
|
|
||||||
sc.comp_unit->FindFunctionByUID(pdb_func.getSymIndexId()))
|
|
||||||
return result.get();
|
return result.get();
|
||||||
|
|
||||||
auto file_vm_addr = pdb_func.getVirtualAddress();
|
auto file_vm_addr = pdb_func.getVirtualAddress();
|
||||||
|
@ -297,7 +289,8 @@ lldb_private::Function *SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc(
|
||||||
|
|
||||||
auto func_length = pdb_func.getLength();
|
auto func_length = pdb_func.getLength();
|
||||||
AddressRange func_range =
|
AddressRange func_range =
|
||||||
AddressRange(file_vm_addr, func_length, sc.module_sp->GetSectionList());
|
AddressRange(file_vm_addr, func_length,
|
||||||
|
GetObjectFile()->GetModule()->GetSectionList());
|
||||||
if (!func_range.GetBaseAddress().IsValid())
|
if (!func_range.GetBaseAddress().IsValid())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
@ -310,10 +303,10 @@ lldb_private::Function *SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc(
|
||||||
Mangled mangled = GetMangledForPDBFunc(pdb_func);
|
Mangled mangled = GetMangledForPDBFunc(pdb_func);
|
||||||
|
|
||||||
FunctionSP func_sp =
|
FunctionSP func_sp =
|
||||||
std::make_shared<Function>(sc.comp_unit, pdb_func.getSymIndexId(),
|
std::make_shared<Function>(&comp_unit, pdb_func.getSymIndexId(),
|
||||||
func_type_uid, mangled, func_type, func_range);
|
func_type_uid, mangled, func_type, func_range);
|
||||||
|
|
||||||
sc.comp_unit->AddFunction(func_sp);
|
comp_unit.AddFunction(func_sp);
|
||||||
|
|
||||||
TypeSystem *type_system = GetTypeSystemForLanguage(lldb::eLanguageTypeC_plus_plus);
|
TypeSystem *type_system = GetTypeSystemForLanguage(lldb::eLanguageTypeC_plus_plus);
|
||||||
if (!type_system)
|
if (!type_system)
|
||||||
|
@ -327,52 +320,44 @@ lldb_private::Function *SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc(
|
||||||
return func_sp.get();
|
return func_sp.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t SymbolFilePDB::ParseCompileUnitFunctions(
|
size_t SymbolFilePDB::ParseFunctions(CompileUnit &comp_unit) {
|
||||||
const lldb_private::SymbolContext &sc) {
|
|
||||||
lldbassert(sc.comp_unit);
|
|
||||||
size_t func_added = 0;
|
size_t func_added = 0;
|
||||||
auto compiland_up = GetPDBCompilandByUID(sc.comp_unit->GetID());
|
auto compiland_up = GetPDBCompilandByUID(comp_unit.GetID());
|
||||||
if (!compiland_up)
|
if (!compiland_up)
|
||||||
return 0;
|
return 0;
|
||||||
auto results_up = compiland_up->findAllChildren<PDBSymbolFunc>();
|
auto results_up = compiland_up->findAllChildren<PDBSymbolFunc>();
|
||||||
if (!results_up)
|
if (!results_up)
|
||||||
return 0;
|
return 0;
|
||||||
while (auto pdb_func_up = results_up->getNext()) {
|
while (auto pdb_func_up = results_up->getNext()) {
|
||||||
auto func_sp =
|
auto func_sp = comp_unit.FindFunctionByUID(pdb_func_up->getSymIndexId());
|
||||||
sc.comp_unit->FindFunctionByUID(pdb_func_up->getSymIndexId());
|
|
||||||
if (!func_sp) {
|
if (!func_sp) {
|
||||||
if (ParseCompileUnitFunctionForPDBFunc(*pdb_func_up, sc))
|
if (ParseCompileUnitFunctionForPDBFunc(*pdb_func_up, comp_unit))
|
||||||
++func_added;
|
++func_added;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return func_added;
|
return func_added;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFilePDB::ParseCompileUnitLineTable(
|
bool SymbolFilePDB::ParseLineTable(CompileUnit &comp_unit) {
|
||||||
const lldb_private::SymbolContext &sc) {
|
if (comp_unit.GetLineTable())
|
||||||
lldbassert(sc.comp_unit);
|
|
||||||
if (sc.comp_unit->GetLineTable())
|
|
||||||
return true;
|
return true;
|
||||||
return ParseCompileUnitLineTable(sc, 0);
|
return ParseCompileUnitLineTable(comp_unit, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFilePDB::ParseCompileUnitDebugMacros(
|
bool SymbolFilePDB::ParseDebugMacros(CompileUnit &comp_unit) {
|
||||||
const lldb_private::SymbolContext &sc) {
|
|
||||||
// PDB doesn't contain information about macros
|
// PDB doesn't contain information about macros
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFilePDB::ParseCompileUnitSupportFiles(
|
bool SymbolFilePDB::ParseSupportFiles(
|
||||||
const lldb_private::SymbolContext &sc,
|
CompileUnit &comp_unit, lldb_private::FileSpecList &support_files) {
|
||||||
lldb_private::FileSpecList &support_files) {
|
|
||||||
lldbassert(sc.comp_unit);
|
|
||||||
|
|
||||||
// In theory this is unnecessary work for us, because all of this information
|
// In theory this is unnecessary work for us, because all of this information
|
||||||
// is easily (and quickly) accessible from DebugInfoPDB, so caching it a
|
// is easily (and quickly) accessible from DebugInfoPDB, so caching it a
|
||||||
// second time seems like a waste. Unfortunately, there's no good way around
|
// second time seems like a waste. Unfortunately, there's no good way around
|
||||||
// this short of a moderate refactor since SymbolVendor depends on being able
|
// this short of a moderate refactor since SymbolVendor depends on being able
|
||||||
// to cache this list.
|
// to cache this list.
|
||||||
auto compiland_up = GetPDBCompilandByUID(sc.comp_unit->GetID());
|
auto compiland_up = GetPDBCompilandByUID(comp_unit.GetID());
|
||||||
if (!compiland_up)
|
if (!compiland_up)
|
||||||
return false;
|
return false;
|
||||||
auto files = m_session_up->getSourceFilesForCompiland(*compiland_up);
|
auto files = m_session_up->getSourceFilesForCompiland(*compiland_up);
|
||||||
|
@ -386,7 +371,7 @@ bool SymbolFilePDB::ParseCompileUnitSupportFiles(
|
||||||
|
|
||||||
// LLDB uses the DWARF-like file numeration (one based),
|
// LLDB uses the DWARF-like file numeration (one based),
|
||||||
// the zeroth file is the compile unit itself
|
// the zeroth file is the compile unit itself
|
||||||
support_files.Insert(0, *sc.comp_unit);
|
support_files.Insert(0, comp_unit);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -464,7 +449,7 @@ SymbolFilePDB::ParseFunctionBlocks(const lldb_private::SymbolContext &sc) {
|
||||||
return num_added;
|
return num_added;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t SymbolFilePDB::ParseTypesForCompileUnit(CompileUnit &comp_unit) {
|
size_t SymbolFilePDB::ParseTypes(CompileUnit &comp_unit) {
|
||||||
|
|
||||||
size_t num_added = 0;
|
size_t num_added = 0;
|
||||||
auto compiland = GetPDBCompilandByUID(comp_unit.GetID());
|
auto compiland = GetPDBCompilandByUID(comp_unit.GetID());
|
||||||
|
@ -726,7 +711,8 @@ SymbolFilePDB::ResolveSymbolContext(const lldb_private::Address &so_addr,
|
||||||
auto func_uid = pdb_func->getSymIndexId();
|
auto func_uid = pdb_func->getSymIndexId();
|
||||||
sc.function = sc.comp_unit->FindFunctionByUID(func_uid).get();
|
sc.function = sc.comp_unit->FindFunctionByUID(func_uid).get();
|
||||||
if (sc.function == nullptr)
|
if (sc.function == nullptr)
|
||||||
sc.function = ParseCompileUnitFunctionForPDBFunc(*pdb_func, sc);
|
sc.function =
|
||||||
|
ParseCompileUnitFunctionForPDBFunc(*pdb_func, *sc.comp_unit);
|
||||||
if (sc.function) {
|
if (sc.function) {
|
||||||
resolved_flags |= eSymbolContextFunction;
|
resolved_flags |= eSymbolContextFunction;
|
||||||
if (resolve_scope & eSymbolContextBlock) {
|
if (resolve_scope & eSymbolContextBlock) {
|
||||||
|
@ -796,7 +782,7 @@ uint32_t SymbolFilePDB::ResolveSymbolContext(
|
||||||
// table that match the requested line (or all lines if `line` == 0).
|
// table that match the requested line (or all lines if `line` == 0).
|
||||||
if (resolve_scope & (eSymbolContextFunction | eSymbolContextBlock |
|
if (resolve_scope & (eSymbolContextFunction | eSymbolContextBlock |
|
||||||
eSymbolContextLineEntry)) {
|
eSymbolContextLineEntry)) {
|
||||||
bool has_line_table = ParseCompileUnitLineTable(sc, line);
|
bool has_line_table = ParseCompileUnitLineTable(*sc.comp_unit, line);
|
||||||
|
|
||||||
if ((resolve_scope & eSymbolContextLineEntry) && !has_line_table) {
|
if ((resolve_scope & eSymbolContextLineEntry) && !has_line_table) {
|
||||||
// The query asks for line entries, but we can't get them for the
|
// The query asks for line entries, but we can't get them for the
|
||||||
|
@ -839,7 +825,8 @@ uint32_t SymbolFilePDB::ResolveSymbolContext(
|
||||||
if (sc.function == nullptr) {
|
if (sc.function == nullptr) {
|
||||||
auto pdb_func = llvm::dyn_cast<PDBSymbolFunc>(symbol_up.get());
|
auto pdb_func = llvm::dyn_cast<PDBSymbolFunc>(symbol_up.get());
|
||||||
assert(pdb_func);
|
assert(pdb_func);
|
||||||
sc.function = ParseCompileUnitFunctionForPDBFunc(*pdb_func, sc);
|
sc.function = ParseCompileUnitFunctionForPDBFunc(*pdb_func,
|
||||||
|
*sc.comp_unit);
|
||||||
}
|
}
|
||||||
if (sc.function && (resolve_scope & eSymbolContextBlock)) {
|
if (sc.function && (resolve_scope & eSymbolContextBlock)) {
|
||||||
Block &block = sc.function->GetBlock(true);
|
Block &block = sc.function->GetBlock(true);
|
||||||
|
@ -1139,7 +1126,7 @@ bool SymbolFilePDB::ResolveFunction(const llvm::pdb::PDBSymbolFunc &pdb_func,
|
||||||
if (!sc.comp_unit)
|
if (!sc.comp_unit)
|
||||||
return false;
|
return false;
|
||||||
sc.module_sp = sc.comp_unit->GetModule();
|
sc.module_sp = sc.comp_unit->GetModule();
|
||||||
sc.function = ParseCompileUnitFunctionForPDBFunc(pdb_func, sc);
|
sc.function = ParseCompileUnitFunctionForPDBFunc(pdb_func, *sc.comp_unit);
|
||||||
if (!sc.function)
|
if (!sc.function)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1717,11 +1704,9 @@ lldb::CompUnitSP SymbolFilePDB::ParseCompileUnitForUID(uint32_t id,
|
||||||
return cu_sp;
|
return cu_sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFilePDB::ParseCompileUnitLineTable(
|
bool SymbolFilePDB::ParseCompileUnitLineTable(CompileUnit &comp_unit,
|
||||||
const lldb_private::SymbolContext &sc, uint32_t match_line) {
|
uint32_t match_line) {
|
||||||
lldbassert(sc.comp_unit);
|
auto compiland_up = GetPDBCompilandByUID(comp_unit.GetID());
|
||||||
|
|
||||||
auto compiland_up = GetPDBCompilandByUID(sc.comp_unit->GetID());
|
|
||||||
if (!compiland_up)
|
if (!compiland_up)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1731,10 +1716,10 @@ bool SymbolFilePDB::ParseCompileUnitLineTable(
|
||||||
// to do a mapping so that we can hand out indices.
|
// to do a mapping so that we can hand out indices.
|
||||||
llvm::DenseMap<uint32_t, uint32_t> index_map;
|
llvm::DenseMap<uint32_t, uint32_t> index_map;
|
||||||
BuildSupportFileIdToSupportFileIndexMap(*compiland_up, index_map);
|
BuildSupportFileIdToSupportFileIndexMap(*compiland_up, index_map);
|
||||||
auto line_table = llvm::make_unique<LineTable>(sc.comp_unit);
|
auto line_table = llvm::make_unique<LineTable>(&comp_unit);
|
||||||
|
|
||||||
// Find contributions to `compiland` from all source and header files.
|
// Find contributions to `compiland` from all source and header files.
|
||||||
std::string path = sc.comp_unit->GetPath();
|
std::string path = comp_unit.GetPath();
|
||||||
auto files = m_session_up->getSourceFilesForCompiland(*compiland_up);
|
auto files = m_session_up->getSourceFilesForCompiland(*compiland_up);
|
||||||
if (!files)
|
if (!files)
|
||||||
return false;
|
return false;
|
||||||
|
@ -1818,7 +1803,7 @@ bool SymbolFilePDB::ParseCompileUnitLineTable(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line_table->GetSize()) {
|
if (line_table->GetSize()) {
|
||||||
sc.comp_unit->SetLineTable(line_table.release());
|
comp_unit.SetLineTable(line_table.release());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -60,20 +60,18 @@ public:
|
||||||
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
|
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
|
||||||
|
|
||||||
lldb::LanguageType
|
lldb::LanguageType
|
||||||
ParseCompileUnitLanguage(const lldb_private::SymbolContext &sc) override;
|
ParseLanguage(lldb_private::CompileUnit &comp_unit) override;
|
||||||
|
|
||||||
size_t
|
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override;
|
||||||
ParseCompileUnitFunctions(const lldb_private::SymbolContext &sc) override;
|
|
||||||
|
|
||||||
bool
|
bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override;
|
||||||
ParseCompileUnitLineTable(const lldb_private::SymbolContext &sc) override;
|
|
||||||
|
|
||||||
bool
|
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override;
|
||||||
ParseCompileUnitDebugMacros(const lldb_private::SymbolContext &sc) override;
|
|
||||||
|
|
||||||
bool ParseCompileUnitSupportFiles(
|
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit,
|
||||||
const lldb_private::SymbolContext &sc,
|
lldb_private::FileSpecList &support_files) override;
|
||||||
lldb_private::FileSpecList &support_files) override;
|
|
||||||
|
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override;
|
||||||
|
|
||||||
bool ParseImportedModules(
|
bool ParseImportedModules(
|
||||||
const lldb_private::SymbolContext &sc,
|
const lldb_private::SymbolContext &sc,
|
||||||
|
@ -81,9 +79,6 @@ public:
|
||||||
|
|
||||||
size_t ParseFunctionBlocks(const lldb_private::SymbolContext &sc) override;
|
size_t ParseFunctionBlocks(const lldb_private::SymbolContext &sc) override;
|
||||||
|
|
||||||
size_t
|
|
||||||
ParseTypesForCompileUnit(lldb_private::CompileUnit &comp_unit) override;
|
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
ParseVariablesForContext(const lldb_private::SymbolContext &sc) override;
|
ParseVariablesForContext(const lldb_private::SymbolContext &sc) override;
|
||||||
|
|
||||||
|
@ -190,7 +185,7 @@ private:
|
||||||
lldb::CompUnitSP ParseCompileUnitForUID(uint32_t id,
|
lldb::CompUnitSP ParseCompileUnitForUID(uint32_t id,
|
||||||
uint32_t index = UINT32_MAX);
|
uint32_t index = UINT32_MAX);
|
||||||
|
|
||||||
bool ParseCompileUnitLineTable(const lldb_private::SymbolContext &sc,
|
bool ParseCompileUnitLineTable(lldb_private::CompileUnit &comp_unit,
|
||||||
uint32_t match_line);
|
uint32_t match_line);
|
||||||
|
|
||||||
void BuildSupportFileIdToSupportFileIndexMap(
|
void BuildSupportFileIdToSupportFileIndexMap(
|
||||||
|
@ -222,7 +217,7 @@ private:
|
||||||
|
|
||||||
lldb_private::Function *
|
lldb_private::Function *
|
||||||
ParseCompileUnitFunctionForPDBFunc(const llvm::pdb::PDBSymbolFunc &pdb_func,
|
ParseCompileUnitFunctionForPDBFunc(const llvm::pdb::PDBSymbolFunc &pdb_func,
|
||||||
const lldb_private::SymbolContext &sc);
|
lldb_private::CompileUnit &comp_unit);
|
||||||
|
|
||||||
void GetCompileUnitIndex(const llvm::pdb::PDBSymbolCompiland &pdb_compiland,
|
void GetCompileUnitIndex(const llvm::pdb::PDBSymbolCompiland &pdb_compiland,
|
||||||
uint32_t &index);
|
uint32_t &index);
|
||||||
|
|
|
@ -131,15 +131,13 @@ CompUnitSP SymbolFileSymtab::ParseCompileUnitAtIndex(uint32_t idx) {
|
||||||
return cu_sp;
|
return cu_sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
lldb::LanguageType
|
lldb::LanguageType SymbolFileSymtab::ParseLanguage(CompileUnit &comp_unit) {
|
||||||
SymbolFileSymtab::ParseCompileUnitLanguage(const SymbolContext &sc) {
|
|
||||||
return eLanguageTypeUnknown;
|
return eLanguageTypeUnknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t SymbolFileSymtab::ParseCompileUnitFunctions(const SymbolContext &sc) {
|
size_t SymbolFileSymtab::ParseFunctions(CompileUnit &comp_unit) {
|
||||||
size_t num_added = 0;
|
size_t num_added = 0;
|
||||||
// We must at least have a valid compile unit
|
// We must at least have a valid compile unit
|
||||||
assert(sc.comp_unit != NULL);
|
|
||||||
const Symtab *symtab = m_obj_file->GetSymtab();
|
const Symtab *symtab = m_obj_file->GetSymtab();
|
||||||
const Symbol *curr_symbol = NULL;
|
const Symbol *curr_symbol = NULL;
|
||||||
const Symbol *next_symbol = NULL;
|
const Symbol *next_symbol = NULL;
|
||||||
|
@ -185,7 +183,7 @@ size_t SymbolFileSymtab::ParseCompileUnitFunctions(const SymbolContext &sc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
FunctionSP func_sp(
|
FunctionSP func_sp(
|
||||||
new Function(sc.comp_unit,
|
new Function(&comp_unit,
|
||||||
symbol_idx, // UserID is the DIE offset
|
symbol_idx, // UserID is the DIE offset
|
||||||
LLDB_INVALID_UID, // We don't have any type info
|
LLDB_INVALID_UID, // We don't have any type info
|
||||||
// for this function
|
// for this function
|
||||||
|
@ -194,7 +192,7 @@ size_t SymbolFileSymtab::ParseCompileUnitFunctions(const SymbolContext &sc) {
|
||||||
func_range)); // first address range
|
func_range)); // first address range
|
||||||
|
|
||||||
if (func_sp.get() != NULL) {
|
if (func_sp.get() != NULL) {
|
||||||
sc.comp_unit->AddFunction(func_sp);
|
comp_unit.AddFunction(func_sp);
|
||||||
++num_added;
|
++num_added;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -207,16 +205,16 @@ size_t SymbolFileSymtab::ParseCompileUnitFunctions(const SymbolContext &sc) {
|
||||||
return num_added;
|
return num_added;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFileSymtab::ParseCompileUnitLineTable(const SymbolContext &sc) {
|
size_t SymbolFileSymtab::ParseTypes(CompileUnit &comp_unit) { return 0; }
|
||||||
|
|
||||||
|
bool SymbolFileSymtab::ParseLineTable(CompileUnit &comp_unit) { return false; }
|
||||||
|
|
||||||
|
bool SymbolFileSymtab::ParseDebugMacros(CompileUnit &comp_unit) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolFileSymtab::ParseCompileUnitDebugMacros(const SymbolContext &sc) {
|
bool SymbolFileSymtab::ParseSupportFiles(CompileUnit &comp_unit,
|
||||||
return false;
|
FileSpecList &support_files) {
|
||||||
}
|
|
||||||
|
|
||||||
bool SymbolFileSymtab::ParseCompileUnitSupportFiles(
|
|
||||||
const SymbolContext &sc, FileSpecList &support_files) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,10 +227,6 @@ size_t SymbolFileSymtab::ParseFunctionBlocks(const SymbolContext &sc) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t SymbolFileSymtab::ParseTypesForCompileUnit(CompileUnit &comp_unit) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t SymbolFileSymtab::ParseVariablesForContext(const SymbolContext &sc) {
|
size_t SymbolFileSymtab::ParseVariablesForContext(const SymbolContext &sc) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,20 +49,18 @@ public:
|
||||||
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
|
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
|
||||||
|
|
||||||
lldb::LanguageType
|
lldb::LanguageType
|
||||||
ParseCompileUnitLanguage(const lldb_private::SymbolContext &sc) override;
|
ParseLanguage(lldb_private::CompileUnit &comp_unit) override;
|
||||||
|
|
||||||
size_t
|
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override;
|
||||||
ParseCompileUnitFunctions(const lldb_private::SymbolContext &sc) override;
|
|
||||||
|
|
||||||
bool
|
bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override;
|
||||||
ParseCompileUnitLineTable(const lldb_private::SymbolContext &sc) override;
|
|
||||||
|
|
||||||
bool
|
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override;
|
||||||
ParseCompileUnitDebugMacros(const lldb_private::SymbolContext &sc) override;
|
|
||||||
|
|
||||||
bool ParseCompileUnitSupportFiles(
|
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit,
|
||||||
const lldb_private::SymbolContext &sc,
|
lldb_private::FileSpecList &support_files) override;
|
||||||
lldb_private::FileSpecList &support_files) override;
|
|
||||||
|
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override;
|
||||||
|
|
||||||
bool ParseImportedModules(
|
bool ParseImportedModules(
|
||||||
const lldb_private::SymbolContext &sc,
|
const lldb_private::SymbolContext &sc,
|
||||||
|
@ -70,9 +68,6 @@ public:
|
||||||
|
|
||||||
size_t ParseFunctionBlocks(const lldb_private::SymbolContext &sc) override;
|
size_t ParseFunctionBlocks(const lldb_private::SymbolContext &sc) override;
|
||||||
|
|
||||||
size_t
|
|
||||||
ParseTypesForCompileUnit(lldb_private::CompileUnit &comp_unit) override;
|
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
ParseVariablesForContext(const lldb_private::SymbolContext &sc) override;
|
ParseVariablesForContext(const lldb_private::SymbolContext &sc) override;
|
||||||
|
|
||||||
|
|
|
@ -182,9 +182,7 @@ lldb::LanguageType CompileUnit::GetLanguage() {
|
||||||
m_flags.Set(flagsParsedLanguage);
|
m_flags.Set(flagsParsedLanguage);
|
||||||
SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor();
|
SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor();
|
||||||
if (symbol_vendor) {
|
if (symbol_vendor) {
|
||||||
SymbolContext sc;
|
m_language = symbol_vendor->ParseLanguage(*this);
|
||||||
CalculateSymbolContext(&sc);
|
|
||||||
m_language = symbol_vendor->ParseCompileUnitLanguage(sc);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -196,11 +194,8 @@ LineTable *CompileUnit::GetLineTable() {
|
||||||
if (m_flags.IsClear(flagsParsedLineTable)) {
|
if (m_flags.IsClear(flagsParsedLineTable)) {
|
||||||
m_flags.Set(flagsParsedLineTable);
|
m_flags.Set(flagsParsedLineTable);
|
||||||
SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor();
|
SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor();
|
||||||
if (symbol_vendor) {
|
if (symbol_vendor)
|
||||||
SymbolContext sc;
|
symbol_vendor->ParseLineTable(*this);
|
||||||
CalculateSymbolContext(&sc);
|
|
||||||
symbol_vendor->ParseCompileUnitLineTable(sc);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return m_line_table_ap.get();
|
return m_line_table_ap.get();
|
||||||
|
@ -220,9 +215,7 @@ DebugMacros *CompileUnit::GetDebugMacros() {
|
||||||
m_flags.Set(flagsParsedDebugMacros);
|
m_flags.Set(flagsParsedDebugMacros);
|
||||||
SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor();
|
SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor();
|
||||||
if (symbol_vendor) {
|
if (symbol_vendor) {
|
||||||
SymbolContext sc;
|
symbol_vendor->ParseDebugMacros(*this);
|
||||||
CalculateSymbolContext(&sc);
|
|
||||||
symbol_vendor->ParseCompileUnitDebugMacros(sc);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -387,9 +380,7 @@ bool CompileUnit::GetIsOptimized() {
|
||||||
if (m_is_optimized == eLazyBoolCalculate) {
|
if (m_is_optimized == eLazyBoolCalculate) {
|
||||||
m_is_optimized = eLazyBoolNo;
|
m_is_optimized = eLazyBoolNo;
|
||||||
if (SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor()) {
|
if (SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor()) {
|
||||||
SymbolContext sc;
|
if (symbol_vendor->ParseIsOptimized(*this))
|
||||||
CalculateSymbolContext(&sc);
|
|
||||||
if (symbol_vendor->ParseCompileUnitIsOptimized(sc))
|
|
||||||
m_is_optimized = eLazyBoolYes;
|
m_is_optimized = eLazyBoolYes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -419,9 +410,7 @@ FileSpecList &CompileUnit::GetSupportFiles() {
|
||||||
m_flags.Set(flagsParsedSupportFiles);
|
m_flags.Set(flagsParsedSupportFiles);
|
||||||
SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor();
|
SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor();
|
||||||
if (symbol_vendor) {
|
if (symbol_vendor) {
|
||||||
SymbolContext sc;
|
symbol_vendor->ParseSupportFiles(*this, m_support_files);
|
||||||
CalculateSymbolContext(&sc);
|
|
||||||
symbol_vendor->ParseCompileUnitSupportFiles(sc, m_support_files);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,63 +118,62 @@ size_t SymbolVendor::GetNumCompileUnits() {
|
||||||
return m_compile_units.size();
|
return m_compile_units.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
lldb::LanguageType
|
lldb::LanguageType SymbolVendor::ParseLanguage(CompileUnit &comp_unit) {
|
||||||
SymbolVendor::ParseCompileUnitLanguage(const SymbolContext &sc) {
|
|
||||||
ModuleSP module_sp(GetModule());
|
ModuleSP module_sp(GetModule());
|
||||||
if (module_sp) {
|
if (module_sp) {
|
||||||
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
|
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
|
||||||
if (m_sym_file_ap.get())
|
if (m_sym_file_ap.get())
|
||||||
return m_sym_file_ap->ParseCompileUnitLanguage(sc);
|
return m_sym_file_ap->ParseLanguage(comp_unit);
|
||||||
}
|
}
|
||||||
return eLanguageTypeUnknown;
|
return eLanguageTypeUnknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t SymbolVendor::ParseCompileUnitFunctions(const SymbolContext &sc) {
|
size_t SymbolVendor::ParseFunctions(CompileUnit &comp_unit) {
|
||||||
ModuleSP module_sp(GetModule());
|
ModuleSP module_sp(GetModule());
|
||||||
if (module_sp) {
|
if (module_sp) {
|
||||||
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
|
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
|
||||||
if (m_sym_file_ap.get())
|
if (m_sym_file_ap.get())
|
||||||
return m_sym_file_ap->ParseCompileUnitFunctions(sc);
|
return m_sym_file_ap->ParseFunctions(comp_unit);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolVendor::ParseCompileUnitLineTable(const SymbolContext &sc) {
|
bool SymbolVendor::ParseLineTable(CompileUnit &comp_unit) {
|
||||||
ModuleSP module_sp(GetModule());
|
ModuleSP module_sp(GetModule());
|
||||||
if (module_sp) {
|
if (module_sp) {
|
||||||
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
|
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
|
||||||
if (m_sym_file_ap.get())
|
if (m_sym_file_ap.get())
|
||||||
return m_sym_file_ap->ParseCompileUnitLineTable(sc);
|
return m_sym_file_ap->ParseLineTable(comp_unit);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolVendor::ParseCompileUnitDebugMacros(const SymbolContext &sc) {
|
bool SymbolVendor::ParseDebugMacros(CompileUnit &comp_unit) {
|
||||||
ModuleSP module_sp(GetModule());
|
ModuleSP module_sp(GetModule());
|
||||||
if (module_sp) {
|
if (module_sp) {
|
||||||
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
|
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
|
||||||
if (m_sym_file_ap.get())
|
if (m_sym_file_ap.get())
|
||||||
return m_sym_file_ap->ParseCompileUnitDebugMacros(sc);
|
return m_sym_file_ap->ParseDebugMacros(comp_unit);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool SymbolVendor::ParseCompileUnitSupportFiles(const SymbolContext &sc,
|
bool SymbolVendor::ParseSupportFiles(CompileUnit &comp_unit,
|
||||||
FileSpecList &support_files) {
|
FileSpecList &support_files) {
|
||||||
ModuleSP module_sp(GetModule());
|
ModuleSP module_sp(GetModule());
|
||||||
if (module_sp) {
|
if (module_sp) {
|
||||||
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
|
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
|
||||||
if (m_sym_file_ap.get())
|
if (m_sym_file_ap.get())
|
||||||
return m_sym_file_ap->ParseCompileUnitSupportFiles(sc, support_files);
|
return m_sym_file_ap->ParseSupportFiles(comp_unit, support_files);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbolVendor::ParseCompileUnitIsOptimized(const SymbolContext &sc) {
|
bool SymbolVendor::ParseIsOptimized(CompileUnit &comp_unit) {
|
||||||
ModuleSP module_sp(GetModule());
|
ModuleSP module_sp(GetModule());
|
||||||
if (module_sp) {
|
if (module_sp) {
|
||||||
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
|
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
|
||||||
if (m_sym_file_ap.get())
|
if (m_sym_file_ap.get())
|
||||||
return m_sym_file_ap->ParseCompileUnitIsOptimized(sc);
|
return m_sym_file_ap->ParseIsOptimized(comp_unit);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -200,12 +199,12 @@ size_t SymbolVendor::ParseFunctionBlocks(const SymbolContext &sc) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t SymbolVendor::ParseTypesForCompileUnit(CompileUnit &comp_unit) {
|
size_t SymbolVendor::ParseTypes(CompileUnit &comp_unit) {
|
||||||
ModuleSP module_sp(GetModule());
|
ModuleSP module_sp(GetModule());
|
||||||
if (module_sp) {
|
if (module_sp) {
|
||||||
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
|
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
|
||||||
if (m_sym_file_ap.get())
|
if (m_sym_file_ap.get())
|
||||||
return m_sym_file_ap->ParseTypesForCompileUnit(comp_unit);
|
return m_sym_file_ap->ParseTypes(comp_unit);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue