fprintf(stderr, "[pid %d][Backtrace]\n", pid_);
uint32_t index = 0;
- Print(cursor, index++);
+ Print(&cursor, index++);
- while (unw_step(&cursor) > 0) Print(cursor, index++);
+ while (unw_step(&cursor) > 0) Print(&cursor, index++);
fflush(stderr);
}
private:
- void Print(unw_cursor_t cursor, uint32_t index) {
+ void Print(unw_cursor_t* cursor, uint32_t index) {
char func_name[256];
unw_word_t pc;
- unw_get_reg(&cursor, UNW_REG_IP, &pc);
+ unw_get_reg(cursor, UNW_REG_IP, &pc);
unw_word_t offset;
- if (!unw_get_proc_name(&cursor, func_name, sizeof(func_name), &offset)) {
+ if (!unw_get_proc_name(cursor, func_name, sizeof(func_name), &offset)) {
fprintf(stderr, "[pid %d][%03u] 0x%zx: %s + 0x%zx [%s]\n", pid_, index, pc,
func_name, offset, GetModuleName(pc));
} else {