summaryrefslogtreecommitdiffstats
path: root/lldb/source/Symbol/Function.cpp
diff options
context:
space:
mode:
authorMichael Sartain <mikesart@valvesoftware.com>2013-07-01 19:45:50 +0000
committerMichael Sartain <mikesart@valvesoftware.com>2013-07-01 19:45:50 +0000
commita7499c98301e847d2e525921801e1edcc44e34da (patch)
tree4b78835f6badd7ce118ed5175279f4efc26f0c80 /lldb/source/Symbol/Function.cpp
parent82bedb1f3ba396b32b0f2275e5e1003e4b143398 (diff)
downloadbcm5719-llvm-a7499c98301e847d2e525921801e1edcc44e34da.tar.gz
bcm5719-llvm-a7499c98301e847d2e525921801e1edcc44e34da.zip
Split symbol support for ELF and Linux.
llvm-svn: 185366
Diffstat (limited to 'lldb/source/Symbol/Function.cpp')
-rw-r--r--lldb/source/Symbol/Function.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp
index c42b0cfd770..594cb3922e6 100644
--- a/lldb/source/Symbol/Function.cpp
+++ b/lldb/source/Symbol/Function.cpp
@@ -568,9 +568,9 @@ Function::GetPrologueByteSize ()
// Check the first few instructions and look for one that has
// is_prologue_end set to true.
const uint32_t last_line_entry_idx = first_line_entry_idx + 6;
- LineEntry line_entry;
for (uint32_t idx = first_line_entry_idx + 1; idx < last_line_entry_idx; ++idx)
{
+ LineEntry line_entry;
if (line_table->GetLineEntryAtIndex (idx, line_entry))
{
if (line_entry.is_prologue_end)
@@ -581,12 +581,31 @@ Function::GetPrologueByteSize ()
}
}
}
-
+
// If we didn't find the end of the prologue in the line tables,
// then just use the end address of the first line table entry
if (prologue_end_file_addr == LLDB_INVALID_ADDRESS)
{
- prologue_end_file_addr = first_line_entry.range.GetBaseAddress().GetFileAddress() + first_line_entry.range.GetByteSize();
+ // Check the first few instructions and look for one that has
+ // a line number that's different than the first entry.
+ const uint32_t last_line_entry_idx = first_line_entry_idx + 6;
+ for (uint32_t idx = first_line_entry_idx + 1; idx < last_line_entry_idx; ++idx)
+ {
+ LineEntry line_entry;
+ if (line_table->GetLineEntryAtIndex (idx, line_entry))
+ {
+ if (line_entry.line != first_line_entry.line)
+ {
+ prologue_end_file_addr = line_entry.range.GetBaseAddress().GetFileAddress();
+ break;
+ }
+ }
+ }
+
+ if (prologue_end_file_addr == LLDB_INVALID_ADDRESS)
+ {
+ prologue_end_file_addr = first_line_entry.range.GetBaseAddress().GetFileAddress() + first_line_entry.range.GetByteSize();
+ }
}
const addr_t func_start_file_addr = m_range.GetBaseAddress().GetFileAddress();
const addr_t func_end_file_addr = func_start_file_addr + m_range.GetByteSize();
OpenPOWER on IntegriCloud