From 10abb25af46c4b452d65d55fd7a16f74a4184897 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Fri, 14 Sep 2012 17:12:00 -0700 Subject: [PATCH] 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. --- src/ptrace/_UPT_access_reg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ptrace/_UPT_access_reg.c b/src/ptrace/_UPT_access_reg.c index 00ba0cc7..99949b25 100644 --- a/src/ptrace/_UPT_access_reg.c +++ b/src/ptrace/_UPT_access_reg.c @@ -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