GDB (API)
/home/stan/gdb/src/gdb/target/waitstatus.h
Go to the documentation of this file.
00001 /* Target waitstatus definitions and prototypes.
00002 
00003    Copyright (C) 1990-2013 Free Software Foundation, Inc.
00004 
00005    This file is part of GDB.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 3 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00019 
00020 #ifndef WAITSTATUS_H
00021 #define WAITSTATUS_H
00022 
00023 #include "common-utils.h"
00024 #include "ptid.h"
00025 #include "gdb_signals.h"
00026 
00027 /* Stuff for target_wait.  */
00028 
00029 /* Generally, what has the program done?  */
00030 enum target_waitkind
00031 {
00032   /* The program has exited.  The exit status is in value.integer.  */
00033   TARGET_WAITKIND_EXITED,
00034 
00035   /* The program has stopped with a signal.  Which signal is in
00036      value.sig.  */
00037   TARGET_WAITKIND_STOPPED,
00038 
00039   /* The program has terminated with a signal.  Which signal is in
00040      value.sig.  */
00041   TARGET_WAITKIND_SIGNALLED,
00042 
00043   /* The program is letting us know that it dynamically loaded
00044      something (e.g. it called load(2) on AIX).  */
00045   TARGET_WAITKIND_LOADED,
00046 
00047   /* The program has forked.  A "related" process' PTID is in
00048      value.related_pid.  I.e., if the child forks, value.related_pid
00049      is the parent's ID.  */
00050   TARGET_WAITKIND_FORKED,
00051  
00052   /* The program has vforked.  A "related" process's PTID is in
00053      value.related_pid.  */
00054   TARGET_WAITKIND_VFORKED,
00055  
00056   /* The program has exec'ed a new executable file.  The new file's
00057      pathname is pointed to by value.execd_pathname.  */
00058   TARGET_WAITKIND_EXECD,
00059   
00060   /* The program had previously vforked, and now the child is done
00061      with the shared memory region, because it exec'ed or exited.
00062      Note that the event is reported to the vfork parent.  This is
00063      only used if GDB did not stay attached to the vfork child,
00064      otherwise, a TARGET_WAITKIND_EXECD or
00065      TARGET_WAITKIND_EXIT|SIGNALLED event associated with the child
00066      has the same effect.  */
00067   TARGET_WAITKIND_VFORK_DONE,
00068 
00069   /* The program has entered or returned from a system call.  On
00070      HP-UX, this is used in the hardware watchpoint implementation.
00071      The syscall's unique integer ID number is in
00072      value.syscall_id.  */
00073   TARGET_WAITKIND_SYSCALL_ENTRY,
00074   TARGET_WAITKIND_SYSCALL_RETURN,
00075 
00076   /* Nothing happened, but we stopped anyway.  This perhaps should
00077      be handled within target_wait, but I'm not sure target_wait
00078      should be resuming the inferior.  */
00079   TARGET_WAITKIND_SPURIOUS,
00080 
00081   /* An event has occured, but we should wait again.
00082      Remote_async_wait() returns this when there is an event
00083      on the inferior, but the rest of the world is not interested in
00084      it.  The inferior has not stopped, but has just sent some output
00085      to the console, for instance.  In this case, we want to go back
00086      to the event loop and wait there for another event from the
00087      inferior, rather than being stuck in the remote_async_wait()
00088      function. sThis way the event loop is responsive to other events,
00089      like for instance the user typing.  */
00090   TARGET_WAITKIND_IGNORE,
00091  
00092   /* The target has run out of history information,
00093      and cannot run backward any further.  */
00094   TARGET_WAITKIND_NO_HISTORY,
00095  
00096   /* There are no resumed children left in the program.  */
00097   TARGET_WAITKIND_NO_RESUMED
00098 };
00099 
00100 struct target_waitstatus
00101 {
00102   enum target_waitkind kind;
00103 
00104   /* Additional information about the event.  */
00105   union
00106     {
00107       /* Exit status */
00108       int integer;
00109       /* Signal number */
00110       enum gdb_signal sig;
00111       /* Forked child pid */
00112       ptid_t related_pid;
00113       /* execd pathname */
00114       char *execd_pathname;
00115       /* Syscall number */
00116       int syscall_number;
00117     } value;
00118 };
00119 
00120 /* Prototypes */
00121 
00122 /* Return a pretty printed form of target_waitstatus.
00123    Space for the result is malloc'd, caller must free.  */
00124 extern char *target_waitstatus_to_string (const struct target_waitstatus *);
00125 
00126 #endif /* WAITSTATUS_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines