24 #define _STRUCTURED_PROC 1
27 #include <sys/types.h>
28 #include <sys/procfs.h>
48 static struct trans pr_why_table[] =
50 #if defined (PR_REQUESTED)
52 { PR_REQUESTED,
"PR_REQUESTED",
53 "Directed to stop by debugger via P(IO)CSTOP or P(IO)CWSTOP" },
55 #if defined (PR_SIGNALLED)
57 { PR_SIGNALLED,
"PR_SIGNALLED",
"Receipt of a traced signal" },
59 #if defined (PR_SYSENTRY)
61 { PR_SYSENTRY,
"PR_SYSENTRY",
"Entry to a traced system call" },
63 #if defined (PR_SYSEXIT)
65 { PR_SYSEXIT,
"PR_SYSEXIT",
"Exit from a traced system call" },
67 #if defined (PR_JOBCONTROL)
69 { PR_JOBCONTROL,
"PR_JOBCONTROL",
"Default job control stop signal action" },
71 #if defined (PR_FAULTED)
73 { PR_FAULTED,
"PR_FAULTED",
"Incurred a traced hardware fault" },
75 #if defined (PR_SUSPENDED)
77 { PR_SUSPENDED,
"PR_SUSPENDED",
"Process suspended" },
79 #if defined (PR_CHECKPOINT)
81 { PR_CHECKPOINT,
"PR_CHECKPOINT",
"Process stopped at checkpoint" },
83 #if defined (PR_FORKSTOP)
85 { PR_FORKSTOP,
"PR_FORKSTOP",
"Process stopped at end of fork call" },
87 #if defined (PR_TCRSTOP)
89 { PR_TCRSTOP,
"PR_TCRSTOP",
"Process stopped on thread creation" },
91 #if defined (PR_TTSTOP)
93 { PR_TTSTOP,
"PR_TTSTOP",
"Process stopped on thread termination" },
97 { PR_DEAD,
"PR_DEAD",
"Process stopped in exit system call" },
113 for (i = 0; i < ARRAY_SIZE (pr_why_table); i++)
114 if (why == pr_why_table[i].
value)
116 fprintf (file,
"%s ", pr_why_table[i].
name);
118 fprintf (file,
": %s ", pr_why_table[i].
desc);
137 fprintf (file,
"Entry to ");
143 fprintf (file,
"Exit from ");
154 fprintf (file,
"Exit status: %ld\n", what);
158 fprintf (file,
"Unknown why %ld, what %ld\n", why, what);
161 fprintf (file,
"\n");
166 fprintf (file,
"Unknown pr_why.\n");
void proc_prettyfprint_why(FILE *file, unsigned long why, unsigned long what, int verbose)
void proc_prettyprint_why(unsigned long why, unsigned long what, int verbose)
void proc_prettyfprint_signal(FILE *file, int signo, int verbose)
void proc_prettyfprint_fault(FILE *file, int faultno, int verbose)
void proc_prettyfprint_syscall(FILE *file, int num, int verbose)