From: Jim Kingdon Date: Fri, 19 Apr 1991 01:34:30 +0000 (+0000) Subject: * inftarg.c (child_open), remote-vx{,.68}.c (vx_proc_open): X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=70dcc196e1548122d4959b1e9e4b22c41c27a179;p=binutils-gdb.git * inftarg.c (child_open), remote-vx{,.68}.c (vx_proc_open): New function to give correct error message. --- diff --git a/gdb/inftarg.c b/gdb/inftarg.c index ce64437f766..5b52fda0a62 100644 --- a/gdb/inftarg.c +++ b/gdb/inftarg.c @@ -153,9 +153,18 @@ child_files_info () attach_flag? "attached": "child", inferior_pid); } +static void +child_open (arg, from_tty) + char *arg; + int from_tty; +{ + error ("Use the \"run\" command to start a Unix child process."); +} + struct target_ops child_ops = { "child", "Unix child process", - 0, 0, /* open, close */ + "Unix child process (started by the \"run\" command).", + child_open, 0, /* open, close */ child_attach, child_detach, child_resume, child_wait, diff --git a/gdb/remote-vx.68.c b/gdb/remote-vx.68.c index 2c17b9e2aef..2138edbc020 100644 --- a/gdb/remote-vx.68.c +++ b/gdb/remote-vx.68.c @@ -1295,6 +1295,8 @@ vx_open (args, from_tty) if (!args) error_no_arg ("target machine name"); + target_preopen (); + printf ("Attaching remote machine across net...\n"); fflush (stdout); @@ -1475,11 +1477,23 @@ net_clnt_call (procNum, inProc, in, outProc, out) return status; } +/* A vxprocess target should be started via "run" not "target". */ +/*ARGSUSED*/ +static void +vx_proc_open (name, from_tty) + char *name; + int from_tty; +{ + error ("Use the \"run\" command to start a VxWorks process."); +} + /* Target ops structure for accessing memory and such over the net */ struct target_ops vx_ops = { "vxworks", "VxWorks target memory via RPC over TCP/IP", + "Use VxWorks target memory. \n\ +Specify the name of the machine to connect to.", vx_open, 0, /* vx_detach, */ 0, 0, /* resume, wait */ 0, 0, /* read_reg, write_reg */ @@ -1501,7 +1515,8 @@ struct target_ops vx_ops = { struct target_ops vx_run_ops = { "vxprocess", "VxWorks process", - vx_open, 0, /* vx_detach, */ + "VxWorks process, started by the \"run\" command.", + vx_proc_open, 0, /* vx_detach, */ vx_resume, vx_wait, vx_read_register, vx_write_register, vx_prepare_to_store, vx_convert_to_virtual, vx_convert_from_virtual, diff --git a/gdb/remote-vx.c b/gdb/remote-vx.c index 63028e257d7..974c6a3e968 100644 --- a/gdb/remote-vx.c +++ b/gdb/remote-vx.c @@ -1379,6 +1379,8 @@ vx_open (args, from_tty) if (!args) error_no_arg ("target machine name"); + target_preopen (from_tty); + unpush_target (&vx_ops); printf ("Attaching remote machine across net...\n"); fflush (stdout); @@ -1722,11 +1724,22 @@ vx_close (quitting) vx_host = 0; } +/* A vxprocess target should be started via "run" not "target". */ +/*ARGSUSED*/ +static void +vx_proc_open (name, from_tty) + char *name; + int from_tty; +{ + error ("Use the \"run\" command to start a VxWorks process."); +} /* Target ops structure for accessing memory and such over the net */ struct target_ops vx_ops = { "vxworks", "VxWorks target memory via RPC over TCP/IP", + "Use VxWorks target memory. \n\ +Specify the name of the machine to connect to.", vx_open, vx_close, vx_attach, 0, /* vx_detach, */ 0, 0, /* resume, wait */ 0, 0, /* read_reg, write_reg */ @@ -1748,7 +1761,8 @@ struct target_ops vx_ops = { struct target_ops vx_run_ops = { "vxprocess", "VxWorks process", - vx_open, vx_proc_close, 0, vx_detach, /* vx_attach */ + "VxWorks process, started by the \"run\" command.", + vx_proc_open, vx_proc_close, 0, vx_detach, /* vx_attach */ vx_resume, vx_wait, vx_read_register, vx_write_register, vx_prepare_to_store, vx_convert_to_virtual, vx_convert_from_virtual,