diff --git a/src/eh_elf/eh_elf.c b/src/eh_elf/eh_elf.c index 853fb5cc..8d01aa7b 100644 --- a/src/eh_elf/eh_elf.c +++ b/src/eh_elf/eh_elf.c @@ -97,6 +97,7 @@ int set_dwarf_loc_ifdef( int eh_elf_step_cursor(struct cursor *cursor) { uintptr_t ip = cursor->dwarf.ip; +#ifdef DEBUG { uintptr_t dbp; dwarf_get(&cursor->dwarf, cursor->dwarf.loc[UNW_TDEP_BP], &dbp); @@ -104,6 +105,7 @@ int eh_elf_step_cursor(struct cursor *cursor) { DWARF_IS_NULL_LOC(cursor->dwarf.loc[UNW_TDEP_BP])?" [NULL]":"", cursor->dwarf.cfa, cursor->dwarf.ip); } +#endif // Retrieve memory map entry mmap_entry_t* mmap_entry = mmap_get_entry(ip); diff --git a/src/x86_64/Gstep.c b/src/x86_64/Gstep.c index d4e48090..46912768 100644 --- a/src/x86_64/Gstep.c +++ b/src/x86_64/Gstep.c @@ -62,12 +62,14 @@ typedef struct { unw_word_t orig_cfa; } unw_step_call_data; +#ifdef DEBUG static int unw_step_id(unw_step_call_data *call_data) { return ( ((call_data->orig_ip + call_data->orig_ip * 257) % 1000003) + (1000003 * init_id)) % (1000000007); } +#endif #define UnwDebug(lvl, fmt, ...) Debug(lvl, "[%X] <%d> {%d} " fmt, unw_step_id(&_step_id_data), init_id, __LINE__, ##__VA_ARGS__) @@ -75,11 +77,14 @@ PROTECTED int unw_step (unw_cursor_t *cursor) { struct cursor *c = (struct cursor *) cursor; +#ifdef DEBUG unw_step_call_data _step_id_data; _step_id_data.orig_ip = c->dwarf.ip; _step_id_data.orig_cfa = c->dwarf.cfa; +#endif UnwDebug(3, "unw_step called\n"); +#ifdef DEBUG { uintptr_t dbp; dwarf_get(&c->dwarf, c->dwarf.loc[RBP], &dbp); @@ -87,6 +92,7 @@ unw_step (unw_cursor_t *cursor) DWARF_IS_NULL_LOC(c->dwarf.loc[RBP])? " [NULL]": "", c->dwarf.cfa, c->dwarf.ip); } +#endif struct timespec _timer_start = chrono_start(); int ret, i;