From 5ee4e16ca776d5dd8c3cdb63489c4da773fd9f5c Mon Sep 17 00:00:00 2001 From: John Gilmore Date: Tue, 22 Sep 1992 07:23:35 +0000 Subject: [PATCH] Break the thread of control that implies that a unix child process will be the default target. * target.c (find_default_run_target, find_default_attach, find_default_create_inferior, return_zero): new functions. (cleanup_target): Make return_zero the default for to_can_run. * exec.c (exec_ops), core.c (core_ops): Replace child_attach and child_create_inferior references with find_default_XXX instead. * target.h (struct target_ops): new field, to_can_run. (find_default_attach, find_default_create_inferior): new prototypes. (target_can_run): new macro. * Also added a zero (default) to_can_run element to all static struct target_ops initializations throughout GDB, except: * inftarg.c (child_ops): Use new child_can_run() to enable child runs. * infrun.c (child_create_inferior): Clean up error handling when no exec file is specified. (child_attach): Don't require exec file. --- gdb/ChangeLog | 24 ++++++++++++++++++++++++ gdb/core.c | 5 +++-- gdb/remote-adapt.c | 1 + gdb/remote-eb.c | 1 + gdb/remote-es1800.c | 2 ++ gdb/remote-hms.c | 1 + gdb/remote-mm.c | 1 + gdb/remote-nindy.c | 1 + gdb/remote-st2000.c | 1 + gdb/remote-udi.c | 1 + gdb/remote-vx.c | 2 ++ gdb/xcoffexec.c | 1 + 12 files changed, 39 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 27276ef6d2..84c17c2647 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,27 @@ +Mon Sep 21 18:16:30 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + Break the thread of control that implies that a unix child + process will be the default target. + + * target.c (find_default_run_target, find_default_attach, + find_default_create_inferior, return_zero): new functions. + (cleanup_target): Make return_zero the default for to_can_run. + + * exec.c (exec_ops), core.c (core_ops): Replace child_attach and + child_create_inferior references with find_default_XXX instead. + + * target.h (struct target_ops): new field, to_can_run. + (find_default_attach, find_default_create_inferior): new prototypes. + (target_can_run): new macro. + + * Also added a zero (default) to_can_run element to all static + struct target_ops initializations throughout GDB, except: + * inftarg.c (child_ops): Use new child_can_run() to enable child runs. + + * infrun.c (child_create_inferior): Clean up error handling when + no exec file is specified. + (child_attach): Don't require exec file. + Mon Sep 21 19:43:13 1992 John Gilmore and K. Richard Pixley (gnu@cygnus.com) Remove kill_inferior_fast, in favor of target_kill, which goes diff --git a/gdb/core.c b/gdb/core.c index dc2cf24d23..21990f0587 100644 --- a/gdb/core.c +++ b/gdb/core.c @@ -433,14 +433,15 @@ struct target_ops core_ops = { "core", "Local core dump file", "Use a core file as a target. Specify the filename of the core file.", core_open, core_close, - child_attach, core_detach, 0, 0, /* resume, wait */ + find_default_attach, core_detach, 0, 0, /* resume, wait */ get_core_registers, 0, 0, /* store_regs, prepare_to_store */ xfer_memory, core_files_info, 0, 0, /* core_insert_breakpoint, core_remove_breakpoint, */ 0, 0, 0, 0, 0, /* terminal stuff */ 0, 0, 0, /* kill, load, lookup sym */ - child_create_inferior, 0, /* mourn_inferior */ + find_default_create_inferior, 0, /* mourn_inferior */ + 0, /* can_run */ core_stratum, 0, /* next */ 0, 1, 1, 1, 0, /* all mem, mem, stack, regs, exec */ 0, 0, /* section pointers */ diff --git a/gdb/remote-adapt.c b/gdb/remote-adapt.c index f8a3271a41..9241573eec 100644 --- a/gdb/remote-adapt.c +++ b/gdb/remote-adapt.c @@ -1425,6 +1425,7 @@ struct target_ops adapt_ops = { 0, /* lookup_symbol */ adapt_create_inferior, /* create_inferior */ adapt_mourn, /* mourn_inferior FIXME */ + 0, /* can_run */ process_stratum, 0, /* next */ 1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */ 0,0, /* Section pointers */ diff --git a/gdb/remote-eb.c b/gdb/remote-eb.c index 575f7cccc8..666de4fcc7 100644 --- a/gdb/remote-eb.c +++ b/gdb/remote-eb.c @@ -987,6 +987,7 @@ executable as it exists on the remote computer. For example,\n\ 0, /* lookup_symbol */ eb_create_inferior, eb_mourn_inferior, + 0, /* can_run */ process_stratum, 0, /* next */ 1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */ 0, 0, /* Section pointers */ diff --git a/gdb/remote-es1800.c b/gdb/remote-es1800.c index 9a542e0425..ca806b2e91 100644 --- a/gdb/remote-es1800.c +++ b/gdb/remote-es1800.c @@ -2187,6 +2187,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).", NULL, /* to_lookup_symbol */ es1800_create_inferior, /* to_create_inferior */ NULL, /* to_mourn_inferior */ + 0, /* to_can_run */ core_stratum, /* to_stratum */ 0, /* to_next */ 0, /* to_has_all_memory */ @@ -2232,6 +2233,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).", NULL, /* to_lookup_symbol */ es1800_create_inferior, /* to_create_inferior */ es1800_mourn_inferior, /* to_mourn_inferior */ + 0, /* to_can_run */ process_stratum, /* to_stratum */ 0, /* to_next */ 1, /* to_has_all_memory */ diff --git a/gdb/remote-hms.c b/gdb/remote-hms.c index 7b0e7b0afc..fc260f1a57 100644 --- a/gdb/remote-hms.c +++ b/gdb/remote-hms.c @@ -1405,6 +1405,7 @@ by a serial line.", 0, /* lookup_symbol */ hms_create_inferior, /* create_inferior */ hms_mourn, /* mourn_inferior FIXME */ + 0, /* can_run */ process_stratum, 0, /* next */ 1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */ 0,0, /* Section pointers */ diff --git a/gdb/remote-mm.c b/gdb/remote-mm.c index d824d2584f..fb9060b015 100644 --- a/gdb/remote-mm.c +++ b/gdb/remote-mm.c @@ -1683,6 +1683,7 @@ struct target_ops mm_ops = { 0, /* lookup_symbol */ mm_create_inferior, /* create_inferior */ mm_mourn, /* mourn_inferior FIXME */ + 0, /* can_run */ process_stratum, 0, /* next */ 1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */ 0,0, /* sections, sections_end */ diff --git a/gdb/remote-nindy.c b/gdb/remote-nindy.c index dcc552a1fa..69849fcaf2 100644 --- a/gdb/remote-nindy.c +++ b/gdb/remote-nindy.c @@ -941,6 +941,7 @@ specified when you started GDB.", 0, /* lookup_symbol */ nindy_create_inferior, nindy_mourn_inferior, + 0, /* can_run */ process_stratum, 0, /* next */ 1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */ 0, 0, /* Section pointers */ diff --git a/gdb/remote-st2000.c b/gdb/remote-st2000.c index f7904fa9d5..d7de930776 100644 --- a/gdb/remote-st2000.c +++ b/gdb/remote-st2000.c @@ -795,6 +795,7 @@ the speed to connect at in bits per second.", 0, /* lookup_symbol */ st2000_create_inferior, st2000_mourn_inferior, + 0, /* can_run */ process_stratum, 0, /* next */ 1, diff --git a/gdb/remote-udi.c b/gdb/remote-udi.c index bac27aa68e..c54ef669d0 100644 --- a/gdb/remote-udi.c +++ b/gdb/remote-udi.c @@ -1342,6 +1342,7 @@ static struct target_ops udi_ops = { 0, /* lookup_symbol */ udi_create_inferior, /* create_inferior */ udi_mourn, /* mourn_inferior FIXME */ + 0, /* can_run */ process_stratum, 0, /* next */ 1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */ 0, 0, /* Section pointers */ diff --git a/gdb/remote-vx.c b/gdb/remote-vx.c index de9aa65f2e..39644f3ba1 100644 --- a/gdb/remote-vx.c +++ b/gdb/remote-vx.c @@ -1339,6 +1339,7 @@ Specify the name of the machine to connect to.", vx_load_command, vx_lookup_symbol, vx_create_inferior, 0, /* mourn_inferior */ + 0, /* can_run */ core_stratum, 0, /* next */ 1, 1, 0, 0, 0, /* all mem, mem, stack, regs, exec */ 0, 0, /* Section pointers */ @@ -1361,6 +1362,7 @@ struct target_ops vx_run_ops = { vx_load_command, vx_lookup_symbol, 0, vx_mourn_inferior, + 0, /* can_run */ process_stratum, 0, /* next */ 0, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */ /* all_mem is off to avoid spurious msg in "i files" */ diff --git a/gdb/xcoffexec.c b/gdb/xcoffexec.c index ddc1d23c1d..9c85b0cc57 100644 --- a/gdb/xcoffexec.c +++ b/gdb/xcoffexec.c @@ -999,6 +999,7 @@ Specify the filename of the executable file.", 0, /* lookup sym */ child_create_inferior, 0, /* mourn_inferior */ + 0, /* can_run */ file_stratum, 0, /* next */ 0, 1, 0, 0, 0, /* all mem, mem, stack, regs, exec */ 0, 0, /* section pointers */