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

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