[Lldb-commits] [lldb] r157217 - /lldb/trunk/source/Symbol/CompileUnit.cpp
Jim Ingham
jingham at apple.com
Mon May 21 16:06:47 PDT 2012
Author: jingham
Date: Mon May 21 18:06:47 2012
New Revision: 157217
URL: http://llvm.org/viewvc/llvm-project?rev=157217&view=rev
Log:
CompileUnit::ResolveSymbolContext was only filling in the LineEntry regardless of what was passed in for "resolve_scope". I fixed that.
Modified:
lldb/trunk/source/Symbol/CompileUnit.cpp
Modified: lldb/trunk/source/Symbol/CompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompileUnit.cpp?rev=157217&r1=157216&r2=157217&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/CompileUnit.cpp (original)
+++ lldb/trunk/source/Symbol/CompileUnit.cpp Mon May 21 18:06:47 2012
@@ -336,18 +336,30 @@
// We only have a single support file that matches, so use
// the line table function that searches for a line entries
// that match a single support file index
- line_idx = line_table->FindLineEntryIndexByFileIndex (0, file_indexes.front(), line, exact, &sc.line_entry);
+ LineEntry line_entry;
+ line_idx = line_table->FindLineEntryIndexByFileIndex (0, file_indexes.front(), line, exact, &line_entry);
// If "exact == true", then "found_line" will be the same
// as "line". If "exact == false", the "found_line" will be the
// closest line entry with a line number greater than "line" and
// we will use this for our subsequent line exact matches below.
- found_line = sc.line_entry.line;
+ found_line = line_entry.line;
while (line_idx != UINT32_MAX)
{
+ // If they only asked for the line entry, then we're done, we can just copy that over.
+ // But if they wanted more than just the line number, fill it in.
+ if (resolve_scope == eSymbolContextLineEntry)
+ {
+ sc.line_entry = line_entry;
+ }
+ else
+ {
+ line_entry.range.GetBaseAddress().CalculateSymbolContext(&sc, resolve_scope);
+ }
+
sc_list.Append(sc);
- line_idx = line_table->FindLineEntryIndexByFileIndex (line_idx + 1, file_indexes.front(), found_line, true, &sc.line_entry);
+ line_idx = line_table->FindLineEntryIndexByFileIndex (line_idx + 1, file_indexes.front(), found_line, true, &line_entry);
}
}
else
@@ -355,18 +367,28 @@
// We found multiple support files that match "file_spec" so use
// the line table function that searches for a line entries
// that match a multiple support file indexes.
- line_idx = line_table->FindLineEntryIndexByFileIndex (0, file_indexes, line, exact, &sc.line_entry);
+ LineEntry line_entry;
+ line_idx = line_table->FindLineEntryIndexByFileIndex (0, file_indexes, line, exact, &line_entry);
// If "exact == true", then "found_line" will be the same
// as "line". If "exact == false", the "found_line" will be the
// closest line entry with a line number greater than "line" and
// we will use this for our subsequent line exact matches below.
- found_line = sc.line_entry.line;
+ found_line = line_entry.line;
while (line_idx != UINT32_MAX)
{
+ if (resolve_scope == eSymbolContextLineEntry)
+ {
+ sc.line_entry = line_entry;
+ }
+ else
+ {
+ line_entry.range.GetBaseAddress().CalculateSymbolContext(&sc, resolve_scope);
+ }
+
sc_list.Append(sc);
- line_idx = line_table->FindLineEntryIndexByFileIndex (line_idx + 1, file_indexes, found_line, true, &sc.line_entry);
+ line_idx = line_table->FindLineEntryIndexByFileIndex (line_idx + 1, file_indexes, found_line, true, &line_entry);
}
}
}
More information about the lldb-commits
mailing list