[Lldb-commits] [lldb] r155579 - /lldb/trunk/source/Symbol/Function.cpp
Jim Ingham
jingham at apple.com
Wed Apr 25 12:48:30 PDT 2012
Author: jingham
Date: Wed Apr 25 14:48:30 2012
New Revision: 155579
URL: http://llvm.org/viewvc/llvm-project?rev=155579&view=rev
Log:
Make sure the end of the first line is still within the function, and if not, don't push the prologue past it.
rdar://problem/11271074
Modified:
lldb/trunk/source/Symbol/Function.cpp
Modified: lldb/trunk/source/Symbol/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Function.cpp?rev=155579&r1=155578&r2=155579&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Function.cpp (original)
+++ lldb/trunk/source/Symbol/Function.cpp Wed Apr 25 14:48:30 2012
@@ -564,7 +564,12 @@
// 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)
+ // Watch out for the case where the end of the first line is at or past the end of the function, in that
+ // case, set the prologue byte size to 0. This happens, for instance, with a function that is one
+ // instruction long...
+ if (!GetAddressRange().ContainsFileAddress(line_entry_end_file_addr))
+ m_prologue_byte_size = 0;
+ else if (line_entry_end_file_addr > func_start_file_addr)
m_prologue_byte_size = line_entry_end_file_addr - func_start_file_addr;
}
}
More information about the lldb-commits
mailing list