#endif
extern const char *signame(const int);
+extern const char *sprintsigname(const int);
extern void pathtrace_select_set(const char *, struct path_set *);
extern bool pathtrace_match_set(struct tcb *, struct path_set *);
return buf;
}
+const char *
+sprintsigname(const int sig)
+{
+ const char *str = signame(sig);
+
+ if (str)
+ return str;
+
+ static char buf[sizeof(sig) * 3 + 2];
+
+ xsprintf(buf, "%d", sig);
+
+ return buf;
+}
+
static unsigned int
popcount32(const uint32_t *a, unsigned int size)
{
if (WIFSIGNALED(status))
xsprintf(buf, "WIFSIGNALED,%ssig=%s",
WCOREDUMP(status) ? "core," : "",
- signame(WTERMSIG(status)));
+ sprintsigname(WTERMSIG(status)));
if (WIFEXITED(status))
xsprintf(buf, "WIFEXITED,exitcode=%u", WEXITSTATUS(status));
if (WIFSTOPPED(status))
- xsprintf(buf, "WIFSTOPPED,sig=%s", signame(WSTOPSIG(status)));
+ xsprintf(buf, "WIFSTOPPED,sig=%s",
+ sprintsigname(WSTOPSIG(status)));
evbuf[0] = '\0';
if (event != 0) {
static const char *const event_names[] = {
&& is_number_in_set(WTERMSIG(status), signal_set)) {
printleader(tcp);
tprintf("+++ killed by %s %s+++\n",
- signame(WTERMSIG(status)),
+ sprintsigname(WTERMSIG(status)),
WCOREDUMP(status) ? "(core dumped) " : "");
line_ended();
}
&& is_number_in_set(sig, signal_set)) {
printleader(tcp);
if (si) {
- tprintf("--- %s ", signame(sig));
+ tprintf("--- %s ", sprintsigname(sig));
printsiginfo(si);
tprints(" ---\n");
} else
- tprintf("--- stopped by %s ---\n", signame(sig));
+ tprintf("--- stopped by %s ---\n", sprintsigname(sig));
line_ended();
#ifdef ENABLE_STACKTRACE
if (WIFSTOPPED(status)) {
int sig = WSTOPSIG(status);
tprintf("[{WIFSTOPPED(s) && WSTOPSIG(s) == %s%s}",
- signame(sig & 0x7f),
+ sprintsigname(sig & 0x7f),
sig & 0x80 ? " | 0x80" : "");
status &= ~W_STOPCODE(sig);
} else if (WIFSIGNALED(status)) {
tprintf("[{WIFSIGNALED(s) && WTERMSIG(s) == %s%s}",
- signame(WTERMSIG(status)),
+ sprintsigname(WTERMSIG(status)),
WCOREDUMP(status) ? " && WCOREDUMP(s)" : "");
status &= ~(W_EXITCODE(0, WTERMSIG(status)) | WCOREFLAG);
} else if (WIFEXITED(status)) {