diff options
| author | Greg Clayton <gclayton@apple.com> | 2010-11-11 20:13:30 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2010-11-11 20:13:30 +0000 |
| commit | c3b849970d3829caa374e7bd798ab2c2cad8ad04 (patch) | |
| tree | 28a1a4b978f077f3bf6226609eaff2945acd3820 /lldb/source/Symbol/Function.cpp | |
| parent | c33f28bf90d42824de226b76ffde33e706d42c33 (diff) | |
| download | bcm5719-llvm-c3b849970d3829caa374e7bd798ab2c2cad8ad04.tar.gz bcm5719-llvm-c3b849970d3829caa374e7bd798ab2c2cad8ad04.zip | |
Fixed an issue with Function::GetPrologueByteSize() where if a function's first line table entry didn't have the same address as the start address of the function itself, we could end up returning and incorrect value.
llvm-svn: 118830
Diffstat (limited to 'lldb/source/Symbol/Function.cpp')
| -rw-r--r-- | lldb/source/Symbol/Function.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp index 52b135673d1..e89782dd3c2 100644 --- a/lldb/source/Symbol/Function.cpp +++ b/lldb/source/Symbol/Function.cpp @@ -500,7 +500,16 @@ Function::GetPrologueByteSize () { LineEntry line_entry; if (line_table->FindLineEntryByAddress(GetAddressRange().GetBaseAddress(), line_entry)) - m_prologue_byte_size = line_entry.range.GetByteSize(); + { + // We need to take the delta of the end of the first line entry + // as a file address and the start file address of the function + // in case the first line entry doesn't start at the beginning + // of the function. + const addr_t func_start_file_addr = m_range.GetBaseAddress().GetFileAddress(); + const addr_t line_entry_end_file_addr = line_entry.range.GetBaseAddress().GetFileAddress() + line_entry.range.GetByteSize(); + if (line_entry_end_file_addr > func_start_file_addr) + m_prologue_byte_size = line_entry_end_file_addr - func_start_file_addr; + } } } return m_prologue_byte_size; |

