Change the_dummy_target to be a global
authorTom Tromey <tromey@adacore.com>
Mon, 4 Mar 2019 20:37:59 +0000 (13:37 -0700)
committerTom Tromey <tromey@adacore.com>
Tue, 5 Mar 2019 21:11:17 +0000 (14:11 -0700)
commit06b5b831a09417bac37b44599dc35d4b904700c5
tree6e27113c46d98cd58a6950974eaacbdd46f118d1
parentff6c8b354d853d40a4982dcf1338b9350060b75f
Change the_dummy_target to be a global

While debugging gdb, I printed the target stack and got:

    (top-gdb) p g_target_stack
    $10 = {
      m_top = thread_stratum,
      m_stack = {0x142b0b0, 0x13da600 <exec_ops>, 0x1c70690, 0x13d63b0 <ravenscar_ops>, 0x0, 0x0, 0x0}
    }

(This is clearly from before the change to make ravenscar
multi-target-capable.)

Here, 0x142b0b0 is the singleton dummy target.  It seems to me that
since this is always a singleton, it would be a bit nicer if it were a
global, so that it would be noted in the above.

This patch implements this idea, and now I get:

    (top-gdb) p g_target_stack
    $2 = {
      m_top = dummy_stratum,
      m_stack = {0x1f1b040 <the_dummy_target>, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
    }

I did not do the same for the debug target.  It didn't seem as useful
to me.

gdb/ChangeLog
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.
gdb/ChangeLog
gdb/target.c
This page took 0.029418 seconds and 4 git commands to generate.