Move ptid.h to common-defs.h
[deliverable/binutils-gdb.git] / gdb / target / waitstatus.h
1 /* Target waitstatus definitions and prototypes.
2
3 Copyright (C) 1990-2014 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 #ifndef WAITSTATUS_H
21 #define WAITSTATUS_H
22
23 #include "common-utils.h"
24 #include "gdb_signals.h"
25
26 /* Stuff for target_wait. */
27
28 /* Generally, what has the program done? */
29 enum target_waitkind
30 {
31 /* The program has exited. The exit status is in value.integer. */
32 TARGET_WAITKIND_EXITED,
33
34 /* The program has stopped with a signal. Which signal is in
35 value.sig. */
36 TARGET_WAITKIND_STOPPED,
37
38 /* The program has terminated with a signal. Which signal is in
39 value.sig. */
40 TARGET_WAITKIND_SIGNALLED,
41
42 /* The program is letting us know that it dynamically loaded
43 something (e.g. it called load(2) on AIX). */
44 TARGET_WAITKIND_LOADED,
45
46 /* The program has forked. A "related" process' PTID is in
47 value.related_pid. I.e., if the child forks, value.related_pid
48 is the parent's ID. */
49 TARGET_WAITKIND_FORKED,
50
51 /* The program has vforked. A "related" process's PTID is in
52 value.related_pid. */
53 TARGET_WAITKIND_VFORKED,
54
55 /* The program has exec'ed a new executable file. The new file's
56 pathname is pointed to by value.execd_pathname. */
57 TARGET_WAITKIND_EXECD,
58
59 /* The program had previously vforked, and now the child is done
60 with the shared memory region, because it exec'ed or exited.
61 Note that the event is reported to the vfork parent. This is
62 only used if GDB did not stay attached to the vfork child,
63 otherwise, a TARGET_WAITKIND_EXECD or
64 TARGET_WAITKIND_EXIT|SIGNALLED event associated with the child
65 has the same effect. */
66 TARGET_WAITKIND_VFORK_DONE,
67
68 /* The program has entered or returned from a system call. On
69 HP-UX, this is used in the hardware watchpoint implementation.
70 The syscall's unique integer ID number is in
71 value.syscall_id. */
72 TARGET_WAITKIND_SYSCALL_ENTRY,
73 TARGET_WAITKIND_SYSCALL_RETURN,
74
75 /* Nothing happened, but we stopped anyway. This perhaps should
76 be handled within target_wait, but I'm not sure target_wait
77 should be resuming the inferior. */
78 TARGET_WAITKIND_SPURIOUS,
79
80 /* An event has occured, but we should wait again.
81 Remote_async_wait() returns this when there is an event
82 on the inferior, but the rest of the world is not interested in
83 it. The inferior has not stopped, but has just sent some output
84 to the console, for instance. In this case, we want to go back
85 to the event loop and wait there for another event from the
86 inferior, rather than being stuck in the remote_async_wait()
87 function. This way the event loop is responsive to other events,
88 like for instance the user typing. */
89 TARGET_WAITKIND_IGNORE,
90
91 /* The target has run out of history information,
92 and cannot run backward any further. */
93 TARGET_WAITKIND_NO_HISTORY,
94
95 /* There are no resumed children left in the program. */
96 TARGET_WAITKIND_NO_RESUMED
97 };
98
99 struct target_waitstatus
100 {
101 enum target_waitkind kind;
102
103 /* Additional information about the event. */
104 union
105 {
106 /* Exit status */
107 int integer;
108 /* Signal number */
109 enum gdb_signal sig;
110 /* Forked child pid */
111 ptid_t related_pid;
112 /* execd pathname */
113 char *execd_pathname;
114 /* Syscall number */
115 int syscall_number;
116 } value;
117 };
118
119 /* Prototypes */
120
121 /* Return a pretty printed form of target_waitstatus.
122 Space for the result is malloc'd, caller must free. */
123 extern char *target_waitstatus_to_string (const struct target_waitstatus *);
124
125 #endif /* WAITSTATUS_H */
This page took 0.036107 seconds and 5 git commands to generate.