Skip to content

Commit 2b7e15a

Browse files
committed
add comment
1 parent 9874a78 commit 2b7e15a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lldb/source/Symbol/Function.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,10 @@ uint32_t Function::GetPrologueByteSize() {
664664

665665
AddressRange entry_range;
666666
m_block.GetRangeContainingAddress(m_address, entry_range);
667-
const addr_t range_start_file_addr = m_address.GetFileAddress();
667+
668+
// Deliberately not starting at entry_range.GetBaseAddress() because the
669+
// function entry point need not be the first address in the range.
670+
const addr_t func_start_file_addr = m_address.GetFileAddress();
668671
const addr_t range_end_file_addr =
669672
entry_range.GetBaseAddress().GetFileAddress() +
670673
entry_range.GetByteSize();
@@ -694,11 +697,11 @@ uint32_t Function::GetPrologueByteSize() {
694697
}
695698
}
696699

697-
// Verify that this prologue end file address in the function's address
698-
// range just to be sure
699-
if (range_start_file_addr < prologue_end_file_addr &&
700+
// Verify that this prologue end file address inside the function just
701+
// to be sure
702+
if (func_start_file_addr < prologue_end_file_addr &&
700703
prologue_end_file_addr < range_end_file_addr) {
701-
m_prologue_byte_size = prologue_end_file_addr - range_start_file_addr;
704+
m_prologue_byte_size = prologue_end_file_addr - func_start_file_addr;
702705
}
703706

704707
if (prologue_end_file_addr < line_zero_end_file_addr &&

0 commit comments

Comments
 (0)