diff options
Diffstat (limited to 'debuggerd/utility.c')
-rw-r--r-- | debuggerd/utility.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/debuggerd/utility.c b/debuggerd/utility.c index 2afdb46..409209c 100644 --- a/debuggerd/utility.c +++ b/debuggerd/utility.c @@ -17,6 +17,7 @@ #include <sys/ptrace.h> #include <sys/exec_elf.h> +#include <signal.h> #include <assert.h> #include <string.h> #include <errno.h> @@ -82,3 +83,20 @@ const mapinfo *pc_to_mapinfo(mapinfo *mi, unsigned pc, unsigned *rel_pc) } return NULL; } + +/* + * Returns true if the specified signal has an associated address (i.e. it + * sets siginfo_t.si_addr). + */ +bool signal_has_address(int sig) +{ + switch (sig) { + case SIGILL: + case SIGFPE: + case SIGSEGV: + case SIGBUS: + return true; + default: + return false; + } +} |