diff options
author | Stan Shebs <shebs@apple.com> | 1999-04-16 01:35:26 +0000 |
---|---|---|
committer | Stan Shebs <shebs@apple.com> | 1999-04-16 01:35:26 +0000 |
commit | 14cd51f7793a9ce07bc435069f57269450141363 (patch) | |
tree | 280a2da48f771d61be5b451ddbacdf9ef8e9ad13 /gdb/vx-share | |
download | gdb-14cd51f7793a9ce07bc435069f57269450141363.tar.gz |
Initial revision
Diffstat (limited to 'gdb/vx-share')
-rw-r--r-- | gdb/vx-share/README | 7 | ||||
-rw-r--r-- | gdb/vx-share/dbgRpcLib.h | 32 | ||||
-rw-r--r-- | gdb/vx-share/ptrace.h | 44 | ||||
-rw-r--r-- | gdb/vx-share/regPacket.h | 160 | ||||
-rw-r--r-- | gdb/vx-share/vxTypes.h | 72 | ||||
-rw-r--r-- | gdb/vx-share/vxWorks.h | 171 | ||||
-rw-r--r-- | gdb/vx-share/wait.h | 46 | ||||
-rw-r--r-- | gdb/vx-share/xdr_ld.c | 84 | ||||
-rw-r--r-- | gdb/vx-share/xdr_ld.h | 45 | ||||
-rw-r--r-- | gdb/vx-share/xdr_ptrace.c | 118 | ||||
-rw-r--r-- | gdb/vx-share/xdr_ptrace.h | 72 | ||||
-rw-r--r-- | gdb/vx-share/xdr_rdb.c | 212 | ||||
-rw-r--r-- | gdb/vx-share/xdr_rdb.h | 137 |
13 files changed, 1200 insertions, 0 deletions
diff --git a/gdb/vx-share/README b/gdb/vx-share/README new file mode 100644 index 00000000000..924b668585e --- /dev/null +++ b/gdb/vx-share/README @@ -0,0 +1,7 @@ +The files in this directory are shared with Wind River Systems' VxWorks +debug stub. This stub runs in the realtime system, as a process, and +waits for net connections from GDB's and DBX's and such. + +Do not change these files without coordinating with Wind River Systems +in Alameda, California. Talk to postmaster@wrs.com to find out who +currently maintains GDB for them. diff --git a/gdb/vx-share/dbgRpcLib.h b/gdb/vx-share/dbgRpcLib.h new file mode 100644 index 00000000000..e858e558e43 --- /dev/null +++ b/gdb/vx-share/dbgRpcLib.h @@ -0,0 +1,32 @@ +/* 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 diff --git a/gdb/vx-share/ptrace.h b/gdb/vx-share/ptrace.h new file mode 100644 index 00000000000..8e3554f13a0 --- /dev/null +++ b/gdb/vx-share/ptrace.h @@ -0,0 +1,44 @@ +/* @(#)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 diff --git a/gdb/vx-share/regPacket.h b/gdb/vx-share/regPacket.h new file mode 100644 index 00000000000..6160c846862 --- /dev/null +++ b/gdb/vx-share/regPacket.h @@ -0,0 +1,160 @@ +/* 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 */ diff --git a/gdb/vx-share/vxTypes.h b/gdb/vx-share/vxTypes.h new file mode 100644 index 00000000000..c6b84192233 --- /dev/null +++ b/gdb/vx-share/vxTypes.h @@ -0,0 +1,72 @@ +/* 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 */ diff --git a/gdb/vx-share/vxWorks.h b/gdb/vx-share/vxWorks.h new file mode 100644 index 00000000000..159883750f1 --- /dev/null +++ b/gdb/vx-share/vxWorks.h @@ -0,0 +1,171 @@ +/* vxWorks.h - VxWorks standard definitions 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 +-------------------- +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 */ diff --git a/gdb/vx-share/wait.h b/gdb/vx-share/wait.h new file mode 100644 index 00000000000..cb8d1b5bbaa --- /dev/null +++ b/gdb/vx-share/wait.h @@ -0,0 +1,46 @@ +/* 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. + But on vanilla-ish USG systems there is not. */ + +#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 diff --git a/gdb/vx-share/xdr_ld.c b/gdb/vx-share/xdr_ld.c new file mode 100644 index 00000000000..3678c3501b8 --- /dev/null +++ b/gdb/vx-share/xdr_ld.c @@ -0,0 +1,84 @@ +/* xdr_ld.c - xdr routines for remote dbx interface to VxWorks */ + +/* Copyright 1984, 1985, 1986, 1987, 1988, 1989, 1992 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)); + } diff --git a/gdb/vx-share/xdr_ld.h b/gdb/vx-share/xdr_ld.h new file mode 100644 index 00000000000..2899c0ef78f --- /dev/null +++ b/gdb/vx-share/xdr_ld.h @@ -0,0 +1,45 @@ +/* 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 diff --git a/gdb/vx-share/xdr_ptrace.c b/gdb/vx-share/xdr_ptrace.c new file mode 100644 index 00000000000..fff43246218 --- /dev/null +++ b/gdb/vx-share/xdr_ptrace.c @@ -0,0 +1,118 @@ +/* xdr_ptrace.c - xdr routines for remote ptrace calls */ + +/* Copyright 1984, 1985, 1986, 1987, 1988, 1989, 1992 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 */ diff --git a/gdb/vx-share/xdr_ptrace.h b/gdb/vx-share/xdr_ptrace.h new file mode 100644 index 00000000000..9b4eb2b0872 --- /dev/null +++ b/gdb/vx-share/xdr_ptrace.h @@ -0,0 +1,72 @@ +/* xdr_ptrace.h - xdr header for remote ptrace structures */ + +/* Copyright 1992 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(); diff --git a/gdb/vx-share/xdr_rdb.c b/gdb/vx-share/xdr_rdb.c new file mode 100644 index 00000000000..0520f7f6e7a --- /dev/null +++ b/gdb/vx-share/xdr_rdb.c @@ -0,0 +1,212 @@ +/* xdr_rdb.c - xdr routines for Remote Debug interface to VxWorks */ + +/* Copyright 1992 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); + } diff --git a/gdb/vx-share/xdr_rdb.h b/gdb/vx-share/xdr_rdb.h new file mode 100644 index 00000000000..01894536297 --- /dev/null +++ b/gdb/vx-share/xdr_rdb.h @@ -0,0 +1,137 @@ +/* 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 |