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.
This commit is contained in:
John Gilmore 1992-09-22 07:23:35 +00:00
parent b28d361723
commit 5ee4e16ca7
12 changed files with 39 additions and 2 deletions

View File

@ -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

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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,

View File

@ -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 */

View File

@ -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" */

View File

@ -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 */