fix typos and compilation warnings

This commit is contained in:
trodrigues 2023-12-09 09:37:14 -06:00
parent e80e1d2484
commit 8503f32b36
2 changed files with 5 additions and 7 deletions

View File

@ -4275,7 +4275,7 @@ dwarf_fileline (struct backtrace_state *state, uintptr_t pc,
{ {
struct dwarf_data *ddata; struct dwarf_data *ddata;
int found; int found;
int ret; int ret = 0;
if (!state->threaded) if (!state->threaded)
{ {

View File

@ -7364,8 +7364,6 @@ FastVector<ElfAddrRange> s_sortedKnownElfRanges(16);
static int address_in_known_elf_ranges(uintptr_t pc) static int address_in_known_elf_ranges(uintptr_t pc)
{ {
size_t range_count = s_sortedKnownElfRanges.size();
auto it = std::lower_bound( s_sortedKnownElfRanges.begin(), s_sortedKnownElfRanges.end(), pc, auto it = std::lower_bound( s_sortedKnownElfRanges.begin(), s_sortedKnownElfRanges.end(), pc,
[]( const ElfAddrRange& lhs, const uintptr_t rhs ) { return uintptr_t(lhs.dlpi_addr) > rhs; } ); []( const ElfAddrRange& lhs, const uintptr_t rhs ) { return uintptr_t(lhs.dlpi_addr) > rhs; } );
if( it != s_sortedKnownElfRanges.end() && pc <= it->dlpi_end_addr ) if( it != s_sortedKnownElfRanges.end() && pc <= it->dlpi_end_addr )
@ -7394,10 +7392,10 @@ phdr_callback_mock (struct dl_phdr_info *info, size_t size ATTRIBUTE_UNUSED,
else ptr->dlpi_name = nullptr; else ptr->dlpi_name = nullptr;
ptr->dlpi_addr = info->dlpi_addr; ptr->dlpi_addr = info->dlpi_addr;
// calculate the address range so we can quickly determine is a PC is within the range of this image // calculate the end address as well, so we can quickly determine if a PC is within the range of this image
ptr->dlpi_end_addr = info->dlpi_phnum ? uintptr_t( info->dlpi_addr + ptr->dlpi_end_addr = uintptr_t(info->dlpi_addr) + (info->dlpi_phnum ? uintptr_t(
info->dlpi_phdr[info->dlpi_phnum - 1].p_vaddr + info->dlpi_phdr[info->dlpi_phnum - 1].p_vaddr +
info->dlpi_phdr[info->dlpi_phnum - 1].p_memsz ) : 0x0; info->dlpi_phdr[info->dlpi_phnum - 1].p_memsz) : 0);
return 0; return 0;
} }