Skip to content

Commit

Permalink
backtrace: Break when reaching ip of 0
Browse files Browse the repository at this point in the history
All backtraces end with ip of 0 for some reason, which will be printed
as 0xffffffffffffffff (we print ip - 1). Drop it to reduce noise.
  • Loading branch information
tgrabiec committed Jan 13, 2017
1 parent 4579fa7 commit 5b92ed8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions util/backtrace.hh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ void backtrace(Func&& func) noexcept(noexcept(func(0))) {
if (unw_get_reg(&cursor, UNW_REG_IP, &ip) < 0) {
break;
}
if (!ip) {
break;
}
func(ip);
}
}
Expand Down

0 comments on commit 5b92ed8

Please sign in to comment.