Skip to content

Commit

Permalink
fix typos and compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
trodrigues committed Dec 9, 2023
1 parent e80e1d2 commit 8503f32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion public/libbacktrace/dwarf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4275,7 +4275,7 @@ dwarf_fileline (struct backtrace_state *state, uintptr_t pc,
{
struct dwarf_data *ddata;
int found;
int ret;
int ret = 0;

if (!state->threaded)
{
Expand Down
10 changes: 4 additions & 6 deletions public/libbacktrace/elf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7364,8 +7364,6 @@ FastVector<ElfAddrRange> s_sortedKnownElfRanges(16);

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,
[]( const ElfAddrRange& lhs, const uintptr_t rhs ) { return uintptr_t(lhs.dlpi_addr) > rhs; } );
if( it != s_sortedKnownElfRanges.end() && pc <= it->dlpi_end_addr )
Expand Down Expand Up @@ -7394,10 +7392,10 @@ phdr_callback_mock (struct dl_phdr_info *info, size_t size ATTRIBUTE_UNUSED,
else ptr->dlpi_name = nullptr;
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
ptr->dlpi_end_addr = info->dlpi_phnum ? uintptr_t( info->dlpi_addr +
info->dlpi_phdr[info->dlpi_phnum - 1].p_vaddr +
info->dlpi_phdr[info->dlpi_phnum - 1].p_memsz ) : 0x0;
// 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 = 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_memsz) : 0);

return 0;
}
Expand Down

0 comments on commit 8503f32

Please sign in to comment.