1 /* Machine independent support for SVR4 /proc (process file system) for GDB.
2 Copyright (C) 1999-2000, 2007-2012 Free Software Foundation, Inc.
3 Written by Michael Snyder at Cygnus Solutions.
4 Based on work by Fred Fish, Stu Grossman, Geoff Noer, and others.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 * Pretty-print the prstatus flags.
24 * Arguments: unsigned long flags, int verbose
30 #if defined (NEW_PROC_API)
31 #define _STRUCTURED_PROC 1
35 #include <sys/types.h>
36 #include <sys/procfs.h>
38 /* Much of the information used in the /proc interface, particularly for
39 printing status information, is kept as tables of structures of the
40 following form. These tables can be used to map numeric values to
41 their symbolic names and to a string that describes their specific use. */
44 int value
; /* The numeric value */
45 char *name
; /* The equivalent symbolic value */
46 char *desc
; /* Short description of value */
49 /* Translate bits in the pr_flags member of the prstatus structure,
50 into the names and desc information. */
52 static struct trans pr_flag_table
[] =
54 #if defined (PR_STOPPED)
55 /* Sol2.5: lwp is stopped
56 * Sol2.6: lwp is stopped
57 * Sol2.7: lwp is stopped
58 * IRIX6: process is stopped
59 * OSF: task/thread is stopped
62 { PR_STOPPED
, "PR_STOPPED", "Process (LWP) is stopped" },
64 #if defined (PR_ISTOP)
65 /* Sol2.5: lwp is stopped on an event of interest
66 * Sol2.6: lwp is stopped on an event of interest
67 * Sol2.7: lwp is stopped on an event of interest
68 * IRIX6: process is stopped on event of interest
69 * OSF: task/thread stopped on event of interest
70 * UW: LWP stopped on an event of interest
72 { PR_ISTOP
, "PR_ISTOP", "Stopped on an event of interest" },
74 #if defined (PR_DSTOP)
75 /* Sol2.5: lwp has a stop directive in effect
76 * Sol2.6: lwp has a stop directive in effect
77 * Sol2.7: lwp has a stop directive in effect
78 * IRIX6: process has stop directive in effect
79 * OSF: task/thread has stop directive in effect
80 * UW: A stop directive is in effect
82 { PR_DSTOP
, "PR_DSTOP", "A stop directive is in effect" },
85 /* Sol2.5: lwp has a single-step directive in effect
86 * Sol2.6: lwp has a single-step directive in effect
87 * Sol2.7: lwp has a single-step directive in effect
88 * IRIX6: process has single step pending
90 { PR_STEP
, "PR_STEP", "A single step directive is in effect" },
92 #if defined (PR_ASLEEP)
93 /* Sol2.5: lwp is sleeping in a system call
94 * Sol2.6: lwp is sleeping in a system call
95 * Sol2.7: lwp is sleeping in a system call
96 * IRIX6: process is in an interruptible sleep
97 * OSF: task/thread is asleep within a system call
98 * UW: LWP is sleep()ing in a system call
100 { PR_ASLEEP
, "PR_ASLEEP", "Sleeping in an (interruptible) system call" },
102 #if defined (PR_PCINVAL)
103 /* Sol2.5: contents of pr_instr undefined
104 * Sol2.6: contents of pr_instr undefined
105 * Sol2.7: contents of pr_instr undefined
106 * IRIX6: current pc is invalid
107 * OSF: program counter contains invalid address
108 * UW: %pc refers to an invalid virtual address
110 { PR_PCINVAL
, "PR_PCINVAL", "PC (pr_instr) is invalid" },
112 #if defined (PR_ASLWP)
113 /* Sol2.5: this lwp is the aslwp
114 * Sol2.6: this lwp is the aslwp
115 * Sol2.7: this lwp is the aslwp
117 { PR_ASLWP
, "PR_ASLWP", "This is the asynchronous signal LWP" },
119 #if defined (PR_AGENT)
120 /* Sol2.6: this lwp is the /proc agent lwp
121 * Sol2.7: this lwp is the /proc agent lwp
123 { PR_AGENT
, "PR_AGENT", "This is the /proc agent LWP" },
125 #if defined (PR_ISSYS)
126 /* Sol2.5: system process
127 * Sol2.6: this is a system process
128 * Sol2.7: this is a system process
129 * IRIX6: process is a system process
130 * OSF: task/thread is a system task/thread
133 { PR_ISSYS
, "PR_ISSYS", "Is a system process/thread" },
135 #if defined (PR_VFORKP)
136 /* Sol2.6: process is the parent of a vfork()d child
137 * Sol2.7: process is the parent of a vfork()d child
139 { PR_VFORKP
, "PR_VFORKP", "Process is the parent of a vforked child" },
142 /* Sol2.6: process's process group is orphaned
143 * Sol2.7: process's process group is orphaned
145 { PR_ORPHAN
, "PR_ORPHAN", "Process's process group is orphaned" },
147 #if defined (PR_FORK)
148 /* Sol2.5: inherit-on-fork is in effect
149 * Sol2.6: inherit-on-fork is in effect
150 * Sol2.7: inherit-on-fork is in effect
151 * IRIX6: process has inherit-on-fork flag set
152 * OSF: task/thread has inherit-on-fork flag set
153 * UW: inherit-on-fork is in effect
155 { PR_FORK
, "PR_FORK", "Inherit-on-fork is in effect" },
158 /* Sol2.5: run-on-last-close is in effect
159 * Sol2.6: run-on-last-close is in effect
160 * Sol2.7: run-on-last-close is in effect
161 * IRIX6: process has run-on-last-close flag set
162 * OSF: task/thread has run-on-last-close flag set
163 * UW: Run-on-last-close is in effect
165 { PR_RLC
, "PR_RLC", "Run-on-last-close is in effect" },
168 /* Sol2.5: kill-on-last-close is in effect
169 * Sol2.6: kill-on-last-close is in effect
170 * Sol2.7: kill-on-last-close is in effect
171 * IRIX6: process has kill-on-last-close flag set
172 * OSF: kill-on-last-close, superceeds RLC
173 * UW: kill-on-last-close is in effect
175 { PR_KLC
, "PR_KLC", "Kill-on-last-close is in effect" },
177 #if defined (PR_ASYNC)
178 /* Sol2.5: asynchronous-stop is in effect
179 * Sol2.6: asynchronous-stop is in effect
180 * Sol2.7: asynchronous-stop is in effect
181 * OSF: asynchronous stop mode is in effect
182 * UW: asynchronous stop mode is in effect
184 { PR_ASYNC
, "PR_ASYNC", "Asynchronous stop is in effect" },
186 #if defined (PR_MSACCT)
187 /* Sol2.5: micro-state usage accounting is in effect
188 * Sol2.6: micro-state usage accounting is in effect
189 * Sol2.7: micro-state usage accounting is in effect
191 { PR_MSACCT
, "PR_MSACCT", "Microstate accounting enabled" },
193 #if defined (PR_BPTADJ)
194 /* Sol2.5: breakpoint trap pc adjustment is in effect
195 * Sol2.6: breakpoint trap pc adjustment is in effect
196 * Sol2.7: breakpoint trap pc adjustment is in effect
198 { PR_BPTADJ
, "PR_BPTADJ", "Breakpoint PC adjustment in effect" },
200 #if defined (PR_PTRACE)
201 /* Note: different meanings on Solaris and Irix 6
202 * Sol2.5: obsolete, never set in SunOS5.0
203 * Sol2.6: ptrace-compatibility mode is in effect
204 * Sol2.7: ptrace-compatibility mode is in effect
205 * IRIX6: process is traced with ptrace() too
206 * OSF: task/thread is being traced by ptrace
207 * UW: Process is being controlled by ptrace(2)
209 { PR_PTRACE
, "PR_PTRACE", "Process is being controlled by ptrace" },
211 #if defined (PR_PCOMPAT)
212 /* Note: PCOMPAT on Sol2.5 means same thing as PTRACE on Sol2.6
213 * Sol2.5 (only): ptrace-compatibility mode is in effect
215 { PR_PCOMPAT
, "PR_PCOMPAT", "Ptrace compatibility mode in effect" },
218 /* Sol2.6: micro-state accounting inherited on fork
219 * Sol2.7: micro-state accounting inherited on fork
221 { PR_MSFORK
, "PR_PCOMPAT", "Micro-state accounting inherited on fork" },
225 /* Irix6: process is a kernel thread */
226 { PR_ISKTHREAD
, "PR_KTHREAD", "Process is a kernel thread" },
230 /* OSF (only): abort the current stop condition */
231 { PR_ABORT
, "PR_ABORT", "Abort the current stop condition" },
235 /* OSF: task is traced */
236 { PR_TRACING
, "PR_TRACING", "Task is traced" },
240 /* OSF: stop child on fork */
241 { PR_STOPFORK
, "PR_STOPFORK", "Stop child on fork" },
245 /* OSF: stop on exec */
246 { PR_STOPEXEC
, "PR_STOPEXEC", "Stop on exec" },
250 /* OSF: stop on task exit */
251 { PR_STOPTERM
, "PR_STOPTERM", "Stop on task exit" },
255 /* OSF: stop on thread creation */
256 { PR_STOPTCR
, "PR_STOPTCR", "Stop on thread creation" },
260 /* OSF: stop on thread exit */
261 { PR_STOPTTERM
, "PR_STOPTTERM", "Stop on thread exit" },
265 /* OSF: user level scheduling is in effect */
266 { PR_USCHED
, "PR_USCHED", "User level scheduling is in effect" },
271 proc_prettyfprint_flags (FILE *file
, unsigned long flags
, int verbose
)
275 for (i
= 0; i
< sizeof (pr_flag_table
) / sizeof (pr_flag_table
[0]); i
++)
276 if (flags
& pr_flag_table
[i
].value
)
278 fprintf (file
, "%s ", pr_flag_table
[i
].name
);
280 fprintf (file
, "%s\n", pr_flag_table
[i
].desc
);
283 fprintf (file
, "\n");
287 proc_prettyprint_flags (unsigned long flags
, int verbose
)
289 proc_prettyfprint_flags (stdout
, flags
, verbose
);
This page took 0.036137 seconds and 4 git commands to generate.