aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/target.c11
2 files changed, 12 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 359d222..120cce0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2019-03-05 Tom Tromey <tromey@adacore.com>
+ * target.c (the_dummy_target): Move later. Change type to
+ "dummy_target".
+ (initialize_targets): Don't initialize the_dummy_target.
+
+2019-03-05 Tom Tromey <tromey@adacore.com>
+
* gdb_bfd.c (gdb_bfd_fdopenr): Remove.
* gdb_bfd.h (gdb_bfd_fdopenr): Don't declare.
diff --git a/gdb/target.c b/gdb/target.c
index fe7cb08..8579c19 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -106,10 +106,8 @@ static enum exec_direction_kind default_execution_direction
static std::unordered_map<const target_info *, target_open_ftype *>
target_factories;
-/* The initial current target, so that there is always a semi-valid
- current target. */
+/* The singleton debug target. */
-static struct target_ops *the_dummy_target;
static struct target_ops *the_debug_target;
/* The target stack. */
@@ -3239,6 +3237,10 @@ dummy_make_corefile_notes (struct target_ops *self,
#include "target-delegates.c"
+/* The initial current target, so that there is always a semi-valid
+ current target. */
+
+static dummy_target the_dummy_target;
static const target_info dummy_target_info = {
"None",
@@ -3976,8 +3978,7 @@ set_write_memory_permission (const char *args, int from_tty,
void
initialize_targets (void)
{
- the_dummy_target = new dummy_target ();
- push_target (the_dummy_target);
+ push_target (&the_dummy_target);
the_debug_target = new debug_target ();