Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Revert "Fix missing line numbers on i686."
This reverts commit aa6bd11.
  • Loading branch information
alexcrichton committed Nov 4, 2017
commit 483da44fa0e16f85a66e2f1f303847846ead4544
13 changes: 7 additions & 6 deletions src/libbacktrace/macho.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* macho.c -- Get debug data from an Mach-O file for backtraces.
Copyright (C) 2012-2016 Free Software Foundation, Inc.
Written by John Colanduoni.

Pending upstream pull request:
https://github.com/ianlancetaylor/libbacktrace/pull/2

Expand Down Expand Up @@ -288,7 +288,7 @@ macho_get_commands (struct backtrace_state *state, int descriptor,

archs_total_size = arch_count * sizeof (struct fat_arch);

if (!backtrace_get_view (state, descriptor, sizeof (struct fat_header),
if (!backtrace_get_view (state, descriptor, sizeof (fat_header),
archs_total_size, error_callback,
data, &fat_archs_view))
goto end;
Expand Down Expand Up @@ -1361,7 +1361,7 @@ backtrace_initialize (struct backtrace_state *state, int descriptor,
current_vmslide = _dyld_get_image_vmaddr_slide (i);
current_name = _dyld_get_image_name (i);

if (current_name == NULL || (i != 0 && current_vmslide == 0))
if (current_name == NULL)
continue;

if (!(current_descriptor =
Expand All @@ -1370,15 +1370,16 @@ backtrace_initialize (struct backtrace_state *state, int descriptor,
continue;
}

if (macho_add (state, error_callback, data, current_descriptor,
if (!macho_add (state, error_callback, data, current_descriptor,
current_name, &macho_fileline_fn, current_vmslide,
&current_found_sym, &current_found_dwarf))
{
found_sym = found_sym || current_found_sym;
found_dwarf = found_dwarf || current_found_dwarf;
return 0;
}

backtrace_close (current_descriptor, error_callback, data);
found_sym = found_sym || current_found_sym;
found_dwarf = found_dwarf || current_found_dwarf;
}

if (!state->threaded)
Expand Down