* m68k-tdep.c (m68k_saved_pc_after_call): Use 'GDB_TARGET_IS_SUN3'
[deliverable/binutils-gdb.git] / gdb / remote-vx.68.c
index 2c17b9e2aefbf0bfec880c03618e9355311d8966..f41ce7f9142517ca6410d9f9c0d08ae842ed6e95 100644 (file)
@@ -1,26 +1,26 @@
 /* Memory-access and commands for remote VxWorks processes, for GDB.
-   Copyright (C) 1990  Free Software Foundation, Inc.
+   Copyright 1990, 1991 Free Software Foundation, Inc.
    Contributed by Wind River Systems and Cygnus Support.
 
 This file is part of GDB.
 
-GDB is free software; you can redistribute it and/or modify
+This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
-any later version.
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
 
-GDB is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GDB; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+#define         TM_FILE_OVERRIDE
 #include "defs.h"
 #include "tm-vxworks68.h"
-#include "param-no-tm.h"
 #include "frame.h"
 #include "inferior.h"
 #include "wait.h"
@@ -30,7 +30,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "symtab.h"
 #include "symfile.h"           /* for struct complaint */
 
-#include <stdio.h>
 #include <string.h>
 #include <errno.h>
 #include <signal.h>
@@ -52,7 +51,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <value.h>
 #include <symtab.h>
  
-extern value call_function_by_hand ();
 extern void symbol_file_command ();
 extern int stop_soon_quietly;          /* for wait_for_inferior */
 
@@ -187,7 +185,7 @@ vx_remove_breakpoint (addr)
 #ifdef FIXME
 /* FIXME, function calls are really fried.  GO back to manual method. */
 value
-vx_call_function (function, nargs, args)
+call_function (function, nargs, args)
      value function;
      int nargs;
      value *args;
@@ -269,7 +267,7 @@ vx_call_function (function, nargs, args)
     start_sp = text_end;
     errcode = target_write_memory (start_sp, dummy1, sizeof dummy);
     if (errcode != 0)
-      error ("Cannot write text segment -- call_function failed");
+      error ("Cannot write text segment -- vx_call_function failed");
   }
 #endif /* After text_end.  */
 #endif /* Not on stack.  */
@@ -318,7 +316,8 @@ vx_call_function (function, nargs, args)
        to the structure, not the structure itself.  */
     if (REG_STRUCT_HAS_ADDR (using_gcc))
       for (i = nargs - 1; i >= 0; i--)
-       if (TYPE_CODE (VALUE_TYPE (args[i])) == TYPE_CODE_STRUCT)
+       if (   TYPE_CODE (VALUE_TYPE (args[i])) == TYPE_CODE_STRUCT
+           || TYPE_CODE (VALUE_TYPE (args[i])) == TYPE_CODE_UNION)
          {
            CORE_ADDR addr;
 #if !(1 INNER_THAN 2)
@@ -1295,6 +1294,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 +1476,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 */
@@ -1489,7 +1502,6 @@ struct target_ops vx_ops = {
        0, 0, 0, 0, 0,  /* terminal stuff */
        0, /* vx_kill, */
        vx_add_file_command,
-       call_function_by_hand,  /* FIXME, calling fns is maybe botched? */
        vx_lookup_symbol,
        vx_create_inferior, 0,  /* mourn_inferior */
        core_stratum, 0, /* next */
@@ -1501,7 +1513,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,
@@ -1510,7 +1523,6 @@ struct target_ops vx_run_ops = {
        0, 0, 0, 0, 0,  /* terminal stuff */
        0, /* vx_kill, */
        vx_add_file_command,
-       call_function_by_hand,  /* FIXME, calling fns is maybe botched? */
        vx_lookup_symbol,
        vx_create_inferior, vx_mourn_inferior,
        process_stratum, 0, /* next */
This page took 0.025495 seconds and 4 git commands to generate.