+2004-11-13 Andrew Cagney <cagney@gnu.org>
+
+ * configure.tgt: Delete i[34567]86-*-vxworks*, m68*-netx-*,
+ m68*-*-vxworks*, mips*-*-vxworks*, powerpc-*-vxworks*, and
+ sparc-*-vxworks*.
+ * NEWS: Mention that vxworks was deleted.
+ * config/m68k/tm-vx68.h, config/mips/tm-vxmips.h: Delete.
+ * config/powerpc/tm-vxworks.h, config/tm-vxworks.h: Delete.
+ * config/i386/vxworks.mt, config/m68k/vxworks68.mt: Delete.
+ * config/mips/vxmips.mt, config/powerpc/vxworks.mt: Delete.
+ * config/sparc/vxworks.mt, vx-share/dbgRpcLib.h: Delete.
+ * vx-share/ptrace.h, vx-share/regPacket.h: Delete.
+ * vx-share/vxTypes.h, vx-share/vxWorks.h: Delete.
+ * vx-share/wait.h, vx-share/xdr_ld.c: Delete.
+ * vx-share/xdr_ld.h, vx-share/xdr_ptrace.c: Delete.
+ * vx-share/xdr_ptrace.h, vx-share/xdr_rdb.c: Delete.
+ * vx-share/xdr_rdb.h, remote-vxsparc.c: Delete.
+ * remote-vxmips.c, remote-vx.c: Delete.
+ * remote-vx68.c: Delete.
+ * config/m68k/tm-os68k.h: Remove reference to VxWorks.
+ * config/m68k/os68k.mt, ada-lang.h: Ditto.
+ * Makefile.in (HFILES_NO_SRCDIR, ALLDEPFILES, remote-vx68.o)
+ (remote-vx.o, remote-vxmips.o, remote-vxsparc.o): Delete vx files.
+
2004-11-13 Eli Zaretskii <eliz@gnu.org>
* config/i386/xm-go32.h: Don't include fopen-bin.h.
jv-lang.h \
m2-lang.h p-lang.h \
complaints.h valprint.h \
- vx-share/dbgRpcLib.h vx-share/ptrace.h vx-share/vxTypes.h \
- vx-share/vxWorks.h vx-share/wait.h vx-share/xdr_ld.h \
- vx-share/xdr_ptrace.h vx-share/xdr_rdb.h gdbthread.h \
+ gdbthread.h \
dcache.h remote-utils.h top.h somsolib.h
# Header files that already have srcdir in them, or which are in objdir.
remote-hms.c remote-m32r-sdi.c remote-mips.c \
remote-rdp.c remote-sim.c \
remote-st.c remote-utils.c dcache.c \
- remote-vx.c \
rs6000-nat.c rs6000-tdep.c \
s390-tdep.c s390-nat.c \
ser-go32.c ser-pipe.c ser-tcp.c \
sparcnbsd-nat.c sparcnbsd-tdep.c sparcobsd-tdep.c \
symm-tdep.c symm-nat.c \
vax-nat.c vax-tdep.c vaxbsd-nat.c vaxnbsd-tdep.c \
- vx-share/xdr_ld.c vx-share/xdr_ptrace.c vx-share/xdr_rdb.c \
win32-nat.c \
xcoffread.c xcoffsolib.c \
xstormy16-tdep.c
remote-utils.o: remote-utils.c $(defs_h) $(gdb_string_h) $(gdbcmd_h) \
$(target_h) $(serial_h) $(gdbcore_h) $(inferior_h) $(remote_utils_h) \
$(regcache_h)
-remote-vx68.o: remote-vx68.c $(defs_h) $(vx_share_regPacket_h) $(frame_h) \
- $(inferior_h) $(target_h) $(gdbcore_h) $(command_h) $(symtab_h) \
- $(symfile_h) $(regcache_h) $(gdb_string_h) $(vx_share_ptrace_h) \
- $(vx_share_xdr_ptrace_h) $(vx_share_xdr_ld_h) $(vx_share_xdr_rdb_h) \
- $(vx_share_dbgRpcLib_h)
-remote-vx.o: remote-vx.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
- $(gdbcore_h) $(command_h) $(symtab_h) $(complaints_h) $(gdbcmd_h) \
- $(bfd_h) $(symfile_h) $(objfiles_h) $(gdb_stabs_h) $(regcache_h) \
- $(gdb_string_h) $(vx_share_ptrace_h) $(vx_share_xdr_ptrace_h) \
- $(vx_share_xdr_ld_h) $(vx_share_xdr_rdb_h) $(vx_share_dbgRpcLib_h)
-remote-vxmips.o: remote-vxmips.c $(defs_h) $(vx_share_regPacket_h) \
- $(frame_h) $(inferior_h) $(target_h) $(gdbcore_h) $(command_h) \
- $(symtab_h) $(symfile_h) $(regcache_h) $(gdb_string_h) \
- $(vx_share_ptrace_h) $(vx_share_xdr_ptrace_h) $(vx_share_xdr_ld_h) \
- $(vx_share_xdr_rdb_h) $(vx_share_dbgRpcLib_h)
-remote-vxsparc.o: remote-vxsparc.c $(defs_h) $(regcache_h) $(gdb_string_h) \
- $(sparc_tdep_h) $(vx_share_ptrace_h) $(vx_share_regPacket_h)
rom68k-rom.o: rom68k-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
$(serial_h) $(regcache_h) $(value_h) $(m68k_tdep_h)
rs6000-nat.o: rs6000-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
$(gdb_curses_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-winsource.c
-#
-# vx-share sub-directory
-#
-
-xdr_ld.o: vx-share/xdr_ld.c $(defs_h) vx-share/vxTypes.h \
- vx-share/vxWorks.h vx-share/xdr_ld.h
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_ld.c
-
-xdr_ptrace.o: vx-share/xdr_ptrace.c $(defs_h) vx-share/vxTypes.h \
- vx-share/vxWorks.h vx-share/xdr_ptrace.h
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_ptrace.c
-
-xdr_rdb.o: vx-share/xdr_rdb.c $(defs_h) vx-share/vxTypes.h \
- vx-share/vxWorks.h vx-share/xdr_rdb.h
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_rdb.c
-
### end of the gdb Makefile.in.
*** Changes since GDB 6.3
+* REMOVED configurations and files
+
+VxWorks and the XDR protocol *-*-vxworks
*** Changes in GDB 6.3:
system and that might consider (confusing) debugging information.
Each name (a basic regular expression string) is followed by a
comma. FIXME: Should be part of a configuration file. */
-#if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)
+#if defined(__alpha__) && defined(__osf__)
#define ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS \
"^[agis]-.*\\.ad[bs]$", \
"/usr/shlib/libpthread\\.so",
+++ /dev/null
-# Target: i386 running VxWorks
-TDEPFILES= i386-tdep.o i387-tdep.o
-DEPRECATED_TM_FILE= config/tm-vxworks.h
-# Target: VxWorks running on a 68000
+# Target: os68k running on a 68000
TDEPFILES= m68k-tdep.o
DEPRECATED_TM_FILE= tm-os68k.h
-/* Parameters for execution on VxWorks m68k's, for GDB, the GNU debugger.
+/* Parameters for execution on os68k's, for GDB, the GNU debugger.
Copyright 1986, 1987, 1989, 1991, 1998, 2003 Free Software Foundation, Inc.
Contributed by Cygnus Support.
+++ /dev/null
-/* Target machine description for VxWorks m68k's, for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1996, 1998, 1999, 2000,
- 2002, 2003
- Free Software Foundation, Inc.
- Contributed by Cygnus Support.
-
- This file is part of GDB.
-
- 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 2 of the License, or
- (at your option) any later version.
-
- 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 this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* GCC is probably the only compiler used on this configuration. So
- get this right even if the code which detects gcc2_compiled. is
- still broken. */
-
-#define BELIEVE_PCC_PROMOTION 1
-
-/* We have more complex, useful breakpoints on the target. */
-#define DECR_PC_AFTER_BREAK 0
-
-#include "config/tm-vxworks.h"
-
-/* Takes the current frame-struct pointer and returns the chain-pointer
- to get to the calling frame.
-
- If our current frame pointer is zero, we're at the top; else read out
- the saved FP from memory pointed to by the current FP. */
-
-#undef DEPRECATED_FRAME_CHAIN
-#define DEPRECATED_FRAME_CHAIN(thisframe) ((thisframe)->frame? read_memory_integer ((thisframe)->frame, 4): 0)
-
-/* FIXME, Longjmp information stolen from Sun-3 config. Dunno if right. */
-/* Offsets (in target ints) into jmp_buf. Not defined by Sun, but at least
- documented in a comment in <machine/setjmp.h>! */
-
-#define JB_ELEMENT_SIZE 4
-
-#define JB_ONSSTACK 0
-#define JB_SIGMASK 1
-#define JB_SP 2
-#define JB_PC 3
-#define JB_PSL 4
-#define JB_D2 5
-#define JB_D3 6
-#define JB_D4 7
-#define JB_D5 8
-#define JB_D6 9
-#define JB_D7 10
-#define JB_A2 11
-#define JB_A3 12
-#define JB_A4 13
-#define JB_A5 14
-#define JB_A6 15
+++ /dev/null
-# Target: Motorola m68k running VxWorks
-TDEPFILES= m68k-tdep.o remote-vx.o remote-vx68.o xdr_ld.o xdr_ptrace.o xdr_rdb.o
-DEPRECATED_TM_FILE= tm-vx68.h
+++ /dev/null
-/* Target machine description for VxWorks MIPS's, for GDB, the GNU debugger.
- Copyright 1996, 1999 Free Software Foundation, Inc.
- Contributed by Cygnus Support.
-
- This file is part of GDB.
-
- 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 2 of the License, or
- (at your option) any later version.
-
- 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 this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "config/tm-vxworks.h"
+++ /dev/null
-# Target: MIPS running VxWorks
-TDEPFILES= mips-tdep.o remote-vx.o remote-vxmips.o xdr_ld.o xdr_ptrace.o xdr_rdb.o
-DEPRECATED_TM_FILE= tm-vxmips.h
+++ /dev/null
-/* Target machine description for VxWorks on the PowerPC,
- for GDB, the GNU debugger.
- Copyright 1999 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 of the License, or
- (at your option) any later version.
-
- 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 this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef TM_VXWORKS_H
-#define TM_VXWORKS_H
-
-#include "powerpc/tm-ppc-eabi.h"
-#include "config/tm-vxworks.h"
-
-#endif /* ifndef TM_VXWORKS_H */
+++ /dev/null
-# Target: Powerpc running VxWorks
-TDEPFILES= rs6000-tdep.o ppc-sysv-tdep.o solib.o solib-svr4.o
-DEPRECATED_TM_FILE= tm-vxworks.h
+++ /dev/null
-# Target: VxWorks SPARC
-TDEPFILES= sparc-tdep.o \
- remote-vx.o remote-vxsparc.o xdr_ld.o xdr_ptrace.o xdr_rdb.o
-DEPRECATED_TM_FILE= config/tm-vxworks.h
+++ /dev/null
-/* Target machine description for VxWorks, for GDB, the GNU debugger.
- Copyright 1999 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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 2 of the License, or
- (at your option) any later version.
-
- 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 this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#define GDBINIT_FILENAME ".vxgdbinit"
-
-#define DEFAULT_PROMPT "(vxgdb) "
i[34567]86-*-netware*) gdb_target=i386
configdirs="${configdirs} nlm" ;;
i[34567]86-*-cygwin*) gdb_target=cygwin ;;
-i[34567]86-*-vxworks*) gdb_target=vxworks ;;
i[34567]86-*-*) gdb_target=i386 ;;
ia64-*-aix*) gdb_target=aix ;;
m68hc11*-*-*|m6811*-*-*) gdb_target=m68hc11 ;;
m68*-cisco*-*) gdb_target=cisco ;;
-m68*-netx-*) gdb_target=vxworks68 ;;
m68*-tandem-*) gdb_target=st2000 ;;
m68*-*-aout*) gdb_target=monitor ;;
m68*-*-coff*) gdb_target=monitor ;;
m68*-*-openbsd*) gdb_target=obsd ;;
m68*-*-os68k*) gdb_target=os68k ;;
m68*-*-uclinux*) gdb_target=monitor ;;
-m68*-*-vxworks*) gdb_target=vxworks68 ;;
m88*-*-openbsd*) gdb_target=obsd ;;
mips*-*-netbsd* | mips*-*-knetbsd*-gnu)
gdb_target=nbsd ;;
mips64*-*-openbsd*) gdb_target=obsd64 ;;
-mips*-*-vxworks*) gdb_target=vxmips ;;
mips*-*-*) gdb_target=embed ;;
mn10300-*-*) gdb_target=mn10300 ;;
build_gdbserver=yes
;;
powerpc64-*-linux*) gdb_target=linux ;;
-powerpc-*-vxworks*) gdb_target=vxworks ;;
powerpc*-*-*) if test -f ../sim/ppc/Makefile; then
gdb_target=ppc-sim
else
sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*)
gdb_target=sol2-64
;;
-sparc-*-vxworks*) gdb_target=vxworks ;;
sparc-*-*) gdb_target=sparc ;;
sparc64-*-*) gdb_target=sparc64 ;;
+++ /dev/null
-/* Memory-access and commands for remote VxWorks processes, for GDB.
-
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999,
- 2000, 2001, 2002 Free Software Foundation, Inc.
-
- Contributed by Wind River Systems and Cygnus Support.
-
- This file is part of GDB.
-
- 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 2 of the License, or
- (at your option) any later version.
-
- 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 this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "frame.h"
-#include "inferior.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "command.h"
-#include "symtab.h"
-#include "complaints.h"
-#include "gdbcmd.h"
-#include "bfd.h" /* Required by objfiles.h. */
-#include "symfile.h"
-#include "objfiles.h"
-#include "gdb-stabs.h"
-#include "regcache.h"
-
-#include "gdb_string.h"
-#include <errno.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#define malloc bogon_malloc /* Sun claims "char *malloc()" not void * */
-#define free bogon_free /* Sun claims "int free()" not void */
-#define realloc bogon_realloc /* Sun claims "char *realloc()", not void * */
-#include <rpc/rpc.h>
-#undef malloc
-#undef free
-#undef realloc
-#include <sys/time.h> /* UTek's <rpc/rpc.h> doesn't #incl this */
-#include <netdb.h>
-#include "vx-share/ptrace.h"
-#include "vx-share/xdr_ptrace.h"
-#include "vx-share/xdr_ld.h"
-#include "vx-share/xdr_rdb.h"
-#include "vx-share/dbgRpcLib.h"
-
-#include <symtab.h>
-
-/* Maximum number of bytes to transfer in a single
- PTRACE_{READ,WRITE}DATA request. */
-#define VX_MEMXFER_MAX 4096
-
-extern void vx_read_register ();
-extern void vx_write_register ();
-extern void symbol_file_command ();
-extern enum stop_kind stop_soon; /* for wait_for_inferior */
-
-static int net_step ();
-static int net_ptrace_clnt_call (); /* Forward decl */
-static enum clnt_stat net_clnt_call (); /* Forward decl */
-
-/* Target ops structure for accessing memory and such over the net */
-
-static struct target_ops vx_ops;
-
-/* Target ops structure for accessing VxWorks child processes over the net */
-
-static struct target_ops vx_run_ops;
-
-/* Saved name of target host and called function for "info files".
- Both malloc'd. */
-
-static char *vx_host;
-static char *vx_running; /* Called function */
-
-/* Nonzero means target that is being debugged remotely has a floating
- point processor. */
-
-int target_has_fp;
-
-/* Default error message when the network is forking up. */
-
-static const char rpcerr[] = "network target debugging: rpc error";
-
-CLIENT *pClient; /* client used in net debugging */
-static int ptraceSock = RPC_ANYSOCK;
-
-enum clnt_stat net_clnt_call ();
-static void parse_args ();
-
-static struct timeval rpcTimeout =
-{10, 0};
-
-static char *skip_white_space ();
-static char *find_white_space ();
-
-/* Tell the VxWorks target system to download a file.
- The load addresses of the text, data, and bss segments are
- stored in *pTextAddr, *pDataAddr, and *pBssAddr (respectively).
- Returns 0 for success, -1 for failure. */
-
-static int
-net_load (char *filename, CORE_ADDR *pTextAddr, CORE_ADDR *pDataAddr,
- CORE_ADDR *pBssAddr)
-{
- enum clnt_stat status;
- struct ldfile ldstruct;
- struct timeval load_timeout;
-
- memset ((char *) &ldstruct, '\0', sizeof (ldstruct));
-
- /* We invoke clnt_call () here directly, instead of through
- net_clnt_call (), because we need to set a large timeout value.
- The load on the target side can take quite a while, easily
- more than 10 seconds. The user can kill this call by typing
- CTRL-C if there really is a problem with the load.
-
- Do not change the tv_sec value without checking -- select() imposes
- a limit of 10**8 on it for no good reason that I can see... */
-
- load_timeout.tv_sec = 99999999; /* A large number, effectively inf. */
- load_timeout.tv_usec = 0;
-
- status = clnt_call (pClient, VX_LOAD, xdr_wrapstring, &filename, xdr_ldfile,
- &ldstruct, load_timeout);
-
- if (status == RPC_SUCCESS)
- {
- if (*ldstruct.name == 0) /* load failed on VxWorks side */
- return -1;
- *pTextAddr = ldstruct.txt_addr;
- *pDataAddr = ldstruct.data_addr;
- *pBssAddr = ldstruct.bss_addr;
- return 0;
- }
- else
- return -1;
-}
-
-/* returns 0 if successful, errno if RPC failed or VxWorks complains. */
-
-static int
-net_break (int addr, u_long procnum)
-{
- enum clnt_stat status;
- int break_status;
- Rptrace ptrace_in; /* XXX This is stupid. It doesn't need to be a ptrace
- structure. How about something smaller? */
-
- memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in));
- break_status = 0;
-
- ptrace_in.addr = addr;
- ptrace_in.pid = PIDGET (inferior_ptid);
-
- status = net_clnt_call (procnum, xdr_rptrace, &ptrace_in, xdr_int,
- &break_status);
-
- if (status != RPC_SUCCESS)
- return errno;
-
- if (break_status == -1)
- return ENOMEM;
- return break_status; /* probably (FIXME) zero */
-}
-
-/* returns 0 if successful, errno otherwise */
-
-static int
-vx_insert_breakpoint (int addr)
-{
- return net_break (addr, VX_BREAK_ADD);
-}
-
-/* returns 0 if successful, errno otherwise */
-
-static int
-vx_remove_breakpoint (int addr)
-{
- return net_break (addr, VX_BREAK_DELETE);
-}
-
-/* Start an inferior process and sets inferior_ptid to its pid.
- EXEC_FILE is the file to run.
- ALLARGS is a string containing the arguments to the program.
- ENV is the environment vector to pass.
- Returns process id. Errors reported with error().
- On VxWorks, we ignore exec_file. */
-
-static void
-vx_create_inferior (char *exec_file, char *args, char **env, int from_tty)
-{
- enum clnt_stat status;
- arg_array passArgs;
- TASK_START taskStart;
-
- memset ((char *) &passArgs, '\0', sizeof (passArgs));
- memset ((char *) &taskStart, '\0', sizeof (taskStart));
-
- /* parse arguments, put them in passArgs */
-
- parse_args (args, &passArgs);
-
- if (passArgs.arg_array_len == 0)
- error ("You must specify a function name to run, and arguments if any");
-
- status = net_clnt_call (PROCESS_START, xdr_arg_array, &passArgs,
- xdr_TASK_START, &taskStart);
-
- if ((status != RPC_SUCCESS) || (taskStart.status == -1))
- error ("Can't create process on remote target machine");
-
- /* Save the name of the running function */
- vx_running = savestring (passArgs.arg_array_val[0],
- strlen (passArgs.arg_array_val[0]));
-
- push_target (&vx_run_ops);
- inferior_ptid = pid_to_ptid (taskStart.pid);
-
- /* We will get a trace trap after one instruction.
- Insert breakpoints and continue. */
-
- init_wait_for_inferior ();
-
- /* Set up the "saved terminal modes" of the inferior
- based on what modes we are starting it with. */
- target_terminal_init ();
-
- /* Install inferior's terminal modes. */
- target_terminal_inferior ();
-
- stop_soon = STOP_QUIETLY;
- wait_for_inferior (); /* Get the task spawn event */
- stop_soon = NO_STOP_QUIETLY;
-
- /* insert_step_breakpoint (); FIXME, do we need this? */
- proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
-}
-
-/* Fill ARGSTRUCT in argc/argv form with the arguments from the
- argument string ARGSTRING. */
-
-static void
-parse_args (char *arg_string, arg_array *arg_struct)
-{
- int arg_count = 0; /* number of arguments */
- int arg_index = 0;
- char *p0;
-
- memset ((char *) arg_struct, '\0', sizeof (arg_array));
-
- /* first count how many arguments there are */
-
- p0 = arg_string;
- while (*p0 != '\0')
- {
- if (*(p0 = skip_white_space (p0)) == '\0')
- break;
- p0 = find_white_space (p0);
- arg_count++;
- }
-
- arg_struct->arg_array_len = arg_count;
- arg_struct->arg_array_val = (char **) xmalloc ((arg_count + 1)
- * sizeof (char *));
-
- /* now copy argument strings into arg_struct. */
-
- while (*(arg_string = skip_white_space (arg_string)))
- {
- p0 = find_white_space (arg_string);
- arg_struct->arg_array_val[arg_index++] = savestring (arg_string,
- p0 - arg_string);
- arg_string = p0;
- }
-
- arg_struct->arg_array_val[arg_count] = NULL;
-}
-
-/* Advance a string pointer across whitespace and return a pointer
- to the first non-white character. */
-
-static char *
-skip_white_space (char *p)
-{
- while (*p == ' ' || *p == '\t')
- p++;
- return p;
-}
-
-/* Search for the first unquoted whitespace character in a string.
- Returns a pointer to the character, or to the null terminator
- if no whitespace is found. */
-
-static char *
-find_white_space (char *p)
-{
- int c;
-
- while ((c = *p) != ' ' && c != '\t' && c)
- {
- if (c == '\'' || c == '"')
- {
- while (*++p != c && *p)
- {
- if (*p == '\\')
- p++;
- }
- if (!*p)
- break;
- }
- p++;
- }
- return p;
-}
-
-/* Poll the VxWorks target system for an event related
- to the debugged task.
- Returns -1 if remote wait failed, task status otherwise. */
-
-static int
-net_wait (RDB_EVENT *pEvent)
-{
- int pid;
- enum clnt_stat status;
-
- memset ((char *) pEvent, '\0', sizeof (RDB_EVENT));
-
- pid = PIDGET (inferior_ptid);
- status = net_clnt_call (PROCESS_WAIT, xdr_int, &pid, xdr_RDB_EVENT,
- pEvent);
-
- /* return (status == RPC_SUCCESS)? pEvent->status: -1; */
- if (status == RPC_SUCCESS)
- return ((pEvent->status) ? 1 : 0);
- else if (status == RPC_TIMEDOUT)
- return (1);
- else
- return (-1);
-}
-
-/* Suspend the remote task.
- Returns -1 if suspend fails on target system, 0 otherwise. */
-
-static int
-net_quit (void)
-{
- int pid;
- int quit_status;
- enum clnt_stat status;
-
- quit_status = 0;
-
- /* don't let rdbTask suspend itself by passing a pid of 0 */
-
- if ((pid = PIDGET (inferior_ptid)) == 0)
- return -1;
-
- status = net_clnt_call (VX_TASK_SUSPEND, xdr_int, &pid, xdr_int,
- &quit_status);
-
- return (status == RPC_SUCCESS) ? quit_status : -1;
-}
-
-/* Read a register or registers from the remote system. */
-
-void
-net_read_registers (char *reg_buf, int len, u_long procnum)
-{
- int status;
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
- C_bytes out_data;
- char message[100];
-
- memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in));
- memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out));
-
- /* Initialize RPC input argument structure. */
-
- ptrace_in.pid = PIDGET (inferior_ptid);
- ptrace_in.info.ttype = NOINFO;
-
- /* Initialize RPC return value structure. */
-
- out_data.bytes = reg_buf;
- out_data.len = len;
- ptrace_out.info.more_data = (caddr_t) & out_data;
-
- /* Call RPC; take an error exit if appropriate. */
-
- status = net_ptrace_clnt_call (procnum, &ptrace_in, &ptrace_out);
- if (status)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno_num;
- sprintf (message, "reading %s registers", (procnum == PTRACE_GETREGS)
- ? "general-purpose"
- : "floating-point");
- perror_with_name (message);
- }
-}
-
-/* Write register values to a VxWorks target. REG_BUF points to a buffer
- containing the raw register values, LEN is the length of REG_BUF in
- bytes, and PROCNUM is the RPC procedure number (PTRACE_SETREGS or
- PTRACE_SETFPREGS). An error exit is taken if the RPC call fails or
- if an error status is returned by the remote debug server. This is
- a utility routine used by vx_write_register (). */
-
-void
-net_write_registers (char *reg_buf, int len, u_long procnum)
-{
- int status;
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
- C_bytes in_data;
- char message[100];
-
- memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in));
- memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out));
-
- /* Initialize RPC input argument structure. */
-
- in_data.bytes = reg_buf;
- in_data.len = len;
-
- ptrace_in.pid = PIDGET (inferior_ptid);
- ptrace_in.info.ttype = DATA;
- ptrace_in.info.more_data = (caddr_t) & in_data;
-
- /* Call RPC; take an error exit if appropriate. */
-
- status = net_ptrace_clnt_call (procnum, &ptrace_in, &ptrace_out);
- if (status)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno_num;
- sprintf (message, "writing %s registers", (procnum == PTRACE_SETREGS)
- ? "general-purpose"
- : "floating-point");
- perror_with_name (message);
- }
-}
-
-/* Prepare to store registers. Since we will store all of them,
- read out their current values now. */
-
-static void
-vx_prepare_to_store (void)
-{
- /* Fetch all registers, if any of them are not yet fetched. */
- deprecated_read_register_bytes (0, NULL, deprecated_register_bytes ());
-}
-
-/* Copy LEN bytes to or from remote inferior's memory starting at MEMADDR
- to debugger memory starting at MYADDR. WRITE is true if writing to the
- inferior. TARGET is unused.
- Result is the number of bytes written or read (zero if error). The
- protocol allows us to return a negative count, indicating that we can't
- handle the current address but can handle one N bytes further, but
- vxworks doesn't give us that information. */
-
-static int
-vx_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
- struct mem_attrib *attrib, struct target_ops *target)
-{
- int status;
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
- C_bytes data;
- enum ptracereq request;
- int nleft, nxfer;
-
- memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in));
- memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out));
-
- ptrace_in.pid = PIDGET (inferior_ptid); /* XXX pid unnecessary for READDATA */
- ptrace_in.addr = (int) memaddr; /* Where from */
- ptrace_in.data = len; /* How many bytes */
-
- if (write)
- {
- ptrace_in.info.ttype = DATA;
- ptrace_in.info.more_data = (caddr_t) & data;
-
- data.bytes = (caddr_t) myaddr; /* Where from */
- data.len = len; /* How many bytes (again, for XDR) */
- request = PTRACE_WRITEDATA;
- }
- else
- {
- ptrace_out.info.more_data = (caddr_t) & data;
- request = PTRACE_READDATA;
- }
- /* Loop until the entire request has been satisfied, transferring
- at most VX_MEMXFER_MAX bytes per iteration. Break from the loop
- if an error status is returned by the remote debug server. */
-
- nleft = len;
- status = 0;
-
- while (nleft > 0 && status == 0)
- {
- nxfer = min (nleft, VX_MEMXFER_MAX);
-
- ptrace_in.addr = (int) memaddr;
- ptrace_in.data = nxfer;
- data.bytes = (caddr_t) myaddr;
- data.len = nxfer;
-
- /* Request a block from the remote debug server; if RPC fails,
- report an error and return to debugger command level. */
-
- if (net_ptrace_clnt_call (request, &ptrace_in, &ptrace_out))
- error (rpcerr);
-
- status = ptrace_out.status;
- if (status == 0)
- {
- memaddr += nxfer;
- myaddr += nxfer;
- nleft -= nxfer;
- }
- else
- {
- /* A target-side error has ocurred. Set errno to the error
- code chosen by the target so that a later perror () will
- say something meaningful. */
-
- errno = ptrace_out.errno_num;
- }
- }
-
- /* Return the number of bytes transferred. */
-
- return (len - nleft);
-}
-
-static void
-vx_files_info (void)
-{
- printf_unfiltered ("\tAttached to host `%s'", vx_host);
- printf_unfiltered (", which has %sfloating point", target_has_fp ? "" : "no ");
- printf_unfiltered (".\n");
-}
-
-static void
-vx_run_files_info (void)
-{
- printf_unfiltered ("\tRunning %s VxWorks process %s",
- vx_running ? "child" : "attached",
- hex_string (PIDGET (inferior_ptid)));
- if (vx_running)
- printf_unfiltered (", function `%s'", vx_running);
- printf_unfiltered (".\n");
-}
-
-static void
-vx_resume (ptid_t ptid, int step, enum target_signal siggnal)
-{
- int status;
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
- CORE_ADDR cont_addr;
-
- if (ptid_equal (ptid, minus_one_ptid))
- ptid = inferior_ptid;
-
- if (siggnal != 0 && siggnal != stop_signal)
- error ("Cannot send signals to VxWorks processes");
-
- /* Set CONT_ADDR to the address at which we are continuing,
- or to 1 if we are continuing from where the program stopped.
- This conforms to traditional ptrace () usage, but at the same
- time has special meaning for the VxWorks remote debug server.
- If the address is not 1, the server knows that the target
- program is jumping to a new address, which requires special
- handling if there is a breakpoint at the new address. */
-
- cont_addr = read_register (PC_REGNUM);
- if (cont_addr == stop_pc)
- cont_addr = 1;
-
- memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in));
- memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out));
-
- ptrace_in.pid = PIDGET (ptid);
- ptrace_in.addr = cont_addr; /* Target side insists on this, or it panics. */
-
- if (step)
- status = net_step ();
- else
- status = net_ptrace_clnt_call (PTRACE_CONT, &ptrace_in, &ptrace_out);
-
- if (status)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno_num;
- perror_with_name ("Resuming remote process");
- }
-}
-
-static void
-vx_mourn_inferior (void)
-{
- pop_target (); /* Pop back to no-child state */
- generic_mourn_inferior ();
-}
-\f
-
-static void vx_add_symbols (char *, int, CORE_ADDR, CORE_ADDR, CORE_ADDR);
-
-struct find_sect_args
- {
- CORE_ADDR text_start;
- CORE_ADDR data_start;
- CORE_ADDR bss_start;
- };
-
-static void find_sect (bfd *, asection *, void *);
-
-static void
-find_sect (bfd *abfd, asection *sect, void *obj)
-{
- struct find_sect_args *args = (struct find_sect_args *) obj;
-
- if (bfd_get_section_flags (abfd, sect) & (SEC_CODE & SEC_READONLY))
- args->text_start = bfd_get_section_vma (abfd, sect);
- else if (bfd_get_section_flags (abfd, sect) & SEC_ALLOC)
- {
- if (bfd_get_section_flags (abfd, sect) & SEC_LOAD)
- {
- /* Exclude .ctor and .dtor sections which have SEC_CODE set but not
- SEC_DATA. */
- if (bfd_get_section_flags (abfd, sect) & SEC_DATA)
- args->data_start = bfd_get_section_vma (abfd, sect);
- }
- else
- args->bss_start = bfd_get_section_vma (abfd, sect);
- }
-}
-
-static void
-vx_add_symbols (char *name, int from_tty, CORE_ADDR text_addr,
- CORE_ADDR data_addr, CORE_ADDR bss_addr)
-{
- struct section_offsets *offs;
- struct objfile *objfile;
- struct find_sect_args ss;
-
- /* It might be nice to suppress the breakpoint_re_set which happens here
- because we are going to do one again after the objfile_relocate. */
- objfile = symbol_file_add (name, from_tty, NULL, 0, 0);
-
- /* This is a (slightly cheesy) way of superceding the old symbols. A less
- cheesy way would be to find the objfile with the same name and
- free_objfile it. */
- objfile_to_front (objfile);
-
- offs =
- (struct section_offsets *)
- alloca (SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
- memcpy (offs, objfile->section_offsets,
- SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
-
- ss.text_start = 0;
- ss.data_start = 0;
- ss.bss_start = 0;
- bfd_map_over_sections (objfile->obfd, find_sect, &ss);
-
- /* Both COFF and b.out frontends use these SECT_OFF_* values. */
- offs->offsets[SECT_OFF_TEXT (objfile)] = text_addr - ss.text_start;
- offs->offsets[SECT_OFF_DATA (objfile)] = data_addr - ss.data_start;
- offs->offsets[SECT_OFF_BSS (objfile)] = bss_addr - ss.bss_start;
- objfile_relocate (objfile, offs);
-}
-
-/* This function allows the addition of incrementally linked object files. */
-
-static void
-vx_load_command (char *arg_string, int from_tty)
-{
- CORE_ADDR text_addr;
- CORE_ADDR data_addr;
- CORE_ADDR bss_addr;
-
- if (arg_string == 0)
- error ("The load command takes a file name");
-
- arg_string = tilde_expand (arg_string);
- make_cleanup (xfree, arg_string);
-
- dont_repeat ();
-
- /* Refuse to load the module if a debugged task is running. Doing so
- can have a number of unpleasant consequences to the running task. */
-
- if (PIDGET (inferior_ptid) != 0 && target_has_execution)
- {
- if (query ("You may not load a module while the target task is running.\n\
-Kill the target task? "))
- target_kill ();
- else
- error ("Load canceled.");
- }
-
- QUIT;
- immediate_quit++;
- if (net_load (arg_string, &text_addr, &data_addr, &bss_addr) == -1)
- error ("Load failed on target machine");
- immediate_quit--;
-
- vx_add_symbols (arg_string, from_tty, text_addr, data_addr, bss_addr);
-
- /* Getting new symbols may change our opinion about what is
- frameless. */
- reinit_frame_cache ();
-}
-
-/* Single step the target program at the source or machine level.
- Takes an error exit if rpc fails.
- Returns -1 if remote single-step operation fails, else 0. */
-
-static int
-net_step (void)
-{
- enum clnt_stat status;
- int step_status;
- SOURCE_STEP source_step;
-
- source_step.taskId = PIDGET (inferior_ptid);
- source_step.startAddr = 0;
- source_step.endAddr = 0;
-
- status = net_clnt_call (VX_SOURCE_STEP, xdr_SOURCE_STEP, &source_step,
- xdr_int, &step_status);
-
- if (status == RPC_SUCCESS)
- return step_status;
- else
- error (rpcerr);
-}
-
-/* Emulate ptrace using RPC calls to the VxWorks target system.
- Returns nonzero (-1) if RPC status to VxWorks is bad, 0 otherwise. */
-
-static int
-net_ptrace_clnt_call (enum ptracereq request, Rptrace *pPtraceIn,
- Ptrace_return *pPtraceOut)
-{
- enum clnt_stat status;
-
- status = net_clnt_call (request, xdr_rptrace, pPtraceIn, xdr_ptrace_return,
- pPtraceOut);
-
- if (status != RPC_SUCCESS)
- return -1;
-
- return 0;
-}
-
-/* Query the target for the name of the file from which VxWorks was
- booted. pBootFile is the address of a pointer to the buffer to
- receive the file name; if the pointer pointed to by pBootFile is
- NULL, memory for the buffer will be allocated by XDR.
- Returns -1 if rpc failed, 0 otherwise. */
-
-static int
-net_get_boot_file (char **pBootFile)
-{
- enum clnt_stat status;
-
- status = net_clnt_call (VX_BOOT_FILE_INQ, xdr_void, (char *) 0,
- xdr_wrapstring, pBootFile);
- return (status == RPC_SUCCESS) ? 0 : -1;
-}
-
-/* Fetch a list of loaded object modules from the VxWorks target
- and store in PLOADTABLE.
- Returns -1 if rpc failed, 0 otherwise
- There's no way to check if the returned loadTable is correct.
- VxWorks doesn't check it. */
-
-static int
-net_get_symbols (ldtabl *pLoadTable)
-{
- enum clnt_stat status;
-
- memset ((char *) pLoadTable, '\0', sizeof (struct ldtabl));
-
- status = net_clnt_call (VX_STATE_INQ, xdr_void, 0, xdr_ldtabl, pLoadTable);
- return (status == RPC_SUCCESS) ? 0 : -1;
-}
-
-/* Look up a symbol in the VxWorks target's symbol table.
- Returns status of symbol read on target side (0=success, -1=fail)
- Returns -1 and complain()s if rpc fails. */
-
-static int
-vx_lookup_symbol (char *name, /* symbol name */
- CORE_ADDR *pAddr)
-{
- enum clnt_stat status;
- SYMBOL_ADDR symbolAddr;
-
- *pAddr = 0;
- memset ((char *) &symbolAddr, '\0', sizeof (symbolAddr));
-
- status = net_clnt_call (VX_SYMBOL_INQ, xdr_wrapstring, &name,
- xdr_SYMBOL_ADDR, &symbolAddr);
- if (status != RPC_SUCCESS)
- {
- complaint (&symfile_complaints, "Lost contact with VxWorks target");
- return -1;
- }
-
- *pAddr = symbolAddr.addr;
- return symbolAddr.status;
-}
-
-/* Check to see if the VxWorks target has a floating point coprocessor.
- Returns 1 if target has floating point processor, 0 otherwise.
- Calls error() if rpc fails. */
-
-static int
-net_check_for_fp (void)
-{
- enum clnt_stat status;
- bool_t fp = 0; /* true if fp processor is present on target board */
-
- status = net_clnt_call (VX_FP_INQUIRE, xdr_void, 0, xdr_bool, &fp);
- if (status != RPC_SUCCESS)
- error (rpcerr);
-
- return (int) fp;
-}
-
-/* Establish an RPC connection with the VxWorks target system.
- Calls error () if unable to establish connection. */
-
-static void
-net_connect (char *host)
-{
- struct sockaddr_in destAddr;
- struct hostent *destHost;
- unsigned long addr;
-
- /* Get the internet address for the given host. Allow a numeric
- IP address or a hostname. */
-
- addr = inet_addr (host);
- if (addr == -1)
- {
- destHost = (struct hostent *) gethostbyname (host);
- if (destHost == NULL)
- /* FIXME: Probably should include hostname here in quotes.
- For example if the user types "target vxworks vx960 " it should
- say "Invalid host `vx960 '." not just "Invalid hostname". */
- error ("Invalid hostname. Couldn't find remote host address.");
- addr = *(unsigned long *) destHost->h_addr;
- }
-
- memset (&destAddr, '\0', sizeof (destAddr));
-
- destAddr.sin_addr.s_addr = addr;
- destAddr.sin_family = AF_INET;
- destAddr.sin_port = 0; /* set to actual port that remote
- ptrace is listening on. */
-
- /* Create a tcp client transport on which to issue
- calls to the remote ptrace server. */
-
- ptraceSock = RPC_ANYSOCK;
- pClient = clnttcp_create (&destAddr, RDBPROG, RDBVERS, &ptraceSock, 0, 0);
- /* FIXME, here is where we deal with different version numbers of the
- proto */
-
- if (pClient == NULL)
- {
- clnt_pcreateerror ("\tnet_connect");
- error ("Couldn't connect to remote target.");
- }
-}
-\f
-/* Sleep for the specified number of milliseconds
- * (assumed to be less than 1000).
- * If select () is interrupted, returns immediately;
- * takes an error exit if select () fails for some other reason.
- */
-
-static void
-sleep_ms (long ms)
-{
- struct timeval select_timeout;
- int status;
-
- select_timeout.tv_sec = 0;
- select_timeout.tv_usec = ms * 1000;
-
- status = select (0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0,
- &select_timeout);
-
- if (status < 0 && errno != EINTR)
- perror_with_name ("select");
-}
-
-static ptid_t
-vx_wait (ptid_t ptid_to_wait_for, struct target_waitstatus *status)
-{
- int pid;
- RDB_EVENT rdbEvent;
- int quit_failed;
-
- do
- {
- /* If CTRL-C is hit during this loop,
- suspend the inferior process. */
-
- quit_failed = 0;
- if (quit_flag)
- {
- quit_failed = (net_quit () == -1);
- quit_flag = 0;
- }
-
- /* If a net_quit () or net_wait () call has failed,
- allow the user to break the connection with the target.
- We can't simply error () out of this loop, since the
- data structures representing the state of the inferior
- are in an inconsistent state. */
-
- if (quit_failed || net_wait (&rdbEvent) == -1)
- {
- terminal_ours ();
- if (query ("Can't %s. Disconnect from target system? ",
- (quit_failed) ? "suspend remote task"
- : "get status of remote task"))
- {
- target_mourn_inferior ();
- error ("Use the \"target\" command to reconnect.");
- }
- else
- {
- terminal_inferior ();
- continue;
- }
- }
-
- pid = rdbEvent.taskId;
- if (pid == 0)
- {
- sleep_ms (200); /* FIXME Don't kill the network too badly */
- }
- else if (pid != PIDGET (inferior_ptid))
- internal_error (__FILE__, __LINE__,
- "Bad pid for debugged task: %s\n",
- hex_string ((unsigned long) pid));
- }
- while (pid == 0);
-
- /* The mostly likely kind. */
- status->kind = TARGET_WAITKIND_STOPPED;
-
- switch (rdbEvent.eventType)
- {
- case EVENT_EXIT:
- status->kind = TARGET_WAITKIND_EXITED;
- /* FIXME is it possible to distinguish between a
- normal vs abnormal exit in VxWorks? */
- status->value.integer = 0;
- break;
-
- case EVENT_START:
- /* Task was just started. */
- status->value.sig = TARGET_SIGNAL_TRAP;
- break;
-
- case EVENT_STOP:
- status->value.sig = TARGET_SIGNAL_TRAP;
- /* XXX was it stopped by a signal? act accordingly */
- break;
-
- case EVENT_BREAK: /* Breakpoint was hit. */
- status->value.sig = TARGET_SIGNAL_TRAP;
- break;
-
- case EVENT_SUSPEND: /* Task was suspended, probably by ^C. */
- status->value.sig = TARGET_SIGNAL_INT;
- break;
-
- case EVENT_BUS_ERR: /* Task made evil nasty reference. */
- status->value.sig = TARGET_SIGNAL_BUS;
- break;
-
- case EVENT_ZERO_DIV: /* Division by zero */
- status->value.sig = TARGET_SIGNAL_FPE;
- break;
-
- case EVENT_SIGNAL:
-#ifdef I80960
- status->value.sig = i960_fault_to_signal (rdbEvent.sigType);
-#else
- /* Back in the old days, before enum target_signal, this code used
- to add NSIG to the signal number and claim that PRINT_RANDOM_SIGNAL
- would take care of it. But PRINT_RANDOM_SIGNAL has never been
- defined except on the i960, so I don't really know what we are
- supposed to do on other architectures. */
- status->value.sig = TARGET_SIGNAL_UNKNOWN;
-#endif
- break;
- } /* switch */
- return pid_to_ptid (pid);
-}
-\f
-static int
-symbol_stub (char *arg)
-{
- symbol_file_add_main (arg, 0);
- return 1;
-}
-
-static int
-add_symbol_stub (char *arg)
-{
- struct ldfile *pLoadFile = (struct ldfile *) arg;
-
- printf_unfiltered ("\t%s: ", pLoadFile->name);
- vx_add_symbols (pLoadFile->name, 0, pLoadFile->txt_addr,
- pLoadFile->data_addr, pLoadFile->bss_addr);
- printf_unfiltered ("ok\n");
- return 1;
-}
-/* Target command for VxWorks target systems.
-
- Used in vxgdb. Takes the name of a remote target machine
- running vxWorks and connects to it to initialize remote network
- debugging. */
-
-static void
-vx_open (char *args, int from_tty)
-{
- extern int close ();
- char *bootFile;
- extern char *source_path;
- struct ldtabl loadTable;
- struct ldfile *pLoadFile;
- int i;
- extern CLIENT *pClient;
- int symbols_added = 0;
-
- if (!args)
- error_no_arg ("target machine name");
-
- target_preopen (from_tty);
-
- unpush_target (&vx_ops);
- printf_unfiltered ("Attaching remote machine across net...\n");
- gdb_flush (gdb_stdout);
-
- /* Allow the user to kill the connect attempt by typing ^C.
- Wait until the call to target_has_fp () completes before
- disallowing an immediate quit, since even if net_connect ()
- is successful, the remote debug server might be hung. */
-
- immediate_quit++;
-
- net_connect (args);
- target_has_fp = net_check_for_fp ();
- printf_filtered ("Connected to %s.\n", args);
-
- immediate_quit--;
-
- push_target (&vx_ops);
-
- /* Save a copy of the target host's name. */
- vx_host = savestring (args, strlen (args));
-
- /* Find out the name of the file from which the target was booted
- and load its symbol table. */
-
- printf_filtered ("Looking in Unix path for all loaded modules:\n");
- bootFile = NULL;
- if (!net_get_boot_file (&bootFile))
- {
- if (*bootFile)
- {
- printf_filtered ("\t%s: ", bootFile);
- /* This assumes that the kernel is never relocated. Hope that is an
- accurate assumption. */
- if (catch_errors
- (symbol_stub,
- bootFile,
- "Error while reading symbols from boot file:\n",
- RETURN_MASK_ALL))
- puts_filtered ("ok\n");
- }
- else if (from_tty)
- printf_unfiltered ("VxWorks kernel symbols not loaded.\n");
- }
- else
- error ("Can't retrieve boot file name from target machine.");
-
- clnt_freeres (pClient, xdr_wrapstring, &bootFile);
-
- if (net_get_symbols (&loadTable) != 0)
- error ("Can't read loaded modules from target machine");
-
- i = 0 - 1;
- while (++i < loadTable.tbl_size)
- {
- QUIT; /* FIXME, avoids clnt_freeres below: mem leak */
- pLoadFile = &loadTable.tbl_ent[i];
-#ifdef WRS_ORIG
- {
- int desc;
- struct cleanup *old_chain;
- char *fullname = NULL;
-
- desc = openp (source_path, 0, pLoadFile->name, O_RDONLY, 0, &fullname);
- if (desc < 0)
- perror_with_name (pLoadFile->name);
- old_chain = make_cleanup (close, desc);
- add_file_at_addr (fullname, desc, pLoadFile->txt_addr, pLoadFile->data_addr,
- pLoadFile->bss_addr);
- do_cleanups (old_chain);
- }
-#else
- /* FIXME: Is there something better to search than the PATH? (probably
- not the source path, since source might be in different directories
- than objects. */
-
- if (catch_errors (add_symbol_stub, (char *) pLoadFile, (char *) 0,
- RETURN_MASK_ALL))
- symbols_added = 1;
-#endif
- }
- printf_filtered ("Done.\n");
-
- clnt_freeres (pClient, xdr_ldtabl, &loadTable);
-
- /* Getting new symbols may change our opinion about what is
- frameless. */
- if (symbols_added)
- reinit_frame_cache ();
-}
-\f
-/* Takes a task started up outside of gdb and ``attaches'' to it.
- This stops it cold in its tracks and allows us to start tracing it. */
-
-static void
-vx_attach (char *args, int from_tty)
-{
- unsigned long pid;
- char *cptr = 0;
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
- int status;
-
- if (!args)
- error_no_arg ("process-id to attach");
-
- pid = strtoul (args, &cptr, 0);
- if ((cptr == args) || (*cptr != '\0'))
- error ("Invalid process-id -- give a single number in decimal or 0xhex");
-
- if (from_tty)
- printf_unfiltered ("Attaching pid %s.\n",
- hex_string ((unsigned long) pid));
-
- memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in));
- memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out));
- ptrace_in.pid = pid;
-
- status = net_ptrace_clnt_call (PTRACE_ATTACH, &ptrace_in, &ptrace_out);
- if (status == -1)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno_num;
- perror_with_name ("Attaching remote process");
- }
-
- /* It worked... */
-
- inferior_ptid = pid_to_ptid (pid);
- push_target (&vx_run_ops);
-
- if (vx_running)
- xfree (vx_running);
- vx_running = 0;
-}
-
-/* detach_command --
- takes a program previously attached to and detaches it.
- The program resumes execution and will no longer stop
- on signals, etc. We better not have left any breakpoints
- in the program or it'll die when it hits one. For this
- to work, it may be necessary for the process to have been
- previously attached. It *might* work if the program was
- started via the normal ptrace (PTRACE_TRACEME). */
-
-static void
-vx_detach (char *args, int from_tty)
-{
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
- int signal = 0;
- int status;
-
- if (args)
- error ("Argument given to VxWorks \"detach\".");
-
- if (from_tty)
- printf_unfiltered ("Detaching pid %s.\n",
- hex_string (
- (unsigned long) PIDGET (inferior_ptid)));
-
- if (args) /* FIXME, should be possible to leave suspended */
- signal = atoi (args);
-
- memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in));
- memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out));
- ptrace_in.pid = PIDGET (inferior_ptid);
-
- status = net_ptrace_clnt_call (PTRACE_DETACH, &ptrace_in, &ptrace_out);
- if (status == -1)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno_num;
- perror_with_name ("Detaching VxWorks process");
- }
-
- inferior_ptid = null_ptid;
- pop_target (); /* go back to non-executing VxWorks connection */
-}
-
-/* vx_kill -- takes a running task and wipes it out. */
-
-static void
-vx_kill (void)
-{
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
- int status;
-
- printf_unfiltered ("Killing pid %s.\n",
- hex_string ((unsigned long) PIDGET (inferior_ptid)));
-
- memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in));
- memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out));
- ptrace_in.pid = PIDGET (inferior_ptid);
-
- status = net_ptrace_clnt_call (PTRACE_KILL, &ptrace_in, &ptrace_out);
- if (status == -1)
- warning (rpcerr);
- else if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno_num;
- perror_with_name ("Killing VxWorks process");
- }
-
- /* If it gives good status, the process is *gone*, no events remain.
- If the kill failed, assume the process is gone anyhow. */
- inferior_ptid = null_ptid;
- pop_target (); /* go back to non-executing VxWorks connection */
-}
-
-/* Clean up from the VxWorks process target as it goes away. */
-
-static void
-vx_proc_close (int quitting)
-{
- inferior_ptid = null_ptid; /* No longer have a process. */
- if (vx_running)
- xfree (vx_running);
- vx_running = 0;
-}
-\f
-/* Make an RPC call to the VxWorks target.
- Returns RPC status. */
-
-static enum clnt_stat
-net_clnt_call (enum ptracereq procNum, xdrproc_t inProc, char *in,
- xdrproc_t outProc, char *out)
-{
- enum clnt_stat status;
-
- status = clnt_call (pClient, procNum, inProc, in, outProc, out, rpcTimeout);
-
- if (status != RPC_SUCCESS)
- clnt_perrno (status);
-
- return status;
-}
-
-/* Clean up before losing control. */
-
-static void
-vx_close (int quitting)
-{
- if (pClient)
- clnt_destroy (pClient); /* The net connection */
- pClient = 0;
-
- if (vx_host)
- xfree (vx_host); /* The hostname */
- vx_host = 0;
-}
-
-/* A vxprocess target should be started via "run" not "target". */
-static void
-vx_proc_open (char *name, int from_tty)
-{
- error ("Use the \"run\" command to start a VxWorks process.");
-}
-
-static void
-init_vx_ops (void)
-{
- vx_ops.to_shortname = "vxworks";
- vx_ops.to_longname = "VxWorks target memory via RPC over TCP/IP";
- vx_ops.to_doc = "Use VxWorks target memory. \n\
-Specify the name of the machine to connect to.";
- vx_ops.to_open = vx_open;
- vx_ops.to_close = vx_close;
- vx_ops.to_attach = vx_attach;
- vx_ops.deprecated_xfer_memory = vx_xfer_memory;
- vx_ops.to_files_info = vx_files_info;
- vx_ops.to_load = vx_load_command;
- vx_ops.to_lookup_symbol = vx_lookup_symbol;
- vx_ops.to_create_inferior = vx_create_inferior;
- vx_ops.to_stratum = core_stratum;
- vx_ops.to_has_all_memory = 1;
- vx_ops.to_has_memory = 1;
- vx_ops.to_magic = OPS_MAGIC; /* Always the last thing */
-};
-
-static void
-init_vx_run_ops (void)
-{
- vx_run_ops.to_shortname = "vxprocess";
- vx_run_ops.to_longname = "VxWorks process";
- vx_run_ops.to_doc = "VxWorks process; started by the \"run\" command.";
- vx_run_ops.to_open = vx_proc_open;
- vx_run_ops.to_close = vx_proc_close;
- vx_run_ops.to_detach = vx_detach;
- vx_run_ops.to_resume = vx_resume;
- vx_run_ops.to_wait = vx_wait;
- vx_run_ops.to_fetch_registers = vx_read_register;
- vx_run_ops.to_store_registers = vx_write_register;
- vx_run_ops.to_prepare_to_store = vx_prepare_to_store;
- vx_run_ops.deprecated_xfer_memory = vx_xfer_memory;
- vx_run_ops.to_files_info = vx_run_files_info;
- vx_run_ops.to_insert_breakpoint = vx_insert_breakpoint;
- vx_run_ops.to_remove_breakpoint = vx_remove_breakpoint;
- vx_run_ops.to_kill = vx_kill;
- vx_run_ops.to_load = vx_load_command;
- vx_run_ops.to_lookup_symbol = vx_lookup_symbol;
- vx_run_ops.to_mourn_inferior = vx_mourn_inferior;
- vx_run_ops.to_stratum = process_stratum;
- vx_run_ops.to_has_memory = 1;
- vx_run_ops.to_has_stack = 1;
- vx_run_ops.to_has_registers = 1;
- vx_run_ops.to_has_execution = 1;
- vx_run_ops.to_magic = OPS_MAGIC;
-}
-\f
-void
-_initialize_vx (void)
-{
- init_vx_ops ();
- add_target (&vx_ops);
- init_vx_run_ops ();
- add_target (&vx_run_ops);
-
- deprecated_add_show_from_set
- (add_set_cmd ("vxworks-timeout", class_support, var_uinteger,
- (char *) &rpcTimeout.tv_sec,
- "Set seconds to wait for rpc calls to return.\n\
-Set the number of seconds to wait for rpc calls to return.", &setlist),
- &showlist);
-}
+++ /dev/null
-/* 68k-dependent portions of the RPC protocol
- used with a VxWorks target
-
- Contributed by Wind River Systems.
-
- This file is part of GDB.
-
- 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 2 of the License, or
- (at your option) any later version.
-
- 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 this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-
-#include "vx-share/regPacket.h"
-#include "frame.h"
-#include "inferior.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "command.h"
-#include "symtab.h"
-#include "symfile.h"
-#include "regcache.h"
-
-#include "gdb_string.h"
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-
-#ifdef _AIX /* IBM claims "void *malloc()" not char * */
-#define malloc bogon_malloc
-#endif
-
-#include <rpc/rpc.h>
-
-#ifdef _AIX
-#undef malloc
-#endif
-
-#include <sys/time.h> /* UTek's <rpc/rpc.h> doesn't #incl this */
-#include <netdb.h>
-#include "vx-share/ptrace.h"
-#include "vx-share/xdr_ptrace.h"
-#include "vx-share/xdr_ld.h"
-#include "vx-share/xdr_rdb.h"
-#include "vx-share/dbgRpcLib.h"
-
-/* get rid of value.h if possible */
-#include <value.h>
-#include <symtab.h>
-
-/* Flag set if target has fpu */
-
-extern int target_has_fp;
-
-/* Generic register read/write routines in remote-vx.c. */
-
-extern void net_read_registers ();
-extern void net_write_registers ();
-
-/* Read a register or registers from the VxWorks target.
- REGNO is the register to read, or -1 for all; currently,
- it is ignored. FIXME look at regno to improve efficiency. */
-
-void
-vx_read_register (int regno)
-{
- char mc68k_greg_packet[MC68K_GREG_PLEN];
- char mc68k_fpreg_packet[MC68K_FPREG_PLEN];
-
- /* Get general-purpose registers. */
-
- net_read_registers (mc68k_greg_packet, MC68K_GREG_PLEN, PTRACE_GETREGS);
-
- memcpy (deprecated_registers,
- &mc68k_greg_packet[MC68K_R_D0]
- 16 * MC68K_GREG_SIZE);
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)],
- &mc68k_greg_packet[MC68K_R_SR],
- MC68K_GREG_SIZE);
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)],
- &mc68k_greg_packet[MC68K_R_PC],
- MC68K_GREG_SIZE);
-
- /* Get floating-point registers, if the target system has them.
- Otherwise, zero them. */
-
- if (target_has_fp)
- {
- net_read_registers (mc68k_fpreg_packet, MC68K_FPREG_PLEN,
- PTRACE_GETFPREGS);
-
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
- &mc68k_fpreg_packet[MC68K_R_FP0],
- MC68K_FPREG_SIZE * 8);
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
- &mc68k_fpreg_packet[MC68K_R_FPCR],
- MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8));
- }
- else
- {
- memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
- 0, MC68K_FPREG_SIZE * 8);
- memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
- 0, MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8));
- }
-
- /* Mark the register cache valid. */
-
- deprecated_registers_fetched ();
-}
-
-/* Store a register or registers into the VxWorks target.
- REGNO is the register to store, or -1 for all; currently,
- it is ignored. FIXME look at regno to improve efficiency. */
-
-void
-vx_write_register (int regno)
-{
- char mc68k_greg_packet[MC68K_GREG_PLEN];
- char mc68k_fpreg_packet[MC68K_FPREG_PLEN];
-
- /* Store general-purpose registers. */
-
- memcpy (&mc68k_greg_packet[MC68K_R_D0], deprecated_registers,
- 16 * MC68K_GREG_SIZE);
- memcpy (&mc68k_greg_packet[MC68K_R_SR],
- &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)],
- MC68K_GREG_SIZE);
- memcpy (&mc68k_greg_packet[MC68K_R_PC],
- &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)],
- MC68K_GREG_SIZE);
-
- net_write_registers (mc68k_greg_packet, MC68K_GREG_PLEN, PTRACE_SETREGS);
-
- /* Store floating point registers if the target has them. */
-
- if (target_has_fp)
- {
- memcpy (&mc68k_fpreg_packet[MC68K_R_FP0],
- &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
- MC68K_FPREG_SIZE * 8);
- memcpy (&mc68k_fpreg_packet[MC68K_R_FPCR],
- &deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
- MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8));
-
- net_write_registers (mc68k_fpreg_packet, MC68K_FPREG_PLEN,
- PTRACE_SETFPREGS);
- }
-}
+++ /dev/null
-/* MIPS-dependent portions of the RPC protocol
- used with a VxWorks target
-
- Contributed by Wind River Systems.
-
- This file is part of GDB.
-
- 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 2 of the License, or
- (at your option) any later version.
-
- 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 this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-
-#include "vx-share/regPacket.h"
-#include "frame.h"
-#include "inferior.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "command.h"
-#include "symtab.h"
-#include "symfile.h"
-#include "regcache.h"
-
-#include "gdb_string.h"
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <rpc/rpc.h>
-#include <sys/time.h> /* UTek's <rpc/rpc.h> doesn't #incl this */
-#include <netdb.h>
-#include "vx-share/ptrace.h"
-#include "vx-share/xdr_ptrace.h"
-#include "vx-share/xdr_ld.h"
-#include "vx-share/xdr_rdb.h"
-#include "vx-share/dbgRpcLib.h"
-
-/* get rid of value.h if possible */
-#include <value.h>
-#include <symtab.h>
-
-/* Flag set if target has fpu */
-
-extern int target_has_fp;
-
-/* Generic register read/write routines in remote-vx.c. */
-
-extern void net_read_registers ();
-extern void net_write_registers ();
-
-/* Read a register or registers from the VxWorks target.
- REGNO is the register to read, or -1 for all; currently,
- it is ignored. FIXME look at regno to improve efficiency. */
-
-void
-vx_read_register (int regno)
-{
- char mips_greg_packet[MIPS_GREG_PLEN];
- char mips_fpreg_packet[MIPS_FPREG_PLEN];
-
- /* Get general-purpose registers. */
-
- net_read_registers (mips_greg_packet, MIPS_GREG_PLEN, PTRACE_GETREGS);
-
- /* this code copies the registers obtained by RPC
- stored in a structure(s) like this :
-
- Register(s) Offset(s)
- gp 0-31 0x00
- hi 0x80
- lo 0x84
- sr 0x88
- pc 0x8c
-
- into a stucture like this:
-
- 0x00 GP 0-31
- 0x80 SR
- 0x84 LO
- 0x88 HI
- 0x8C BAD --- Not available currently
- 0x90 CAUSE --- Not available currently
- 0x94 PC
- 0x98 FP 0-31
- 0x118 FCSR
- 0x11C FIR --- Not available currently
- 0x120 FP --- Not available currently
-
- structure is 0x124 (292) bytes in length */
-
- /* Copy the general registers. */
-
- memcpy (&deprecated_registers[0], &mips_greg_packet[MIPS_R_GP0],
- 32 * MIPS_GREG_SIZE);
-
- /* Copy SR, LO, HI, and PC. */
-
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (MIPS_PS_REGNUM)],
- &mips_greg_packet[MIPS_R_SR],
- MIPS_GREG_SIZE);
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)],
- &mips_greg_packet[MIPS_R_LO],
- MIPS_GREG_SIZE);
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)],
- &mips_greg_packet[MIPS_R_HI],
- MIPS_GREG_SIZE);
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)],
- &mips_greg_packet[MIPS_R_PC],
- MIPS_GREG_SIZE);
-
- /* If the target has floating point registers, fetch them.
- Otherwise, zero the floating point register values in
- registers[] for good measure, even though we might not
- need to. */
-
- if (target_has_fp)
- {
- net_read_registers (mips_fpreg_packet, MIPS_FPREG_PLEN,
- PTRACE_GETFPREGS);
-
- /* Copy the floating point registers. */
-
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
- &mips_fpreg_packet[MIPS_R_FP0],
- register_size (current_gdbarch, FP0_REGNUM) * 32);
-
- /* Copy the floating point control/status register (fpcsr). */
-
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)],
- &mips_fpreg_packet[MIPS_R_FPCSR],
- register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp_control_status));
- }
- else
- {
- memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
- 0, register_size (current_gdbarch, FP0_REGNUM) * 32);
- memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)],
- 0, register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp_control_status));
- }
-
- /* Mark the register cache valid. */
-
- deprecated_registers_fetched ();
-}
-
-/* Store a register or registers into the VxWorks target.
- REGNO is the register to store, or -1 for all; currently,
- it is ignored. FIXME look at regno to improve efficiency. */
-
-vx_write_register (int regno)
-{
- char mips_greg_packet[MIPS_GREG_PLEN];
- char mips_fpreg_packet[MIPS_FPREG_PLEN];
-
- /* Store general registers. */
-
- memcpy (&mips_greg_packet[MIPS_R_GP0], &deprecated_registers[0],
- 32 * MIPS_GREG_SIZE);
-
- /* Copy SR, LO, HI, and PC. */
-
- memcpy (&mips_greg_packet[MIPS_R_SR],
- &deprecated_registers[DEPRECATED_REGISTER_BYTE (MIPS_PS_REGNUM)],
- MIPS_GREG_SIZE);
- memcpy (&mips_greg_packet[MIPS_R_LO],
- &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)],
- MIPS_GREG_SIZE);
- memcpy (&mips_greg_packet[MIPS_R_HI],
- &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)],
- MIPS_GREG_SIZE);
- memcpy (&mips_greg_packet[MIPS_R_PC],
- &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)],
- MIPS_GREG_SIZE);
-
- net_write_registers (mips_greg_packet, MIPS_GREG_PLEN, PTRACE_SETREGS);
-
- /* Store floating point registers if the target has them. */
-
- if (target_has_fp)
- {
- /* Copy the floating point data registers. */
-
- memcpy (&mips_fpreg_packet[MIPS_R_FP0],
- &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
- register_size (current_gdbarch, FP0_REGNUM) * 32);
-
- /* Copy the floating point control/status register (fpcsr). */
-
- memcpy (&mips_fpreg_packet[MIPS_R_FPCSR],
- &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)],
- register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp_control_status));
-
- net_write_registers (mips_fpreg_packet, MIPS_FPREG_PLEN,
- PTRACE_SETFPREGS);
- }
-}
+++ /dev/null
-/* SPARC-specific portions of the RPC protocol for VxWorks.
-
- Contributed by Wind River Systems.
-
- This file is part of GDB.
-
- 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 2 of the License, or
- (at your option) any later version.
-
- 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 this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "regcache.h"
-
-#include "gdb_string.h"
-
-#include "sparc-tdep.h"
-
-#include "vx-share/ptrace.h"
-#include "vx-share/regPacket.h"
-
-#define SPARC_R_G1 (SPARC_R_G0 + SPARC_GREG_SIZE)
-
-const struct sparc_gregset vxsparc_gregset =
-{
- SPARC_R_PSR, /* %psr */
- SPARC_R_PC, /* %pc */
- SPARC_R_NPC, /* %npc */
- SPARC_R_Y, /* %y */
- SPARC_R_WIM, /* %wim */
- SPARC_R_TBR, /* %tbr */
- SPARC_R_G1, /* %g1 */
- SPARC_R_I0 /* %l0 */
-};
-
-/* Flag set if target has an FPU. */
-
-extern int target_has_fp;
-
-/* Generic register read/write routines in remote-vx.c. */
-
-extern void net_read_registers ();
-extern void net_write_registers ();
-
-/* Read a register or registers from the VxWorks target. REGNUM is
- the register to read, or -1 for all; currently, it is ignored.
- FIXME: Look at REGNUM to improve efficiency. */
-
-void
-vx_read_register (int regnum)
-{
- struct regcache *regcache = current_regcache;
- char gregs[SPARC_GREG_PLEN];
- char fpregs[SPARC_FPREG_PLEN];
- CORE_ADDR sp;
-
- /* Get the general-purpose registers. */
- net_read_registers (gregs, SPARC_GREG_PLEN, PTRACE_GETREGS);
- sparc32_supply_gregset (&vxsparc_gregset, regcache, -1, gregs);
-
- /* If the target has floating-point registers, fetch them.
- Otherwise, zero the floating-point register values in GDB's
- register cache for good measure, even though we might not need
- to. */
- if (target_has_fp)
- net_read_registers (fpregs, SPARC_FPREG_PLEN, PTRACE_GETFPREGS);
- else
- memset (fpregs, 0, SPARC_FPREG_PLEN);
- sparc32_supply_fpregset (regcache, -1, fpregs);
-}
-
-/* Store a register or registers into the VxWorks target. REGNUM is
- the register to store, or -1 for all; currently, it is ignored.
- FIXME: Look at REGNUM to improve efficiency. */
-
-void
-vx_write_register (int regnum)
-{
- struct regcache *regcache = current_regcache;
- char gregs[SPARC_GREG_PLEN];
- char fpregs[SPARC_FPREG_PLEN];
- int gregs_p = 1;
- int fpregs_p = 1;
- CORE_ADDR sp;
-
- if (regnum != -1)
- {
- if ((SPARC_G0_REGNUM <= regnum && regnum <= SPARC_I7_REGNUM)
- || (SPARC32_Y_REGNUM <= regnum && regnum <= SPARC32_NPC_REGNUM))
- fpregs_p = 0;
- else
- gregs_p = 0;
- }
-
- /* Store the general-purpose registers. */
- if (gregs_p)
- {
- sparc32_collect_gregset (&vxsparc_gregset, regcache, -1, gregs);
- net_write_registers (gregs, SPARC_GREG_PLEN, PTRACE_SETREGS);
-
- /* Deal with the stack regs. */
- if (regnum == -1 || regnum == SPARC_SP_REGNUM
- || (regnum >= SPARC_L0_REGNUM && regnum <= SPARC_I7_REGNUM))
- {
- ULONGEST sp;
-
- regcache_cooked_read_unsigned (regcache, SPARC_SP_REGNUM, &sp);
- sparc_collect_rwindow (regcache, sp, regnum);
- }
- }
-
- /* Store the floating-point registers if the target has them. */
- if (fpregs_p && target_has_fp)
- {
- sparc32_collect_fpregset (regcache, -1, fpregs);
- net_write_registers (fpregs, SPARC_FPREG_PLEN, PTRACE_SETFPREGS);
- }
-}
+++ /dev/null
-/* Copyright 1992 Free Software Foundation, Inc.
-
- This code was donated by Wind River Systems, Inc.
-
- dbgRpcLib.h - header file for remote debugging via rpc */
-
-/*
-modification history
---------------------
-01b,04oct90,maf added VX_BOOT_FILE_INQ.
-01a,05jun90,llk extracted from xdr_dbx.h.
-*/
-
-#ifndef INCdbxRpcLibh
-#define INCdbxRpcLibh 1
-
-#define PROCESS_START 50
-#define PROCESS_WAIT 51
-#define VX_STATE_INQ 60
-#define VX_LOAD 61
-#define VX_SYMBOL_INQ 62
-#define VX_BREAK_ADD 63
-#define VX_BREAK_DELETE 64
-#define VX_FP_INQUIRE 65
-#define VX_TASK_SUSPEND 66
-#define VX_CALL_FUNC 67
-#define VX_CONV_FROM_68881 68
-#define VX_CONV_TO_68881 69
-#define VX_BOOT_FILE_INQ 70
-#define VX_SOURCE_STEP 71
-
-#endif INCdbxRpcLibh
+++ /dev/null
-/* @(#)ptrace.h 1.1 86/07/07 SMI */
-
-/*
- * Copyright (c) 1985 by Sun Microsystems, Inc.
- */
-
-/*
-modification history
---------------------
-01a,05jun90,llk borrowed.
-*/
-
-#ifndef _PTRACE_
-#define _PTRACE_
-
-/*
- * Request values for the ptrace system call
- */
-enum ptracereq {
- PTRACE_TRACEME = 0, /* 0, by tracee to begin tracing */
- PTRACE_CHILDDONE = 0, /* 0, tracee is done with his half */
- PTRACE_PEEKTEXT, /* 1, read word from text segment */
- PTRACE_PEEKDATA, /* 2, read word from data segment */
- PTRACE_PEEKUSER, /* 3, read word from user struct */
- PTRACE_POKETEXT, /* 4, write word into text segment */
- PTRACE_POKEDATA, /* 5, write word into data segment */
- PTRACE_POKEUSER, /* 6, write word into user struct */
- PTRACE_CONT, /* 7, continue process */
- PTRACE_KILL, /* 8, terminate process */
- PTRACE_SINGLESTEP, /* 9, single step process */
- PTRACE_ATTACH, /* 10, attach to an existing process */
- PTRACE_DETACH, /* 11, detach from a process */
- PTRACE_GETREGS, /* 12, get all registers */
- PTRACE_SETREGS, /* 13, set all registers */
- PTRACE_GETFPREGS, /* 14, get all floating point regs */
- PTRACE_SETFPREGS, /* 15, set all floating point regs */
- PTRACE_READDATA, /* 16, read data segment */
- PTRACE_WRITEDATA, /* 17, write data segment */
- PTRACE_READTEXT, /* 18, read text segment */
- PTRACE_WRITETEXT, /* 19, write text segment */
- PTRACE_GETFPAREGS, /* 20, get all fpa regs */
- PTRACE_SETFPAREGS /* 21, set all fpa regs */
-};
-#endif !_PTRACE
+++ /dev/null
-/* regPacket.h - register packet definitions for rdb */
-
-/* Copyright 1992-1993 Wind River Systems, Inc. */
-
-/*
-modification history
---------------------
-01d,30nov93,pad Added Am29K target definitions.
-01c,14jun93,maf additional definitions for documentation purposes.
- fixed reversal of MIPS_R_LO and MIPS_R_HI.
-01b,08feb93,scy added SPARC target definitions. changed to WRS code convetion.
-01a,20feb92,j_w created.
-*/
-
-#ifndef __INCregPacketh
-#define __INCregPacketh
-
-
-/* MC68K */
-
-#define MC68K_GREG_SIZE 0x04 /* size of general-purpose reg */
-#define MC68K_GREG_PLEN 0x48 /* size of general-purpose reg block */
-
-/* offsets into general-purpose register block */
-
-#define MC68K_R_D0 0x00 /* d0; d1 - d7 follow in sequence */
-#define MC68K_R_A0 0x20 /* a0; a1 - a7 follow in sequence */
-#define MC68K_R_SR 0x40 /* sr (represented as a 4-byte val) */
-#define MC68K_R_PC 0x44 /* pc */
-
-#define MC68K_FPREG_SIZE 0x0c /* size of floating-point data reg */
-#define MC68K_FPREG_PLEN 0x6c /* size of floating-point reg block */
-
-/* offsets into floating-point register block */
-
-#define MC68K_R_FP0 0x00 /* fp0; fp1 - fp7 follow in sequence */
-#define MC68K_R_FPCR 0x60 /* fpcr */
-#define MC68K_R_FPSR 0x64 /* fpsr */
-#define MC68K_R_FPIAR 0x68 /* fpiar */
-
-
-/* I960 */
-
-#define I960_GREG_SIZE 0x04 /* size of general-purpose reg */
-#define I960_GREG_PLEN 0x8c /* size of general-purpose reg block */
-
-/* offsets into general-purpose register block */
-
-#define I960_R_R0 0x00 /* r0; r1 - r15 follow in sequence */
-#define I960_R_G0 0x40 /* g0; g1 - g15 follow in sequence */
-#define I960_R_PCW 0x80 /* pcw */
-#define I960_R_ACW 0x84 /* acw */
-#define I960_R_TCW 0x88 /* tcw */
-
-#define I960_FPREG_SIZE 0x10 /* size of floating-point reg */
-#define I960_FPREG_PLEN 0x28 /* size of floating-point reg block */
-
-/* offsets into floating-point register block */
-
-#define I960_R_FP0 0x00 /* fp0; fp1 - fp3 follow in sequence */
-
-
-/* SPARC */
-
-#define SPARC_GREG_SIZE 0x04 /* size of general-purpose reg */
-#define SPARC_GREG_PLEN 0x98 /* size of general-purpose reg block */
-
-/* offsets into general-purpose register block */
-
-#define SPARC_R_G0 0x00 /* g0; g1 - g7 follow in sequence */
-#define SPARC_R_O0 0x20 /* o0; o1 - o7 follow in sequence */
-#define SPARC_R_L0 0x40 /* l0; l1 - l7 follow in sequence */
-#define SPARC_R_I0 0x60 /* i0; i1 - i7 follow in sequence */
-#define SPARC_R_Y 0x80 /* y */
-#define SPARC_R_PSR 0x84 /* psr */
-#define SPARC_R_WIM 0x88 /* wim */
-#define SPARC_R_TBR 0x8c /* tbr */
-#define SPARC_R_PC 0x90 /* pc */
-#define SPARC_R_NPC 0x94 /* npc */
-
-#define SPARC_FPREG_SIZE 0x04 /* size of floating-point reg */
-#define SPARC_FPREG_PLEN 0x84 /* size of floating-point reg block */
-
-/* offsets into floating-point register block */
-
-#define SPARC_R_FP0 0x00 /* f0; f1 - f31 follow in sequence */
-#define SPARC_R_FSR 0x80 /* fsr */
-
-
-/* MIPS */
-
-#define MIPS_GREG_SIZE 0x04 /* size of general-purpose reg */
-#define MIPS_GREG_PLEN 0x90 /* size of general-purpose reg block */
-
-/* offsets into general-purpose register block */
-
-#define MIPS_R_GP0 0x00 /* gp0 (zero) */
-#define MIPS_R_AT 0x04 /* at */
-#define MIPS_R_V0 0x08 /* v0 */
-#define MIPS_R_V1 0x0c /* v1 */
-#define MIPS_R_A0 0x10 /* a0 */
-#define MIPS_R_A1 0x14 /* a1 */
-#define MIPS_R_A2 0x18 /* a2 */
-#define MIPS_R_A3 0x1c /* a3 */
-#define MIPS_R_T0 0x20 /* t0 */
-#define MIPS_R_T1 0x24 /* t1 */
-#define MIPS_R_T2 0x28 /* t2 */
-#define MIPS_R_T3 0x2c /* t3 */
-#define MIPS_R_T4 0x30 /* t4 */
-#define MIPS_R_T5 0x34 /* t5 */
-#define MIPS_R_T6 0x38 /* t6 */
-#define MIPS_R_T7 0x3c /* t7 */
-#define MIPS_R_S0 0x40 /* s0 */
-#define MIPS_R_S1 0x44 /* s1 */
-#define MIPS_R_S2 0x48 /* s2 */
-#define MIPS_R_S3 0x4c /* s3 */
-#define MIPS_R_S4 0x50 /* s4 */
-#define MIPS_R_S5 0x54 /* s5 */
-#define MIPS_R_S6 0x58 /* s6 */
-#define MIPS_R_S7 0x5c /* s7 */
-#define MIPS_R_T8 0x60 /* t8 */
-#define MIPS_R_T9 0x64 /* t9 */
-#define MIPS_R_K0 0x68 /* k0 */
-#define MIPS_R_K1 0x6c /* k1 */
-#define MIPS_R_GP 0x70 /* gp */
-#define MIPS_R_SP 0x74 /* sp */
-#define MIPS_R_S8 0x78 /* s8 */
-#define MIPS_R_LO 0x80 /* lo */
-#define MIPS_R_HI 0x84 /* hi */
-#define MIPS_R_SR 0x88 /* sr */
-#define MIPS_R_PC 0x8c /* pc */
-
-#define MIPS_FPREG_SIZE 0x04 /* size of floating-point data reg */
-#define MIPS_FPREG_PLEN 0x84 /* size of floating-point reg block */
-
-/* offsets into floating-point register block */
-
-#define MIPS_R_FP0 0x00 /* f0; f1 - f31 follow in sequence */
-#define MIPS_R_FPCSR 0x80 /* offset of fpcsr in reg block */
-
-
-/* General registers for the Am29k */
-
-#define AM29K_GREG_SIZE 0x04
-#define AM29K_GREG_PLEN 0x2d4
-
-#define AM29K_R_GR96 0x0
-#define AM29K_R_VAB 0x280
-#define AM29K_R_INTE 0x2bc
-#define AM29K_R_RSP 0x2c0
-
-/* Floating Point registers for the Am29k */
-
-#define AM29K_FPREG_SIZE 0x04
-#define AM29K_FPREG_PLEN 0x8
-
-#define AM29K_R_FPE 0x0
-#define AM29K_R_FPS 0x4
-
-#endif /* __INCregPacketh */
+++ /dev/null
-/* vxTypes.h - VxWorks type definition header */
-
-/* Copyright 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1992 Free Software Foundation, Inc.
-
- This code was donated by Wind River Systems, Inc. */
-
-/*
-modification history
---------------------
-01c,05oct90,shl added copyright notice.
- made #endif ANSI style.
-01b,10aug90,dnw added VOIDFUNCPTR
-01a,29may90,del written.
-*/
-
-#ifndef INCvxTypesh
-#define INCvxTypesh
-
-/* The following stuff must NOT be included if this include file is used
- * from assembly language. Just #define ASMLANGUAGE before the include,
- * to get rid of it.
- */
-
-#ifndef ASMLANGUAGE
-
-/* vxWorks types */
-
-typedef char INT8;
-typedef short INT16;
-typedef int INT32;
-
-typedef unsigned char UINT8;
-typedef unsigned short UINT16;
-typedef unsigned int UINT32;
-
-typedef unsigned char UCHAR;
-typedef unsigned short USHORT;
-typedef unsigned int UINT;
-typedef unsigned long ULONG;
-
-typedef int BOOL;
-typedef int VOID;
-typedef int STATUS;
-typedef int ARGINT;
-
-typedef int (*FUNCPTR) (); /* ptr to function returning int */
-typedef VOID (*VOIDFUNCPTR) (); /* ptr to function returning VOID */
-
-
-/* historical definitions - now obsolete */
-
-typedef char TINY; /* obsolete */
-typedef char TBOOL; /* obsolete */
-typedef unsigned char UTINY; /* obsolete */
-
-
-/* architecture dependent typedefs */
-
-#ifdef CPU_FAMILY
-
-#if CPU_FAMILY==MC680X0
-typedef unsigned short INSTR; /* word-aligned instructions */
-#endif /* CPU_FAMILY==MC680X0 */
-
-#if CPU_FAMILY==SPARC
-typedef unsigned long INSTR; /* 32 bit word-aligned instructions */
-#endif /* CPU_FAMILY==SPARC */
-
-#endif
-
-#endif /* ASMLANGUAGE */
-#endif /* INCvxTypesh */
+++ /dev/null
-/* vxWorks.h - VxWorks standard definitions header */
-
-/* Copyright 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1992, 1993
- Free Software Foundation, Inc.
-
- This code was donated by Wind River Systems, Inc. */
-
-/*
-modification history
---------------------
-01z,05oct90,shl added copyright notice.
- made #endif ANSI style.
-01y,28sep90,del added I960 defines.
-01x,29may90,del moved types to vxTypes.h
-01w,09apr90,jcf added timeout definitions.
-01v,24jan90,gae moved network configuration flags here from makefile's.
-01u,01sep88,mcl definition of INSTR dependent on processor family; added SPARC.
- +gae added MC680X0 and defined CPU_FAMILY.
-01t,08apr89,dnw added ifdef to prevent inclusion of vxWorks.h more than once.
-01s,22jun88,dnw moved READ, WRITE, and UPDATE back here from ioLib.h.
-01r,22apr88,gae oops! forgot some #endif's in 01q.
-01q,12apr88,gae removed QUICK & WAIT; added STD_{IN,OUT,ERR}.
- fixed #define's of FALSE, TRUE, etc.
- moved READ, WRITE, and UPDATE to ioLib.h.
-01p,04dec87,dnw added undefine of MC68000 to get around Green Hills bug that
- pre-defines MC68000.
-01o,12nov87,ecs added type ULONG.
-01n,08feb86,dnw added types INSTR, UINT, USHORT.
-01m,14oct85,rdc added BUS types.
-01l,16jul85,jlf added conditional for NULL and EOF.
-01k,24jun85,rdc installed condtional compile so we can include in
- assembly language files. See instructions below.
- Added System type macro and CPU type macro.
-01j,13jun85,dnw cleaned-up, removed more obsolete stuff to wrs.h
-01i,11sep84,jlf changed name from wrs.h to vxWorks.h. removed GLOBAL.
-01h,03jun84,dnw removed IGNORE declaration.
-01g,09apr84,jlf added MEMBER_SIZE macro.
-01f,14dec83,dnw added MSB, LSB macros
-01e,17nov83,jlf added STATUS type, for routines which return a status.
-01d,13jul83,dnw added NELEMENTS macro
-01c,14May83,dnw added OFFSET macro
-01b,17Feb83,dnw added stuff from Whitesmiths std.h
-01a,15Feb83,dnw written
-*/
-
-#ifndef INCvxWorksh
-#define INCvxWorksh
-
-#if !defined(EOF) || (EOF!=(-1))
-#define EOF (-1)
-#endif
-
-#if !defined(FALSE) || (FALSE!=0)
-#define FALSE 0
-#endif
-
-#if !defined(TRUE) || (TRUE!=1)
-#define TRUE 1
-#endif
-
-
-#define NONE (-1) /* for times when NULL won't do */
-#define EOS '\0' /* C string terminator */
-
-
-/* return status values */
-
-#define OK 0
-#define ERROR (-1)
-
-/* timeout defines */
-
-#define NO_WAIT 0
-#define WAIT_FOREVER (-1)
-
-/* low-level I/O input, output, error fd's */
-
-#define STD_IN 0
-#define STD_OUT 1
-#define STD_ERR 2
-
-/* modes - must match O_RDONLY/O_WRONLY/O_RDWR in ioLib.h! */
-
-#define READ 0
-#define WRITE 1
-#define UPDATE 2
-
-/* SYSTEM types */
-
-#define V7 1 /* ATT version 7 */
-#define SYS_V 2 /* ATT System 5 */
-#define BSD_4_2 3 /* Berkeley BSD 4.2 */
-
-/* CPU types */
-
-/* The Green Hills compiler pre-defines "MC68000"!! */
-#ifdef MC68000
-#undef MC68000
-#endif
-
-#define MC68000 1
-#define MC68010 2
-#define MC68020 3
-#define MC68030 4
-#define MC68040 5
-#define MC680X0 9
-
-#define SPARC 10
-
-#ifndef I960
-#define I960 20
-#endif
-
-#define I960KB 21
-#define I960CA 22
-
-#if CPU==MC68000 || CPU==MC68010 || CPU==MC68020 || CPU==MC68030
-#define CPU_FAMILY MC680X0
-#endif /* CPU==MC68000 || CPU==MC68010 || CPU==MC68020 || CPU==MC68030 */
-
-#if CPU==SPARC
-#define CPU_FAMILY SPARC
-#endif /* CPU==SPARC */
-
-#if CPU==I960KB
-#define CPU_FAMILY I960
-#endif /* CPU==I960KB */
-
-#if CPU==I960CA
-#define CPU_FAMILY I960
-#endif /* CPU==I960CA */
-
-/* BUS types */
-
-#define VME_BUS 1
-#define MULTI_BUS 2
-
-/* network configuration parameters */
-
-#define INET /* include internet protocols */
-#define BSD 43 /* BSD 4.3 -like OS */
-#define BSDDEBUG /* turn on debug */
-#define GATEWAY /* tables to be initialized for gateway routing */
-
-/* common macros */
-
-#define MSB(x) (((x) >> 8) & 0xff) /* most signif byte of 2-byte integer */
-#define LSB(x) ((x) & 0xff) /* least signif byte of 2-byte integer*/
-
-#define OFFSET(structure, member) /* byte offset of member in structure*/\
- ((int) &(((structure *) 0) -> member))
-
-#define MEMBER_SIZE(structure, member) /* size of a member of a structure */\
- (sizeof (((structure *) 0) -> member))
-
-#define NELEMENTS(array) /* number of elements in an array */ \
- (sizeof (array) / sizeof ((array) [0]))
-
-#define FOREVER for (;;)
-
-/* storage class specifier definitions */
-
-#define FAST register
-#define IMPORT extern
-#define LOCAL static
-
-
-/* include typedefs - must come after CPU_FAMILY definitions above */
-
-#include "vxTypes.h"
-
-#endif /* INCvxWorksh */
+++ /dev/null
-/* wait.h - header file for remote wait call */
-
-/* Copyright 1992 Free Software Foundation, Inc.
-
- This code was donated by Wind River Systems, Inc. */
-
-/*
-modification history
---------------------
-01a,05jun90,llk borrowed.
-*/
-
-/* Define how to access the structure that the wait system call
- stores. On many systems, there is a structure defined for
- this. */
-
-#ifndef HAVE_WAIT_STRUCT
-#define WAITTYPE int
-#define WIFSTOPPED(w) (((w)&0377) == 0177)
-#define WIFSIGNALED(w) (((w)&0377) != 0177 && ((w)&~0377) == 0)
-#define WIFEXITED(w) (((w)&0377) == 0)
-#define WRETCODE(w) ((w) >> 8)
-#define WSTOPSIG(w) ((w) >> 8)
-#define WCOREDUMP(w) (((w)&0200) != 0)
-#define WTERMSIG(w) ((w) & 0177)
-#define WSETEXIT(w, status) ((w) = (status))
-#define WSETSTOP(w,sig) ((w) = (0177 | ((sig) << 8)))
-#else
-#if FALSE
-#ifndef ORIG
-
-/* don't include sys/wait.h */
-
-#else ORIG
-#include <sys/wait.h>
-#endif ORIG
-#endif FALSE
-#define WAITTYPE union wait
-#define WRETCODE(w) (w).w_retcode
-#define WSTOPSIG(w) (w).w_stopsig
-#define WCOREDUMP(w) (w).w_coredump
-#define WTERMSIG(w) (w).w_termsig
-#define WSETEXIT(w, status) ((w).w_status = (status))
-#define WSETSTOP(w,sig) \
- ((w).w_stopsig = (sig), (w).w_coredump = 0, (w).w_termsig = 0177)
-#endif
+++ /dev/null
-/* xdr_ld.c - xdr routines for remote dbx interface to VxWorks */
-
-/* Copyright 1984, 1985, 1986, 1987, 1988, 1989, 1992, 1993, 1998
- Free Software Foundation, Inc.
-
- This code was donated by Wind River Systems, Inc. */
-
-/*
-modification history
---------------------
-01a,05jun90,llk extracted from xdr_dbx.c.
-*/
-
-/*
-DESCRIPTION
-This module contains the eXternal Data Representation (XDR) routines
-for object files that are downloaded to VxWorks. They are used by
-remote debuggers that use RPC (such as dbxWorks and vxGdb).
-*/
-
-#include "defs.h"
-#include "vxWorks.h"
-#include "rpc/rpc.h"
-#include "xdr_ld.h"
-
-/* forward declarations */
-
-bool_t xdr_String(); /* xdr routine for argument list */
-
-
-/*******************************************************************************
-*
-* xdr_String - xdr routine for strings.
-*
-* Used by xdr_arg_info to handle the actual argument
-* strings. normally calls xdr_string - but does something
-* reasonable encode of null pointer.
-*/
-
-bool_t xdr_String (xdrs, strp)
- XDR *xdrs;
- char **strp;
-
- {
- if ((*strp == NULL) & (xdrs->x_op == XDR_ENCODE))
- return(FALSE);
- else
- return(xdr_string(xdrs, strp, MAXSTRLEN));
- }
-/*******************************************************************************
-*
-* xdr_ldfile - xdr routine for a single element in the load table
-*/
-
-bool_t xdr_ldfile (xdrs, objp)
- XDR *xdrs;
- ldfile *objp;
-
- {
- if (! xdr_String(xdrs, &objp->name))
- return(FALSE);
- if (! xdr_int(xdrs, &objp->txt_addr))
- return(FALSE);
- if (! xdr_int(xdrs, &objp->data_addr))
- return(FALSE);
- if (! xdr_int(xdrs, &objp->bss_addr))
- return(FALSE);
-
- return(TRUE);
- }
-/*******************************************************************************
-*
-* xdr_ldtabl -
-*
-* xdr routine for a list of files and load addresses loaded into VxWorks.
-*/
-
-bool_t xdr_ldtabl (xdrs,objp)
- XDR *xdrs;
- ldtabl *objp;
-
- {
- return (xdr_array (xdrs, (char **) &objp->tbl_ent, (UINT *) &objp->tbl_size,
- MAXTBLSZ, sizeof(ldfile), xdr_ldfile));
- }
+++ /dev/null
-/* xdr_ld.h - xdr for additional dbxWorks structures */
-
-/* Copyright 1992 Free Software Foundation, Inc.
-
- This code was donated by Wind River Systems, Inc. */
-
-/*
-modification history
---------------------
-01a,05jun90,llk extracted from xdr_dbx.h.
-*/
-
-#ifndef INCxdrldh
-#define INCxdrldh
-
-#define MAXSTRLEN 256
-#define MAXTBLSZ 100
-
-/*
- * structure used to pass back the information for a single file
- * loaded in VxWorks
- */
-struct ldfile {
- char *name;
- int txt_addr;
- int data_addr;
- int bss_addr;
-};
-typedef struct ldfile ldfile;
-
-/*
- * structure used to return a list of all files loaded over to
- * VxWorks. (VX_STATE_INQ return)
- */
-struct ldtabl {
- u_int tbl_size;
- ldfile *tbl_ent;
-};
-typedef struct ldtabl ldtabl;
-
-
-bool_t xdr_ldfile();
-bool_t xdr_ldtabl();
-
-#endif INCxdrldh
+++ /dev/null
-/* xdr_ptrace.c - xdr routines for remote ptrace calls */
-
-/* Copyright 1984, 1985, 1986, 1987, 1988, 1989, 1991, 1992, 1993, 1998
- Free Software Foundation, Inc.
-
- This code was donated by Wind River Systems, Inc. */
-
-/*
-modification history
---------------------
-01b,25may91,maf now uses counted bytes struct to transfer registers.
- removed xdr_regs_ptr (), xdr_fp_status_ptr (), and
- xdr_fpa_regs_ptr ().
-01a,05jun90,llk extracted from xdr_ptrace.h, version 01c.
-*/
-
-#include "defs.h"
-#include "vxWorks.h"
-#include <rpc/rpc.h>
-#include "xdr_ptrace.h"
-
-#define MAX_LEN 32000
-
-/********************************************************************
-*
-* xdr_c_bytes -
-*
-* xdr routine for counted bytes
-*
-*/
-bool_t xdr_c_bytes(xdrs,objp)
- XDR *xdrs;
- C_bytes *objp;
- {
- return(xdr_bytes(xdrs, &objp->bytes, (u_int *) &objp->len, MAX_LEN));
- } /* xdr_c_bytes */
-
-/********************************************************************
-*
-* xdr_c_bytes_ptr -
-*
-* xdr routine for counted bytes branch of ptrace_info
-*
-*/
-
-LOCAL bool_t xdr_c_bytes_ptr(xdrs,objp)
- XDR *xdrs;
- C_bytes **objp;
- {
- return(xdr_pointer(xdrs, (char **) objp, sizeof(C_bytes), xdr_c_bytes));
- } /* xdr_c_bytes_ptr */
-
-/********************************************************************
-*
-* xdr_ptrace_info -
-*
-* xdr routine for discriminated union ptrace_info
-*
-*/
-
-bool_t xdr_ptrace_info(xdrs,objp)
- XDR *xdrs;
- Ptrace_info *objp;
- {
- static struct xdr_discrim choices[] =
- {
- { (int) DATA, xdr_c_bytes_ptr },
- { __dontcare__, NULL }
- };
-
- return(xdr_union(xdrs, (enum_t *) &objp->ttype,
- (char *) &objp->more_data, choices, xdr_void));
- } /* xdr_ptrace_info */
-
-/********************************************************************
-*
-* xdr_rptrace -
-*
-* xdr routine for remote ptrace data into server
-*
-*/
-
-bool_t xdr_rptrace(xdrs,objp)
- XDR *xdrs;
- Rptrace *objp;
- {
- if (! xdr_int(xdrs, &objp->pid))
- return(FALSE);
- if (! xdr_int(xdrs, &objp->data))
- return(FALSE);
- if (! xdr_int(xdrs, &objp->addr))
- return(FALSE);
- if (! xdr_ptrace_info(xdrs, &objp->info))
- return(FALSE);
-
- return(TRUE);
- } /* xdr_rptrace */
-
-/********************************************************************
-*
-* xdr_ptrace_return -
-*
-* xdr routine for remote ptrace data returned by server
-*
-*/
-
-bool_t xdr_ptrace_return(xdrs, objp)
- XDR *xdrs;
- Ptrace_return *objp;
- {
- if (! xdr_int(xdrs, &objp->status))
- return(FALSE);
- if (! xdr_int(xdrs, &objp->errno_num))
- return(FALSE);
- if (! xdr_ptrace_info(xdrs, &objp->info))
- return(FALSE);
-
- return(TRUE);
- } /* xdr_ptrace_return */
+++ /dev/null
-/* xdr_ptrace.h - xdr header for remote ptrace structures */
-
-/* Copyright 1992, 1998 Free Software Foundation, Inc.
-
- This code was donated by Wind River Systems, Inc. */
-
-/*
-modification history
---------------------
-01b,25may91,maf now uses counted bytes struct to transfer registers;
- removed references to old xdr_regs functions.
- removed includes of "xdr_regs.h" and "reg.h".
-01a,05jun90,llk extracted from xdr_ptrace.h.
-*/
-
-
-/*
- * Counted byte structure used by READ/WRITE TEXT/DATA
- * and GET/SET REGS/FPREGS
- */
-struct c_bytes {
- u_int len;
- caddr_t bytes;
-};
-typedef struct c_bytes C_bytes;
-
-/*
- * enum for discriminated union ptrace_info
- */
-enum ptype {
- NOINFO = 0, /* no additional infomation */
- DATA = 1 /* c_bytes */
-};
-typedef enum ptype ptype;
-
-/*
- * discrimnated union for passing additional data to be
- * written to the debugged process.
- */
-struct ptrace_info {
- ptype ttype;
- caddr_t more_data;
-};
-typedef struct ptrace_info Ptrace_info;
-
-/*
- * structure passed to server on all remote ptrace calls
- */
-struct rptrace {
- int pid;
- int data;
- int addr; /* FIX! this really should be caddr_t or something */
- Ptrace_info info;
-};
-typedef struct rptrace Rptrace;
-
-/*
- * structure returned by server on all remote ptrace calls
- */
-/* This used to have a field called errno, but that fails on hosts which
- define errno to be a macro, so it was changed to errno_num. */
-struct ptrace_return {
- int status;
- int errno_num;
- Ptrace_info info;
-};
-typedef struct ptrace_return Ptrace_return;
-
-bool_t xdr_c_bytes();
-bool_t xdr_ptrace_info();
-bool_t xdr_rptrace();
-bool_t xdr_ptrace_return();
+++ /dev/null
-/* xdr_rdb.c - xdr routines for Remote Debug interface to VxWorks */
-
-/* Copyright 1992, 1993 Free Software Foundation, Inc.
-
- This code was donated by Wind River Systems, Inc. */
-
-/*
-modification history
---------------------
-01a,21mar90,llk created using modification 01d of xdr_dbx.c.
-*/
-
-/*
-DESCRIPTION
-This module contains the eXternal Data Representation (XDR) routines
-for the RDB interface for VxWorks.
-*/
-
-#include "defs.h"
-#include "vxWorks.h"
-#include <rpc/rpc.h>
-#include "xdr_rdb.h"
-
-/* forward declarations */
-
-bool_t
-xdr_arg_type(xdrs, objp)
- XDR *xdrs;
- arg_type *objp;
-{
- if (!xdr_enum(xdrs, (enum_t *)objp)) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-bool_t
-xdr_arg_value(xdrs, objp)
- XDR *xdrs;
- arg_value *objp;
-{
- if (!xdr_arg_type(xdrs, &objp->type)) {
- return (FALSE);
- }
- switch (objp->type) {
- case T_BYTE:
- if (!xdr_char(xdrs, &objp->arg_value_u.v_byte)) {
- return (FALSE);
- }
- break;
- case T_WORD:
- if (!xdr_short(xdrs, &objp->arg_value_u.v_word)) {
- return (FALSE);
- }
- break;
- case T_INT:
- if (!xdr_int(xdrs, &objp->arg_value_u.v_int)) {
- return (FALSE);
- }
- break;
- case T_FLOAT:
- if (!xdr_float(xdrs, &objp->arg_value_u.v_fp)) {
- return (FALSE);
- }
- break;
- case T_DOUBLE:
- if (!xdr_double(xdrs, &objp->arg_value_u.v_dp)) {
- return (FALSE);
- }
- break;
- case T_UNKNOWN:
- break;
- }
- return (TRUE);
-}
-
-bool_t
-xdr_func_call(xdrs, objp)
- XDR *xdrs;
- func_call *objp;
-{
- if (!xdr_int(xdrs, &objp->func_addr)) {
- return (FALSE);
- }
- if (!xdr_array(xdrs, (char **)&objp->args.args_val, (u_int *)&objp->args.args_len, MAX_FUNC_ARGS, sizeof(arg_value), xdr_arg_value)) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-bool_t
-xdr_arg_one(xdrs, objp)
- XDR *xdrs;
- arg_one *objp;
-{
- if (!xdr_string(xdrs, objp, MAX_ARG_LEN)) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-
-
-
-bool_t
-xdr_arg_array(xdrs, objp)
- XDR *xdrs;
- arg_array *objp;
-{
- if (!xdr_array(xdrs, (char **)&objp->arg_array_val, (u_int *)&objp->arg_array_len, MAX_ARG_CNT, sizeof(arg_one), xdr_arg_one)) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-/*********************************************************************
-*
-* xdr_EVENT_TYPE -
-*
-*/
-
-bool_t xdr_EVENT_TYPE(xdrs, objp)
- XDR *xdrs;
- EVENT_TYPE *objp;
-
- {
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return (FALSE);
- return (TRUE);
- }
-
-/*********************************************************************
-*
-* xdr_RDB_EVENT -
-*
-*/
-
-bool_t xdr_RDB_EVENT (xdrs, objp)
- XDR *xdrs;
- RDB_EVENT *objp;
-
- {
- if (!xdr_int (xdrs, &objp->status))
- return (FALSE);
- if (!xdr_int (xdrs, &objp->taskId))
- return (FALSE);
- if (!xdr_EVENT_TYPE (xdrs, &objp->eventType))
- return (FALSE);
- if (!xdr_int (xdrs, &objp->sigType))
- return (FALSE);
- return (TRUE);
- }
-
-/*********************************************************************
-*
-* xdr_TASK_START -
-*
-*/
-
-bool_t
-xdr_TASK_START (xdrs, objp)
- XDR *xdrs;
- TASK_START *objp;
-
- {
- if (!xdr_int (xdrs, &objp->status))
- return (FALSE);
- if (!xdr_int (xdrs, &objp->pid))
- return (FALSE);
- return (TRUE);
- }
-
-
-/*********************************************************************
-*
-* xdr_SYMBOL_ADDR -
-*
-*/
-
-bool_t
-xdr_SYMBOL_ADDR (xdrs, objp)
- XDR *xdrs;
- SYMBOL_ADDR *objp;
-
- {
- if (!xdr_int (xdrs, &objp->status))
- return (FALSE);
- if (!xdr_u_int (xdrs, &objp->addr))
- return (FALSE);
- return (TRUE);
- }
-
-/*********************************************************************
-*
-* xdr_SOURCE_STEP -
-*
-*/
-
-bool_t
-xdr_SOURCE_STEP (xdrs, objp)
- XDR *xdrs;
- SOURCE_STEP *objp;
-
- {
- if (!xdr_int (xdrs, &objp->taskId))
- return (FALSE);
- if (!xdr_u_int (xdrs, &objp->startAddr))
- return (FALSE);
- if (!xdr_u_int (xdrs, &objp->endAddr))
- return (FALSE);
- return (TRUE);
- }
+++ /dev/null
-/* xdr_rdb.h - xdr for additional rdb structures */
-
-/* Copyright 1992 Free Software Foundation, Inc.
-
- This code was donated by Wind River Systems, Inc. */
-
-/*
-modification history
---------------------
-01c,25may91,maf rolled RDBVERS for VxGDB 1.0 version.
-01b,12apr91,maf rolled RDBVERS.
-01a,09jan91,maf created using v1a of xdr_rdb.h for 4.0.2 VxWorks 68k.
- added struct SOURCE_STEP.
-*/
-
-#ifndef INCxdrrdbh
-#define INCxdrrdbh
-
-enum arg_type {
- T_UNKNOWN = 0,
- T_BYTE = 1,
- T_WORD = 2,
- T_INT = 3,
- T_FLOAT = 4,
- T_DOUBLE = 5
-};
-typedef enum arg_type arg_type;
-bool_t xdr_arg_type();
-
-
-struct arg_value {
- arg_type type;
- union {
- char v_byte;
- short v_word;
- int v_int;
- float v_fp;
- double v_dp;
- } arg_value_u;
-};
-typedef struct arg_value arg_value;
-bool_t xdr_arg_value();
-
-struct func_call {
- int func_addr;
- struct {
- u_int args_len;
- arg_value *args_val;
- } args;
-};
-typedef struct func_call func_call;
-bool_t xdr_func_call();
-
-
-typedef char *arg_one;
-bool_t xdr_arg_one();
-
-
-typedef struct {
- u_int arg_array_len;
- arg_one *arg_array_val;
-} arg_array;
-bool_t xdr_arg_array();
-
-
-/*
- * Structures used to pass structures required for
- * process control but not part of the standard ptrace interface
- */
-
-/*
- * arg_info is used to pass arguments into process start
- */
-struct arg_info {
- int rargc;
- char **rargv;
-};
-typedef struct arg_info Arg_info;
-
-
-enum EVENT_TYPE {
- EVENT_BREAK = 0,
- EVENT_STOP = 1,
- EVENT_EXIT = 2,
- EVENT_BUS_ERR = 3,
- EVENT_SUSPEND = 4,
- EVENT_ZERO_DIV = 5,
- EVENT_SIGNAL = 6,
- EVENT_START = 7
-};
-typedef enum EVENT_TYPE EVENT_TYPE;
-
-
-struct RDB_EVENT {
- int status;
- int taskId;
- EVENT_TYPE eventType;
- int sigType;
-};
-typedef struct RDB_EVENT RDB_EVENT;
-
-
-struct TASK_START {
- int status;
- int pid;
-};
-typedef struct TASK_START TASK_START;
-
-
-struct SYMBOL_ADDR {
- int status;
- u_int addr;
-};
-typedef struct SYMBOL_ADDR SYMBOL_ADDR;
-
-struct SOURCE_STEP {
- int taskId;
- u_int startAddr;
- u_int endAddr;
-};
-typedef struct SOURCE_STEP SOURCE_STEP;
-
-#define MAX_ARG_CNT 10
-#define MAX_FUNC_ARGS 100
-#define MAX_ARG_LEN 100
-
-
-bool_t xdr_arg_info();
-bool_t xdr_EVENT_TYPE();
-bool_t xdr_RDB_EVENT();
-bool_t xdr_TASK_START();
-bool_t xdr_SYMBOL_ADDR();
-bool_t xdr_SOURCE_STEP();
-
-#define RDBPROG (u_long) 0x44444444
-#define RDBVERS (u_long) 3
-#endif INCxdrrdbh