aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2009-03-17 19:28:09 +0000
committerJoel Brobecker <brobecker@gnat.com>2009-03-17 19:28:09 +0000
commit7d85a9c0e3639345cb6d19c139ccb9da5095fc76 (patch)
tree72a4cba16ffa78f6e727bde589b242829e4facab /gdb/target.c
parent14064aa202f80cd07434295c44268f44944859aa (diff)
downloadgdb-7d85a9c0e3639345cb6d19c139ccb9da5095fc76.zip
gdb-7d85a9c0e3639345cb6d19c139ccb9da5095fc76.tar.gz
gdb-7d85a9c0e3639345cb6d19c139ccb9da5095fc76.tar.bz2
Add a target_ops parameter to the to_kill method in struct target_ops.
* target.h (struct target_ops): Add a "target_ops *" parameter to method to_kill. (target_kill): Remove macro. Add declaration. * target.c (debug_to_kill): Delete, no longer necessary. (target_kill): New function. (update_current_target): Stop inheriting the to_kill method. Do not de_fault it to no_process either. (setup_target_debug): Do not set current_target.to_kill. * gnu-nat.c, go32-nat.c, hpux-thread.c, inf-ptrace.c, inf-ttrace.c, linux-nat.c, monitor.c, nto-procfs.c, procfs.c, remote-m32r-sdi.c, remote-mips.c, remote-sim.c, remote.c, windows-nat.c: Update accordingly.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/gdb/target.c b/gdb/target.c
index b89d551..86cdb71 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -136,8 +136,6 @@ static void debug_to_terminal_ours (void);
static void debug_to_terminal_info (char *, int);
-static void debug_to_kill (void);
-
static void debug_to_load (char *, int);
static int debug_to_lookup_symbol (char *, CORE_ADDR *);
@@ -257,6 +255,24 @@ target_ignore (void)
}
void
+target_kill (void)
+{
+ struct target_ops *t;
+
+ for (t = current_target.beneath; t != NULL; t = t->beneath)
+ if (t->to_kill != NULL)
+ {
+ if (targetdebug)
+ fprintf_unfiltered (gdb_stdlog, "target_kill ()\n");
+
+ t->to_kill (t);
+ return;
+ }
+
+ noprocess ();
+}
+
+void
target_load (char *arg, int from_tty)
{
dcache_invalidate (target_dcache);
@@ -430,7 +446,7 @@ update_current_target (void)
INHERIT (to_terminal_ours, t);
INHERIT (to_terminal_save_ours, t);
INHERIT (to_terminal_info, t);
- INHERIT (to_kill, t);
+ /* Do not inherit to_kill. */
INHERIT (to_load, t);
INHERIT (to_lookup_symbol, t);
/* Do no inherit to_create_inferior. */
@@ -556,9 +572,6 @@ update_current_target (void)
target_ignore);
de_fault (to_terminal_info,
default_terminal_info);
- de_fault (to_kill,
- (void (*) (void))
- noprocess);
de_fault (to_load,
(void (*) (char *, int))
tcomplain);
@@ -3025,14 +3038,6 @@ debug_to_terminal_info (char *arg, int from_tty)
}
static void
-debug_to_kill (void)
-{
- debug_target.to_kill ();
-
- fprintf_unfiltered (gdb_stdlog, "target_kill ()\n");
-}
-
-static void
debug_to_load (char *args, int from_tty)
{
debug_target.to_load (args, from_tty);
@@ -3227,7 +3232,6 @@ setup_target_debug (void)
current_target.to_terminal_ours = debug_to_terminal_ours;
current_target.to_terminal_save_ours = debug_to_terminal_save_ours;
current_target.to_terminal_info = debug_to_terminal_info;
- current_target.to_kill = debug_to_kill;
current_target.to_load = debug_to_load;
current_target.to_lookup_symbol = debug_to_lookup_symbol;
current_target.to_post_startup_inferior = debug_to_post_startup_inferior;