summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
Diffstat (limited to 'lldb')
-rw-r--r--lldb/include/lldb/Symbol/Symbol.h4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp37
-rw-r--r--lldb/source/Symbol/Symbol.cpp30
3 files changed, 7 insertions, 64 deletions
diff --git a/lldb/include/lldb/Symbol/Symbol.h b/lldb/include/lldb/Symbol/Symbol.h
index f52c9b42474..60b7052ac9f 100644
--- a/lldb/include/lldb/Symbol/Symbol.h
+++ b/lldb/include/lldb/Symbol/Symbol.h
@@ -114,9 +114,6 @@ public:
void
GetDescription (Stream *s, lldb::DescriptionLevel level, Target *target) const;
- Function *
- GetFunction ();
-
Address &
GetValue () { return m_addr_range.GetBaseAddress(); }
@@ -203,7 +200,6 @@ protected:
m_searched_for_function:1;// non-zero if we have looked for the function associated with this symbol already.
AddressRange m_addr_range; // Contains the value, or the section offset address when the value is an address in a section, and the size (if any)
uint32_t m_flags; // A copy of the flags from the original symbol table, the ObjectFile plug-in can interpret these
- Function * m_function;
};
} // namespace lldb_private
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index f9453afd0f3..7beadf88c34 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -659,39 +659,6 @@ SymbolFileDWARF::ParseCompileUnitFunction (const SymbolContext& sc, DWARFCompile
if (die->Tag() != DW_TAG_subprogram)
return NULL;
-// clang::DeclContext *containing_decl_ctx = GetClangDeclContextContainingDIE (dwarf_cu, die);
-// const clang::Decl::Kind containing_decl_kind = containing_decl_ctx->getDeclKind();
-//
-// switch (containing_decl_kind)
-// {
-// case clang::Decl::Record:
-// case clang::Decl::CXXRecord:
-// case clang::Decl::ObjCClass:
-// case clang::Decl::ObjCImplementation:
-// case clang::Decl::ObjCInterface:
-// // We have methods of a class or struct
-// {
-// const DWARFDebugInfoEntry *containing_decl_die = m_decl_ctx_to_die[containing_decl_ctx];
-// assert (containing_decl_die);
-// Type *class_type = ResolveType (dwarf_cu, containing_decl_die);
-// if (class_type)
-// class_type->GetClangFullType();
-// // Make sure the class definition contains the funciton DIE
-// // we wanted to parse. If it does, we are done. Else, we need
-// // to fall through and parse the function DIE stil...
-// if (containing_decl_die->Contains (die))
-// break; // DIE has been parsed, we are done
-// }
-// // Fall through...
-//
-// default:
-// // Parse the function prototype as a type that can then be added to concrete function instance
-// //ParseTypes (sc, dwarf_cu, die, false, false);
-// break;
-// }
-
- //FixupTypes();
-
if (die->GetDIENamesAndRanges(this, dwarf_cu, name, mangled, func_ranges, decl_file, decl_line, decl_column, call_file, call_line, call_column, &frame_base))
{
// Union of all ranges in the function DIE (if the function is discontiguous)
@@ -720,6 +687,7 @@ SymbolFileDWARF::ParseCompileUnitFunction (const SymbolContext& sc, DWARFCompile
decl_line,
decl_column));
+ // Supply the type _only_ if it has already been parsed
Type *func_type = m_die_to_type.lookup (die);
assert(func_type == NULL || func_type != DIE_IS_BEING_PARSED);
@@ -735,7 +703,8 @@ SymbolFileDWARF::ParseCompileUnitFunction (const SymbolContext& sc, DWARFCompile
if (func_sp.get() != NULL)
{
- func_sp->GetFrameBaseExpression() = frame_base;
+ if (frame_base.IsValid())
+ func_sp->GetFrameBaseExpression() = frame_base;
sc.comp_unit->AddFunction(func_sp);
return func_sp.get();
}
diff --git a/lldb/source/Symbol/Symbol.cpp b/lldb/source/Symbol/Symbol.cpp
index 27780a939ad..b764bada554 100644
--- a/lldb/source/Symbol/Symbol.cpp
+++ b/lldb/source/Symbol/Symbol.cpp
@@ -33,8 +33,7 @@ Symbol::Symbol() :
m_size_is_synthesized (false),
m_searched_for_function (false),
m_addr_range (),
- m_flags (),
- m_function (NULL)
+ m_flags ()
{
}
@@ -66,8 +65,7 @@ Symbol::Symbol
m_size_is_synthesized (false),
m_searched_for_function (false),
m_addr_range (section, offset, size),
- m_flags (flags),
- m_function (NULL)
+ m_flags (flags)
{
}
@@ -97,8 +95,7 @@ Symbol::Symbol
m_size_is_synthesized (false),
m_searched_for_function (false),
m_addr_range (range),
- m_flags (flags),
- m_function (NULL)
+ m_flags (flags)
{
}
@@ -116,8 +113,7 @@ Symbol::Symbol(const Symbol& rhs):
m_size_is_synthesized (false),
m_searched_for_function (false),
m_addr_range (rhs.m_addr_range),
- m_flags (rhs.m_flags),
- m_function (NULL)
+ m_flags (rhs.m_flags)
{
}
@@ -140,7 +136,6 @@ Symbol::operator= (const Symbol& rhs)
m_searched_for_function = rhs.m_searched_for_function;
m_addr_range = rhs.m_addr_range;
m_flags = rhs.m_flags;
- m_function = rhs.m_function;
}
return *this;
}
@@ -252,23 +247,6 @@ Symbol::Dump(Stream *s, Target *target, uint32_t index) const
}
}
-Function *
-Symbol::GetFunction ()
-{
- if (m_function == NULL && !m_searched_for_function)
- {
- m_searched_for_function = true;
- Module *module = m_addr_range.GetBaseAddress().GetModule();
- if (module)
- {
- SymbolContext sc;
- if (module->ResolveSymbolContextForAddress(m_addr_range.GetBaseAddress(), eSymbolContextFunction, sc))
- m_function = sc.function;
- }
- }
- return m_function;
-}
-
uint32_t
Symbol::GetPrologueByteSize ()
{
OpenPOWER on IntegriCloud