summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2012-05-22 15:04:53 +0000
committerPedro Alves <palves@redhat.com>2012-05-22 15:04:53 +0000
commitde0beaf50e1d02f6c31ff7e74513635efaefbfde (patch)
treebb89319c15af16df4416592ae2756a48e6148de7 /gdb
parentdab3af53ef688d1c5f5062fddc18798142234285 (diff)
downloadgdb-de0beaf50e1d02f6c31ff7e74513635efaefbfde.tar.gz
2012-05-22 Pedro Alves <palves@redhat.com>
* target.h (store_waitstatus): Move declaration ... * inf-child.h (store_waitstatus): ... here. * target.c: Move inclusion of gdb_wait.h, and ... (store_waitstatus): ... this ... * inf-child.c: ... here. * linux-nat.c: Include inf-child.h. * rs6000-nat.c: Include inf-child.h. * spu-linux-nat.c: Include inf-child.h.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog11
-rw-r--r--gdb/inf-child.c24
-rw-r--r--gdb/inf-child.h5
-rw-r--r--gdb/linux-nat.c1
-rw-r--r--gdb/rs6000-nat.c1
-rw-r--r--gdb/spu-linux-nat.c1
-rw-r--r--gdb/target.c24
-rw-r--r--gdb/target.h4
8 files changed, 43 insertions, 28 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8b594741eec..400bd8e857d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,14 @@
+2012-05-22 Pedro Alves <palves@redhat.com>
+
+ * target.h (store_waitstatus): Move declaration ...
+ * inf-child.h (store_waitstatus): ... here.
+ * target.c: Move inclusion of gdb_wait.h, and ...
+ (store_waitstatus): ... this ...
+ * inf-child.c: ... here.
+ * linux-nat.c: Include inf-child.h.
+ * rs6000-nat.c: Include inf-child.h.
+ * spu-linux-nat.c: Include inf-child.h.
+
2012-05-22 Pierre Muller <muller@ics.u-strasbg.fr>
* tracepoint.c (start_tracing): Add missing i18n markup.
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index 5531102314b..08955eaec2d 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -30,6 +30,7 @@
#include "inf-child.h"
#include "gdb/fileio.h"
#include "agent.h"
+#include "gdb_wait.h"
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h> /* for MAXPATHLEN */
@@ -38,6 +39,29 @@
#include <fcntl.h>
#include <unistd.h>
+/* Helper function for child_wait and the derivatives of child_wait.
+ HOSTSTATUS is the waitstatus from wait() or the equivalent; store our
+ translation of that in OURSTATUS. */
+void
+store_waitstatus (struct target_waitstatus *ourstatus, int hoststatus)
+{
+ if (WIFEXITED (hoststatus))
+ {
+ ourstatus->kind = TARGET_WAITKIND_EXITED;
+ ourstatus->value.integer = WEXITSTATUS (hoststatus);
+ }
+ else if (!WIFSTOPPED (hoststatus))
+ {
+ ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
+ ourstatus->value.sig = target_signal_from_host (WTERMSIG (hoststatus));
+ }
+ else
+ {
+ ourstatus->kind = TARGET_WAITKIND_STOPPED;
+ ourstatus->value.sig = target_signal_from_host (WSTOPSIG (hoststatus));
+ }
+}
+
/* Fetch register REGNUM from the inferior. If REGNUM is -1, do this
for all registers. */
diff --git a/gdb/inf-child.h b/gdb/inf-child.h
index d32c8cb3a84..c394d5ae858 100644
--- a/gdb/inf-child.h
+++ b/gdb/inf-child.h
@@ -25,4 +25,9 @@
extern struct target_ops *inf_child_target (void);
+/* Functions for helping to write a native target. */
+
+/* This is for native targets which use a unix/POSIX-style waitstatus. */
+extern void store_waitstatus (struct target_waitstatus *, int);
+
#endif
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index ac1a0ea3a1d..86b3c7df513 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -36,6 +36,7 @@
#include "gdbcmd.h"
#include "regcache.h"
#include "regset.h"
+#include "inf-child.h"
#include "inf-ptrace.h"
#include "auxv.h"
#include <sys/param.h> /* for MAXPATHLEN */
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index 117ca014d6e..b2b3e7efbbc 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -31,6 +31,7 @@
#include "gdb-stabs.h"
#include "regcache.h"
#include "arch-utils.h"
+#include "inf-child.h"
#include "inf-ptrace.h"
#include "ppc-tdep.h"
#include "rs6000-tdep.h"
diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c
index 7ddfc7acdc3..235458ed7f3 100644
--- a/gdb/spu-linux-nat.c
+++ b/gdb/spu-linux-nat.c
@@ -23,6 +23,7 @@
#include "gdb_string.h"
#include "target.h"
#include "inferior.h"
+#include "inf-child.h"
#include "inf-ptrace.h"
#include "regcache.h"
#include "symfile.h"
diff --git a/gdb/target.c b/gdb/target.c
index 5361dbc6cbf..6dba9361db9 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -29,7 +29,6 @@
#include "bfd.h"
#include "symfile.h"
#include "objfiles.h"
-#include "gdb_wait.h"
#include "dcache.h"
#include <signal.h>
#include "regcache.h"
@@ -3650,29 +3649,6 @@ generic_mourn_inferior (void)
deprecated_detach_hook ();
}
-/* Helper function for child_wait and the derivatives of child_wait.
- HOSTSTATUS is the waitstatus from wait() or the equivalent; store our
- translation of that in OURSTATUS. */
-void
-store_waitstatus (struct target_waitstatus *ourstatus, int hoststatus)
-{
- if (WIFEXITED (hoststatus))
- {
- ourstatus->kind = TARGET_WAITKIND_EXITED;
- ourstatus->value.integer = WEXITSTATUS (hoststatus);
- }
- else if (!WIFSTOPPED (hoststatus))
- {
- ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
- ourstatus->value.sig = target_signal_from_host (WTERMSIG (hoststatus));
- }
- else
- {
- ourstatus->kind = TARGET_WAITKIND_STOPPED;
- ourstatus->value.sig = target_signal_from_host (WSTOPSIG (hoststatus));
- }
-}
-
/* Convert a normal process ID to a string. Returns the string in a
static buffer. */
diff --git a/gdb/target.h b/gdb/target.h
index 50a0ea6c35c..84b462a3d3a 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -1857,10 +1857,6 @@ extern int baud_rate;
extern int remote_timeout;
-/* Functions for helping to write a native target. */
-
-/* This is for native targets which use a unix/POSIX-style waitstatus. */
-extern void store_waitstatus (struct target_waitstatus *, int);
/* Set the show memory breakpoints mode to show, and installs a cleanup
to restore it back to the current value. */