aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2009-05-21 15:48:42 +0000
committerPedro Alves <palves@redhat.com>2009-05-21 15:48:42 +0000
commit47608cb1acc3880b330b8d3a8ad6aa29218046d9 (patch)
treeaa86b1ddd38ba6878b760346377a4dfebe955e1f /gdb/target.h
parent9944e9c2ac5e0e5d18eaf5100f6c57bf31cbe6e7 (diff)
downloadgdb-47608cb1acc3880b330b8d3a8ad6aa29218046d9.zip
gdb-47608cb1acc3880b330b8d3a8ad6aa29218046d9.tar.gz
gdb-47608cb1acc3880b330b8d3a8ad6aa29218046d9.tar.bz2
* target.h (TARGET_WNOHANG): New.
* target.c (target_wait): Add `options' argument. Adjust. (struct target_ops) <to_wait>: Add `options' argument. (target_wait): Add `options' argument. * infrun.c (wait_for_inferior): Pass 0 as options to target_wait (blocking wait). (fetch_inferior_event): Pass TARGET_WNOHANG as options to target_wait. * fork-child.c (startup_inferior): Pass 0 as options to target_wait (blocking wait). * linux-nat.c (linux_nat_create_inferior): Remove async masking. (linux_nat_wait_1): Add `target_options' argument. Use it instead of checking on target_can_async_p. (linux_nat_wait): Add `target_options' argument. Adjust. * remote.c (remote_wait_ns): Add `options' argument. Adjust to check on TARGET_WNOWAIT instead of checking on remote_is_async_p. (remote_wait_as): Add `options' argument. Adjust to check on TARGET_WNOWAIT instead of checking on remote_is_async_p. If doing a blocking wait, keep waiting until an interesting event comes out. (remote_wait): Add `options' argument. Don't loop here if the target is in async mode, and a blocking wait has been requested. * top.c (deprecated_target_wait_hook): Add `options' argument. * linux-thread-db.c (thread_db_wait): Add `options' argument, and pass it down to the layer beneath. * inf-ptrace.c (inf_ptrace_wait): Add `options' argument. * record.c (record_beneath_to_wait): Add `options' argument. (record_wait): Add `options' argument, and pass it down to the layer beneath. * bsd-uthread.c (bsd_uthread_wait): Add `options' argument. * darwin-nat.c (darwin_wait): Likewise. * defs.h (deprecated_target_wait_hook): Likewise. * gnu-nat.c (gnu_wait): Add `options' argument. * go32-nat.c (go32_wait): Likewise. * hpux-thread.c (hpux_thread_wait): Add `options' argument, and pass it down to the layer beneath. * inf-ttrace.c (inf_ttrace_wait): Add `options' argument. * monitor.c (monitor_wait): Likewise. * nto-procfs.c (procfs_wait): Likewise. * remote-mips.c (mips_wait): Add `options' argument. * remote-sim.c (gdbsim_wait): Likewise. * rs6000-nat.c (rs6000_wait): Add `options' argument. * sol-thread.c (sol_thread_wait): Add `options' argument, and pass it down to the layer beneath. * spu-linux-nat.c (spu_child_wait): Add `options' argument. * windows-nat.c (windows_wait): Likewise. * tui/tui-hooks.c (tui_target_wait_hook): Likewise. Adjust.
Diffstat (limited to 'gdb/target.h')
-rw-r--r--gdb/target.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/gdb/target.h b/gdb/target.h
index b94149a..5ec06a0 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -153,6 +153,13 @@ struct target_waitstatus
value;
};
+/* Options that can be passed to target_wait. */
+
+/* Return immediately if there's no event already queued. If this
+ options is not requested, target_wait blocks waiting for an
+ event. */
+#define TARGET_WNOHANG 1
+
/* Return a pretty printed form of target_waitstatus.
Space for the result is malloc'd, caller must free. */
extern char *target_waitstatus_to_string (const struct target_waitstatus *);
@@ -327,7 +334,7 @@ struct target_ops
void (*to_disconnect) (struct target_ops *, char *, int);
void (*to_resume) (struct target_ops *, ptid_t, int, enum target_signal);
ptid_t (*to_wait) (struct target_ops *,
- ptid_t, struct target_waitstatus *);
+ ptid_t, struct target_waitstatus *, int);
void (*to_fetch_registers) (struct target_ops *, struct regcache *, int);
void (*to_store_registers) (struct target_ops *, struct regcache *, int);
void (*to_prepare_to_store) (struct regcache *);
@@ -621,9 +628,11 @@ extern void target_resume (ptid_t ptid, int step, enum target_signal signal);
_NOT_ OK to throw_exception() out of target_wait() without popping
the debugging target from the stack; GDB isn't prepared to get back
to the prompt with a debugging target but without the frame cache,
- stop_pc, etc., set up. */
+ stop_pc, etc., set up. OPTIONS is a bitwise OR of TARGET_W*
+ options. */
-extern ptid_t target_wait (ptid_t ptid, struct target_waitstatus *status);
+extern ptid_t target_wait (ptid_t ptid, struct target_waitstatus *status,
+ int options);
/* Fetch at least register REGNO, or all regs if regno == -1. No result. */