aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-12-18 14:40:23 -0700
committerTom Tromey <tromey@redhat.com>2014-02-19 07:48:12 -0700
commit8d65703517069975d781d7957d90a9de3ce94e5d (patch)
tree338bab9d0dbba3c4411b4d50808418fe8d423453 /gdb/target.c
parent098dba18ee55150df53f3a6846de4dd9c7564088 (diff)
downloadgdb-8d65703517069975d781d7957d90a9de3ce94e5d.zip
gdb-8d65703517069975d781d7957d90a9de3ce94e5d.tar.gz
gdb-8d65703517069975d781d7957d90a9de3ce94e5d.tar.bz2
convert to_mourn_inferior
2014-02-19 Tom Tromey <tromey@redhat.com> * target-delegates.c: Rebuild. * target.c (default_mourn_inferior): New function. (target_mourn_inferior): Unconditionally delegate. * target.h (struct target_ops) <to_mourn_inferior>: Use TARGET_DEFAULT_FUNC.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 9afb317..13ec67d 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -63,6 +63,8 @@ static ptid_t default_get_ada_task_ptid (struct target_ops *self,
static int default_follow_fork (struct target_ops *self, int follow_child,
int detach_fork);
+static void default_mourn_inferior (struct target_ops *self);
+
static void tcomplain (void) ATTRIBUTE_NORETURN;
static int nomemory (CORE_ADDR, char *, int, int, struct target_ops *);
@@ -2660,30 +2662,24 @@ target_follow_fork (int follow_child, int detach_fork)
return retval;
}
+static void
+default_mourn_inferior (struct target_ops *self)
+{
+ internal_error (__FILE__, __LINE__,
+ _("could not find a target to follow mourn inferior"));
+}
+
void
target_mourn_inferior (void)
{
- struct target_ops *t;
-
- for (t = current_target.beneath; t != NULL; t = t->beneath)
- {
- if (t->to_mourn_inferior != NULL)
- {
- t->to_mourn_inferior (t);
- if (targetdebug)
- fprintf_unfiltered (gdb_stdlog, "target_mourn_inferior ()\n");
-
- /* We no longer need to keep handles on any of the object files.
- Make sure to release them to avoid unnecessarily locking any
- of them while we're not actually debugging. */
- bfd_cache_close_all ();
-
- return;
- }
- }
+ current_target.to_mourn_inferior (&current_target);
+ if (targetdebug)
+ fprintf_unfiltered (gdb_stdlog, "target_mourn_inferior ()\n");
- internal_error (__FILE__, __LINE__,
- _("could not find a target to follow mourn inferior"));
+ /* We no longer need to keep handles on any of the object files.
+ Make sure to release them to avoid unnecessarily locking any
+ of them while we're not actually debugging. */
+ bfd_cache_close_all ();
}
/* Look for a target which can describe architectural features, starting