OLD | NEW |
(Empty) | |
| 1 /* Target waitstatus definitions and prototypes. |
| 2 |
| 3 Copyright (C) 1990-2013 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 "ptid.h" |
| 25 #include "gdb_signals.h" |
| 26 |
| 27 /* Stuff for target_wait. */ |
| 28 |
| 29 /* Generally, what has the program done? */ |
| 30 enum target_waitkind |
| 31 { |
| 32 /* The program has exited. The exit status is in value.integer. */ |
| 33 TARGET_WAITKIND_EXITED, |
| 34 |
| 35 /* The program has stopped with a signal. Which signal is in |
| 36 value.sig. */ |
| 37 TARGET_WAITKIND_STOPPED, |
| 38 |
| 39 /* The program has terminated with a signal. Which signal is in |
| 40 value.sig. */ |
| 41 TARGET_WAITKIND_SIGNALLED, |
| 42 |
| 43 /* The program is letting us know that it dynamically loaded |
| 44 something (e.g. it called load(2) on AIX). */ |
| 45 TARGET_WAITKIND_LOADED, |
| 46 |
| 47 /* The program has forked. A "related" process' PTID is in |
| 48 value.related_pid. I.e., if the child forks, value.related_pid |
| 49 is the parent's ID. */ |
| 50 TARGET_WAITKIND_FORKED, |
| 51 |
| 52 /* The program has vforked. A "related" process's PTID is in |
| 53 value.related_pid. */ |
| 54 TARGET_WAITKIND_VFORKED, |
| 55 |
| 56 /* The program has exec'ed a new executable file. The new file's |
| 57 pathname is pointed to by value.execd_pathname. */ |
| 58 TARGET_WAITKIND_EXECD, |
| 59 |
| 60 /* The program had previously vforked, and now the child is done |
| 61 with the shared memory region, because it exec'ed or exited. |
| 62 Note that the event is reported to the vfork parent. This is |
| 63 only used if GDB did not stay attached to the vfork child, |
| 64 otherwise, a TARGET_WAITKIND_EXECD or |
| 65 TARGET_WAITKIND_EXIT|SIGNALLED event associated with the child |
| 66 has the same effect. */ |
| 67 TARGET_WAITKIND_VFORK_DONE, |
| 68 |
| 69 /* The program has entered or returned from a system call. On |
| 70 HP-UX, this is used in the hardware watchpoint implementation. |
| 71 The syscall's unique integer ID number is in |
| 72 value.syscall_id. */ |
| 73 TARGET_WAITKIND_SYSCALL_ENTRY, |
| 74 TARGET_WAITKIND_SYSCALL_RETURN, |
| 75 |
| 76 /* Nothing happened, but we stopped anyway. This perhaps should |
| 77 be handled within target_wait, but I'm not sure target_wait |
| 78 should be resuming the inferior. */ |
| 79 TARGET_WAITKIND_SPURIOUS, |
| 80 |
| 81 /* An event has occured, but we should wait again. |
| 82 Remote_async_wait() returns this when there is an event |
| 83 on the inferior, but the rest of the world is not interested in |
| 84 it. The inferior has not stopped, but has just sent some output |
| 85 to the console, for instance. In this case, we want to go back |
| 86 to the event loop and wait there for another event from the |
| 87 inferior, rather than being stuck in the remote_async_wait() |
| 88 function. This way the event loop is responsive to other events, |
| 89 like for instance the user typing. */ |
| 90 TARGET_WAITKIND_IGNORE, |
| 91 |
| 92 /* The target has run out of history information, |
| 93 and cannot run backward any further. */ |
| 94 TARGET_WAITKIND_NO_HISTORY, |
| 95 |
| 96 /* There are no resumed children left in the program. */ |
| 97 TARGET_WAITKIND_NO_RESUMED |
| 98 }; |
| 99 |
| 100 struct target_waitstatus |
| 101 { |
| 102 enum target_waitkind kind; |
| 103 |
| 104 /* Additional information about the event. */ |
| 105 union |
| 106 { |
| 107 /* Exit status */ |
| 108 int integer; |
| 109 /* Signal number */ |
| 110 enum gdb_signal sig; |
| 111 /* Forked child pid */ |
| 112 ptid_t related_pid; |
| 113 /* execd pathname */ |
| 114 char *execd_pathname; |
| 115 /* Syscall number */ |
| 116 int syscall_number; |
| 117 } value; |
| 118 }; |
| 119 |
| 120 /* Prototypes */ |
| 121 |
| 122 /* Return a pretty printed form of target_waitstatus. |
| 123 Space for the result is malloc'd, caller must free. */ |
| 124 extern char *target_waitstatus_to_string (const struct target_waitstatus *); |
| 125 |
| 126 #endif /* WAITSTATUS_H */ |
OLD | NEW |