1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-12-25 12:33:42 +01:00

ptrace/access_reg: print out register name on "bad register"

When we have a "bad register", print out the name of that register (if
possible) to aid in debugging.
This commit is contained in:
Cody P Schafer 2012-09-14 17:12:00 -07:00 committed by Arun Sharma
parent f8cfe8388a
commit 10abb25af4

View file

@ -251,7 +251,7 @@ _UPT_access_reg (unw_addr_space_t as, unw_regnum_t reg, unw_word_t *val,
return 0;
badreg:
Debug (1, "bad register number %u (error: %s)\n", reg, strerror (errno));
Debug (1, "bad register %s [%u] (error: %s)\n", unw_regname(reg), reg, strerror (errno));
return -UNW_EBADREG;
}
#elif HAVE_DECL_PT_GETREGS
@ -285,7 +285,7 @@ _UPT_access_reg (unw_addr_space_t as, unw_regnum_t reg, unw_word_t *val,
return 0;
badreg:
Debug (1, "bad register number %u (error: %s)\n", reg, strerror (errno));
Debug (1, "bad register %s [%u] (error: %s)\n", unw_regname(reg), reg, strerror (errno));
return -UNW_EBADREG;
}
#else