aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-10-17 21:55:24 +0000
committerDaniel Jacobowitz <drow@false.org>2006-10-17 21:55:24 +0000
commit52bb452f802c0e3642b86e7ffccde8a1333bd280 (patch)
tree9fb4c926a2d9f650c88ffc78d498bf8a74ce7a6c /gdb/target.c
parentb40ce68a7796afe94e81363e28347fa1ef4475ce (diff)
downloadgdb-52bb452f802c0e3642b86e7ffccde8a1333bd280.zip
gdb-52bb452f802c0e3642b86e7ffccde8a1333bd280.tar.gz
gdb-52bb452f802c0e3642b86e7ffccde8a1333bd280.tar.bz2
gdb/
* gdbint.texinfo (Target Vector Definition): Move most content into Existing Targets. Add a menu. (Existing Targets): New section, moved from Target Vector Definition. Use @subsection. (Managing Execution State): New section. gdb/doc/ * remote-sim.c (gdbsim_kill): Call target_mourn_inferior. (gdbsim_load): Don't bother to adjust inferior_ptid here. (gdbsim_create_inferior): Mark the simulator as running. (gdbsim_open): Don't bother fetching registers. Mark the target as not running. (gdbsim_xfer): When the program is not running, pass memory requests down. (gdbsim_mourn_inferior): Mark the target as not running. * target.c (target_mark_running, target_mark_exited): New. * target.h (target_has_execution): Update the comment. (target_mark_running, target_mark_exited): New prototypes.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c
index a757f53..2ff882c 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -649,6 +649,56 @@ update_current_target (void)
current_target.beneath = target_stack;
}
+/* Mark OPS as a running target. This reverses the effect
+ of target_mark_exited. */
+
+void
+target_mark_running (struct target_ops *ops)
+{
+ struct target_ops *t;
+
+ for (t = target_stack; t != NULL; t = t->beneath)
+ if (t == ops)
+ break;
+ if (t == NULL)
+ internal_error (__FILE__, __LINE__,
+ "Attempted to mark unpushed target \"%s\" as running",
+ ops->to_shortname);
+
+ ops->to_has_execution = 1;
+ ops->to_has_all_memory = 1;
+ ops->to_has_memory = 1;
+ ops->to_has_stack = 1;
+ ops->to_has_registers = 1;
+
+ update_current_target ();
+}
+
+/* Mark OPS as a non-running target. This reverses the effect
+ of target_mark_running. */
+
+void
+target_mark_exited (struct target_ops *ops)
+{
+ struct target_ops *t;
+
+ for (t = target_stack; t != NULL; t = t->beneath)
+ if (t == ops)
+ break;
+ if (t == NULL)
+ internal_error (__FILE__, __LINE__,
+ "Attempted to mark unpushed target \"%s\" as running",
+ ops->to_shortname);
+
+ ops->to_has_execution = 0;
+ ops->to_has_all_memory = 0;
+ ops->to_has_memory = 0;
+ ops->to_has_stack = 0;
+ ops->to_has_registers = 0;
+
+ update_current_target ();
+}
+
/* Push a new target type into the stack of the existing target accessors,
possibly superseding some of the existing accessors.