diff options
author | Greg Clayton <gclayton@apple.com> | 2011-12-10 21:05:26 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-12-10 21:05:26 +0000 |
commit | 6f6bf26a3e8e5baeec72aad1a68f384c0a9264dd (patch) | |
tree | f602656ba7ae12d1c288b3abdaa86d0eb9f9f5f8 /lldb/source/Core/SourceManager.cpp | |
parent | 53d2fb0aa26bc73c89bae3c74afd103f28602c65 (diff) | |
download | bcm5719-llvm-6f6bf26a3e8e5baeec72aad1a68f384c0a9264dd.tar.gz bcm5719-llvm-6f6bf26a3e8e5baeec72aad1a68f384c0a9264dd.zip |
<rdar://problem/9958446>
<rdar://problem/10561406>
Stopped the SymbolFileDWARF::FindFunctions (...) from always calculating
the line table entry for all functions that were found. This can slow down
the expression parser if it ends up finding a bunch of matches. Fixed the
places that were relying on the line table entry being filled in.
Discovered a recursive stack blowout that happened when "main" didn't have
line info for it and there was no line information for "main"
llvm-svn: 146330
Diffstat (limited to 'lldb/source/Core/SourceManager.cpp')
-rw-r--r-- | lldb/source/Core/SourceManager.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
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 |