summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/Core/Address.h14
-rw-r--r--lldb/source/Core/Address.cpp14
-rw-r--r--lldb/source/Core/SourceManager.cpp19
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp17
4 files changed, 25 insertions, 39 deletions
diff --git a/lldb/include/lldb/Core/Address.h b/lldb/include/lldb/Core/Address.h
index 0db2eb9bdf3..1b82346aa18 100644
--- a/lldb/include/lldb/Core/Address.h
+++ b/lldb/include/lldb/Core/Address.h
@@ -498,25 +498,25 @@ public:
//------------------------------------------------------------------
uint32_t
CalculateSymbolContext (SymbolContext *sc,
- uint32_t resolve_scope = lldb::eSymbolContextEverything);
+ uint32_t resolve_scope = lldb::eSymbolContextEverything) const;
Module *
- CalculateSymbolContextModule ();
+ CalculateSymbolContextModule () const;
CompileUnit *
- CalculateSymbolContextCompileUnit ();
+ CalculateSymbolContextCompileUnit () const;
Function *
- CalculateSymbolContextFunction ();
+ CalculateSymbolContextFunction () const;
Block *
- CalculateSymbolContextBlock ();
+ CalculateSymbolContextBlock () const;
Symbol *
- CalculateSymbolContextSymbol ();
+ CalculateSymbolContextSymbol () const;
bool
- CalculateSymbolContextLineEntry (LineEntry &line_entry);
+ CalculateSymbolContextLineEntry (LineEntry &line_entry) const;
protected:
//------------------------------------------------------------------
diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp
index 89131caddea..2ea3bb17312 100644
--- a/lldb/source/Core/Address.cpp
+++ b/lldb/source/Core/Address.cpp
@@ -729,7 +729,7 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum
}
uint32_t
-Address::CalculateSymbolContext (SymbolContext *sc, uint32_t resolve_scope)
+Address::CalculateSymbolContext (SymbolContext *sc, uint32_t resolve_scope) const
{
sc->Clear();
// Absolute addresses don't have enough information to reconstruct even their target.
@@ -747,7 +747,7 @@ Address::CalculateSymbolContext (SymbolContext *sc, uint32_t resolve_scope)
}
Module *
-Address::CalculateSymbolContextModule ()
+Address::CalculateSymbolContextModule () const
{
if (m_section)
return m_section->GetModule();
@@ -755,7 +755,7 @@ Address::CalculateSymbolContextModule ()
}
CompileUnit *
-Address::CalculateSymbolContextCompileUnit ()
+Address::CalculateSymbolContextCompileUnit () const
{
if (m_section)
{
@@ -771,7 +771,7 @@ Address::CalculateSymbolContextCompileUnit ()
}
Function *
-Address::CalculateSymbolContextFunction ()
+Address::CalculateSymbolContextFunction () const
{
if (m_section)
{
@@ -787,7 +787,7 @@ Address::CalculateSymbolContextFunction ()
}
Block *
-Address::CalculateSymbolContextBlock ()
+Address::CalculateSymbolContextBlock () const
{
if (m_section)
{
@@ -803,7 +803,7 @@ Address::CalculateSymbolContextBlock ()
}
Symbol *
-Address::CalculateSymbolContextSymbol ()
+Address::CalculateSymbolContextSymbol () const
{
if (m_section)
{
@@ -819,7 +819,7 @@ Address::CalculateSymbolContextSymbol ()
}
bool
-Address::CalculateSymbolContextLineEntry (LineEntry &line_entry)
+Address::CalculateSymbolContextLineEntry (LineEntry &line_entry) const
{
if (m_section)
{
diff --git a/lldb/source/Core/SourceManager.cpp b/lldb/source/Core/SourceManager.cpp
index 482ccbbcdb0..3e4a78ac68e 100644
--- a/lldb/source/Core/SourceManager.cpp
+++ b/lldb/source/Core/SourceManager.cpp
@@ -250,19 +250,22 @@ SourceManager::GetDefaultFileAndLine (FileSpec &file_spec, uint32_t &line)
{
SymbolContext sc;
sc_list.GetContextAtIndex(idx, sc);
- if (sc.line_entry.file)
+ if (sc.function)
{
- SetDefaultFileAndLine(sc.line_entry.file, sc.line_entry.line);
- break;
+ lldb_private::LineEntry line_entry;
+ if (sc.function->GetAddressRange().GetBaseAddress().CalculateSymbolContextLineEntry (line_entry))
+ {
+ SetDefaultFileAndLine (line_entry.file,
+ line_entry.line);
+ file_spec = m_last_file_sp->GetFileSpec();
+ line = m_last_file_line;
+ return true;
+ }
}
}
- return GetDefaultFileAndLine (file_spec, line);
}
- else
- return false;
}
- else
- return false;
+ return false;
}
void
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 50b4bc60d4c..c3573bc8253 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1997,11 +1997,6 @@ SymbolFileDWARF::ResolveSymbolContext (const Address& so_addr, uint32_t resolve_
if (resolve_scope & eSymbolContextLineEntry)
{
LineTable *line_table = sc.comp_unit->GetLineTable();
- if (line_table == NULL)
- {
- if (ParseCompileUnitLineTable(sc))
- line_table = sc.comp_unit->GetLineTable();
- }
if (line_table != NULL)
{
if (so_addr.IsLinkedAddress())
@@ -2560,18 +2555,6 @@ SymbolFileDWARF::ResolveFunction (DWARFCompileUnit *cu,
if (addr.IsValid())
{
-
- // We found the function, so we should find the line table
- // and line table entry as well
- LineTable *line_table = sc.comp_unit->GetLineTable();
- if (line_table == NULL)
- {
- if (ParseCompileUnitLineTable(sc))
- line_table = sc.comp_unit->GetLineTable();
- }
- if (line_table != NULL)
- line_table->FindLineEntryByAddress (addr, sc.line_entry);
-
sc_list.Append(sc);
return true;
}
OpenPOWER on IntegriCloud