summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-02-01 19:33:15 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-02-01 19:33:15 +0000
commit97f6256fd2f25fe123d5abdc7e25b3508e92af37 (patch)
treef88f8afc6323f10469db8f4c086a52688d19cd32 /c
parentbdb86b4efeb2a455524520f8c1db18c3e1d5acfe (diff)
downloadrtems-97f6256fd2f25fe123d5abdc7e25b3508e92af37.tar.bz2
2002-02-01 Eric Valette <valette@crf.canon.fr>
* So many patches have been posted recently on the mailing list and because we were unable to find correct solution to compile on various linux distros (due to rpcgen incompatibilities), and because the coding style of rdbg was rather inconsistant among various pieces of code, I decided to: 1) make some cleaning regarding global coding style (using indent + manual edits), 2) incorporate/review the paches send by various people (S. Holford, T. Strauman), 3) Fix the bug due to varying rpcgen code generation in remdeb_svc.c, 4) Remove some dead code, 5) Apply a patches enabling to call enterRdbg imediately after rdbg initialization is done, NB : the paches is huge but it is mainly due to coding styke chnages. Only few lines of codes have been really changed and they do not impact rdbg functionnality (AFAIKT). * include/rdbg/servrpc.h, include/rdbg/i386/rdbg_f.h, include/rdbg/m68k/rdbg_f.h, include/rdbg/powerpc/rdbg_f.h, src/_servtgt.c, src/awk.svc, src/excep.c, src/ptrace.c, src/rdbg.c, src/remdeb.x, src/servbkpt.c, src/servcon.c, src/servrpc.c, src/servtgt.c, src/servtsp.c, src/servutil.c, src/i386/excep_f.c, src/i386/rdbg_f.c, src/i386/any/Makefile.am, src/i386/any/remdeb.h, src/i386/any/remdeb_svc.c, src/i386/any/remdeb_xdr.c, src/m68k/excep_f.c, src/m68k/rdbg_f.c, src/m68k/any/Makefile.am, src/m68k/any/remdeb.h, src/m68k/any/remdeb_svc.c, src/m68k/any/remdeb_xdr.c, src/powerpc/excep_f.c, src/powerpc/rdbg_f.c, src/powerpc/new_exception_processing/Makefile.am, src/powerpc/new_exception_processing/remdeb.h, src/powerpc/new_exception_processing/remdeb_svc.c, src/powerpc/new_exception_processing/remdeb_xdr.c: Modified.
Diffstat (limited to 'c')
-rw-r--r--c/src/librdbg/ChangeLog120
-rw-r--r--c/src/librdbg/src/i386/any/remdeb.h937
-rw-r--r--c/src/librdbg/src/i386/any/remdeb_svc.c133
-rw-r--r--c/src/librdbg/src/i386/any/remdeb_xdr.c1713
-rw-r--r--c/src/librdbg/src/m68k/any/remdeb.h913
-rw-r--r--c/src/librdbg/src/m68k/any/remdeb_svc.c133
-rw-r--r--c/src/librdbg/src/m68k/any/remdeb_xdr.c1833
-rw-r--r--c/src/librdbg/src/powerpc/new_exception_processing/remdeb.h118
-rw-r--r--c/src/librdbg/src/powerpc/new_exception_processing/remdeb_svc.c120
-rw-r--r--c/src/librdbg/src/powerpc/new_exception_processing/remdeb_xdr.c44
10 files changed, 2644 insertions, 3420 deletions
diff --git a/c/src/librdbg/ChangeLog b/c/src/librdbg/ChangeLog
index 09d6f7821b..0526a18411 100644
--- a/c/src/librdbg/ChangeLog
+++ b/c/src/librdbg/ChangeLog
@@ -34,123 +34,3 @@
src/powerpc/new_exception_processing/remdeb_svc.c,
src/powerpc/new_exception_processing/remdeb_xdr.c: Modified.
-2002-01-18 Till Straumann <strauman@slac.stanford.edu>
-
- * src/powerpc/excep_f.c: This patch addresses the following issues:
- - exception handler needs to enable MSR_FP if the interrupted
- thread is FP enabled.
- - printk message for MSR fixed and added stacktrace
-
- NOTE: this requires the stacktrace patch to
- lib/libbsp/powerpc/shared/vectors/vector_init.c
- (#ifdef DDEBUG only, however)
-
-2001-01-18 Joel Sherrill <joel@OARcorp.com>
-
- * src/powerpc/new_exception_processing/remdeb_svc.c: Corrected
- macro using variable arguments.
-
-2001-01-18 Joel Sherrill <joel@OARcorp.com>
-
- * src/powerpc/new_exception_processing/remdeb.h,
- src/powerpc/new_exception_processing/remdeb_xdr.c: Regenerated since
- I updated the main RTEMS development machine to RedHat 7.2 and
- apparently got a new version of rpcgen.
-
-2001-10-30 Victor V. Vengerov <vvv@oktet.ru>
-
- * src/m68k/rdbg_cpu_asm.S: Now compiles on ColdFire.
-
-2001-10-17 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * configure.ac: Fix latent bug exposed by removal of config.cache's
- which prevented powerpc targets librdbg from building.
-
-2001-10-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * .cvsignore: Add autom4te.cache for autoconf > 2.52.
- * configure.in: Remove.
- * configure.ac: New file, generated from configure.in by autoupdate.
-
-2001-09-23 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * include/rdbg/i386/Makefile.am: Use 'PREINSTALL_FILES ='.
- * include/rdbg/m68k/Makefile.am: Use 'PREINSTALL_FILES ='.
- * include/rdbg/powerpc/Makefile.am: Use 'PREINSTALL_FILES ='.
- * include/rdbg/Makefile.am: Use 'PREINSTALL_FILES ='.
- * src/i386/any/Makefile.am: Use 'PREINSTALL_FILES ='.
- * src/m68k/any/Makefile.am: Use 'PREINSTALL_FILES ='.
- * src/powerpc/new_exception_processing/Makefile.am: Use 'PREINSTALL_FILES ='.
-
-2001-09-22 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * src/i386/any/Makefile.am: Move MAINTAINERCLEANFILES before the
- includes and use MAINTAINERCLEANFILES = to make automake-1.5 happy.
- * src/m68k/any/Makefile.am: Ditto.
- * src/powerpc/new_exception_processing/Makefile.am: Ditto.
-
-2001-09-14 Eric Norum <eric.norum@usask.ca>
-
- * include/rdbg/rdbg.h, src/ptrace.c: Modifications to make gcc 3.x happy.
-
-2001-04-20 Eric Valette <valette@crf.canon.fr>
-
- * mcp750 directory renamed new_exception processing as it
- supports many more CPU models.
- * configure.in, src/powerpc/Makefile.am,
- src/powerpc/new_exception_processing/Makefile.am,
- src/powerpc/new_exception_processing/remdeb_f.x: New files
- formerly in mcp750 plus modifications.
- * src/powerpc/mcp750/.cvsignore, src/powerpc/mcp750/Makefile.am,
- src/powerpc/mcp750/remdeb.h, src/powerpc/mcp750/remdeb_f.x,
- src/powerpc/mcp750/remdeb_svc.c, src/powerpc/mcp750/remdeb_xdr.c:
- Removed when moved to new_exception_processing.
- * configure.in, src/powerpc/Makefile.am,
- src/powerpc/new_exception_processing/Makefile.am,
- src/powerpc/new_exception_processing/remdeb_f.x: Modified as
- part of this effort to add support for the MPC8xx.
-
-2001-02-04 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * include/rdbg/Makefile.am, include/rdbg/i386/Makefile.am,
- include/rdbg/m68k/Makefile.am, include/rdbg/powerpc/Makefile.am:
- Cleanup including more proper style on include files.
-
-2000-11-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS.
-
-2000-11-02 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal.
-
-2000-10-25 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros.
- Switch to GNU canonicalization.
-
-2000-10-19 Antti P Miettinen <anmietti@trshp.ntc.nokia.com>
-
- * src/m68k/any/remdeb.h, src/m68k/any/remdeb_xdr.c,
- src/m68k/any/remdeb_svc.c: New files missed in merger.
-
-2000-10-19 Antti P Miettinen <anmietti@trshp.ntc.nokia.com>
-
- * configure.in: Add m68k support.
- * include/rdbg/m68k, src/m68k, src/m68k/any: New subdirectory.
- * src/_servtgt.c: add status text to prinf upon task creation failure.
- * src/rdbg.c: reconnect rdbg exception handlers upon RPC calls.
- * src/m68k/Makefile.am, src/m68k/any/Makefile.am,
- src/m68k/any/remdeb_f.x, src/m68k/any/.cvsignore,
- src/m68k/any/remdeb.h, src/m68k/any/remdeb_xdr.c,
- src/m68k/any/remdeb_svc.c, src/m68k/excep_f.c, src/m68k/rdbg_cpu_asm.S,
- src/m68k/rdbg_f.c, src/m68k/.cvsignore: New files.
-
-2000-09-04 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * src/i386/any/Makefile.am, src/powerpc/mcp750/Makefile.am: Include
- compile.am
-
-2000-08-10 Joel Sherrill <joel@OARcorp.com>
-
- * ChangeLog: New file.
diff --git a/c/src/librdbg/src/i386/any/remdeb.h b/c/src/librdbg/src/i386/any/remdeb.h
index 5054a706aa..b7b8c90c3b 100644
--- a/c/src/librdbg/src/i386/any/remdeb.h
+++ b/c/src/librdbg/src/i386/any/remdeb.h
@@ -8,6 +8,7 @@
#include <rpc/rpc.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -15,122 +16,123 @@ extern "C" {
#define RTEMS_PORT 2071
#define RTEMS_BACK_PORT 2073
#ifndef REMDEB_H
-#define RPCGENSRVNAME(a) a
+#define RPCGENSRVNAME(a) a
- enum rpc_type {
- SUNRPC = 0,
- BADRPCTYPE = 25,
- };
- typedef enum rpc_type rpc_type;
+enum rpc_type {
+ SUNRPC = 0,
+ BADRPCTYPE = 25,
+};
+typedef enum rpc_type rpc_type;
#define NET_SAFE 1400
- struct UDP_MSG {
- u_char type;
- u_char msg_num;
- u_short spec;
- long pid;
- u_long context;
- };
- typedef struct UDP_MSG UDP_MSG;
+struct UDP_MSG {
+ u_char type;
+ u_char msg_num;
+ u_short spec;
+ long pid;
+ u_long context;
+};
+typedef struct UDP_MSG UDP_MSG;
/*
* Sun request values for the remote ptrace system call
*/
- enum ptracereq {
- RPT_TRACEME = 0,
- RPT_CHILDDONE = 0,
- RPT_PEEKTEXT = 0 + 1,
- RPT_PEEKDATA = 0 + 2,
- RPT_PEEKUSER = 0 + 3,
- RPT_POKETEXT = 0 + 4,
- RPT_POKEDATA = 0 + 5,
- RPT_POKEUSER = 0 + 6,
- RPT_CONT = 0 + 7,
- RPT_KILL = 0 + 8,
- RPT_SINGLESTEP = 0 + 9,
- RPT_ATTACH = 0 + 10,
- RPT_DETACH = 0 + 11,
- RPT_GETREGS = 0 + 12,
- RPT_SETREGS = 0 + 13,
- RPT_GETFPREGS = 0 + 14,
- RPT_SETFPREGS = 0 + 15,
- RPT_READDATA = 0 + 16,
- RPT_WRITEDATA = 0 + 17,
- RPT_READTEXT = 0 + 18,
- RPT_WRITETEXT = 0 + 19,
- RPT_GETFPAREGS = 0 + 20,
- RPT_SETFPAREGS = 0 + 21,
- RPT_22 = 0 + 22,
- RPT_23 = 0 + 23,
- RPT_SYSCALL = 0 + 24,
- RPT_DUMPCORE = 0 + 25,
- RPT_26 = 0 + 26,
- RPT_27 = 0 + 27,
- RPT_28 = 0 + 28,
- RPT_GETUCODE = 0 + 29,
- RPT_GETTARGETTHREAD = 50,
- RPT_SETTARGETTHREAD = 51,
- RPT_THREADSUSPEND = 52,
- RPT_THREADRESUME = 53,
- RPT_THREADLIST = 54,
- RPT_GETTHREADNAME = 55,
- RPT_SETTHREADNAME = 56,
- RPT_SETTHREADREGS = 57,
- RPT_GETTHREADREGS = 58,
- RPT_STEPRANGE = 75,
- RPT_CONTTO = 76,
- RPT_SETBREAK = 77,
- RPT_CLRBREAK = 78,
- RPT_GETBREAK = 79,
- RPT_GETNAME = 80,
- RPT_STOP = 81,
- RPT_PGETREGS = 82,
- RPT_PSETREGS = 83,
- RPT_PSETTHREADREGS = 84,
- RPT_PGETTHREADREGS = 85,
- };
- typedef enum ptracereq ptracereq;
-
- struct xdr_regs {
- u_int tabreg[19];
- };
- typedef struct xdr_regs xdr_regs;
+
+enum ptracereq {
+ RPT_TRACEME = 0,
+ RPT_CHILDDONE = 0,
+ RPT_PEEKTEXT = 0 + 1,
+ RPT_PEEKDATA = 0 + 2,
+ RPT_PEEKUSER = 0 + 3,
+ RPT_POKETEXT = 0 + 4,
+ RPT_POKEDATA = 0 + 5,
+ RPT_POKEUSER = 0 + 6,
+ RPT_CONT = 0 + 7,
+ RPT_KILL = 0 + 8,
+ RPT_SINGLESTEP = 0 + 9,
+ RPT_ATTACH = 0 + 10,
+ RPT_DETACH = 0 + 11,
+ RPT_GETREGS = 0 + 12,
+ RPT_SETREGS = 0 + 13,
+ RPT_GETFPREGS = 0 + 14,
+ RPT_SETFPREGS = 0 + 15,
+ RPT_READDATA = 0 + 16,
+ RPT_WRITEDATA = 0 + 17,
+ RPT_READTEXT = 0 + 18,
+ RPT_WRITETEXT = 0 + 19,
+ RPT_GETFPAREGS = 0 + 20,
+ RPT_SETFPAREGS = 0 + 21,
+ RPT_22 = 0 + 22,
+ RPT_23 = 0 + 23,
+ RPT_SYSCALL = 0 + 24,
+ RPT_DUMPCORE = 0 + 25,
+ RPT_26 = 0 + 26,
+ RPT_27 = 0 + 27,
+ RPT_28 = 0 + 28,
+ RPT_GETUCODE = 0 + 29,
+ RPT_GETTARGETTHREAD = 50,
+ RPT_SETTARGETTHREAD = 51,
+ RPT_THREADSUSPEND = 52,
+ RPT_THREADRESUME = 53,
+ RPT_THREADLIST = 54,
+ RPT_GETTHREADNAME = 55,
+ RPT_SETTHREADNAME = 56,
+ RPT_SETTHREADREGS = 57,
+ RPT_GETTHREADREGS = 58,
+ RPT_STEPRANGE = 75,
+ RPT_CONTTO = 76,
+ RPT_SETBREAK = 77,
+ RPT_CLRBREAK = 78,
+ RPT_GETBREAK = 79,
+ RPT_GETNAME = 80,
+ RPT_STOP = 81,
+ RPT_PGETREGS = 82,
+ RPT_PSETREGS = 83,
+ RPT_PSETTHREADREGS = 84,
+ RPT_PGETTHREADREGS = 85,
+};
+typedef enum ptracereq ptracereq;
+
+struct xdr_regs {
+ u_int tabreg[19];
+};
+typedef struct xdr_regs xdr_regs;
/* now define register macros to apply to xdr_reg struct */
-#define GS 0
-#define FS 1
-#define ES 2
-#define DS 3
-#define EDI 4
-#define ESI 5
-#define EBP 6
-#define ESP 7
-#define EBX 8
-#define EDX 9
-#define ECX 10
-#define EAX 11
+#define GS 0
+#define FS 1
+#define ES 2
+#define DS 3
+#define EDI 4
+#define ESI 5
+#define EBP 6
+#define ESP 7
+#define EBX 8
+#define EDX 9
+#define ECX 10
+#define EAX 11
#define TRAPNO 12
-#define ERR 13
-#define EIP 14
-#define CS 15
-#define EFL 16
-#define UESP 17
-#define SS 18
-
-#define REG_PC tabreg[EIP] /* PC (eip) register offset */
-#define REG_SP tabreg[UESP] /* SP (uesp) register offset */
-#define REG_FP tabreg[EBP] /* FP (ebp) register offset */
+#define ERR 13
+#define EIP 14
+#define CS 15
+#define EFL 16
+#define UESP 17
+#define SS 18
+
+#define REG_PC tabreg[EIP] /* PC (eip) register offset */
+#define REG_SP tabreg[UESP] /* SP (uesp) register offset */
+#define REG_FP tabreg[EBP] /* FP (ebp) register offset */
/* now define the BREAKPOINT mask technique to a long word */
-#define SET_BREAK(l) ((l&0xFFFFFF00) | 0xCC)
-#define IS_BREAK(l) (((l) & 0xFF) == 0xCC)
+#define SET_BREAK(l) ((l&0xFFFFFF00) | 0xCC)
+#define IS_BREAK(l) (((l) & 0xFF) == 0xCC)
#define ORG_BREAK(c,p) (((c) & 0xFFFFFF00) | ((p) & 0xFF))
-#define IS_STEP(regs) (regs.tabreg[TRAPNO] == 1) /* was step and not break */
-#define BREAK_ADJ 1 /* must subtract one from address after bp */
-#define BREAK_SIZE 1 /* Breakpoint occupies one byte */
-#define TARGET_PROC_TYPE 0
+#define IS_STEP(regs) (regs.tabreg[TRAPNO] == 1) /* was step and not break */
+#define BREAK_ADJ 1 /* must subtract one from address after bp */
+#define BREAK_SIZE 1 /* Breakpoint occupies one byte */
+#define TARGET_PROC_TYPE 0
#define MAXDEBUGGEE 150
#define NAMEMAX 17
- /*
+ /*
* Memory data for read/write text or data. The size is in data. The target
* addr is in the addr field.
* Be careful before modifying because this value goes into internal
@@ -139,298 +141,255 @@ extern "C" {
*/
#define MEM_DATA_MAX 256
- struct xdr_mem {
- u_long addr;
- u_int dataNb;
- u_char data[MEM_DATA_MAX];
- };
- typedef struct xdr_mem xdr_mem;
-
- enum break_type {
- BRKT_NONE = 0,
- BRKT_INSTR = 1,
- BRKT_READ = 2,
- BRKT_WRITE = 3,
- BRKT_ACCESS = 4,
- BRKT_EXEC = 5,
- BRKT_OS_CALL = 6,
- BRKT_OS_SWITCH = 7,
- BRKT_STEPEMUL = 8,
- };
- typedef enum break_type break_type;
+struct xdr_mem {
+ u_long addr;
+ u_int dataNb;
+ u_char data[MEM_DATA_MAX];
+};
+typedef struct xdr_mem xdr_mem;
+
+enum break_type {
+ BRKT_NONE = 0,
+ BRKT_INSTR = 1,
+ BRKT_READ = 2,
+ BRKT_WRITE = 3,
+ BRKT_ACCESS = 4,
+ BRKT_EXEC = 5,
+ BRKT_OS_CALL = 6,
+ BRKT_OS_SWITCH = 7,
+ BRKT_STEPEMUL = 8,
+};
+typedef enum break_type break_type;
#define MAX_THRD_BRK 4
- struct xdr_break {
- u_char type;
- u_char thread_spec;
- u_short handle;
- u_long ee_loc;
- u_long ee_type;
- u_short length;
- u_char pass_count;
- u_char curr_pass;
- u_long thread_list[MAX_THRD_BRK];
- };
- typedef struct xdr_break xdr_break;
+struct xdr_break {
+ u_char type;
+ u_char thread_spec;
+ u_short handle;
+ u_long ee_loc;
+ u_long ee_type;
+ u_short length;
+ u_char pass_count;
+ u_char curr_pass;
+ u_long thread_list[MAX_THRD_BRK];
+};
+typedef struct xdr_break xdr_break;
#define UTHREAD_MAX 64
#define THREADNAMEMAX 16
- typedef char *thread_name;
-
- struct KernThread {
- u_int threadLi;
- };
- typedef struct KernThread KernThread;
- typedef KernThread *ptThreadList;
-
- struct thread_list {
- u_int nbThread;
- ptThreadList threads;
- };
- typedef struct thread_list thread_list;
-
- struct ptrace_addr_data_in {
- ptracereq req;
- union {
- xdr_regs regs;
- struct {
- u_int pregs_len;
- u_int *pregs_val;
- } pregs;
- thread_name name;
- xdr_mem mem;
- xdr_break breakp;
- u_int address;
- } ptrace_addr_data_in_u;
- };
- typedef struct ptrace_addr_data_in ptrace_addr_data_in;
-
- struct ptrace_addr_data_out {
- ptracereq req;
- union {
- xdr_regs regs;
- struct {
- u_int pregs_len;
- u_int *pregs_val;
- } pregs;
- thread_list threads;
- thread_name name;
- xdr_mem mem;
- xdr_break breakp;
- u_int addr;
- } ptrace_addr_data_out_u;
- };
- typedef struct ptrace_addr_data_out ptrace_addr_data_out;
-
- typedef struct {
- u_int CHAR_DATA_len;
- char *CHAR_DATA_val;
- } CHAR_DATA;
-#define XRY_MAX_INST_BUFF 128
-#define XRY_MAX_INSTANCES 16
-#ifndef XRY_MAX_CMD_STR
-#define XRY_MAX_CMD_STR 320
-#endif /* REMDEB_H */
-
- struct xry_inst {
- u_char flags;
- u_char type;
- u_char sub_type;
- u_char res_type;
- u_long value;
- u_long value2;
- };
- typedef struct xry_inst xry_inst;
-
- struct instance {
- struct xry_inst instances[XRY_MAX_INSTANCES];
- u_char buffer[XRY_MAX_INST_BUFF];
- };
- typedef struct instance instance;
-
- struct instance_union {
- bool_t instances;
- union {
- instance inst;
- char *buffer;
- } instance_union_u;
- };
- typedef struct instance_union instance_union;
-
- typedef char *one_arg;
-#define XRY_MAX_OBJ_NAME 32
- /*
- * now open_connex() routine which establishes a connection to server
- */
-
- enum debug_type {
- DEBTYP_PROCESS = 0,
- DEBTYP_C_ACTOR = 1,
- DEBTYP_KERNEL = 2,
- DEBTYP_OTHER = 3,
- };
- typedef enum debug_type debug_type;
-#define DEBUGGER_IS_GDB 0x2 /* */
-
- struct open_in {
- u_char back_port[16];
- u_short debug_type;
- u_short flags;
- u_char destination[16];
- one_arg user_name;
- };
- typedef struct open_in open_in;
-
- struct open_out {
- u_long port;
- u_int pad[4];
- u_int fp;
- u_char cmd_table_num;
- u_char cmd_table_vers;
- u_short server_vers;
- };
- typedef struct open_out open_out;
- /*
- * now close_connex() routine which detaches from server
- */
-
- enum close_control {
- CLOSE_IGNORE = 0,
- CLOSE_KILL = 1,
- CLOSE_DETACH = 2,
- };
- typedef enum close_control close_control;
-
- struct close_in {
- close_control control;
- };
- typedef struct close_in close_in;
- /*
- * now send_signal() routine which sends signals to processes like kill(2)
- */
-
- struct signal_in {
- int pid;
- int sig;
- };
- typedef struct signal_in signal_in;
-
- struct signal_out {
- int kill_return;
- int errNo;
- };
- typedef struct signal_out signal_out;
- /*
- * now wait_info() routine which returns results of polling the wait status
- * of a process/actor. It may return 0 if running, else pid or -1
- */
-
- enum stop_code {
- STOP_ERROR = 0,
- STOP_NONE = 1,
- STOP_UNKNOWN = 2,
- STOP_BREAK = 3,
- STOP_STEP = 4,
- STOP_SIGNAL = 5,
- STOP_TERM_EXIT = 6,
- STOP_TERM_SIG = 7,
- STOP_DETACHED = 8,
- STOP_KILLED = 9,
- STOP_SPAWN_FAILED = 10,
- };
- typedef enum stop_code stop_code;
-
- struct wait_in {
- int pid;
- };
- typedef struct wait_in wait_in;
-
- struct wait_out {
- int wait_return;
- int errNo;
- int status;
- stop_code reason;
- int handle;
- u_long PC;
- u_long SP;
- u_long FP;
- u_long thread;
- };
- typedef struct wait_out wait_out;
- /*
- * now ptrace() routine. This matches the Sun UNIX ptrace as well as
- * some additions
- */
+typedef char *thread_name;
+
+struct KernThread {
+ u_int threadLi;
+};
+typedef struct KernThread KernThread;
+typedef KernThread *ptThreadList;
+
+struct thread_list {
+ u_int nbThread;
+ ptThreadList threads;
+};
+typedef struct thread_list thread_list;
+
+struct ptrace_addr_data_in {
+ ptracereq req;
+ union {
+ xdr_regs regs;
+ struct {
+ u_int pregs_len;
+ u_int *pregs_val;
+ } pregs;
+ thread_name name;
+ xdr_mem mem;
+ xdr_break breakp;
+ u_int address;
+ } ptrace_addr_data_in_u;
+};
+typedef struct ptrace_addr_data_in ptrace_addr_data_in;
+
+struct ptrace_addr_data_out {
+ ptracereq req;
+ union {
+ xdr_regs regs;
+ struct {
+ u_int pregs_len;
+ u_int *pregs_val;
+ } pregs;
+ thread_list threads;
+ thread_name name;
+ xdr_mem mem;
+ xdr_break breakp;
+ u_int addr;
+ } ptrace_addr_data_out_u;
+};
+typedef struct ptrace_addr_data_out ptrace_addr_data_out;
+
+typedef struct {
+ u_int CHAR_DATA_len;
+ char *CHAR_DATA_val;
+} CHAR_DATA;
+
+typedef char *one_arg;
+ /* now open_connex() routine which establishes a connection to server */
+
+enum debug_type {
+ DEBTYP_PROCESS = 0,
+ DEBTYP_C_ACTOR = 1,
+ DEBTYP_KERNEL = 2,
+ DEBTYP_OTHER = 3,
+};
+typedef enum debug_type debug_type;
+#define DEBUGGER_IS_GDB 0x2 /* */
+
+struct open_in {
+ u_char back_port[16];
+ u_short debug_type;
+ u_short flags;
+ u_char destination[16];
+ one_arg user_name;
+};
+typedef struct open_in open_in;
+
+struct open_out {
+ u_long port;
+ u_int pad[4];
+ u_int fp;
+ u_char cmd_table_num;
+ u_char cmd_table_vers;
+ u_short server_vers;
+};
+typedef struct open_out open_out;
+ /* now close_connex() routine which detaches from server */
+
+enum close_control {
+ CLOSE_IGNORE = 0,
+ CLOSE_KILL = 1,
+ CLOSE_DETACH = 2,
+};
+typedef enum close_control close_control;
+
+struct close_in {
+ close_control control;
+};
+typedef struct close_in close_in;
+ /* now send_signal() routine which sends signals to processes like kill(2) */
+
+struct signal_in {
+ int pid;
+ int sig;
+};
+typedef struct signal_in signal_in;
+
+struct signal_out {
+ int kill_return;
+ int errNo;
+};
+typedef struct signal_out signal_out;
+ /* now wait_info() routine which returns results of polling the wait status
+ of a process/actor. It may return 0 if running, else pid or -1 */
+
+enum stop_code {
+ STOP_ERROR = 0,
+ STOP_NONE = 1,
+ STOP_UNKNOWN = 2,
+ STOP_BREAK = 3,
+ STOP_STEP = 4,
+ STOP_SIGNAL = 5,
+ STOP_TERM_EXIT = 6,
+ STOP_TERM_SIG = 7,
+ STOP_DETACHED = 8,
+ STOP_KILLED = 9,
+ STOP_SPAWN_FAILED = 10,
+};
+typedef enum stop_code stop_code;
+
+struct wait_in {
+ int pid;
+};
+typedef struct wait_in wait_in;
+
+struct wait_out {
+ int wait_return;
+ int errNo;
+ int status;
+ stop_code reason;
+ int handle;
+ u_long PC;
+ u_long SP;
+ u_long FP;
+ u_long thread;
+};
+typedef struct wait_out wait_out;
+ /* now ptrace() routine. This matches the Sun UNIX ptrace as well as
+ some additions */
#define PTRFLG_FORCE 1
#define PTRFLG_NON_OWNER 2
#define PTRFLG_FREE 4
#define PTRDET_UNOWN 0x100
- struct ptrace_in {
- int pid;
- ptrace_addr_data_in addr;
- u_int data;
- u_int flags;
- };
- typedef struct ptrace_in ptrace_in;
-
- struct ptrace_out {
- ptrace_addr_data_out addr;
- int result;
- int errNo;
- };
- typedef struct ptrace_out ptrace_out;
-
- struct one_symbol {
- char *symbolName;
- long symbolValue;
- };
- typedef struct one_symbol one_symbol;
-
- typedef struct {
- u_int all_symbols_len;
- one_symbol *all_symbols_val;
- } all_symbols;
-
- struct get_global_symbols_out {
- all_symbols symbols;
- };
- typedef struct get_global_symbols_out get_global_symbols_out;
-
- struct get_text_data_in {
- int pid;
- char *actorName;
- };
- typedef struct get_text_data_in get_text_data_in;
-
- struct get_text_data_out {
- int result;
- int errNo;
- u_long textStart;
- u_long textSize;
- u_long dataStart;
- u_long dataSize;
- };
- typedef struct get_text_data_out get_text_data_out;
-
- struct one_signal {
- u_int number;
- char *name;
- };
- typedef struct one_signal one_signal;
-
- typedef struct {
- u_int all_signals_len;
- one_signal *all_signals_val;
- } all_signals;
-
- struct get_signal_names_out {
- all_signals signals;
- };
- typedef struct get_signal_names_out get_signal_names_out;
- /*
- * now define the actual calls we support
- */
+struct ptrace_in {
+ int pid;
+ ptrace_addr_data_in addr;
+ u_int data;
+ u_int flags;
+};
+typedef struct ptrace_in ptrace_in;
+
+struct ptrace_out {
+ ptrace_addr_data_out addr;
+ int result;
+ int errNo;
+};
+typedef struct ptrace_out ptrace_out;
+
+struct one_symbol {
+ char *symbolName;
+ long symbolValue;
+};
+typedef struct one_symbol one_symbol;
+
+typedef struct {
+ u_int all_symbols_len;
+ one_symbol *all_symbols_val;
+} all_symbols;
+
+struct get_global_symbols_out {
+ all_symbols symbols;
+};
+typedef struct get_global_symbols_out get_global_symbols_out;
+
+struct get_text_data_in {
+ int pid;
+ char *actorName;
+};
+typedef struct get_text_data_in get_text_data_in;
+
+struct get_text_data_out {
+ int result;
+ int errNo;
+ u_long textStart;
+ u_long textSize;
+ u_long dataStart;
+ u_long dataSize;
+};
+typedef struct get_text_data_out get_text_data_out;
+
+struct one_signal {
+ u_int number;
+ char *name;
+};
+typedef struct one_signal one_signal;
+
+typedef struct {
+ u_int all_signals_len;
+ one_signal *all_signals_val;
+} all_signals;
+
+struct get_signal_names_out {
+ all_signals signals;
+};
+typedef struct get_signal_names_out get_signal_names_out;
+ /* now define the actual calls we support */
#define REMDEB_H
#endif
@@ -439,131 +398,125 @@ extern "C" {
#if defined(__STDC__) || defined(__cplusplus)
#define OPEN_CONNEX 1
- extern open_out *open_connex_2 (open_in *, CLIENT *);
- extern open_out *open_connex_2_svc (open_in *, struct svc_req *);
+extern open_out * open_connex_2(open_in *, CLIENT *);
+extern open_out * open_connex_2_svc(open_in *, struct svc_req *);
#define SEND_SIGNAL 2
- extern signal_out *send_signal_2 (signal_in *, CLIENT *);
- extern signal_out *send_signal_2_svc (signal_in *, struct svc_req *);
+extern signal_out * send_signal_2(signal_in *, CLIENT *);
+extern signal_out * send_signal_2_svc(signal_in *, struct svc_req *);
#define CLOSE_CONNEX 10
- extern void *close_connex_2 (close_in *, CLIENT *);
- extern void *close_connex_2_svc (close_in *, struct svc_req *);
+extern void * close_connex_2(close_in *, CLIENT *);
+extern void * close_connex_2_svc(close_in *, struct svc_req *);
#define PTRACE 11
- extern ptrace_out *ptrace_2 (ptrace_in *, CLIENT *);
- extern ptrace_out *ptrace_2_svc (ptrace_in *, struct svc_req *);
+extern ptrace_out * ptrace_2(ptrace_in *, CLIENT *);
+extern ptrace_out * ptrace_2_svc(ptrace_in *, struct svc_req *);
#define WAIT_INFO 13
- extern wait_out *wait_info_2 (wait_in *, CLIENT *);
- extern wait_out *wait_info_2_svc (wait_in *, struct svc_req *);
+extern wait_out * wait_info_2(wait_in *, CLIENT *);
+extern wait_out * wait_info_2_svc(wait_in *, struct svc_req *);
#define GET_SIGNAL_NAMES 17
- extern get_signal_names_out *get_signal_names_2 (void *, CLIENT *);
- extern get_signal_names_out *get_signal_names_2_svc (void *,
- struct svc_req *);
- extern int remotedeb_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+extern get_signal_names_out * get_signal_names_2(void *, CLIENT *);
+extern get_signal_names_out * get_signal_names_2_svc(void *, struct svc_req *);
+extern int remotedeb_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
-#else /* K&R C */
+#else /* K&R C */
#define OPEN_CONNEX 1
- extern open_out *open_connex_2 ();
- extern open_out *open_connex_2_svc ();
+extern open_out * open_connex_2();
+extern open_out * open_connex_2_svc();
#define SEND_SIGNAL 2
- extern signal_out *send_signal_2 ();
- extern signal_out *send_signal_2_svc ();
+extern signal_out * send_signal_2();
+extern signal_out * send_signal_2_svc();
#define CLOSE_CONNEX 10
- extern void *close_connex_2 ();
- extern void *close_connex_2_svc ();
+extern void * close_connex_2();
+extern void * close_connex_2_svc();
#define PTRACE 11
- extern ptrace_out *ptrace_2 ();
- extern ptrace_out *ptrace_2_svc ();
+extern ptrace_out * ptrace_2();
+extern ptrace_out * ptrace_2_svc();
#define WAIT_INFO 13
- extern wait_out *wait_info_2 ();
- extern wait_out *wait_info_2_svc ();
+extern wait_out * wait_info_2();
+extern wait_out * wait_info_2_svc();
#define GET_SIGNAL_NAMES 17
- extern get_signal_names_out *get_signal_names_2 ();
- extern get_signal_names_out *get_signal_names_2_svc ();
- extern int remotedeb_2_freeresult ();
-#endif /* K&R C */
+extern get_signal_names_out * get_signal_names_2();
+extern get_signal_names_out * get_signal_names_2_svc();
+extern int remotedeb_2_freeresult ();
+#endif /* K&R C */
/* the xdr functions */
#if defined(__STDC__) || defined(__cplusplus)
- extern bool_t xdr_rpc_type (XDR *, rpc_type *);
- extern bool_t xdr_UDP_MSG (XDR *, UDP_MSG *);
- extern bool_t xdr_ptracereq (XDR *, ptracereq *);
- extern bool_t xdr_xdr_regs (XDR *, xdr_regs *);
- extern bool_t xdr_xdr_mem (XDR *, xdr_mem *);
- extern bool_t xdr_break_type (XDR *, break_type *);
- extern bool_t xdr_xdr_break (XDR *, xdr_break *);
- extern bool_t xdr_thread_name (XDR *, thread_name *);
- extern bool_t xdr_KernThread (XDR *, KernThread *);
- extern bool_t xdr_thread_list (XDR *, thread_list *);
- extern bool_t xdr_ptrace_addr_data_in (XDR *, ptrace_addr_data_in *);
- extern bool_t xdr_ptrace_addr_data_out (XDR *, ptrace_addr_data_out *);
- extern bool_t xdr_CHAR_DATA (XDR *, CHAR_DATA *);
- extern bool_t xdr_xry_inst (XDR *, xry_inst *);
- extern bool_t xdr_instance (XDR *, instance *);
- extern bool_t xdr_instance_union (XDR *, instance_union *);
- extern bool_t xdr_one_arg (XDR *, one_arg *);
- extern bool_t xdr_debug_type (XDR *, debug_type *);
- extern bool_t xdr_open_in (XDR *, open_in *);
- extern bool_t xdr_open_out (XDR *, open_out *);
- extern bool_t xdr_close_control (XDR *, close_control *);
- extern bool_t xdr_close_in (XDR *, close_in *);
- extern bool_t xdr_signal_in (XDR *, signal_in *);
- extern bool_t xdr_signal_out (XDR *, signal_out *);
- extern bool_t xdr_stop_code (XDR *, stop_code *);
- extern bool_t xdr_wait_in (XDR *, wait_in *);
- extern bool_t xdr_wait_out (XDR *, wait_out *);
- extern bool_t xdr_ptrace_in (XDR *, ptrace_in *);
- extern bool_t xdr_ptrace_out (XDR *, ptrace_out *);
- extern bool_t xdr_one_symbol (XDR *, one_symbol *);
- extern bool_t xdr_all_symbols (XDR *, all_symbols *);
- extern bool_t xdr_get_global_symbols_out (XDR *, get_global_symbols_out *);
- extern bool_t xdr_get_text_data_in (XDR *, get_text_data_in *);
- extern bool_t xdr_get_text_data_out (XDR *, get_text_data_out *);
- extern bool_t xdr_one_signal (XDR *, one_signal *);
- extern bool_t xdr_all_signals (XDR *, all_signals *);
- extern bool_t xdr_get_signal_names_out (XDR *, get_signal_names_out *);
-
-#else /* K&R C */
- extern bool_t xdr_rpc_type ();
- extern bool_t xdr_UDP_MSG ();
- extern bool_t xdr_ptracereq ();
- extern bool_t xdr_xdr_regs ();
- extern bool_t xdr_xdr_mem ();
- extern bool_t xdr_break_type ();
- extern bool_t xdr_xdr_break ();
- extern bool_t xdr_thread_name ();
- extern bool_t xdr_KernThread ();
- extern bool_t xdr_thread_list ();
- extern bool_t xdr_ptrace_addr_data_in ();
- extern bool_t xdr_ptrace_addr_data_out ();
- extern bool_t xdr_CHAR_DATA ();
- extern bool_t xdr_xry_inst ();
- extern bool_t xdr_instance ();
- extern bool_t xdr_instance_union ();
- extern bool_t xdr_one_arg ();
- extern bool_t xdr_debug_type ();
- extern bool_t xdr_open_in ();
- extern bool_t xdr_open_out ();
- extern bool_t xdr_close_control ();
- extern bool_t xdr_close_in ();
- extern bool_t xdr_signal_in ();
- extern bool_t xdr_signal_out ();
- extern bool_t xdr_stop_code ();
- extern bool_t xdr_wait_in ();
- extern bool_t xdr_wait_out ();
- extern bool_t xdr_ptrace_in ();
- extern bool_t xdr_ptrace_out ();
- extern bool_t xdr_one_symbol ();
- extern bool_t xdr_all_symbols ();
- extern bool_t xdr_get_global_symbols_out ();
- extern bool_t xdr_get_text_data_in ();
- extern bool_t xdr_get_text_data_out ();
- extern bool_t xdr_one_signal ();
- extern bool_t xdr_all_signals ();
- extern bool_t xdr_get_signal_names_out ();
-
-#endif /* K&R C */
+extern bool_t xdr_rpc_type (XDR *, rpc_type*);
+extern bool_t xdr_UDP_MSG (XDR *, UDP_MSG*);
+extern bool_t xdr_ptracereq (XDR *, ptracereq*);
+extern bool_t xdr_xdr_regs (XDR *, xdr_regs*);
+extern bool_t xdr_xdr_mem (XDR *, xdr_mem*);
+extern bool_t xdr_break_type (XDR *, break_type*);
+extern bool_t xdr_xdr_break (XDR *, xdr_break*);
+extern bool_t xdr_thread_name (XDR *, thread_name*);
+extern bool_t xdr_KernThread (XDR *, KernThread*);
+extern bool_t xdr_thread_list (XDR *, thread_list*);
+extern bool_t xdr_ptrace_addr_data_in (XDR *, ptrace_addr_data_in*);
+extern bool_t xdr_ptrace_addr_data_out (XDR *, ptrace_addr_data_out*);
+extern bool_t xdr_CHAR_DATA (XDR *, CHAR_DATA*);
+extern bool_t xdr_one_arg (XDR *, one_arg*);
+extern bool_t xdr_debug_type (XDR *, debug_type*);
+extern bool_t xdr_open_in (XDR *, open_in*);
+extern bool_t xdr_open_out (XDR *, open_out*);
+extern bool_t xdr_close_control (XDR *, close_control*);
+extern bool_t xdr_close_in (XDR *, close_in*);
+extern bool_t xdr_signal_in (XDR *, signal_in*);
+extern bool_t xdr_signal_out (XDR *, signal_out*);
+extern bool_t xdr_stop_code (XDR *, stop_code*);
+extern bool_t xdr_wait_in (XDR *, wait_in*);
+extern bool_t xdr_wait_out (XDR *, wait_out*);
+extern bool_t xdr_ptrace_in (XDR *, ptrace_in*);
+extern bool_t xdr_ptrace_out (XDR *, ptrace_out*);
+extern bool_t xdr_one_symbol (XDR *, one_symbol*);
+extern bool_t xdr_all_symbols (XDR *, all_symbols*);
+extern bool_t xdr_get_global_symbols_out (XDR *, get_global_symbols_out*);
+extern bool_t xdr_get_text_data_in (XDR *, get_text_data_in*);
+extern bool_t xdr_get_text_data_out (XDR *, get_text_data_out*);
+extern bool_t xdr_one_signal (XDR *, one_signal*);
+extern bool_t xdr_all_signals (XDR *, all_signals*);
+extern bool_t xdr_get_signal_names_out (XDR *, get_signal_names_out*);
+
+#else /* K&R C */
+extern bool_t xdr_rpc_type ();
+extern bool_t xdr_UDP_MSG ();
+extern bool_t xdr_ptracereq ();
+extern bool_t xdr_xdr_regs ();
+extern bool_t xdr_xdr_mem ();
+extern bool_t xdr_break_type ();
+extern bool_t xdr_xdr_break ();
+extern bool_t xdr_thread_name ();
+extern bool_t xdr_KernThread ();
+extern bool_t xdr_thread_list ();
+extern bool_t xdr_ptrace_addr_data_in ();
+extern bool_t xdr_ptrace_addr_data_out ();
+extern bool_t xdr_CHAR_DATA ();
+extern bool_t xdr_one_arg ();
+extern bool_t xdr_debug_type ();
+extern bool_t xdr_open_in ();
+extern bool_t xdr_open_out ();
+extern bool_t xdr_close_control ();
+extern bool_t xdr_close_in ();
+extern bool_t xdr_signal_in ();
+extern bool_t xdr_signal_out ();
+extern bool_t xdr_stop_code ();
+extern bool_t xdr_wait_in ();
+extern bool_t xdr_wait_out ();
+extern bool_t xdr_ptrace_in ();
+extern bool_t xdr_ptrace_out ();
+extern bool_t xdr_one_symbol ();
+extern bool_t xdr_all_symbols ();
+extern bool_t xdr_get_global_symbols_out ();
+extern bool_t xdr_get_text_data_in ();
+extern bool_t xdr_get_text_data_out ();
+extern bool_t xdr_one_signal ();
+extern bool_t xdr_all_signals ();
+extern bool_t xdr_get_signal_names_out ();
+
+#endif /* K&R C */
#ifdef __cplusplus
}
#endif
-#endif /* !_REMDEB_H_RPCGEN */
+
+#endif /* !_REMDEB_H_RPCGEN */
diff --git a/c/src/librdbg/src/i386/any/remdeb_svc.c b/c/src/librdbg/src/i386/any/remdeb_svc.c
index 1827a53e3c..e69de29bb2 100644
--- a/c/src/librdbg/src/i386/any/remdeb_svc.c
+++ b/c/src/librdbg/src/i386/any/remdeb_svc.c
@@ -1,133 +0,0 @@
-#include <rpc/types.h>
-#include <rpc/rpc.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <bsp.h>
-#include <rdbg/servrpc.h>
-#include <rdbg/remdeb.h>
-#define fprintf(a,b) printf(b)
-/*HEADER_START*/
-#define RTEMS_PORT 2071
-#define RTEMS_BACK_PORT 2073
-/*
- * Sun request values for the remote ptrace system call
- */
-
- /*
- * Memory data for read/write text or data. The size is in data. The target
- * addr is in the addr field.
- * Be careful before modifying because this value goes into internal
- * pipes and is allocated on stack too. Pipes and/or the stack could
- * become too small if this value gets incremented.
- */
-#ifndef XRY_MAX_CMD_STR
-#endif /* REMDEB_H */
- /*
- * now open_connex() routine which establishes a connection to server
- */
-#define DEBUGGER_IS_GDB 0x2 /* */
- /*
- * now close_connex() routine which detaches from server
- */
- /*
- * now send_signal() routine which sends signals to processes like kill(2)
- */
- /*
- * now wait_info() routine which returns results of polling the wait status
- * of a process/actor. It may return 0 if running, else pid or -1
- */
- /*
- * now ptrace() routine. This matches the Sun UNIX ptrace as well as
- * some additions
- */
- /*
- * now define the actual calls we support
- */
-const char *names[] = {
- "NULLPROC", "OPEN_CONNEX", "SEND_SIGNAL", "name3",
- "name4", "name5", "name6", "name7",
- "name8", "name9", "CLOSE_CONNEX", "PTRACE",
- "name12", "WAIT_INFO", "name14", "name15",
- "name16", "GET_SIGNAL_NAMES", "name18"
-};
-
-void
-remotedeb_2 (struct svc_req *rqstp, register SVCXPRT * transp)
-{
- union {
- open_in open_connex_2_arg;
- signal_in send_signal_2_arg;
- close_in close_connex_2_arg;
- ptrace_in ptrace_2_arg;
- wait_in wait_info_2_arg;
- } argument;
- char *result;
- xdrproc_t _xdr_argument, _xdr_result;
- char *(*local) (char *, struct svc_req *);
-
- DPRINTF (("remotedeb_2: %s (%d)\n",
- (unsigned) rqstp->rq_proc <
- (unsigned) (sizeof names / sizeof names[0]) ?
- names[rqstp->rq_proc] : "???", (int) rqstp->rq_proc));
-
- switch (rqstp->rq_proc) {
- case NULLPROC:
- (void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *) NULL);
- return;
-
- case OPEN_CONNEX:
- _xdr_argument = (xdrproc_t) xdr_open_in;
- _xdr_result = (xdrproc_t) xdr_open_out;
- local = (char *(*)(char *, struct svc_req *)) open_connex_2_svc;
- break;
-
- case SEND_SIGNAL:
- _xdr_argument = (xdrproc_t) xdr_signal_in;
- _xdr_result = (xdrproc_t) xdr_signal_out;
- local = (char *(*)(char *, struct svc_req *)) send_signal_2_svc;
- break;
-
- case CLOSE_CONNEX:
- _xdr_argument = (xdrproc_t) xdr_close_in;
- _xdr_result = (xdrproc_t) xdr_void;
- local = (char *(*)(char *, struct svc_req *)) close_connex_2_svc;
- break;
-
- case PTRACE:
- _xdr_argument = (xdrproc_t) xdr_ptrace_in;
- _xdr_result = (xdrproc_t) xdr_ptrace_out;
- local = (char *(*)(char *, struct svc_req *)) ptrace_2_svc;
- break;
-
- case WAIT_INFO:
- _xdr_argument = (xdrproc_t) xdr_wait_in;
- _xdr_result = (xdrproc_t) xdr_wait_out;
- local = (char *(*)(char *, struct svc_req *)) wait_info_2_svc;
- break;
-
- case GET_SIGNAL_NAMES:
- _xdr_argument = (xdrproc_t) xdr_void;
- _xdr_result = (xdrproc_t) xdr_get_signal_names_out;
- local = (char *(*)(char *, struct svc_req *)) get_signal_names_2_svc;
- break;
-
- default:
- svcerr_noproc (transp);
- return;
- }
- memset ((char *) &argument, 0, sizeof (argument));
- if (!svc_getargs (transp, _xdr_argument, (caddr_t) & argument)) {
- svcerr_decode (transp);
- return;
- }
- result = (*local) ((char *) &argument, rqstp);
- if (result != NULL && !svc_sendreply (transp, _xdr_result, result)) {
- svcerr_systemerr (transp);
- }
- if (!svc_freeargs (transp, _xdr_argument, (caddr_t) & argument)) {
- fprintf (stderr, "unable to free arguments");
- exit (1);
- }
- return;
-}
diff --git a/c/src/librdbg/src/i386/any/remdeb_xdr.c b/c/src/librdbg/src/i386/any/remdeb_xdr.c
index b3d6cf7a02..721dfdc200 100644
--- a/c/src/librdbg/src/i386/any/remdeb_xdr.c
+++ b/c/src/librdbg/src/i386/any/remdeb_xdr.c
@@ -8,951 +8,862 @@
#define RTEMS_BACK_PORT 2073
bool_t
-xdr_rpc_type (XDR * xdrs, rpc_type * objp)
+xdr_rpc_type (XDR *xdrs, rpc_type *objp)
{
- register int32_t *buf;
+ register int32_t *buf;
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
+ if (!xdr_enum (xdrs, (enum_t *) objp))
+ return FALSE;
+ return TRUE;
}
bool_t
-xdr_UDP_MSG (XDR * xdrs, UDP_MSG * objp)
+xdr_UDP_MSG (XDR *xdrs, UDP_MSG *objp)
{
- register int32_t *buf;
+ register int32_t *buf;
- if (!xdr_u_char (xdrs, &objp->type))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->msg_num))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->spec))
- return FALSE;
- if (!xdr_long (xdrs, &objp->pid))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->context))
- return FALSE;
- return TRUE;
+ if (!xdr_u_char (xdrs, &objp->type))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->msg_num))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->spec))
+ return FALSE;
+ if (!xdr_long (xdrs, &objp->pid))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->context))
+ return FALSE;
+ return TRUE;
}
-
/*
* Sun request values for the remote ptrace system call
*/
+
bool_t
-xdr_ptracereq (XDR * xdrs, ptracereq * objp)
+xdr_ptracereq (XDR *xdrs, ptracereq *objp)
{
- register int32_t *buf;
+ register int32_t *buf;
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
+ if (!xdr_enum (xdrs, (enum_t *) objp))
+ return FALSE;
+ return TRUE;
}
bool_t
-xdr_xdr_regs (XDR * xdrs, xdr_regs * objp)
+xdr_xdr_regs (XDR *xdrs, xdr_regs *objp)
{
- register int32_t *buf;
+ register int32_t *buf;
- int i;
+ int i;
- if (xdrs->x_op == XDR_ENCODE) {
- buf = XDR_INLINE (xdrs, 19 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_vector (xdrs, (char *) objp->tabreg, 19,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- } else {
- {
- register u_int *genp;
+ if (xdrs->x_op == XDR_ENCODE) {
+ buf = XDR_INLINE (xdrs, ( 19 ) * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_vector (xdrs, (char *)objp->tabreg, 19,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ } else {
+ {
+ register u_int *genp;
- for (i = 0, genp = objp->tabreg; i < 19; ++i) {
- IXDR_PUT_U_LONG (buf, *genp++);
- }
- }
- }
- return TRUE;
- } else if (xdrs->x_op == XDR_DECODE) {
- buf = XDR_INLINE (xdrs, 19 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_vector (xdrs, (char *) objp->tabreg, 19,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- } else {
- {
- register u_int *genp;
+ for (i = 0, genp = objp->tabreg;
+ i < 19; ++i) {
+ IXDR_PUT_U_LONG(buf, *genp++);
+ }
+ }
+ }
+ return TRUE;
+ } else if (xdrs->x_op == XDR_DECODE) {
+ buf = XDR_INLINE (xdrs, ( 19 ) * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_vector (xdrs, (char *)objp->tabreg, 19,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ } else {
+ {
+ register u_int *genp;
- for (i = 0, genp = objp->tabreg; i < 19; ++i) {
- *genp++ = IXDR_GET_U_LONG (buf);
- }
- }
- }
- return TRUE;
- }
+ for (i = 0, genp = objp->tabreg;
+ i < 19; ++i) {
+ *genp++ = IXDR_GET_U_LONG(buf);
+ }
+ }
+ }
+ return TRUE;
+ }
- if (!xdr_vector (xdrs, (char *) objp->tabreg, 19,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- return TRUE;
+ if (!xdr_vector (xdrs, (char *)objp->tabreg, 19,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ return TRUE;
}
-
- /*
+ /*
* Memory data for read/write text or data. The size is in data. The target
* addr is in the addr field.
* Be careful before modifying because this value goes into internal
* pipes and is allocated on stack too. Pipes and/or the stack could
* become too small if this value gets incremented.
*/
-bool_t
-xdr_xdr_mem (xdrs, objp)
- XDR *xdrs;
- struct xdr_mem *objp;
-{
- if (!xdr_u_long (xdrs, &objp->addr)) {
- return (FALSE);
- }
- if (!xdr_u_int (xdrs, &objp->dataNb)) {
- return (FALSE);
- }
- return (xdr_opaque (xdrs, objp->data, objp->dataNb));
-}
-
-bool_t
-xdr_break_type (XDR * xdrs, break_type * objp)
-{
- register int32_t *buf;
-
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_xdr_break (XDR * xdrs, xdr_break * objp)
-{
- register int32_t *buf;
-
- int i;
-
- if (xdrs->x_op == XDR_ENCODE) {
- if (!xdr_u_char (xdrs, &objp->type))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->thread_spec))
- return FALSE;
- buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_u_short (xdrs, &objp->handle))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->ee_loc))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->ee_type))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->length))
- return FALSE;
-
- } else {
- IXDR_PUT_U_SHORT (buf, objp->handle);
- IXDR_PUT_U_LONG (buf, objp->ee_loc);
- IXDR_PUT_U_LONG (buf, objp->ee_type);
- IXDR_PUT_U_SHORT (buf, objp->length);
- }
- if (!xdr_u_char (xdrs, &objp->pass_count))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->curr_pass))
- return FALSE;
- buf = XDR_INLINE (xdrs, MAX_THRD_BRK * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_vector (xdrs, (char *) objp->thread_list, MAX_THRD_BRK,
- sizeof (u_long), (xdrproc_t) xdr_u_long))
- return FALSE;
- } else {
- {
- register u_long *genp;
-
- for (i = 0, genp = objp->thread_list; i < MAX_THRD_BRK; ++i) {
- IXDR_PUT_U_LONG (buf, *genp++);
- }
- }
- }
- return TRUE;
- } else if (xdrs->x_op == XDR_DECODE) {
- if (!xdr_u_char (xdrs, &objp->type))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->thread_spec))
- return FALSE;
- buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_u_short (xdrs, &objp->handle))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->ee_loc))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->ee_type))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->length))
- return FALSE;
-
- } else {
- objp->handle = IXDR_GET_U_SHORT (buf);
- objp->ee_loc = IXDR_GET_U_LONG (buf);
- objp->ee_type = IXDR_GET_U_LONG (buf);
- objp->length = IXDR_GET_U_SHORT (buf);
- }
- if (!xdr_u_char (xdrs, &objp->pass_count))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->curr_pass))
- return FALSE;
- buf = XDR_INLINE (xdrs, MAX_THRD_BRK * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_vector (xdrs, (char *) objp->thread_list, MAX_THRD_BRK,
- sizeof (u_long), (xdrproc_t) xdr_u_long))
- return FALSE;
- } else {
- {
- register u_long *genp;
-
- for (i = 0, genp = objp->thread_list; i < MAX_THRD_BRK; ++i) {
- *genp++ = IXDR_GET_U_LONG (buf);
- }
- }
- }
- return TRUE;
- }
-
- if (!xdr_u_char (xdrs, &objp->type))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->thread_spec))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->handle))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->ee_loc))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->ee_type))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->length))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->pass_count))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->curr_pass))
- return FALSE;
- if (!xdr_vector (xdrs, (char *) objp->thread_list, MAX_THRD_BRK,
- sizeof (u_long), (xdrproc_t) xdr_u_long))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_thread_name (XDR * xdrs, thread_name * objp)
-{
- register int32_t *buf;
-
- if (!xdr_string (xdrs, objp, THREADNAMEMAX))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_KernThread (XDR * xdrs, KernThread * objp)
-{
- register int32_t *buf;
-
- if (!xdr_u_int (xdrs, &objp->threadLi))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_thread_list (xdrs, objp)
- XDR *xdrs;
- struct thread_list *objp;
-{
- return (xdr_array (xdrs, (char **) &objp->threads, &objp->nbThread,
- UTHREAD_MAX, sizeof (KernThread), xdr_KernThread));
-}
-
-bool_t
-xdr_ptrace_addr_data_in (XDR * xdrs, ptrace_addr_data_in * objp)
-{
- register int32_t *buf;
-
- if (!xdr_ptracereq (xdrs, &objp->req))
- return FALSE;
- switch (objp->req) {
- case RPT_SETTHREADREGS:
- if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_in_u.regs))
- return FALSE;
- break;
- case RPT_SETREGS:
- if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_in_u.regs))
- return FALSE;
- break;
- case RPT_PSETTHREADREGS:
- if (!xdr_array
- (xdrs, (char **) &objp->ptrace_addr_data_in_u.pregs.pregs_val,
- (u_int *) & objp->ptrace_addr_data_in_u.pregs.pregs_len, ~0,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- break;
- case RPT_PSETREGS:
- if (!xdr_array
- (xdrs, (char **) &objp->ptrace_addr_data_in_u.pregs.pregs_val,
- (u_int *) & objp->ptrace_addr_data_in_u.pregs.pregs_len, ~0,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- break;
- case RPT_SETTHREADNAME:
- if (!xdr_thread_name (xdrs, &objp->ptrace_addr_data_in_u.name))
- return FALSE;
- break;
- case RPT_WRITETEXT:
- if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_in_u.mem))
- return FALSE;
- break;
- case RPT_WRITEDATA:
- if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_in_u.mem))
- return FALSE;
- break;
- case RPT_SETBREAK:
- if (!xdr_xdr_break (xdrs, &objp->ptrace_addr_data_in_u.breakp))
- return FALSE;
- break;
- default:
- if (!xdr_u_int (xdrs, &objp->ptrace_addr_data_in_u.address))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_ptrace_addr_data_out (XDR * xdrs, ptrace_addr_data_out * objp)
-{
- register int32_t *buf;
-
- if (!xdr_ptracereq (xdrs, &objp->req))
- return FALSE;
- switch (objp->req) {
- case RPT_GETREGS:
- if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_out_u.regs))
- return FALSE;
- break;
- case RPT_GETTHREADREGS:
- if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_out_u.regs))
- return FALSE;
- break;
- case RPT_PGETREGS:
- if (!xdr_array
- (xdrs, (char **) &objp->ptrace_addr_data_out_u.pregs.pregs_val,
- (u_int *) & objp->ptrace_addr_data_out_u.pregs.pregs_len, ~0,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- break;
- case RPT_PGETTHREADREGS:
- if (!xdr_array
- (xdrs, (char **) &objp->ptrace_addr_data_out_u.pregs.pregs_val,
- (u_int *) & objp->ptrace_addr_data_out_u.pregs.pregs_len, ~0,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- break;
- case RPT_THREADLIST:
- if (!xdr_thread_list (xdrs, &objp->ptrace_addr_data_out_u.threads))
- return FALSE;
- break;
- case RPT_GETTHREADNAME:
- if (!xdr_thread_name (xdrs, &objp->ptrace_addr_data_out_u.name))
- return FALSE;
- break;
- case RPT_READTEXT:
- if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_out_u.mem))
- return FALSE;
- break;
- case RPT_GETNAME:
- if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_out_u.mem))
- return FALSE;
- break;
- case RPT_READDATA:
- if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_out_u.mem))
- return FALSE;
- break;
- case RPT_GETBREAK:
- if (!xdr_xdr_break (xdrs, &objp->ptrace_addr_data_out_u.breakp))
- return FALSE;
- break;
- default:
- if (!xdr_u_int (xdrs, &objp->ptrace_addr_data_out_u.addr))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_CHAR_DATA (XDR * xdrs, CHAR_DATA * objp)
-{
- register int32_t *buf;
-
- if (!xdr_bytes
- (xdrs, (char **) &objp->CHAR_DATA_val, (u_int *) & objp->CHAR_DATA_len,
- NET_SAFE))
- return FALSE;
- return TRUE;
-}
-
-#ifndef XRY_MAX_CMD_STR
-#endif /* REMDEB_H */
-
-bool_t
-xdr_xry_inst (XDR * xdrs, xry_inst * objp)
-{
- register int32_t *buf;
-
- if (!xdr_u_char (xdrs, &objp->flags))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->type))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->sub_type))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->res_type))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->value))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->value2))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_instance (XDR * xdrs, instance * objp)
-{
- register int32_t *buf;
-
- int i;
- if (!xdr_vector (xdrs, (char *) objp->instances, XRY_MAX_INSTANCES,
- sizeof (xry_inst), (xdrproc_t) xdr_xry_inst))
- return FALSE;
- if (!xdr_vector (xdrs, (char *) objp->buffer, XRY_MAX_INST_BUFF,
- sizeof (u_char), (xdrproc_t) xdr_u_char))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_instance_union (XDR * xdrs, instance_union * objp)
-{
- register int32_t *buf;
-
- if (!xdr_bool (xdrs, &objp->instances))
- return FALSE;
- switch (objp->instances) {
- case TRUE:
- if (!xdr_instance (xdrs, &objp->instance_union_u.inst))
- return FALSE;
- break;
- case FALSE:
- if (!xdr_string (xdrs, &objp->instance_union_u.buffer, XRY_MAX_CMD_STR))
- return FALSE;
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-bool_t
-xdr_one_arg (XDR * xdrs, one_arg * objp)
-{
- register int32_t *buf;
-
- if (!xdr_string (xdrs, objp, NET_SAFE))
- return FALSE;
- return TRUE;
-}
-
- /*
- * now open_connex() routine which establishes a connection to server
- */
-
-bool_t
-xdr_debug_type (XDR * xdrs, debug_type * objp)
-{
- register int32_t *buf;
-
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-#define DEBUGGER_IS_GDB 0x2 /* */
-
-bool_t
-xdr_open_in (XDR * xdrs, open_in * objp)
-{
- register int32_t *buf;
-
- int i;
- if (!xdr_vector (xdrs, (char *) objp->back_port, 16,
- sizeof (u_char), (xdrproc_t) xdr_u_char))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->debug_type))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->flags))
- return FALSE;
- if (!xdr_vector (xdrs, (char *) objp->destination, 16,
- sizeof (u_char), (xdrproc_t) xdr_u_char))
- return FALSE;
- if (!xdr_one_arg (xdrs, &objp->user_name))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_open_out (XDR * xdrs, open_out * objp)
-{
- register int32_t *buf;
-
- int i;
-
- if (xdrs->x_op == XDR_ENCODE) {
- buf = XDR_INLINE (xdrs, (2 + (4)) * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_u_long (xdrs, &objp->port))
- return FALSE;
- if (!xdr_vector (xdrs, (char *) objp->pad, 4,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- if (!xdr_u_int (xdrs, &objp->fp))
- return FALSE;
-
- } else {
- IXDR_PUT_U_LONG (buf, objp->port);
- {
- register u_int *genp;
-
- for (i = 0, genp = objp->pad; i < 4; ++i) {
- IXDR_PUT_U_LONG (buf, *genp++);
- }
- }
- IXDR_PUT_U_LONG (buf, objp->fp);
- }
- if (!xdr_u_char (xdrs, &objp->cmd_table_num))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->cmd_table_vers))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->server_vers))
- return FALSE;
- return TRUE;
- } else if (xdrs->x_op == XDR_DECODE) {
- buf = XDR_INLINE (xdrs, (2 + (4)) * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_u_long (xdrs, &objp->port))
- return FALSE;
- if (!xdr_vector (xdrs, (char *) objp->pad, 4,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- if (!xdr_u_int (xdrs, &objp->fp))
- return FALSE;
-
- } else {
- objp->port = IXDR_GET_U_LONG (buf);
- {
- register u_int *genp;
-
- for (i = 0, genp = objp->pad; i < 4; ++i) {
- *genp++ = IXDR_GET_U_LONG (buf);
- }
- }
- objp->fp = IXDR_GET_U_LONG (buf);
- }
- if (!xdr_u_char (xdrs, &objp->cmd_table_num))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->cmd_table_vers))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->server_vers))
- return FALSE;
- return TRUE;
- }
-
- if (!xdr_u_long (xdrs, &objp->port))
- return FALSE;
- if (!xdr_vector (xdrs, (char *) objp->pad, 4,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- if (!xdr_u_int (xdrs, &objp->fp))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->cmd_table_num))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->cmd_table_vers))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->server_vers))
- return FALSE;
- return TRUE;
-}
-
- /*
- * now close_connex() routine which detaches from server
- */
-
-bool_t
-xdr_close_control (XDR * xdrs, close_control * objp)
-{
- register int32_t *buf;
-
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_close_in (XDR * xdrs, close_in * objp)
-{
- register int32_t *buf;
-
- if (!xdr_close_control (xdrs, &objp->control))
- return FALSE;
- return TRUE;
-}
-
- /*
- * now send_signal() routine which sends signals to processes like kill(2)
- */
-
-bool_t
-xdr_signal_in (XDR * xdrs, signal_in * objp)
-{
- register int32_t *buf;
-
- if (!xdr_int (xdrs, &objp->pid))
- return FALSE;
- if (!xdr_int (xdrs, &objp->sig))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_signal_out (XDR * xdrs, signal_out * objp)
-{
- register int32_t *buf;
-
- if (!xdr_int (xdrs, &objp->kill_return))
- return FALSE;
- if (!xdr_int (xdrs, &objp->errNo))
- return FALSE;
- return TRUE;
-}
-
- /*
- * now wait_info() routine which returns results of polling the wait status
- * of a process/actor. It may return 0 if running, else pid or -1
- */
-
-bool_t
-xdr_stop_code (XDR * xdrs, stop_code * objp)
-{
- register int32_t *buf;
-
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_wait_in (XDR * xdrs, wait_in * objp)
-{
- register int32_t *buf;
-
- if (!xdr_int (xdrs, &objp->pid))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_wait_out (XDR * xdrs, wait_out * objp)
-{
- register int32_t *buf;
-
- if (xdrs->x_op == XDR_ENCODE) {
- buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_int (xdrs, &objp->wait_return))
- return FALSE;
- if (!xdr_int (xdrs, &objp->errNo))
- return FALSE;
- if (!xdr_int (xdrs, &objp->status))
- return FALSE;
-
- } else {
- IXDR_PUT_LONG (buf, objp->wait_return);
- IXDR_PUT_LONG (buf, objp->errNo);
- IXDR_PUT_LONG (buf, objp->status);
- }
- if (!xdr_stop_code (xdrs, &objp->reason))
- return FALSE;
- buf = XDR_INLINE (xdrs, 5 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_int (xdrs, &objp->handle))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->PC))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->SP))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->FP))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->thread))
- return FALSE;
- } else {
- IXDR_PUT_LONG (buf, objp->handle);
- IXDR_PUT_U_LONG (buf, objp->PC);
- IXDR_PUT_U_LONG (buf, objp->SP);
- IXDR_PUT_U_LONG (buf, objp->FP);
- IXDR_PUT_U_LONG (buf, objp->thread);
- }
- return TRUE;
- } else if (xdrs->x_op == XDR_DECODE) {
- buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_int (xdrs, &objp->wait_return))
- return FALSE;
- if (!xdr_int (xdrs, &objp->errNo))
- return FALSE;
- if (!xdr_int (xdrs, &objp->status))
- return FALSE;
-
- } else {
- objp->wait_return = IXDR_GET_LONG (buf);
- objp->errNo = IXDR_GET_LONG (buf);
- objp->status = IXDR_GET_LONG (buf);
- }
- if (!xdr_stop_code (xdrs, &objp->reason))
- return FALSE;
- buf = XDR_INLINE (xdrs, 5 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_int (xdrs, &objp->handle))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->PC))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->SP))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->FP))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->thread))
- return FALSE;
- } else {
- objp->handle = IXDR_GET_LONG (buf);
- objp->PC = IXDR_GET_U_LONG (buf);
- objp->SP = IXDR_GET_U_LONG (buf);
- objp->FP = IXDR_GET_U_LONG (buf);
- objp->thread = IXDR_GET_U_LONG (buf);
- }
- return TRUE;
- }
-
- if (!xdr_int (xdrs, &objp->wait_return))
- return FALSE;
- if (!xdr_int (xdrs, &objp->errNo))
- return FALSE;
- if (!xdr_int (xdrs, &objp->status))
- return FALSE;
- if (!xdr_stop_code (xdrs, &objp->reason))
- return FALSE;
- if (!xdr_int (xdrs, &objp->handle))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->PC))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->SP))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->FP))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->thread))
- return FALSE;
- return TRUE;
-}
-
- /*
- * now ptrace() routine. This matches the Sun UNIX ptrace as well as
- * some additions
- */
-
-bool_t
-xdr_ptrace_in (XDR * xdrs, ptrace_in * objp)
-{
- register int32_t *buf;
-
- if (!xdr_int (xdrs, &objp->pid))
- return FALSE;
- if (!xdr_ptrace_addr_data_in (xdrs, &objp->addr))
- return FALSE;
- if (!xdr_u_int (xdrs, &objp->data))
- return FALSE;
- if (!xdr_u_int (xdrs, &objp->flags))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_ptrace_out (XDR * xdrs, ptrace_out * objp)
-{
- register int32_t *buf;
-
- if (!xdr_ptrace_addr_data_out (xdrs, &objp->addr))
- return FALSE;
- if (!xdr_int (xdrs, &objp->result))
- return FALSE;
- if (!xdr_int (xdrs, &objp->errNo))
- return FALSE;
- return TRUE;
-}
+bool_t xdr_xdr_mem(xdrs, objp)
+ XDR *xdrs;
+ struct xdr_mem *objp;
+{
+ if (!xdr_u_long(xdrs, &objp->addr)) {
+ return (FALSE);
+ }
+ if (!xdr_u_int(xdrs, &objp->dataNb)) {
+ return(FALSE);
+ }
+ return (xdr_opaque(xdrs, objp->data, objp->dataNb));
+}
+
+bool_t
+xdr_break_type (XDR *xdrs, break_type *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_enum (xdrs, (enum_t *) objp))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_xdr_break (XDR *xdrs, xdr_break *objp)
+{
+ register int32_t *buf;
+
+ int i;
+
+ if (xdrs->x_op == XDR_ENCODE) {
+ if (!xdr_u_char (xdrs, &objp->type))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->thread_spec))
+ return FALSE;
+ buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_u_short (xdrs, &objp->handle))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->ee_loc))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->ee_type))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->length))
+ return FALSE;
+
+ } else {
+ IXDR_PUT_U_SHORT(buf, objp->handle);
+ IXDR_PUT_U_LONG(buf, objp->ee_loc);
+ IXDR_PUT_U_LONG(buf, objp->ee_type);
+ IXDR_PUT_U_SHORT(buf, objp->length);
+ }
+ if (!xdr_u_char (xdrs, &objp->pass_count))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->curr_pass))
+ return FALSE;
+ buf = XDR_INLINE (xdrs, ( MAX_THRD_BRK ) * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_vector (xdrs, (char *)objp->thread_list, MAX_THRD_BRK,
+ sizeof (u_long), (xdrproc_t) xdr_u_long))
+ return FALSE;
+ } else {
+ {
+ register u_long *genp;
+
+ for (i = 0, genp = objp->thread_list;
+ i < MAX_THRD_BRK; ++i) {
+ IXDR_PUT_U_LONG(buf, *genp++);
+ }
+ }
+ }
+ return TRUE;
+ } else if (xdrs->x_op == XDR_DECODE) {
+ if (!xdr_u_char (xdrs, &objp->type))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->thread_spec))
+ return FALSE;
+ buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_u_short (xdrs, &objp->handle))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->ee_loc))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->ee_type))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->length))
+ return FALSE;
+
+ } else {
+ objp->handle = IXDR_GET_U_SHORT(buf);
+ objp->ee_loc = IXDR_GET_U_LONG(buf);
+ objp->ee_type = IXDR_GET_U_LONG(buf);
+ objp->length = IXDR_GET_U_SHORT(buf);
+ }
+ if (!xdr_u_char (xdrs, &objp->pass_count))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->curr_pass))
+ return FALSE;
+ buf = XDR_INLINE (xdrs, ( MAX_THRD_BRK ) * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_vector (xdrs, (char *)objp->thread_list, MAX_THRD_BRK,
+ sizeof (u_long), (xdrproc_t) xdr_u_long))
+ return FALSE;
+ } else {
+ {
+ register u_long *genp;
+
+ for (i = 0, genp = objp->thread_list;
+ i < MAX_THRD_BRK; ++i) {
+ *genp++ = IXDR_GET_U_LONG(buf);
+ }
+ }
+ }
+ return TRUE;
+ }
+
+ if (!xdr_u_char (xdrs, &objp->type))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->thread_spec))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->handle))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->ee_loc))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->ee_type))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->length))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->pass_count))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->curr_pass))
+ return FALSE;
+ if (!xdr_vector (xdrs, (char *)objp->thread_list, MAX_THRD_BRK,
+ sizeof (u_long), (xdrproc_t) xdr_u_long))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_thread_name (XDR *xdrs, thread_name *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_string (xdrs, objp, THREADNAMEMAX))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_KernThread (XDR *xdrs, KernThread *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_u_int (xdrs, &objp->threadLi))
+ return FALSE;
+ return TRUE;
+}
+bool_t xdr_thread_list(xdrs, objp)
+ XDR *xdrs;
+ struct thread_list *objp;
+{
+ return (xdr_array(xdrs, (char**)&objp->threads, &objp->nbThread,
+ UTHREAD_MAX, sizeof(KernThread), xdr_KernThread));
+}
+
+bool_t
+xdr_ptrace_addr_data_in (XDR *xdrs, ptrace_addr_data_in *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_ptracereq (xdrs, &objp->req))
+ return FALSE;
+ switch (objp->req) {
+ case RPT_SETTHREADREGS:
+ if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_in_u.regs))
+ return FALSE;
+ break;
+ case RPT_SETREGS:
+ if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_in_u.regs))
+ return FALSE;
+ break;
+ case RPT_PSETTHREADREGS:
+ if (!xdr_array (xdrs, (char **)&objp->ptrace_addr_data_in_u.pregs.pregs_val, (u_int *) &objp->ptrace_addr_data_in_u.pregs.pregs_len, ~0,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ break;
+ case RPT_PSETREGS:
+ if (!xdr_array (xdrs, (char **)&objp->ptrace_addr_data_in_u.pregs.pregs_val, (u_int *) &objp->ptrace_addr_data_in_u.pregs.pregs_len, ~0,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ break;
+ case RPT_SETTHREADNAME:
+ if (!xdr_thread_name (xdrs, &objp->ptrace_addr_data_in_u.name))
+ return FALSE;
+ break;
+ case RPT_WRITETEXT:
+ if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_in_u.mem))
+ return FALSE;
+ break;
+ case RPT_WRITEDATA:
+ if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_in_u.mem))
+ return FALSE;
+ break;
+ case RPT_SETBREAK:
+ if (!xdr_xdr_break (xdrs, &objp->ptrace_addr_data_in_u.breakp))
+ return FALSE;
+ break;
+ default:
+ if (!xdr_u_int (xdrs, &objp->ptrace_addr_data_in_u.address))
+ return FALSE;
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ptrace_addr_data_out (XDR *xdrs, ptrace_addr_data_out *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_ptracereq (xdrs, &objp->req))
+ return FALSE;
+ switch (objp->req) {
+ case RPT_GETREGS:
+ if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_out_u.regs))
+ return FALSE;
+ break;
+ case RPT_GETTHREADREGS:
+ if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_out_u.regs))
+ return FALSE;
+ break;
+ case RPT_PGETREGS:
+ if (!xdr_array (xdrs, (char **)&objp->ptrace_addr_data_out_u.pregs.pregs_val, (u_int *) &objp->ptrace_addr_data_out_u.pregs.pregs_len, ~0,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ break;
+ case RPT_PGETTHREADREGS:
+ if (!xdr_array (xdrs, (char **)&objp->ptrace_addr_data_out_u.pregs.pregs_val, (u_int *) &objp->ptrace_addr_data_out_u.pregs.pregs_len, ~0,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ break;
+ case RPT_THREADLIST:
+ if (!xdr_thread_list (xdrs, &objp->ptrace_addr_data_out_u.threads))
+ return FALSE;
+ break;
+ case RPT_GETTHREADNAME:
+ if (!xdr_thread_name (xdrs, &objp->ptrace_addr_data_out_u.name))
+ return FALSE;
+ break;
+ case RPT_READTEXT:
+ if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_out_u.mem))
+ return FALSE;
+ break;
+ case RPT_GETNAME:
+ if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_out_u.mem))
+ return FALSE;
+ break;
+ case RPT_READDATA:
+ if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_out_u.mem))
+ return FALSE;
+ break;
+ case RPT_GETBREAK:
+ if (!xdr_xdr_break (xdrs, &objp->ptrace_addr_data_out_u.breakp))
+ return FALSE;
+ break;
+ default:
+ if (!xdr_u_int (xdrs, &objp->ptrace_addr_data_out_u.addr))
+ return FALSE;
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CHAR_DATA (XDR *xdrs, CHAR_DATA *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_bytes (xdrs, (char **)&objp->CHAR_DATA_val, (u_int *) &objp->CHAR_DATA_len, NET_SAFE))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_one_arg (XDR *xdrs, one_arg *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_string (xdrs, objp, NET_SAFE))
+ return FALSE;
+ return TRUE;
+}
+ /* now open_connex() routine which establishes a connection to server */
+
+bool_t
+xdr_debug_type (XDR *xdrs, debug_type *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_enum (xdrs, (enum_t *) objp))
+ return FALSE;
+ return TRUE;
+}
+#define DEBUGGER_IS_GDB 0x2 /* */
+
+bool_t
+xdr_open_in (XDR *xdrs, open_in *objp)
+{
+ register int32_t *buf;
+
+ int i;
+ if (!xdr_vector (xdrs, (char *)objp->back_port, 16,
+ sizeof (u_char), (xdrproc_t) xdr_u_char))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->debug_type))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->flags))
+ return FALSE;
+ if (!xdr_vector (xdrs, (char *)objp->destination, 16,
+ sizeof (u_char), (xdrproc_t) xdr_u_char))
+ return FALSE;
+ if (!xdr_one_arg (xdrs, &objp->user_name))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_open_out (XDR *xdrs, open_out *objp)
+{
+ register int32_t *buf;
+
+ int i;
+
+ if (xdrs->x_op == XDR_ENCODE) {
+ buf = XDR_INLINE (xdrs, (2 + ( 4 )) * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_u_long (xdrs, &objp->port))
+ return FALSE;
+ if (!xdr_vector (xdrs, (char *)objp->pad, 4,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ if (!xdr_u_int (xdrs, &objp->fp))
+ return FALSE;
+
+ } else {
+ IXDR_PUT_U_LONG(buf, objp->port);
+ {
+ register u_int *genp;
-bool_t
-xdr_one_symbol (XDR * xdrs, one_symbol * objp)
-{
- register int32_t *buf;
+ for (i = 0, genp = objp->pad;
+ i < 4; ++i) {
+ IXDR_PUT_U_LONG(buf, *genp++);
+ }
+ }
+ IXDR_PUT_U_LONG(buf, objp->fp);
+ }
+ if (!xdr_u_char (xdrs, &objp->cmd_table_num))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->cmd_table_vers))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->server_vers))
+ return FALSE;
+ return TRUE;
+ } else if (xdrs->x_op == XDR_DECODE) {
+ buf = XDR_INLINE (xdrs, (2 + ( 4 )) * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_u_long (xdrs, &objp->port))
+ return FALSE;
+ if (!xdr_vector (xdrs, (char *)objp->pad, 4,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ if (!xdr_u_int (xdrs, &objp->fp))
+ return FALSE;
- if (!xdr_string (xdrs, &objp->symbolName, ~0))
- return FALSE;
- if (!xdr_long (xdrs, &objp->symbolValue))
- return FALSE;
- return TRUE;
-}
+ } else {
+ objp->port = IXDR_GET_U_LONG(buf);
+ {
+ register u_int *genp;
-bool_t
-xdr_all_symbols (XDR * xdrs, all_symbols * objp)
-{
- register int32_t *buf;
+ for (i = 0, genp = objp->pad;
+ i < 4; ++i) {
+ *genp++ = IXDR_GET_U_LONG(buf);
+ }
+ }
+ objp->fp = IXDR_GET_U_LONG(buf);
+ }
+ if (!xdr_u_char (xdrs, &objp->cmd_table_num))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->cmd_table_vers))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->server_vers))
+ return FALSE;
+ return TRUE;
+ }
- if (!xdr_array
- (xdrs, (char **) &objp->all_symbols_val,
- (u_int *) & objp->all_symbols_len, ~0, sizeof (one_symbol),
- (xdrproc_t) xdr_one_symbol))
- return FALSE;
- return TRUE;
+ if (!xdr_u_long (xdrs, &objp->port))
+ return FALSE;
+ if (!xdr_vector (xdrs, (char *)objp->pad, 4,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ if (!xdr_u_int (xdrs, &objp->fp))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->cmd_table_num))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->cmd_table_vers))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->server_vers))
+ return FALSE;
+ return TRUE;
+}
+ /* now close_connex() routine which detaches from server */
+
+bool_t
+xdr_close_control (XDR *xdrs, close_control *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_enum (xdrs, (enum_t *) objp))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_close_in (XDR *xdrs, close_in *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_close_control (xdrs, &objp->control))
+ return FALSE;
+ return TRUE;
+}
+ /* now send_signal() routine which sends signals to processes like kill(2) */
+
+bool_t
+xdr_signal_in (XDR *xdrs, signal_in *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_int (xdrs, &objp->pid))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->sig))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_signal_out (XDR *xdrs, signal_out *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_int (xdrs, &objp->kill_return))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->errNo))
+ return FALSE;
+ return TRUE;
+}
+ /* now wait_info() routine which returns results of polling the wait status
+ of a process/actor. It may return 0 if running, else pid or -1 */
+
+bool_t
+xdr_stop_code (XDR *xdrs, stop_code *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_enum (xdrs, (enum_t *) objp))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_wait_in (XDR *xdrs, wait_in *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_int (xdrs, &objp->pid))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_wait_out (XDR *xdrs, wait_out *objp)
+{
+ register int32_t *buf;
+
+
+ if (xdrs->x_op == XDR_ENCODE) {
+ buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_int (xdrs, &objp->wait_return))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->errNo))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->status))
+ return FALSE;
+
+ } else {
+ IXDR_PUT_LONG(buf, objp->wait_return);
+ IXDR_PUT_LONG(buf, objp->errNo);
+ IXDR_PUT_LONG(buf, objp->status);
+ }
+ if (!xdr_stop_code (xdrs, &objp->reason))
+ return FALSE;
+ buf = XDR_INLINE (xdrs, 5 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_int (xdrs, &objp->handle))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->PC))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->SP))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->FP))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->thread))
+ return FALSE;
+ } else {
+ IXDR_PUT_LONG(buf, objp->handle);
+ IXDR_PUT_U_LONG(buf, objp->PC);
+ IXDR_PUT_U_LONG(buf, objp->SP);
+ IXDR_PUT_U_LONG(buf, objp->FP);
+ IXDR_PUT_U_LONG(buf, objp->thread);
+ }
+ return TRUE;
+ } else if (xdrs->x_op == XDR_DECODE) {
+ buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_int (xdrs, &objp->wait_return))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->errNo))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->status))
+ return FALSE;
+
+ } else {
+ objp->wait_return = IXDR_GET_LONG(buf);
+ objp->errNo = IXDR_GET_LONG(buf);
+ objp->status = IXDR_GET_LONG(buf);
+ }
+ if (!xdr_stop_code (xdrs, &objp->reason))
+ return FALSE;
+ buf = XDR_INLINE (xdrs, 5 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_int (xdrs, &objp->handle))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->PC))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->SP))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->FP))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->thread))
+ return FALSE;
+ } else {
+ objp->handle = IXDR_GET_LONG(buf);
+ objp->PC = IXDR_GET_U_LONG(buf);
+ objp->SP = IXDR_GET_U_LONG(buf);
+ objp->FP = IXDR_GET_U_LONG(buf);
+ objp->thread = IXDR_GET_U_LONG(buf);
+ }
+ return TRUE;
+ }
+
+ if (!xdr_int (xdrs, &objp->wait_return))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->errNo))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->status))
+ return FALSE;
+ if (!xdr_stop_code (xdrs, &objp->reason))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->handle))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->PC))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->SP))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->FP))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->thread))
+ return FALSE;
+ return TRUE;
+}
+ /* now ptrace() routine. This matches the Sun UNIX ptrace as well as
+ some additions */
+
+bool_t
+xdr_ptrace_in (XDR *xdrs, ptrace_in *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_int (xdrs, &objp->pid))
+ return FALSE;
+ if (!xdr_ptrace_addr_data_in (xdrs, &objp->addr))
+ return FALSE;
+ if (!xdr_u_int (xdrs, &objp->data))
+ return FALSE;
+ if (!xdr_u_int (xdrs, &objp->flags))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_ptrace_out (XDR *xdrs, ptrace_out *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_ptrace_addr_data_out (xdrs, &objp->addr))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->result))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->errNo))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_one_symbol (XDR *xdrs, one_symbol *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_string (xdrs, &objp->symbolName, ~0))
+ return FALSE;
+ if (!xdr_long (xdrs, &objp->symbolValue))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_all_symbols (XDR *xdrs, all_symbols *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_array (xdrs, (char **)&objp->all_symbols_val, (u_int *) &objp->all_symbols_len, ~0,
+ sizeof (one_symbol), (xdrproc_t) xdr_one_symbol))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_get_global_symbols_out (XDR *xdrs, get_global_symbols_out *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_all_symbols (xdrs, &objp->symbols))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_get_text_data_in (XDR *xdrs, get_text_data_in *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_int (xdrs, &objp->pid))
+ return FALSE;
+ if (!xdr_string (xdrs, &objp->actorName, 16))
+ return FALSE;
+ return TRUE;
}
bool_t
-xdr_get_global_symbols_out (XDR * xdrs, get_global_symbols_out * objp)
+xdr_get_text_data_out (XDR *xdrs, get_text_data_out *objp)
{
- register int32_t *buf;
+ register int32_t *buf;
- if (!xdr_all_symbols (xdrs, &objp->symbols))
- return FALSE;
- return TRUE;
-}
-bool_t
-xdr_get_text_data_in (XDR * xdrs, get_text_data_in * objp)
-{
- register int32_t *buf;
+ if (xdrs->x_op == XDR_ENCODE) {
+ buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_int (xdrs, &objp->result))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->errNo))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->textStart))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->textSize))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->dataStart))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->dataSize))
+ return FALSE;
+ } else {
+ IXDR_PUT_LONG(buf, objp->result);
+ IXDR_PUT_LONG(buf, objp->errNo);
+ IXDR_PUT_U_LONG(buf, objp->textStart);
+ IXDR_PUT_U_LONG(buf, objp->textSize);
+ IXDR_PUT_U_LONG(buf, objp->dataStart);
+ IXDR_PUT_U_LONG(buf, objp->dataSize);
+ }
+ return TRUE;
+ } else if (xdrs->x_op == XDR_DECODE) {
+ buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_int (xdrs, &objp->result))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->errNo))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->textStart))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->textSize))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->dataStart))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->dataSize))
+ return FALSE;
+ } else {
+ objp->result = IXDR_GET_LONG(buf);
+ objp->errNo = IXDR_GET_LONG(buf);
+ objp->textStart = IXDR_GET_U_LONG(buf);
+ objp->textSize = IXDR_GET_U_LONG(buf);
+ objp->dataStart = IXDR_GET_U_LONG(buf);
+ objp->dataSize = IXDR_GET_U_LONG(buf);
+ }
+ return TRUE;
+ }
- if (!xdr_int (xdrs, &objp->pid))
- return FALSE;
- if (!xdr_string (xdrs, &objp->actorName, 16))
- return FALSE;
- return TRUE;
+ if (!xdr_int (xdrs, &objp->result))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->errNo))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->textStart))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->textSize))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->dataStart))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->dataSize))
+ return FALSE;
+ return TRUE;
}
bool_t
-xdr_get_text_data_out (XDR * xdrs, get_text_data_out * objp)
-{
- register int32_t *buf;
-
- if (xdrs->x_op == XDR_ENCODE) {
- buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_int (xdrs, &objp->result))
- return FALSE;
- if (!xdr_int (xdrs, &objp->errNo))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->textStart))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->textSize))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->dataStart))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->dataSize))
- return FALSE;
- } else {
- IXDR_PUT_LONG (buf, objp->result);
- IXDR_PUT_LONG (buf, objp->errNo);
- IXDR_PUT_U_LONG (buf, objp->textStart);
- IXDR_PUT_U_LONG (buf, objp->textSize);
- IXDR_PUT_U_LONG (buf, objp->dataStart);
- IXDR_PUT_U_LONG (buf, objp->dataSize);
- }
- return TRUE;
- } else if (xdrs->x_op == XDR_DECODE) {
- buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_int (xdrs, &objp->result))
- return FALSE;
- if (!xdr_int (xdrs, &objp->errNo))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->textStart))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->textSize))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->dataStart))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->dataSize))
- return FALSE;
- } else {
- objp->result = IXDR_GET_LONG (buf);
- objp->errNo = IXDR_GET_LONG (buf);
- objp->textStart = IXDR_GET_U_LONG (buf);
- objp->textSize = IXDR_GET_U_LONG (buf);
- objp->dataStart = IXDR_GET_U_LONG (buf);
- objp->dataSize = IXDR_GET_U_LONG (buf);
- }
- return TRUE;
- }
-
- if (!xdr_int (xdrs, &objp->result))
- return FALSE;
- if (!xdr_int (xdrs, &objp->errNo))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->textStart))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->textSize))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->dataStart))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->dataSize))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_one_signal (XDR * xdrs, one_signal * objp)
+xdr_one_signal (XDR *xdrs, one_signal *objp)
{
- register int32_t *buf;
+ register int32_t *buf;
- if (!xdr_u_int (xdrs, &objp->number))
- return FALSE;
- if (!xdr_string (xdrs, &objp->name, ~0))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_all_signals (XDR * xdrs, all_signals * objp)
-{
- register int32_t *buf;
-
- if (!xdr_array
- (xdrs, (char **) &objp->all_signals_val,
- (u_int *) & objp->all_signals_len, ~0, sizeof (one_signal),
- (xdrproc_t) xdr_one_signal))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_get_signal_names_out (XDR * xdrs, get_signal_names_out * objp)
-{
- register int32_t *buf;
-
- if (!xdr_all_signals (xdrs, &objp->signals))
- return FALSE;
- return TRUE;
-}
-
- /*
- * now define the actual calls we support
- */
+ if (!xdr_u_int (xdrs, &objp->number))
+ return FALSE;
+ if (!xdr_string (xdrs, &objp->name, ~0))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_all_signals (XDR *xdrs, all_signals *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_array (xdrs, (char **)&objp->all_signals_val, (u_int *) &objp->all_signals_len, ~0,
+ sizeof (one_signal), (xdrproc_t) xdr_one_signal))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_get_signal_names_out (XDR *xdrs, get_signal_names_out *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_all_signals (xdrs, &objp->signals))
+ return FALSE;
+ return TRUE;
+}
+ /* now define the actual calls we support */
diff --git a/c/src/librdbg/src/m68k/any/remdeb.h b/c/src/librdbg/src/m68k/any/remdeb.h
index bfa0f04838..63e70e0ef4 100644
--- a/c/src/librdbg/src/m68k/any/remdeb.h
+++ b/c/src/librdbg/src/m68k/any/remdeb.h
@@ -8,6 +8,7 @@
#include <rpc/rpc.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -15,109 +16,110 @@ extern "C" {
#define RTEMS_PORT 2071
#define RTEMS_BACK_PORT 2073
#ifndef REMDEB_H
-#define RPCGENSRVNAME(a) a
+#define RPCGENSRVNAME(a) a
- enum rpc_type {
- SUNRPC = 0,
- BADRPCTYPE = 25,
- };
- typedef enum rpc_type rpc_type;
+enum rpc_type {
+ SUNRPC = 0,
+ BADRPCTYPE = 25,
+};
+typedef enum rpc_type rpc_type;
#define NET_SAFE 1400
- struct UDP_MSG {
- u_char type;
- u_char msg_num;
- u_short spec;
- long pid;
- u_long context;
- };
- typedef struct UDP_MSG UDP_MSG;
+struct UDP_MSG {
+ u_char type;
+ u_char msg_num;
+ u_short spec;
+ long pid;
+ u_long context;
+};
+typedef struct UDP_MSG UDP_MSG;
/*
* Sun request values for the remote ptrace system call
*/
- enum ptracereq {
- RPT_TRACEME = 0,
- RPT_CHILDDONE = 0,
- RPT_PEEKTEXT = 0 + 1,
- RPT_PEEKDATA = 0 + 2,
- RPT_PEEKUSER = 0 + 3,
- RPT_POKETEXT = 0 + 4,
- RPT_POKEDATA = 0 + 5,
- RPT_POKEUSER = 0 + 6,
- RPT_CONT = 0 + 7,
- RPT_KILL = 0 + 8,
- RPT_SINGLESTEP = 0 + 9,
- RPT_ATTACH = 0 + 10,
- RPT_DETACH = 0 + 11,
- RPT_GETREGS = 0 + 12,
- RPT_SETREGS = 0 + 13,
- RPT_GETFPREGS = 0 + 14,
- RPT_SETFPREGS = 0 + 15,
- RPT_READDATA = 0 + 16,
- RPT_WRITEDATA = 0 + 17,
- RPT_READTEXT = 0 + 18,
- RPT_WRITETEXT = 0 + 19,
- RPT_GETFPAREGS = 0 + 20,
- RPT_SETFPAREGS = 0 + 21,
- RPT_22 = 0 + 22,
- RPT_23 = 0 + 23,
- RPT_SYSCALL = 0 + 24,
- RPT_DUMPCORE = 0 + 25,
- RPT_26 = 0 + 26,
- RPT_27 = 0 + 27,
- RPT_28 = 0 + 28,
- RPT_GETUCODE = 0 + 29,
- RPT_GETTARGETTHREAD = 50,
- RPT_SETTARGETTHREAD = 51,
- RPT_THREADSUSPEND = 52,
- RPT_THREADRESUME = 53,
- RPT_THREADLIST = 54,
- RPT_GETTHREADNAME = 55,
- RPT_SETTHREADNAME = 56,
- RPT_SETTHREADREGS = 57,
- RPT_GETTHREADREGS = 58,
- RPT_STEPRANGE = 75,
- RPT_CONTTO = 76,
- RPT_SETBREAK = 77,
- RPT_CLRBREAK = 78,
- RPT_GETBREAK = 79,
- RPT_GETNAME = 80,
- RPT_STOP = 81,
- RPT_PGETREGS = 82,
- RPT_PSETREGS = 83,
- RPT_PSETTHREADREGS = 84,
- RPT_PGETTHREADREGS = 85,
- };
- typedef enum ptracereq ptracereq;
-
- struct xdr_regs {
- int r_dreg[8];
- int r_areg[8];
- int r_sr;
- int r_pc;
- int r_vec;
- };
- typedef struct xdr_regs xdr_regs;
+
+enum ptracereq {
+ RPT_TRACEME = 0,
+ RPT_CHILDDONE = 0,
+ RPT_PEEKTEXT = 0 + 1,
+ RPT_PEEKDATA = 0 + 2,
+ RPT_PEEKUSER = 0 + 3,
+ RPT_POKETEXT = 0 + 4,
+ RPT_POKEDATA = 0 + 5,
+ RPT_POKEUSER = 0 + 6,
+ RPT_CONT = 0 + 7,
+ RPT_KILL = 0 + 8,
+ RPT_SINGLESTEP = 0 + 9,
+ RPT_ATTACH = 0 + 10,
+ RPT_DETACH = 0 + 11,
+ RPT_GETREGS = 0 + 12,
+ RPT_SETREGS = 0 + 13,
+ RPT_GETFPREGS = 0 + 14,
+ RPT_SETFPREGS = 0 + 15,
+ RPT_READDATA = 0 + 16,
+ RPT_WRITEDATA = 0 + 17,
+ RPT_READTEXT = 0 + 18,
+ RPT_WRITETEXT = 0 + 19,
+ RPT_GETFPAREGS = 0 + 20,
+ RPT_SETFPAREGS = 0 + 21,
+ RPT_22 = 0 + 22,
+ RPT_23 = 0 + 23,
+ RPT_SYSCALL = 0 + 24,
+ RPT_DUMPCORE = 0 + 25,
+ RPT_26 = 0 + 26,
+ RPT_27 = 0 + 27,
+ RPT_28 = 0 + 28,
+ RPT_GETUCODE = 0 + 29,
+ RPT_GETTARGETTHREAD = 50,
+ RPT_SETTARGETTHREAD = 51,
+ RPT_THREADSUSPEND = 52,
+ RPT_THREADRESUME = 53,
+ RPT_THREADLIST = 54,
+ RPT_GETTHREADNAME = 55,
+ RPT_SETTHREADNAME = 56,
+ RPT_SETTHREADREGS = 57,
+ RPT_GETTHREADREGS = 58,
+ RPT_STEPRANGE = 75,
+ RPT_CONTTO = 76,
+ RPT_SETBREAK = 77,
+ RPT_CLRBREAK = 78,
+ RPT_GETBREAK = 79,
+ RPT_GETNAME = 80,
+ RPT_STOP = 81,
+ RPT_PGETREGS = 82,
+ RPT_PSETREGS = 83,
+ RPT_PSETTHREADREGS = 84,
+ RPT_PGETTHREADREGS = 85,
+};
+typedef enum ptracereq ptracereq;
+
+struct xdr_regs {
+ int r_dreg[8];
+ int r_areg[8];
+ int r_sr;
+ int r_pc;
+ int r_vec;
+};
+typedef struct xdr_regs xdr_regs;
/* now define register macros to apply to xdr_reg struct */
-#define r_r0 r_dreg[0] /* r0 for portability */
-#define r_sp r_areg[7] /* user stack pointer */
-#define r_ps r_sr
-#define REG_PC r_pc /* PC register offset */
-#define REG_SP r_areg[7] /* SP register offset */
-#define REG_FP r_areg[6] /* FP register offset */
+#define r_r0 r_dreg[0] /* r0 for portability */
+#define r_sp r_areg[7] /* user stack pointer */
+#define r_ps r_sr
+#define REG_PC r_pc /* PC register offset */
+#define REG_SP r_areg[7] /* SP register offset */
+#define REG_FP r_areg[6] /* FP register offset */
/* now define the BREAKPOINT mask technique to a long word */
-#define SET_BREAK(l) ((l&0x0000FFFF) | 0x4E4F0000) /* TRAP 15 */
-#define IS_BREAK(l) (((l) & 0xFFFF0000) == 0x4E4F0000)
+#define SET_BREAK(l) ((l&0x0000FFFF) | 0x4E4F0000) /* TRAP 15 */
+#define IS_BREAK(l) (((l) & 0xFFFF0000) == 0x4E4F0000)
#define ORG_BREAK(c,p) (((c) & 0x0000FFFF) | ((p) & 0xFFFF0000))
-#define IS_STEP(regs) ((regs).r_vec == 9)
-#define BREAK_ADJ 0
-#define BREAK_SIZE 2
-#define TARGET_PROC_TYPE 2
+#define IS_STEP(regs) ((regs).r_vec == 9)
+#define BREAK_ADJ 0
+#define BREAK_SIZE 2
+#define TARGET_PROC_TYPE 2
#define MAXDEBUGGEE 150
#define NAMEMAX 17
- /*
+ /*
* Memory data for read/write text or data. The size is in data. The target
* addr is in the addr field.
* Be careful before modifying because this value goes into internal
@@ -126,298 +128,255 @@ extern "C" {
*/
#define MEM_DATA_MAX 256
- struct xdr_mem {
- u_long addr;
- u_int dataNb;
- u_char data[MEM_DATA_MAX];
- };
- typedef struct xdr_mem xdr_mem;
-
- enum break_type {
- BRKT_NONE = 0,
- BRKT_INSTR = 1,
- BRKT_READ = 2,
- BRKT_WRITE = 3,
- BRKT_ACCESS = 4,
- BRKT_EXEC = 5,
- BRKT_OS_CALL = 6,
- BRKT_OS_SWITCH = 7,
- BRKT_STEPEMUL = 8,
- };
- typedef enum break_type break_type;
+struct xdr_mem {
+ u_long addr;
+ u_int dataNb;
+ u_char data[MEM_DATA_MAX];
+};
+typedef struct xdr_mem xdr_mem;
+
+enum break_type {
+ BRKT_NONE = 0,
+ BRKT_INSTR = 1,
+ BRKT_READ = 2,
+ BRKT_WRITE = 3,
+ BRKT_ACCESS = 4,
+ BRKT_EXEC = 5,
+ BRKT_OS_CALL = 6,
+ BRKT_OS_SWITCH = 7,
+ BRKT_STEPEMUL = 8,
+};
+typedef enum break_type break_type;
#define MAX_THRD_BRK 4
- struct xdr_break {
- u_char type;
- u_char thread_spec;
- u_short handle;
- u_long ee_loc;
- u_long ee_type;
- u_short length;
- u_char pass_count;
- u_char curr_pass;
- u_long thread_list[MAX_THRD_BRK];
- };
- typedef struct xdr_break xdr_break;
+struct xdr_break {
+ u_char type;
+ u_char thread_spec;
+ u_short handle;
+ u_long ee_loc;
+ u_long ee_type;
+ u_short length;
+ u_char pass_count;
+ u_char curr_pass;
+ u_long thread_list[MAX_THRD_BRK];
+};
+typedef struct xdr_break xdr_break;
#define UTHREAD_MAX 64
#define THREADNAMEMAX 16
- typedef char *thread_name;
-
- struct KernThread {
- u_int threadLi;
- };
- typedef struct KernThread KernThread;
- typedef KernThread *ptThreadList;
-
- struct thread_list {
- u_int nbThread;
- ptThreadList threads;
- };
- typedef struct thread_list thread_list;
-
- struct ptrace_addr_data_in {
- ptracereq req;
- union {
- xdr_regs regs;
- struct {
- u_int pregs_len;
- u_int *pregs_val;
- } pregs;
- thread_name name;
- xdr_mem mem;
- xdr_break breakp;
- u_int address;
- } ptrace_addr_data_in_u;
- };
- typedef struct ptrace_addr_data_in ptrace_addr_data_in;
-
- struct ptrace_addr_data_out {
- ptracereq req;
- union {
- xdr_regs regs;
- struct {
- u_int pregs_len;
- u_int *pregs_val;
- } pregs;
- thread_list threads;
- thread_name name;
- xdr_mem mem;
- xdr_break breakp;
- u_int addr;
- } ptrace_addr_data_out_u;
- };
- typedef struct ptrace_addr_data_out ptrace_addr_data_out;
-
- typedef struct {
- u_int CHAR_DATA_len;
- char *CHAR_DATA_val;
- } CHAR_DATA;
-#define XRY_MAX_INST_BUFF 128
-#define XRY_MAX_INSTANCES 16
-#ifndef XRY_MAX_CMD_STR
-#define XRY_MAX_CMD_STR 320
-#endif /* REMDEB_H */
-
- struct xry_inst {
- u_char flags;
- u_char type;
- u_char sub_type;
- u_char res_type;
- u_long value;
- u_long value2;
- };
- typedef struct xry_inst xry_inst;
-
- struct instance {
- struct xry_inst instances[XRY_MAX_INSTANCES];
- u_char buffer[XRY_MAX_INST_BUFF];
- };
- typedef struct instance instance;
-
- struct instance_union {
- bool_t instances;
- union {
- instance inst;
- char *buffer;
- } instance_union_u;
- };
- typedef struct instance_union instance_union;
-
- typedef char *one_arg;
-#define XRY_MAX_OBJ_NAME 32
- /*
- * now open_connex() routine which establishes a connection to server
- */
-
- enum debug_type {
- DEBTYP_PROCESS = 0,
- DEBTYP_C_ACTOR = 1,
- DEBTYP_KERNEL = 2,
- DEBTYP_OTHER = 3,
- };
- typedef enum debug_type debug_type;
-#define DEBUGGER_IS_GDB 0x2 /* */
-
- struct open_in {
- u_char back_port[16];
- u_short debug_type;
- u_short flags;
- u_char destination[16];
- one_arg user_name;
- };
- typedef struct open_in open_in;
-
- struct open_out {
- u_long port;
- u_int pad[4];
- u_int fp;
- u_char cmd_table_num;
- u_char cmd_table_vers;
- u_short server_vers;
- };
- typedef struct open_out open_out;
- /*
- * now close_connex() routine which detaches from server
- */
-
- enum close_control {
- CLOSE_IGNORE = 0,
- CLOSE_KILL = 1,
- CLOSE_DETACH = 2,
- };
- typedef enum close_control close_control;
-
- struct close_in {
- close_control control;
- };
- typedef struct close_in close_in;
- /*
- * now send_signal() routine which sends signals to processes like kill(2)
- */
-
- struct signal_in {
- int pid;
- int sig;
- };
- typedef struct signal_in signal_in;
-
- struct signal_out {
- int kill_return;
- int errNo;
- };
- typedef struct signal_out signal_out;
- /*
- * now wait_info() routine which returns results of polling the wait status
- * of a process/actor. It may return 0 if running, else pid or -1
- */
-
- enum stop_code {
- STOP_ERROR = 0,
- STOP_NONE = 1,
- STOP_UNKNOWN = 2,
- STOP_BREAK = 3,
- STOP_STEP = 4,
- STOP_SIGNAL = 5,
- STOP_TERM_EXIT = 6,
- STOP_TERM_SIG = 7,
- STOP_DETACHED = 8,
- STOP_KILLED = 9,
- STOP_SPAWN_FAILED = 10,
- };
- typedef enum stop_code stop_code;
-
- struct wait_in {
- int pid;
- };
- typedef struct wait_in wait_in;
-
- struct wait_out {
- int wait_return;
- int errNo;
- int status;
- stop_code reason;
- int handle;
- u_long PC;
- u_long SP;
- u_long FP;
- u_long thread;
- };
- typedef struct wait_out wait_out;
- /*
- * now ptrace() routine. This matches the Sun UNIX ptrace as well as
- * some additions
- */
+typedef char *thread_name;
+
+struct KernThread {
+ u_int threadLi;
+};
+typedef struct KernThread KernThread;
+typedef KernThread *ptThreadList;
+
+struct thread_list {
+ u_int nbThread;
+ ptThreadList threads;
+};
+typedef struct thread_list thread_list;
+
+struct ptrace_addr_data_in {
+ ptracereq req;
+ union {
+ xdr_regs regs;
+ struct {
+ u_int pregs_len;
+ u_int *pregs_val;
+ } pregs;
+ thread_name name;
+ xdr_mem mem;
+ xdr_break breakp;
+ u_int address;
+ } ptrace_addr_data_in_u;
+};
+typedef struct ptrace_addr_data_in ptrace_addr_data_in;
+
+struct ptrace_addr_data_out {
+ ptracereq req;
+ union {
+ xdr_regs regs;
+ struct {
+ u_int pregs_len;
+ u_int *pregs_val;
+ } pregs;
+ thread_list threads;
+ thread_name name;
+ xdr_mem mem;
+ xdr_break breakp;
+ u_int addr;
+ } ptrace_addr_data_out_u;
+};
+typedef struct ptrace_addr_data_out ptrace_addr_data_out;
+
+typedef struct {
+ u_int CHAR_DATA_len;
+ char *CHAR_DATA_val;
+} CHAR_DATA;
+
+typedef char *one_arg;
+ /* now open_connex() routine which establishes a connection to server */
+
+enum debug_type {
+ DEBTYP_PROCESS = 0,
+ DEBTYP_C_ACTOR = 1,
+ DEBTYP_KERNEL = 2,
+ DEBTYP_OTHER = 3,
+};
+typedef enum debug_type debug_type;
+#define DEBUGGER_IS_GDB 0x2 /* */
+
+struct open_in {
+ u_char back_port[16];
+ u_short debug_type;
+ u_short flags;
+ u_char destination[16];
+ one_arg user_name;
+};
+typedef struct open_in open_in;
+
+struct open_out {
+ u_long port;
+ u_int pad[4];
+ u_int fp;
+ u_char cmd_table_num;
+ u_char cmd_table_vers;
+ u_short server_vers;
+};
+typedef struct open_out open_out;
+ /* now close_connex() routine which detaches from server */
+
+enum close_control {
+ CLOSE_IGNORE = 0,
+ CLOSE_KILL = 1,
+ CLOSE_DETACH = 2,
+};
+typedef enum close_control close_control;
+
+struct close_in {
+ close_control control;
+};
+typedef struct close_in close_in;
+ /* now send_signal() routine which sends signals to processes like kill(2) */
+
+struct signal_in {
+ int pid;
+ int sig;
+};
+typedef struct signal_in signal_in;
+
+struct signal_out {
+ int kill_return;
+ int errNo;
+};
+typedef struct signal_out signal_out;
+ /* now wait_info() routine which returns results of polling the wait status
+ of a process/actor. It may return 0 if running, else pid or -1 */
+
+enum stop_code {
+ STOP_ERROR = 0,
+ STOP_NONE = 1,
+ STOP_UNKNOWN = 2,
+ STOP_BREAK = 3,
+ STOP_STEP = 4,
+ STOP_SIGNAL = 5,
+ STOP_TERM_EXIT = 6,
+ STOP_TERM_SIG = 7,
+ STOP_DETACHED = 8,
+ STOP_KILLED = 9,
+ STOP_SPAWN_FAILED = 10,
+};
+typedef enum stop_code stop_code;
+
+struct wait_in {
+ int pid;
+};
+typedef struct wait_in wait_in;
+
+struct wait_out {
+ int wait_return;
+ int errNo;
+ int status;
+ stop_code reason;
+ int handle;
+ u_long PC;
+ u_long SP;
+ u_long FP;
+ u_long thread;
+};
+typedef struct wait_out wait_out;
+ /* now ptrace() routine. This matches the Sun UNIX ptrace as well as
+ some additions */
#define PTRFLG_FORCE 1
#define PTRFLG_NON_OWNER 2
#define PTRFLG_FREE 4
#define PTRDET_UNOWN 0x100
- struct ptrace_in {
- int pid;
- ptrace_addr_data_in addr;
- u_int data;
- u_int flags;
- };
- typedef struct ptrace_in ptrace_in;
-
- struct ptrace_out {
- ptrace_addr_data_out addr;
- int result;
- int errNo;
- };
- typedef struct ptrace_out ptrace_out;
-
- struct one_symbol {
- char *symbolName;
- long symbolValue;
- };
- typedef struct one_symbol one_symbol;
-
- typedef struct {
- u_int all_symbols_len;
- one_symbol *all_symbols_val;
- } all_symbols;
-
- struct get_global_symbols_out {
- all_symbols symbols;
- };
- typedef struct get_global_symbols_out get_global_symbols_out;
-
- struct get_text_data_in {
- int pid;
- char *actorName;
- };
- typedef struct get_text_data_in get_text_data_in;
-
- struct get_text_data_out {
- int result;
- int errNo;
- u_long textStart;
- u_long textSize;
- u_long dataStart;
- u_long dataSize;
- };
- typedef struct get_text_data_out get_text_data_out;
-
- struct one_signal {
- u_int number;
- char *name;
- };
- typedef struct one_signal one_signal;
-
- typedef struct {
- u_int all_signals_len;
- one_signal *all_signals_val;
- } all_signals;
-
- struct get_signal_names_out {
- all_signals signals;
- };
- typedef struct get_signal_names_out get_signal_names_out;
- /*
- * now define the actual calls we support
- */
+struct ptrace_in {
+ int pid;
+ ptrace_addr_data_in addr;
+ u_int data;
+ u_int flags;
+};
+typedef struct ptrace_in ptrace_in;
+
+struct ptrace_out {
+ ptrace_addr_data_out addr;
+ int result;
+ int errNo;
+};
+typedef struct ptrace_out ptrace_out;
+
+struct one_symbol {
+ char *symbolName;
+ long symbolValue;
+};
+typedef struct one_symbol one_symbol;
+
+typedef struct {
+ u_int all_symbols_len;
+ one_symbol *all_symbols_val;
+} all_symbols;
+
+struct get_global_symbols_out {
+ all_symbols symbols;
+};
+typedef struct get_global_symbols_out get_global_symbols_out;
+
+struct get_text_data_in {
+ int pid;
+ char *actorName;
+};
+typedef struct get_text_data_in get_text_data_in;
+
+struct get_text_data_out {
+ int result;
+ int errNo;
+ u_long textStart;
+ u_long textSize;
+ u_long dataStart;
+ u_long dataSize;
+};
+typedef struct get_text_data_out get_text_data_out;
+
+struct one_signal {
+ u_int number;
+ char *name;
+};
+typedef struct one_signal one_signal;
+
+typedef struct {
+ u_int all_signals_len;
+ one_signal *all_signals_val;
+} all_signals;
+
+struct get_signal_names_out {
+ all_signals signals;
+};
+typedef struct get_signal_names_out get_signal_names_out;
+ /* now define the actual calls we support */
#define REMDEB_H
#endif
@@ -426,131 +385,125 @@ extern "C" {
#if defined(__STDC__) || defined(__cplusplus)
#define OPEN_CONNEX 1
- extern open_out *open_connex_2 (open_in *, CLIENT *);
- extern open_out *open_connex_2_svc (open_in *, struct svc_req *);
+extern open_out * open_connex_2(open_in *, CLIENT *);
+extern open_out * open_connex_2_svc(open_in *, struct svc_req *);
#define SEND_SIGNAL 2
- extern signal_out *send_signal_2 (signal_in *, CLIENT *);
- extern signal_out *send_signal_2_svc (signal_in *, struct svc_req *);
+extern signal_out * send_signal_2(signal_in *, CLIENT *);
+extern signal_out * send_signal_2_svc(signal_in *, struct svc_req *);
#define CLOSE_CONNEX 10
- extern void *close_connex_2 (close_in *, CLIENT *);
- extern void *close_connex_2_svc (close_in *, struct svc_req *);
+extern void * close_connex_2(close_in *, CLIENT *);
+extern void * close_connex_2_svc(close_in *, struct svc_req *);
#define PTRACE 11
- extern ptrace_out *ptrace_2 (ptrace_in *, CLIENT *);
- extern ptrace_out *ptrace_2_svc (ptrace_in *, struct svc_req *);
+extern ptrace_out * ptrace_2(ptrace_in *, CLIENT *);
+extern ptrace_out * ptrace_2_svc(ptrace_in *, struct svc_req *);
#define WAIT_INFO 13
- extern wait_out *wait_info_2 (wait_in *, CLIENT *);
- extern wait_out *wait_info_2_svc (wait_in *, struct svc_req *);
+extern wait_out * wait_info_2(wait_in *, CLIENT *);
+extern wait_out * wait_info_2_svc(wait_in *, struct svc_req *);
#define GET_SIGNAL_NAMES 17
- extern get_signal_names_out *get_signal_names_2 (void *, CLIENT *);
- extern get_signal_names_out *get_signal_names_2_svc (void *,
- struct svc_req *);
- extern int remotedeb_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+extern get_signal_names_out * get_signal_names_2(void *, CLIENT *);
+extern get_signal_names_out * get_signal_names_2_svc(void *, struct svc_req *);
+extern int remotedeb_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
-#else /* K&R C */
+#else /* K&R C */
#define OPEN_CONNEX 1
- extern open_out *open_connex_2 ();
- extern open_out *open_connex_2_svc ();
+extern open_out * open_connex_2();
+extern open_out * open_connex_2_svc();
#define SEND_SIGNAL 2
- extern signal_out *send_signal_2 ();
- extern signal_out *send_signal_2_svc ();
+extern signal_out * send_signal_2();
+extern signal_out * send_signal_2_svc();
#define CLOSE_CONNEX 10
- extern void *close_connex_2 ();
- extern void *close_connex_2_svc ();
+extern void * close_connex_2();
+extern void * close_connex_2_svc();
#define PTRACE 11
- extern ptrace_out *ptrace_2 ();
- extern ptrace_out *ptrace_2_svc ();
+extern ptrace_out * ptrace_2();
+extern ptrace_out * ptrace_2_svc();
#define WAIT_INFO 13
- extern wait_out *wait_info_2 ();
- extern wait_out *wait_info_2_svc ();
+extern wait_out * wait_info_2();
+extern wait_out * wait_info_2_svc();
#define GET_SIGNAL_NAMES 17
- extern get_signal_names_out *get_signal_names_2 ();
- extern get_signal_names_out *get_signal_names_2_svc ();
- extern int remotedeb_2_freeresult ();
-#endif /* K&R C */
+extern get_signal_names_out * get_signal_names_2();
+extern get_signal_names_out * get_signal_names_2_svc();
+extern int remotedeb_2_freeresult ();
+#endif /* K&R C */
/* the xdr functions */
#if defined(__STDC__) || defined(__cplusplus)
- extern bool_t xdr_rpc_type (XDR *, rpc_type *);
- extern bool_t xdr_UDP_MSG (XDR *, UDP_MSG *);
- extern bool_t xdr_ptracereq (XDR *, ptracereq *);
- extern bool_t xdr_xdr_regs (XDR *, xdr_regs *);
- extern bool_t xdr_xdr_mem (XDR *, xdr_mem *);
- extern bool_t xdr_break_type (XDR *, break_type *);
- extern bool_t xdr_xdr_break (XDR *, xdr_break *);
- extern bool_t xdr_thread_name (XDR *, thread_name *);
- extern bool_t xdr_KernThread (XDR *, KernThread *);
- extern bool_t xdr_thread_list (XDR *, thread_list *);
- extern bool_t xdr_ptrace_addr_data_in (XDR *, ptrace_addr_data_in *);
- extern bool_t xdr_ptrace_addr_data_out (XDR *, ptrace_addr_data_out *);
- extern bool_t xdr_CHAR_DATA (XDR *, CHAR_DATA *);
- extern bool_t xdr_xry_inst (XDR *, xry_inst *);
- extern bool_t xdr_instance (XDR *, instance *);
- extern bool_t xdr_instance_union (XDR *, instance_union *);
- extern bool_t xdr_one_arg (XDR *, one_arg *);
- extern bool_t xdr_debug_type (XDR *, debug_type *);
- extern bool_t xdr_open_in (XDR *, open_in *);
- extern bool_t xdr_open_out (XDR *, open_out *);
- extern bool_t xdr_close_control (XDR *, close_control *);
- extern bool_t xdr_close_in (XDR *, close_in *);
- extern bool_t xdr_signal_in (XDR *, signal_in *);
- extern bool_t xdr_signal_out (XDR *, signal_out *);
- extern bool_t xdr_stop_code (XDR *, stop_code *);
- extern bool_t xdr_wait_in (XDR *, wait_in *);
- extern bool_t xdr_wait_out (XDR *, wait_out *);
- extern bool_t xdr_ptrace_in (XDR *, ptrace_in *);
- extern bool_t xdr_ptrace_out (XDR *, ptrace_out *);
- extern bool_t xdr_one_symbol (XDR *, one_symbol *);
- extern bool_t xdr_all_symbols (XDR *, all_symbols *);
- extern bool_t xdr_get_global_symbols_out (XDR *, get_global_symbols_out *);
- extern bool_t xdr_get_text_data_in (XDR *, get_text_data_in *);
- extern bool_t xdr_get_text_data_out (XDR *, get_text_data_out *);
- extern bool_t xdr_one_signal (XDR *, one_signal *);
- extern bool_t xdr_all_signals (XDR *, all_signals *);
- extern bool_t xdr_get_signal_names_out (XDR *, get_signal_names_out *);
-
-#else /* K&R C */
- extern bool_t xdr_rpc_type ();
- extern bool_t xdr_UDP_MSG ();
- extern bool_t xdr_ptracereq ();
- extern bool_t xdr_xdr_regs ();
- extern bool_t xdr_xdr_mem ();
- extern bool_t xdr_break_type ();
- extern bool_t xdr_xdr_break ();
- extern bool_t xdr_thread_name ();
- extern bool_t xdr_KernThread ();
- extern bool_t xdr_thread_list ();
- extern bool_t xdr_ptrace_addr_data_in ();
- extern bool_t xdr_ptrace_addr_data_out ();
- extern bool_t xdr_CHAR_DATA ();
- extern bool_t xdr_xry_inst ();
- extern bool_t xdr_instance ();
- extern bool_t xdr_instance_union ();
- extern bool_t xdr_one_arg ();
- extern bool_t xdr_debug_type ();
- extern bool_t xdr_open_in ();
- extern bool_t xdr_open_out ();
- extern bool_t xdr_close_control ();
- extern bool_t xdr_close_in ();
- extern bool_t xdr_signal_in ();
- extern bool_t xdr_signal_out ();
- extern bool_t xdr_stop_code ();
- extern bool_t xdr_wait_in ();
- extern bool_t xdr_wait_out ();
- extern bool_t xdr_ptrace_in ();
- extern bool_t xdr_ptrace_out ();
- extern bool_t xdr_one_symbol ();
- extern bool_t xdr_all_symbols ();
- extern bool_t xdr_get_global_symbols_out ();
- extern bool_t xdr_get_text_data_in ();
- extern bool_t xdr_get_text_data_out ();
- extern bool_t xdr_one_signal ();
- extern bool_t xdr_all_signals ();
- extern bool_t xdr_get_signal_names_out ();
-
-#endif /* K&R C */
+extern bool_t xdr_rpc_type (XDR *, rpc_type*);
+extern bool_t xdr_UDP_MSG (XDR *, UDP_MSG*);
+extern bool_t xdr_ptracereq (XDR *, ptracereq*);
+extern bool_t xdr_xdr_regs (XDR *, xdr_regs*);
+extern bool_t xdr_xdr_mem (XDR *, xdr_mem*);
+extern bool_t xdr_break_type (XDR *, break_type*);
+extern bool_t xdr_xdr_break (XDR *, xdr_break*);
+extern bool_t xdr_thread_name (XDR *, thread_name*);
+extern bool_t xdr_KernThread (XDR *, KernThread*);
+extern bool_t xdr_thread_list (XDR *, thread_list*);
+extern bool_t xdr_ptrace_addr_data_in (XDR *, ptrace_addr_data_in*);
+extern bool_t xdr_ptrace_addr_data_out (XDR *, ptrace_addr_data_out*);
+extern bool_t xdr_CHAR_DATA (XDR *, CHAR_DATA*);
+extern bool_t xdr_one_arg (XDR *, one_arg*);
+extern bool_t xdr_debug_type (XDR *, debug_type*);
+extern bool_t xdr_open_in (XDR *, open_in*);
+extern bool_t xdr_open_out (XDR *, open_out*);
+extern bool_t xdr_close_control (XDR *, close_control*);
+extern bool_t xdr_close_in (XDR *, close_in*);
+extern bool_t xdr_signal_in (XDR *, signal_in*);
+extern bool_t xdr_signal_out (XDR *, signal_out*);
+extern bool_t xdr_stop_code (XDR *, stop_code*);
+extern bool_t xdr_wait_in (XDR *, wait_in*);
+extern bool_t xdr_wait_out (XDR *, wait_out*);
+extern bool_t xdr_ptrace_in (XDR *, ptrace_in*);
+extern bool_t xdr_ptrace_out (XDR *, ptrace_out*);
+extern bool_t xdr_one_symbol (XDR *, one_symbol*);
+extern bool_t xdr_all_symbols (XDR *, all_symbols*);
+extern bool_t xdr_get_global_symbols_out (XDR *, get_global_symbols_out*);
+extern bool_t xdr_get_text_data_in (XDR *, get_text_data_in*);
+extern bool_t xdr_get_text_data_out (XDR *, get_text_data_out*);
+extern bool_t xdr_one_signal (XDR *, one_signal*);
+extern bool_t xdr_all_signals (XDR *, all_signals*);
+extern bool_t xdr_get_signal_names_out (XDR *, get_signal_names_out*);
+
+#else /* K&R C */
+extern bool_t xdr_rpc_type ();
+extern bool_t xdr_UDP_MSG ();
+extern bool_t xdr_ptracereq ();
+extern bool_t xdr_xdr_regs ();
+extern bool_t xdr_xdr_mem ();
+extern bool_t xdr_break_type ();
+extern bool_t xdr_xdr_break ();
+extern bool_t xdr_thread_name ();
+extern bool_t xdr_KernThread ();
+extern bool_t xdr_thread_list ();
+extern bool_t xdr_ptrace_addr_data_in ();
+extern bool_t xdr_ptrace_addr_data_out ();
+extern bool_t xdr_CHAR_DATA ();
+extern bool_t xdr_one_arg ();
+extern bool_t xdr_debug_type ();
+extern bool_t xdr_open_in ();
+extern bool_t xdr_open_out ();
+extern bool_t xdr_close_control ();
+extern bool_t xdr_close_in ();
+extern bool_t xdr_signal_in ();
+extern bool_t xdr_signal_out ();
+extern bool_t xdr_stop_code ();
+extern bool_t xdr_wait_in ();
+extern bool_t xdr_wait_out ();
+extern bool_t xdr_ptrace_in ();
+extern bool_t xdr_ptrace_out ();
+extern bool_t xdr_one_symbol ();
+extern bool_t xdr_all_symbols ();
+extern bool_t xdr_get_global_symbols_out ();
+extern bool_t xdr_get_text_data_in ();
+extern bool_t xdr_get_text_data_out ();
+extern bool_t xdr_one_signal ();
+extern bool_t xdr_all_signals ();
+extern bool_t xdr_get_signal_names_out ();
+
+#endif /* K&R C */
#ifdef __cplusplus
}
#endif
-#endif /* !_REMDEB_H_RPCGEN */
+
+#endif /* !_REMDEB_H_RPCGEN */
diff --git a/c/src/librdbg/src/m68k/any/remdeb_svc.c b/c/src/librdbg/src/m68k/any/remdeb_svc.c
index 1827a53e3c..e69de29bb2 100644
--- a/c/src/librdbg/src/m68k/any/remdeb_svc.c
+++ b/c/src/librdbg/src/m68k/any/remdeb_svc.c
@@ -1,133 +0,0 @@
-#include <rpc/types.h>
-#include <rpc/rpc.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <bsp.h>
-#include <rdbg/servrpc.h>
-#include <rdbg/remdeb.h>
-#define fprintf(a,b) printf(b)
-/*HEADER_START*/
-#define RTEMS_PORT 2071
-#define RTEMS_BACK_PORT 2073
-/*
- * Sun request values for the remote ptrace system call
- */
-
- /*
- * Memory data for read/write text or data. The size is in data. The target
- * addr is in the addr field.
- * Be careful before modifying because this value goes into internal
- * pipes and is allocated on stack too. Pipes and/or the stack could
- * become too small if this value gets incremented.
- */
-#ifndef XRY_MAX_CMD_STR
-#endif /* REMDEB_H */
- /*
- * now open_connex() routine which establishes a connection to server
- */
-#define DEBUGGER_IS_GDB 0x2 /* */
- /*
- * now close_connex() routine which detaches from server
- */
- /*
- * now send_signal() routine which sends signals to processes like kill(2)
- */
- /*
- * now wait_info() routine which returns results of polling the wait status
- * of a process/actor. It may return 0 if running, else pid or -1
- */
- /*
- * now ptrace() routine. This matches the Sun UNIX ptrace as well as
- * some additions
- */
- /*
- * now define the actual calls we support
- */
-const char *names[] = {
- "NULLPROC", "OPEN_CONNEX", "SEND_SIGNAL", "name3",
- "name4", "name5", "name6", "name7",
- "name8", "name9", "CLOSE_CONNEX", "PTRACE",
- "name12", "WAIT_INFO", "name14", "name15",
- "name16", "GET_SIGNAL_NAMES", "name18"
-};
-
-void
-remotedeb_2 (struct svc_req *rqstp, register SVCXPRT * transp)
-{
- union {
- open_in open_connex_2_arg;
- signal_in send_signal_2_arg;
- close_in close_connex_2_arg;
- ptrace_in ptrace_2_arg;
- wait_in wait_info_2_arg;
- } argument;
- char *result;
- xdrproc_t _xdr_argument, _xdr_result;
- char *(*local) (char *, struct svc_req *);
-
- DPRINTF (("remotedeb_2: %s (%d)\n",
- (unsigned) rqstp->rq_proc <
- (unsigned) (sizeof names / sizeof names[0]) ?
- names[rqstp->rq_proc] : "???", (int) rqstp->rq_proc));
-
- switch (rqstp->rq_proc) {
- case NULLPROC:
- (void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *) NULL);
- return;
-
- case OPEN_CONNEX:
- _xdr_argument = (xdrproc_t) xdr_open_in;
- _xdr_result = (xdrproc_t) xdr_open_out;
- local = (char *(*)(char *, struct svc_req *)) open_connex_2_svc;
- break;
-
- case SEND_SIGNAL:
- _xdr_argument = (xdrproc_t) xdr_signal_in;
- _xdr_result = (xdrproc_t) xdr_signal_out;
- local = (char *(*)(char *, struct svc_req *)) send_signal_2_svc;
- break;
-
- case CLOSE_CONNEX:
- _xdr_argument = (xdrproc_t) xdr_close_in;
- _xdr_result = (xdrproc_t) xdr_void;
- local = (char *(*)(char *, struct svc_req *)) close_connex_2_svc;
- break;
-
- case PTRACE:
- _xdr_argument = (xdrproc_t) xdr_ptrace_in;
- _xdr_result = (xdrproc_t) xdr_ptrace_out;
- local = (char *(*)(char *, struct svc_req *)) ptrace_2_svc;
- break;
-
- case WAIT_INFO:
- _xdr_argument = (xdrproc_t) xdr_wait_in;
- _xdr_result = (xdrproc_t) xdr_wait_out;
- local = (char *(*)(char *, struct svc_req *)) wait_info_2_svc;
- break;
-
- case GET_SIGNAL_NAMES:
- _xdr_argument = (xdrproc_t) xdr_void;
- _xdr_result = (xdrproc_t) xdr_get_signal_names_out;
- local = (char *(*)(char *, struct svc_req *)) get_signal_names_2_svc;
- break;
-
- default:
- svcerr_noproc (transp);
- return;
- }
- memset ((char *) &argument, 0, sizeof (argument));
- if (!svc_getargs (transp, _xdr_argument, (caddr_t) & argument)) {
- svcerr_decode (transp);
- return;
- }
- result = (*local) ((char *) &argument, rqstp);
- if (result != NULL && !svc_sendreply (transp, _xdr_result, result)) {
- svcerr_systemerr (transp);
- }
- if (!svc_freeargs (transp, _xdr_argument, (caddr_t) & argument)) {
- fprintf (stderr, "unable to free arguments");
- exit (1);
- }
- return;
-}
diff --git a/c/src/librdbg/src/m68k/any/remdeb_xdr.c b/c/src/librdbg/src/m68k/any/remdeb_xdr.c
index 9a7652590f..cb7662d2a5 100644
--- a/c/src/librdbg/src/m68k/any/remdeb_xdr.c
+++ b/c/src/librdbg/src/m68k/any/remdeb_xdr.c
@@ -8,998 +8,911 @@
#define RTEMS_BACK_PORT 2073
bool_t
-xdr_rpc_type (XDR * xdrs, rpc_type * objp)
+xdr_rpc_type (XDR *xdrs, rpc_type *objp)
{
- register int32_t *buf;
+ register int32_t *buf;
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
+ if (!xdr_enum (xdrs, (enum_t *) objp))
+ return FALSE;
+ return TRUE;
}
bool_t
-xdr_UDP_MSG (XDR * xdrs, UDP_MSG * objp)
+xdr_UDP_MSG (XDR *xdrs, UDP_MSG *objp)
{
- register int32_t *buf;
+ register int32_t *buf;
- if (!xdr_u_char (xdrs, &objp->type))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->msg_num))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->spec))
- return FALSE;
- if (!xdr_long (xdrs, &objp->pid))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->context))
- return FALSE;
- return TRUE;
+ if (!xdr_u_char (xdrs, &objp->type))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->msg_num))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->spec))
+ return FALSE;
+ if (!xdr_long (xdrs, &objp->pid))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->context))
+ return FALSE;
+ return TRUE;
}
-
/*
* Sun request values for the remote ptrace system call
*/
+
bool_t
-xdr_ptracereq (XDR * xdrs, ptracereq * objp)
-{
- register int32_t *buf;
-
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_xdr_regs (XDR * xdrs, xdr_regs * objp)
-{
- register int32_t *buf;
-
- int i;
-
- if (xdrs->x_op == XDR_ENCODE) {
- buf = XDR_INLINE (xdrs, (3 + 8 + 8) * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_vector (xdrs, (char *) objp->r_dreg, 8,
- sizeof (int), (xdrproc_t) xdr_int))
- return FALSE;
- if (!xdr_vector (xdrs, (char *) objp->r_areg, 8,
- sizeof (int), (xdrproc_t) xdr_int))
- return FALSE;
- if (!xdr_int (xdrs, &objp->r_sr))
- return FALSE;
- if (!xdr_int (xdrs, &objp->r_pc))
- return FALSE;
- if (!xdr_int (xdrs, &objp->r_vec))
- return FALSE;
- } else {
- {
- register int *genp;
-
- for (i = 0, genp = objp->r_dreg; i < 8; ++i) {
- IXDR_PUT_LONG (buf, *genp++);
- }
- }
- {
- register int *genp;
-
- for (i = 0, genp = objp->r_areg; i < 8; ++i) {
- IXDR_PUT_LONG (buf, *genp++);
- }
- }
- IXDR_PUT_LONG (buf, objp->r_sr);
- IXDR_PUT_LONG (buf, objp->r_pc);
- IXDR_PUT_LONG (buf, objp->r_vec);
- }
- return TRUE;
- } else if (xdrs->x_op == XDR_DECODE) {
- buf = XDR_INLINE (xdrs, (3 + 8 + 8) * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_vector (xdrs, (char *) objp->r_dreg, 8,
- sizeof (int), (xdrproc_t) xdr_int))
- return FALSE;
- if (!xdr_vector (xdrs, (char *) objp->r_areg, 8,
- sizeof (int), (xdrproc_t) xdr_int))
- return FALSE;
- if (!xdr_int (xdrs, &objp->r_sr))
- return FALSE;
- if (!xdr_int (xdrs, &objp->r_pc))
- return FALSE;
- if (!xdr_int (xdrs, &objp->r_vec))
- return FALSE;
- } else {
- {
- register int *genp;
-
- for (i = 0, genp = objp->r_dreg; i < 8; ++i) {
- *genp++ = IXDR_GET_LONG (buf);
- }
- }
- {
- register int *genp;
-
- for (i = 0, genp = objp->r_areg; i < 8; ++i) {
- *genp++ = IXDR_GET_LONG (buf);
- }
- }
- objp->r_sr = IXDR_GET_LONG (buf);
- objp->r_pc = IXDR_GET_LONG (buf);
- objp->r_vec = IXDR_GET_LONG (buf);
- }
- return TRUE;
- }
-
- if (!xdr_vector (xdrs, (char *) objp->r_dreg, 8,
- sizeof (int), (xdrproc_t) xdr_int))
- return FALSE;
- if (!xdr_vector (xdrs, (char *) objp->r_areg, 8,
- sizeof (int), (xdrproc_t) xdr_int))
- return FALSE;
- if (!xdr_int (xdrs, &objp->r_sr))
- return FALSE;
- if (!xdr_int (xdrs, &objp->r_pc))
- return FALSE;
- if (!xdr_int (xdrs, &objp->r_vec))
- return FALSE;
- return TRUE;
-}
-
- /*
+xdr_ptracereq (XDR *xdrs, ptracereq *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_enum (xdrs, (enum_t *) objp))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_xdr_regs (XDR *xdrs, xdr_regs *objp)
+{
+ register int32_t *buf;
+
+ int i;
+
+ if (xdrs->x_op == XDR_ENCODE) {
+ buf = XDR_INLINE (xdrs, (3 + 8 + 8 )* BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_vector (xdrs, (char *)objp->r_dreg, 8,
+ sizeof (int), (xdrproc_t) xdr_int))
+ return FALSE;
+ if (!xdr_vector (xdrs, (char *)objp->r_areg, 8,
+ sizeof (int), (xdrproc_t) xdr_int))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->r_sr))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->r_pc))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->r_vec))
+ return FALSE;
+ } else {
+ {
+ register int *genp;
+
+ for (i = 0, genp = objp->r_dreg;
+ i < 8; ++i) {
+ IXDR_PUT_LONG(buf, *genp++);
+ }
+ }
+ {
+ register int *genp;
+
+ for (i = 0, genp = objp->r_areg;
+ i < 8; ++i) {
+ IXDR_PUT_LONG(buf, *genp++);
+ }
+ }
+ IXDR_PUT_LONG(buf, objp->r_sr);
+ IXDR_PUT_LONG(buf, objp->r_pc);
+ IXDR_PUT_LONG(buf, objp->r_vec);
+ }
+ return TRUE;
+ } else if (xdrs->x_op == XDR_DECODE) {
+ buf = XDR_INLINE (xdrs, (3 + 8 + 8 )* BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_vector (xdrs, (char *)objp->r_dreg, 8,
+ sizeof (int), (xdrproc_t) xdr_int))
+ return FALSE;
+ if (!xdr_vector (xdrs, (char *)objp->r_areg, 8,
+ sizeof (int), (xdrproc_t) xdr_int))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->r_sr))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->r_pc))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->r_vec))
+ return FALSE;
+ } else {
+ {
+ register int *genp;
+
+ for (i = 0, genp = objp->r_dreg;
+ i < 8; ++i) {
+ *genp++ = IXDR_GET_LONG(buf);
+ }
+ }
+ {
+ register int *genp;
+
+ for (i = 0, genp = objp->r_areg;
+ i < 8; ++i) {
+ *genp++ = IXDR_GET_LONG(buf);
+ }
+ }
+ objp->r_sr = IXDR_GET_LONG(buf);
+ objp->r_pc = IXDR_GET_LONG(buf);
+ objp->r_vec = IXDR_GET_LONG(buf);
+ }
+ return TRUE;
+ }
+
+ if (!xdr_vector (xdrs, (char *)objp->r_dreg, 8,
+ sizeof (int), (xdrproc_t) xdr_int))
+ return FALSE;
+ if (!xdr_vector (xdrs, (char *)objp->r_areg, 8,
+ sizeof (int), (xdrproc_t) xdr_int))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->r_sr))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->r_pc))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->r_vec))
+ return FALSE;
+ return TRUE;
+}
+ /*
* Memory data for read/write text or data. The size is in data. The target
* addr is in the addr field.
* Be careful before modifying because this value goes into internal
* pipes and is allocated on stack too. Pipes and/or the stack could
* become too small if this value gets incremented.
*/
-bool_t
-xdr_xdr_mem (xdrs, objp)
- XDR *xdrs;
- struct xdr_mem *objp;
-{
- if (!xdr_u_long (xdrs, &objp->addr)) {
- return (FALSE);
- }
- if (!xdr_u_int (xdrs, &objp->dataNb)) {
- return (FALSE);
- }
- return (xdr_opaque (xdrs, objp->data, objp->dataNb));
-}
-
-bool_t
-xdr_break_type (XDR * xdrs, break_type * objp)
-{
- register int32_t *buf;
-
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_xdr_break (XDR * xdrs, xdr_break * objp)
-{
- register int32_t *buf;
-
- int i;
-
- if (xdrs->x_op == XDR_ENCODE) {
- if (!xdr_u_char (xdrs, &objp->type))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->thread_spec))
- return FALSE;
- buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_u_short (xdrs, &objp->handle))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->ee_loc))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->ee_type))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->length))
- return FALSE;
-
- } else {
- IXDR_PUT_U_SHORT (buf, objp->handle);
- IXDR_PUT_U_LONG (buf, objp->ee_loc);
- IXDR_PUT_U_LONG (buf, objp->ee_type);
- IXDR_PUT_U_SHORT (buf, objp->length);
- }
- if (!xdr_u_char (xdrs, &objp->pass_count))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->curr_pass))
- return FALSE;
- buf = XDR_INLINE (xdrs, MAX_THRD_BRK * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_vector (xdrs, (char *) objp->thread_list, MAX_THRD_BRK,
- sizeof (u_long), (xdrproc_t) xdr_u_long))
- return FALSE;
- } else {
- {
- register u_long *genp;
-
- for (i = 0, genp = objp->thread_list; i < MAX_THRD_BRK; ++i) {
- IXDR_PUT_U_LONG (buf, *genp++);
- }
- }
- }
- return TRUE;
- } else if (xdrs->x_op == XDR_DECODE) {
- if (!xdr_u_char (xdrs, &objp->type))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->thread_spec))
- return FALSE;
- buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_u_short (xdrs, &objp->handle))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->ee_loc))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->ee_type))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->length))
- return FALSE;
-
- } else {
- objp->handle = IXDR_GET_U_SHORT (buf);
- objp->ee_loc = IXDR_GET_U_LONG (buf);
- objp->ee_type = IXDR_GET_U_LONG (buf);
- objp->length = IXDR_GET_U_SHORT (buf);
- }
- if (!xdr_u_char (xdrs, &objp->pass_count))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->curr_pass))
- return FALSE;
- buf = XDR_INLINE (xdrs, MAX_THRD_BRK * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_vector (xdrs, (char *) objp->thread_list, MAX_THRD_BRK,
- sizeof (u_long), (xdrproc_t) xdr_u_long))
- return FALSE;
- } else {
- {
- register u_long *genp;
-
- for (i = 0, genp = objp->thread_list; i < MAX_THRD_BRK; ++i) {
- *genp++ = IXDR_GET_U_LONG (buf);
- }
- }
- }
- return TRUE;
- }
-
- if (!xdr_u_char (xdrs, &objp->type))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->thread_spec))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->handle))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->ee_loc))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->ee_type))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->length))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->pass_count))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->curr_pass))
- return FALSE;
- if (!xdr_vector (xdrs, (char *) objp->thread_list, MAX_THRD_BRK,
- sizeof (u_long), (xdrproc_t) xdr_u_long))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_thread_name (XDR * xdrs, thread_name * objp)
-{
- register int32_t *buf;
-
- if (!xdr_string (xdrs, objp, THREADNAMEMAX))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_KernThread (XDR * xdrs, KernThread * objp)
-{
- register int32_t *buf;
-
- if (!xdr_u_int (xdrs, &objp->threadLi))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_thread_list (xdrs, objp)
- XDR *xdrs;
- struct thread_list *objp;
-{
- return (xdr_array (xdrs, (char **) &objp->threads, &objp->nbThread,
- UTHREAD_MAX, sizeof (KernThread), xdr_KernThread));
-}
-
-bool_t
-xdr_ptrace_addr_data_in (XDR * xdrs, ptrace_addr_data_in * objp)
-{
- register int32_t *buf;
-
- if (!xdr_ptracereq (xdrs, &objp->req))
- return FALSE;
- switch (objp->req) {
- case RPT_SETTHREADREGS:
- if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_in_u.regs))
- return FALSE;
- break;
- case RPT_SETREGS:
- if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_in_u.regs))
- return FALSE;
- break;
- case RPT_PSETTHREADREGS:
- if (!xdr_array
- (xdrs, (char **) &objp->ptrace_addr_data_in_u.pregs.pregs_val,
- (u_int *) & objp->ptrace_addr_data_in_u.pregs.pregs_len, ~0,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- break;
- case RPT_PSETREGS:
- if (!xdr_array
- (xdrs, (char **) &objp->ptrace_addr_data_in_u.pregs.pregs_val,
- (u_int *) & objp->ptrace_addr_data_in_u.pregs.pregs_len, ~0,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- break;
- case RPT_SETTHREADNAME:
- if (!xdr_thread_name (xdrs, &objp->ptrace_addr_data_in_u.name))
- return FALSE;
- break;
- case RPT_WRITETEXT:
- if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_in_u.mem))
- return FALSE;
- break;
- case RPT_WRITEDATA:
- if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_in_u.mem))
- return FALSE;
- break;
- case RPT_SETBREAK:
- if (!xdr_xdr_break (xdrs, &objp->ptrace_addr_data_in_u.breakp))
- return FALSE;
- break;
- default:
- if (!xdr_u_int (xdrs, &objp->ptrace_addr_data_in_u.address))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_ptrace_addr_data_out (XDR * xdrs, ptrace_addr_data_out * objp)
-{
- register int32_t *buf;
-
- if (!xdr_ptracereq (xdrs, &objp->req))
- return FALSE;
- switch (objp->req) {
- case RPT_GETREGS:
- if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_out_u.regs))
- return FALSE;
- break;
- case RPT_GETTHREADREGS:
- if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_out_u.regs))
- return FALSE;
- break;
- case RPT_PGETREGS:
- if (!xdr_array
- (xdrs, (char **) &objp->ptrace_addr_data_out_u.pregs.pregs_val,
- (u_int *) & objp->ptrace_addr_data_out_u.pregs.pregs_len, ~0,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- break;
- case RPT_PGETTHREADREGS:
- if (!xdr_array
- (xdrs, (char **) &objp->ptrace_addr_data_out_u.pregs.pregs_val,
- (u_int *) & objp->ptrace_addr_data_out_u.pregs.pregs_len, ~0,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- break;
- case RPT_THREADLIST:
- if (!xdr_thread_list (xdrs, &objp->ptrace_addr_data_out_u.threads))
- return FALSE;
- break;
- case RPT_GETTHREADNAME:
- if (!xdr_thread_name (xdrs, &objp->ptrace_addr_data_out_u.name))
- return FALSE;
- break;
- case RPT_READTEXT:
- if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_out_u.mem))
- return FALSE;
- break;
- case RPT_GETNAME:
- if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_out_u.mem))
- return FALSE;
- break;
- case RPT_READDATA:
- if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_out_u.mem))
- return FALSE;
- break;
- case RPT_GETBREAK:
- if (!xdr_xdr_break (xdrs, &objp->ptrace_addr_data_out_u.breakp))
- return FALSE;
- break;
- default:
- if (!xdr_u_int (xdrs, &objp->ptrace_addr_data_out_u.addr))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_CHAR_DATA (XDR * xdrs, CHAR_DATA * objp)
-{
- register int32_t *buf;
-
- if (!xdr_bytes
- (xdrs, (char **) &objp->CHAR_DATA_val, (u_int *) & objp->CHAR_DATA_len,
- NET_SAFE))
- return FALSE;
- return TRUE;
-}
-
-#ifndef XRY_MAX_CMD_STR
-#endif /* REMDEB_H */
-
-bool_t
-xdr_xry_inst (XDR * xdrs, xry_inst * objp)
-{
- register int32_t *buf;
-
- if (!xdr_u_char (xdrs, &objp->flags))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->type))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->sub_type))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->res_type))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->value))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->value2))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_instance (XDR * xdrs, instance * objp)
-{
- register int32_t *buf;
-
- int i;
- if (!xdr_vector (xdrs, (char *) objp->instances, XRY_MAX_INSTANCES,
- sizeof (xry_inst), (xdrproc_t) xdr_xry_inst))
- return FALSE;
- if (!xdr_vector (xdrs, (char *) objp->buffer, XRY_MAX_INST_BUFF,
- sizeof (u_char), (xdrproc_t) xdr_u_char))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_instance_union (XDR * xdrs, instance_union * objp)
-{
- register int32_t *buf;
-
- if (!xdr_bool (xdrs, &objp->instances))
- return FALSE;
- switch (objp->instances) {
- case TRUE:
- if (!xdr_instance (xdrs, &objp->instance_union_u.inst))
- return FALSE;
- break;
- case FALSE:
- if (!xdr_string (xdrs, &objp->instance_union_u.buffer, XRY_MAX_CMD_STR))
- return FALSE;
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-bool_t
-xdr_one_arg (XDR * xdrs, one_arg * objp)
-{
- register int32_t *buf;
-
- if (!xdr_string (xdrs, objp, NET_SAFE))
- return FALSE;
- return TRUE;
-}
-
- /*
- * now open_connex() routine which establishes a connection to server
- */
-
-bool_t
-xdr_debug_type (XDR * xdrs, debug_type * objp)
-{
- register int32_t *buf;
-
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-#define DEBUGGER_IS_GDB 0x2 /* */
-
-bool_t
-xdr_open_in (XDR * xdrs, open_in * objp)
-{
- register int32_t *buf;
-
- int i;
- if (!xdr_vector (xdrs, (char *) objp->back_port, 16,
- sizeof (u_char), (xdrproc_t) xdr_u_char))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->debug_type))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->flags))
- return FALSE;
- if (!xdr_vector (xdrs, (char *) objp->destination, 16,
- sizeof (u_char), (xdrproc_t) xdr_u_char))
- return FALSE;
- if (!xdr_one_arg (xdrs, &objp->user_name))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_open_out (XDR * xdrs, open_out * objp)
-{
- register int32_t *buf;
-
- int i;
-
- if (xdrs->x_op == XDR_ENCODE) {
- buf = XDR_INLINE (xdrs, (2 + (4)) * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_u_long (xdrs, &objp->port))
- return FALSE;
- if (!xdr_vector (xdrs, (char *) objp->pad, 4,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- if (!xdr_u_int (xdrs, &objp->fp))
- return FALSE;
-
- } else {
- IXDR_PUT_U_LONG (buf, objp->port);
- {
- register u_int *genp;
-
- for (i = 0, genp = objp->pad; i < 4; ++i) {
- IXDR_PUT_U_LONG (buf, *genp++);
- }
- }
- IXDR_PUT_U_LONG (buf, objp->fp);
- }
- if (!xdr_u_char (xdrs, &objp->cmd_table_num))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->cmd_table_vers))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->server_vers))
- return FALSE;
- return TRUE;
- } else if (xdrs->x_op == XDR_DECODE) {
- buf = XDR_INLINE (xdrs, (2 + (4)) * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_u_long (xdrs, &objp->port))
- return FALSE;
- if (!xdr_vector (xdrs, (char *) objp->pad, 4,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- if (!xdr_u_int (xdrs, &objp->fp))
- return FALSE;
-
- } else {
- objp->port = IXDR_GET_U_LONG (buf);
- {
- register u_int *genp;
-
- for (i = 0, genp = objp->pad; i < 4; ++i) {
- *genp++ = IXDR_GET_U_LONG (buf);
- }
- }
- objp->fp = IXDR_GET_U_LONG (buf);
- }
- if (!xdr_u_char (xdrs, &objp->cmd_table_num))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->cmd_table_vers))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->server_vers))
- return FALSE;
- return TRUE;
- }
-
- if (!xdr_u_long (xdrs, &objp->port))
- return FALSE;
- if (!xdr_vector (xdrs, (char *) objp->pad, 4,
- sizeof (u_int), (xdrproc_t) xdr_u_int))
- return FALSE;
- if (!xdr_u_int (xdrs, &objp->fp))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->cmd_table_num))
- return FALSE;
- if (!xdr_u_char (xdrs, &objp->cmd_table_vers))
- return FALSE;
- if (!xdr_u_short (xdrs, &objp->server_vers))
- return FALSE;
- return TRUE;
-}
-
- /*
- * now close_connex() routine which detaches from server
- */
+bool_t xdr_xdr_mem(xdrs, objp)
+ XDR *xdrs;
+ struct xdr_mem *objp;
+{
+ if (!xdr_u_long(xdrs, &objp->addr)) {
+ return (FALSE);
+ }
+ if (!xdr_u_int(xdrs, &objp->dataNb)) {
+ return(FALSE);
+ }
+ return (xdr_opaque(xdrs, objp->data, objp->dataNb));
+}
+
+bool_t
+xdr_break_type (XDR *xdrs, break_type *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_enum (xdrs, (enum_t *) objp))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_xdr_break (XDR *xdrs, xdr_break *objp)
+{
+ register int32_t *buf;
+
+ int i;
+
+ if (xdrs->x_op == XDR_ENCODE) {
+ if (!xdr_u_char (xdrs, &objp->type))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->thread_spec))
+ return FALSE;
+ buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_u_short (xdrs, &objp->handle))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->ee_loc))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->ee_type))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->length))
+ return FALSE;
+
+ } else {
+ IXDR_PUT_U_SHORT(buf, objp->handle);
+ IXDR_PUT_U_LONG(buf, objp->ee_loc);
+ IXDR_PUT_U_LONG(buf, objp->ee_type);
+ IXDR_PUT_U_SHORT(buf, objp->length);
+ }
+ if (!xdr_u_char (xdrs, &objp->pass_count))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->curr_pass))
+ return FALSE;
+ buf = XDR_INLINE (xdrs, ( MAX_THRD_BRK ) * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_vector (xdrs, (char *)objp->thread_list, MAX_THRD_BRK,
+ sizeof (u_long), (xdrproc_t) xdr_u_long))
+ return FALSE;
+ } else {
+ {
+ register u_long *genp;
+
+ for (i = 0, genp = objp->thread_list;
+ i < MAX_THRD_BRK; ++i) {
+ IXDR_PUT_U_LONG(buf, *genp++);
+ }
+ }
+ }
+ return TRUE;
+ } else if (xdrs->x_op == XDR_DECODE) {
+ if (!xdr_u_char (xdrs, &objp->type))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->thread_spec))
+ return FALSE;
+ buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_u_short (xdrs, &objp->handle))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->ee_loc))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->ee_type))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->length))
+ return FALSE;
+
+ } else {
+ objp->handle = IXDR_GET_U_SHORT(buf);
+ objp->ee_loc = IXDR_GET_U_LONG(buf);
+ objp->ee_type = IXDR_GET_U_LONG(buf);
+ objp->length = IXDR_GET_U_SHORT(buf);
+ }
+ if (!xdr_u_char (xdrs, &objp->pass_count))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->curr_pass))
+ return FALSE;
+ buf = XDR_INLINE (xdrs, ( MAX_THRD_BRK ) * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_vector (xdrs, (char *)objp->thread_list, MAX_THRD_BRK,
+ sizeof (u_long), (xdrproc_t) xdr_u_long))
+ return FALSE;
+ } else {
+ {
+ register u_long *genp;
+
+ for (i = 0, genp = objp->thread_list;
+ i < MAX_THRD_BRK; ++i) {
+ *genp++ = IXDR_GET_U_LONG(buf);
+ }
+ }
+ }
+ return TRUE;
+ }
+
+ if (!xdr_u_char (xdrs, &objp->type))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->thread_spec))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->handle))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->ee_loc))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->ee_type))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->length))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->pass_count))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->curr_pass))
+ return FALSE;
+ if (!xdr_vector (xdrs, (char *)objp->thread_list, MAX_THRD_BRK,
+ sizeof (u_long), (xdrproc_t) xdr_u_long))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_thread_name (XDR *xdrs, thread_name *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_string (xdrs, objp, THREADNAMEMAX))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_KernThread (XDR *xdrs, KernThread *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_u_int (xdrs, &objp->threadLi))
+ return FALSE;
+ return TRUE;
+}
+bool_t xdr_thread_list(xdrs, objp)
+ XDR *xdrs;
+ struct thread_list *objp;
+{
+ return (xdr_array(xdrs, (char**)&objp->threads, &objp->nbThread,
+ UTHREAD_MAX, sizeof(KernThread), xdr_KernThread));
+}
+
+bool_t
+xdr_ptrace_addr_data_in (XDR *xdrs, ptrace_addr_data_in *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_ptracereq (xdrs, &objp->req))
+ return FALSE;
+ switch (objp->req) {
+ case RPT_SETTHREADREGS:
+ if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_in_u.regs))
+ return FALSE;
+ break;
+ case RPT_SETREGS:
+ if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_in_u.regs))
+ return FALSE;
+ break;
+ case RPT_PSETTHREADREGS:
+ if (!xdr_array (xdrs, (char **)&objp->ptrace_addr_data_in_u.pregs.pregs_val, (u_int *) &objp->ptrace_addr_data_in_u.pregs.pregs_len, ~0,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ break;
+ case RPT_PSETREGS:
+ if (!xdr_array (xdrs, (char **)&objp->ptrace_addr_data_in_u.pregs.pregs_val, (u_int *) &objp->ptrace_addr_data_in_u.pregs.pregs_len, ~0,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ break;
+ case RPT_SETTHREADNAME:
+ if (!xdr_thread_name (xdrs, &objp->ptrace_addr_data_in_u.name))
+ return FALSE;
+ break;
+ case RPT_WRITETEXT:
+ if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_in_u.mem))
+ return FALSE;
+ break;
+ case RPT_WRITEDATA:
+ if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_in_u.mem))
+ return FALSE;
+ break;
+ case RPT_SETBREAK:
+ if (!xdr_xdr_break (xdrs, &objp->ptrace_addr_data_in_u.breakp))
+ return FALSE;
+ break;
+ default:
+ if (!xdr_u_int (xdrs, &objp->ptrace_addr_data_in_u.address))
+ return FALSE;
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ptrace_addr_data_out (XDR *xdrs, ptrace_addr_data_out *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_ptracereq (xdrs, &objp->req))
+ return FALSE;
+ switch (objp->req) {
+ case RPT_GETREGS:
+ if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_out_u.regs))
+ return FALSE;
+ break;
+ case RPT_GETTHREADREGS:
+ if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_out_u.regs))
+ return FALSE;
+ break;
+ case RPT_PGETREGS:
+ if (!xdr_array (xdrs, (char **)&objp->ptrace_addr_data_out_u.pregs.pregs_val, (u_int *) &objp->ptrace_addr_data_out_u.pregs.pregs_len, ~0,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ break;
+ case RPT_PGETTHREADREGS:
+ if (!xdr_array (xdrs, (char **)&objp->ptrace_addr_data_out_u.pregs.pregs_val, (u_int *) &objp->ptrace_addr_data_out_u.pregs.pregs_len, ~0,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ break;
+ case RPT_THREADLIST:
+ if (!xdr_thread_list (xdrs, &objp->ptrace_addr_data_out_u.threads))
+ return FALSE;
+ break;
+ case RPT_GETTHREADNAME:
+ if (!xdr_thread_name (xdrs, &objp->ptrace_addr_data_out_u.name))
+ return FALSE;
+ break;
+ case RPT_READTEXT:
+ if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_out_u.mem))
+ return FALSE;
+ break;
+ case RPT_GETNAME:
+ if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_out_u.mem))
+ return FALSE;
+ break;
+ case RPT_READDATA:
+ if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_out_u.mem))
+ return FALSE;
+ break;
+ case RPT_GETBREAK:
+ if (!xdr_xdr_break (xdrs, &objp->ptrace_addr_data_out_u.breakp))
+ return FALSE;
+ break;
+ default:
+ if (!xdr_u_int (xdrs, &objp->ptrace_addr_data_out_u.addr))
+ return FALSE;
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CHAR_DATA (XDR *xdrs, CHAR_DATA *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_bytes (xdrs, (char **)&objp->CHAR_DATA_val, (u_int *) &objp->CHAR_DATA_len, NET_SAFE))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_one_arg (XDR *xdrs, one_arg *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_string (xdrs, objp, NET_SAFE))
+ return FALSE;
+ return TRUE;
+}
+ /* now open_connex() routine which establishes a connection to server */
+
+bool_t
+xdr_debug_type (XDR *xdrs, debug_type *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_enum (xdrs, (enum_t *) objp))
+ return FALSE;
+ return TRUE;
+}
+#define DEBUGGER_IS_GDB 0x2 /* */
+
+bool_t
+xdr_open_in (XDR *xdrs, open_in *objp)
+{
+ register int32_t *buf;
+
+ int i;
+ if (!xdr_vector (xdrs, (char *)objp->back_port, 16,
+ sizeof (u_char), (xdrproc_t) xdr_u_char))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->debug_type))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->flags))
+ return FALSE;
+ if (!xdr_vector (xdrs, (char *)objp->destination, 16,
+ sizeof (u_char), (xdrproc_t) xdr_u_char))
+ return FALSE;
+ if (!xdr_one_arg (xdrs, &objp->user_name))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_open_out (XDR *xdrs, open_out *objp)
+{
+ register int32_t *buf;
+
+ int i;
+
+ if (xdrs->x_op == XDR_ENCODE) {
+ buf = XDR_INLINE (xdrs, (2 + ( 4 )) * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_u_long (xdrs, &objp->port))
+ return FALSE;
+ if (!xdr_vector (xdrs, (char *)objp->pad, 4,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ if (!xdr_u_int (xdrs, &objp->fp))
+ return FALSE;
+
+ } else {
+ IXDR_PUT_U_LONG(buf, objp->port);
+ {
+ register u_int *genp;
-bool_t
-xdr_close_control (XDR * xdrs, close_control * objp)
-{
- register int32_t *buf;
+ for (i = 0, genp = objp->pad;
+ i < 4; ++i) {
+ IXDR_PUT_U_LONG(buf, *genp++);
+ }
+ }
+ IXDR_PUT_U_LONG(buf, objp->fp);
+ }
+ if (!xdr_u_char (xdrs, &objp->cmd_table_num))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->cmd_table_vers))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->server_vers))
+ return FALSE;
+ return TRUE;
+ } else if (xdrs->x_op == XDR_DECODE) {
+ buf = XDR_INLINE (xdrs, (2 + ( 4 )) * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_u_long (xdrs, &objp->port))
+ return FALSE;
+ if (!xdr_vector (xdrs, (char *)objp->pad, 4,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ if (!xdr_u_int (xdrs, &objp->fp))
+ return FALSE;
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
+ } else {
+ objp->port = IXDR_GET_U_LONG(buf);
+ {
+ register u_int *genp;
-bool_t
-xdr_close_in (XDR * xdrs, close_in * objp)
-{
- register int32_t *buf;
+ for (i = 0, genp = objp->pad;
+ i < 4; ++i) {
+ *genp++ = IXDR_GET_U_LONG(buf);
+ }
+ }
+ objp->fp = IXDR_GET_U_LONG(buf);
+ }
+ if (!xdr_u_char (xdrs, &objp->cmd_table_num))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->cmd_table_vers))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->server_vers))
+ return FALSE;
+ return TRUE;
+ }
- if (!xdr_close_control (xdrs, &objp->control))
- return FALSE;
- return TRUE;
+ if (!xdr_u_long (xdrs, &objp->port))
+ return FALSE;
+ if (!xdr_vector (xdrs, (char *)objp->pad, 4,
+ sizeof (u_int), (xdrproc_t) xdr_u_int))
+ return FALSE;
+ if (!xdr_u_int (xdrs, &objp->fp))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->cmd_table_num))
+ return FALSE;
+ if (!xdr_u_char (xdrs, &objp->cmd_table_vers))
+ return FALSE;
+ if (!xdr_u_short (xdrs, &objp->server_vers))
+ return FALSE;
+ return TRUE;
+}
+ /* now close_connex() routine which detaches from server */
+
+bool_t
+xdr_close_control (XDR *xdrs, close_control *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_enum (xdrs, (enum_t *) objp))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_close_in (XDR *xdrs, close_in *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_close_control (xdrs, &objp->control))
+ return FALSE;
+ return TRUE;
+}
+ /* now send_signal() routine which sends signals to processes like kill(2) */
+
+bool_t
+xdr_signal_in (XDR *xdrs, signal_in *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_int (xdrs, &objp->pid))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->sig))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_signal_out (XDR *xdrs, signal_out *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_int (xdrs, &objp->kill_return))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->errNo))
+ return FALSE;
+ return TRUE;
+}
+ /* now wait_info() routine which returns results of polling the wait status
+ of a process/actor. It may return 0 if running, else pid or -1 */
+
+bool_t
+xdr_stop_code (XDR *xdrs, stop_code *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_enum (xdrs, (enum_t *) objp))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_wait_in (XDR *xdrs, wait_in *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_int (xdrs, &objp->pid))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_wait_out (XDR *xdrs, wait_out *objp)
+{
+ register int32_t *buf;
+
+
+ if (xdrs->x_op == XDR_ENCODE) {
+ buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_int (xdrs, &objp->wait_return))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->errNo))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->status))
+ return FALSE;
+
+ } else {
+ IXDR_PUT_LONG(buf, objp->wait_return);
+ IXDR_PUT_LONG(buf, objp->errNo);
+ IXDR_PUT_LONG(buf, objp->status);
+ }
+ if (!xdr_stop_code (xdrs, &objp->reason))
+ return FALSE;
+ buf = XDR_INLINE (xdrs, 5 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_int (xdrs, &objp->handle))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->PC))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->SP))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->FP))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->thread))
+ return FALSE;
+ } else {
+ IXDR_PUT_LONG(buf, objp->handle);
+ IXDR_PUT_U_LONG(buf, objp->PC);
+ IXDR_PUT_U_LONG(buf, objp->SP);
+ IXDR_PUT_U_LONG(buf, objp->FP);
+ IXDR_PUT_U_LONG(buf, objp->thread);
+ }
+ return TRUE;
+ } else if (xdrs->x_op == XDR_DECODE) {
+ buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_int (xdrs, &objp->wait_return))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->errNo))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->status))
+ return FALSE;
+
+ } else {
+ objp->wait_return = IXDR_GET_LONG(buf);
+ objp->errNo = IXDR_GET_LONG(buf);
+ objp->status = IXDR_GET_LONG(buf);
+ }
+ if (!xdr_stop_code (xdrs, &objp->reason))
+ return FALSE;
+ buf = XDR_INLINE (xdrs, 5 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_int (xdrs, &objp->handle))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->PC))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->SP))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->FP))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->thread))
+ return FALSE;
+ } else {
+ objp->handle = IXDR_GET_LONG(buf);
+ objp->PC = IXDR_GET_U_LONG(buf);
+ objp->SP = IXDR_GET_U_LONG(buf);
+ objp->FP = IXDR_GET_U_LONG(buf);
+ objp->thread = IXDR_GET_U_LONG(buf);
+ }
+ return TRUE;
+ }
+
+ if (!xdr_int (xdrs, &objp->wait_return))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->errNo))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->status))
+ return FALSE;
+ if (!xdr_stop_code (xdrs, &objp->reason))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->handle))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->PC))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->SP))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->FP))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->thread))
+ return FALSE;
+ return TRUE;
+}
+ /* now ptrace() routine. This matches the Sun UNIX ptrace as well as
+ some additions */
+
+bool_t
+xdr_ptrace_in (XDR *xdrs, ptrace_in *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_int (xdrs, &objp->pid))
+ return FALSE;
+ if (!xdr_ptrace_addr_data_in (xdrs, &objp->addr))
+ return FALSE;
+ if (!xdr_u_int (xdrs, &objp->data))
+ return FALSE;
+ if (!xdr_u_int (xdrs, &objp->flags))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_ptrace_out (XDR *xdrs, ptrace_out *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_ptrace_addr_data_out (xdrs, &objp->addr))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->result))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->errNo))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_one_symbol (XDR *xdrs, one_symbol *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_string (xdrs, &objp->symbolName, ~0))
+ return FALSE;
+ if (!xdr_long (xdrs, &objp->symbolValue))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_all_symbols (XDR *xdrs, all_symbols *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_array (xdrs, (char **)&objp->all_symbols_val, (u_int *) &objp->all_symbols_len, ~0,
+ sizeof (one_symbol), (xdrproc_t) xdr_one_symbol))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_get_global_symbols_out (XDR *xdrs, get_global_symbols_out *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_all_symbols (xdrs, &objp->symbols))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_get_text_data_in (XDR *xdrs, get_text_data_in *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_int (xdrs, &objp->pid))
+ return FALSE;
+ if (!xdr_string (xdrs, &objp->actorName, 16))
+ return FALSE;
+ return TRUE;
}
- /*
- * now send_signal() routine which sends signals to processes like kill(2)
- */
-
bool_t
-xdr_signal_in (XDR * xdrs, signal_in * objp)
+xdr_get_text_data_out (XDR *xdrs, get_text_data_out *objp)
{
- register int32_t *buf;
+ register int32_t *buf;
- if (!xdr_int (xdrs, &objp->pid))
- return FALSE;
- if (!xdr_int (xdrs, &objp->sig))
- return FALSE;
- return TRUE;
-}
-bool_t
-xdr_signal_out (XDR * xdrs, signal_out * objp)
-{
- register int32_t *buf;
+ if (xdrs->x_op == XDR_ENCODE) {
+ buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_int (xdrs, &objp->result))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->errNo))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->textStart))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->textSize))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->dataStart))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->dataSize))
+ return FALSE;
+ } else {
+ IXDR_PUT_LONG(buf, objp->result);
+ IXDR_PUT_LONG(buf, objp->errNo);
+ IXDR_PUT_U_LONG(buf, objp->textStart);
+ IXDR_PUT_U_LONG(buf, objp->textSize);
+ IXDR_PUT_U_LONG(buf, objp->dataStart);
+ IXDR_PUT_U_LONG(buf, objp->dataSize);
+ }
+ return TRUE;
+ } else if (xdrs->x_op == XDR_DECODE) {
+ buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL) {
+ if (!xdr_int (xdrs, &objp->result))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->errNo))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->textStart))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->textSize))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->dataStart))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->dataSize))
+ return FALSE;
+ } else {
+ objp->result = IXDR_GET_LONG(buf);
+ objp->errNo = IXDR_GET_LONG(buf);
+ objp->textStart = IXDR_GET_U_LONG(buf);
+ objp->textSize = IXDR_GET_U_LONG(buf);
+ objp->dataStart = IXDR_GET_U_LONG(buf);
+ objp->dataSize = IXDR_GET_U_LONG(buf);
+ }
+ return TRUE;
+ }
- if (!xdr_int (xdrs, &objp->kill_return))
- return FALSE;
- if (!xdr_int (xdrs, &objp->errNo))
- return FALSE;
- return TRUE;
+ if (!xdr_int (xdrs, &objp->result))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->errNo))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->textStart))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->textSize))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->dataStart))
+ return FALSE;
+ if (!xdr_u_long (xdrs, &objp->dataSize))
+ return FALSE;
+ return TRUE;
}
- /*
- * now wait_info() routine which returns results of polling the wait status
- * of a process/actor. It may return 0 if running, else pid or -1
- */
-
-bool_t
-xdr_stop_code (XDR * xdrs, stop_code * objp)
-{
- register int32_t *buf;
-
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_wait_in (XDR * xdrs, wait_in * objp)
-{
- register int32_t *buf;
-
- if (!xdr_int (xdrs, &objp->pid))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_wait_out (XDR * xdrs, wait_out * objp)
-{
- register int32_t *buf;
-
- if (xdrs->x_op == XDR_ENCODE) {
- buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_int (xdrs, &objp->wait_return))
- return FALSE;
- if (!xdr_int (xdrs, &objp->errNo))
- return FALSE;
- if (!xdr_int (xdrs, &objp->status))
- return FALSE;
-
- } else {
- IXDR_PUT_LONG (buf, objp->wait_return);
- IXDR_PUT_LONG (buf, objp->errNo);
- IXDR_PUT_LONG (buf, objp->status);
- }
- if (!xdr_stop_code (xdrs, &objp->reason))
- return FALSE;
- buf = XDR_INLINE (xdrs, 5 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_int (xdrs, &objp->handle))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->PC))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->SP))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->FP))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->thread))
- return FALSE;
- } else {
- IXDR_PUT_LONG (buf, objp->handle);
- IXDR_PUT_U_LONG (buf, objp->PC);
- IXDR_PUT_U_LONG (buf, objp->SP);
- IXDR_PUT_U_LONG (buf, objp->FP);
- IXDR_PUT_U_LONG (buf, objp->thread);
- }
- return TRUE;
- } else if (xdrs->x_op == XDR_DECODE) {
- buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_int (xdrs, &objp->wait_return))
- return FALSE;
- if (!xdr_int (xdrs, &objp->errNo))
- return FALSE;
- if (!xdr_int (xdrs, &objp->status))
- return FALSE;
-
- } else {
- objp->wait_return = IXDR_GET_LONG (buf);
- objp->errNo = IXDR_GET_LONG (buf);
- objp->status = IXDR_GET_LONG (buf);
- }
- if (!xdr_stop_code (xdrs, &objp->reason))
- return FALSE;
- buf = XDR_INLINE (xdrs, 5 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_int (xdrs, &objp->handle))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->PC))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->SP))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->FP))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->thread))
- return FALSE;
- } else {
- objp->handle = IXDR_GET_LONG (buf);
- objp->PC = IXDR_GET_U_LONG (buf);
- objp->SP = IXDR_GET_U_LONG (buf);
- objp->FP = IXDR_GET_U_LONG (buf);
- objp->thread = IXDR_GET_U_LONG (buf);
- }
- return TRUE;
- }
-
- if (!xdr_int (xdrs, &objp->wait_return))
- return FALSE;
- if (!xdr_int (xdrs, &objp->errNo))
- return FALSE;
- if (!xdr_int (xdrs, &objp->status))
- return FALSE;
- if (!xdr_stop_code (xdrs, &objp->reason))
- return FALSE;
- if (!xdr_int (xdrs, &objp->handle))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->PC))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->SP))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->FP))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->thread))
- return FALSE;
- return TRUE;
-}
-
- /*
- * now ptrace() routine. This matches the Sun UNIX ptrace as well as
- * some additions
- */
-
bool_t
-xdr_ptrace_in (XDR * xdrs, ptrace_in * objp)
+xdr_one_signal (XDR *xdrs, one_signal *objp)
{
- register int32_t *buf;
-
- if (!xdr_int (xdrs, &objp->pid))
- return FALSE;
- if (!xdr_ptrace_addr_data_in (xdrs, &objp->addr))
- return FALSE;
- if (!xdr_u_int (xdrs, &objp->data))
- return FALSE;
- if (!xdr_u_int (xdrs, &objp->flags))
- return FALSE;
- return TRUE;
-}
+ register int32_t *buf;
-bool_t
-xdr_ptrace_out (XDR * xdrs, ptrace_out * objp)
-{
- register int32_t *buf;
-
- if (!xdr_ptrace_addr_data_out (xdrs, &objp->addr))
- return FALSE;
- if (!xdr_int (xdrs, &objp->result))
- return FALSE;
- if (!xdr_int (xdrs, &objp->errNo))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_one_symbol (XDR * xdrs, one_symbol * objp)
-{
- register int32_t *buf;
-
- if (!xdr_string (xdrs, &objp->symbolName, ~0))
- return FALSE;
- if (!xdr_long (xdrs, &objp->symbolValue))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_all_symbols (XDR * xdrs, all_symbols * objp)
-{
- register int32_t *buf;
-
- if (!xdr_array
- (xdrs, (char **) &objp->all_symbols_val,
- (u_int *) & objp->all_symbols_len, ~0, sizeof (one_symbol),
- (xdrproc_t) xdr_one_symbol))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_get_global_symbols_out (XDR * xdrs, get_global_symbols_out * objp)
-{
- register int32_t *buf;
-
- if (!xdr_all_symbols (xdrs, &objp->symbols))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_get_text_data_in (XDR * xdrs, get_text_data_in * objp)
-{
- register int32_t *buf;
-
- if (!xdr_int (xdrs, &objp->pid))
- return FALSE;
- if (!xdr_string (xdrs, &objp->actorName, 16))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_get_text_data_out (XDR * xdrs, get_text_data_out * objp)
-{
- register int32_t *buf;
-
- if (xdrs->x_op == XDR_ENCODE) {
- buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_int (xdrs, &objp->result))
- return FALSE;
- if (!xdr_int (xdrs, &objp->errNo))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->textStart))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->textSize))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->dataStart))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->dataSize))
- return FALSE;
- } else {
- IXDR_PUT_LONG (buf, objp->result);
- IXDR_PUT_LONG (buf, objp->errNo);
- IXDR_PUT_U_LONG (buf, objp->textStart);
- IXDR_PUT_U_LONG (buf, objp->textSize);
- IXDR_PUT_U_LONG (buf, objp->dataStart);
- IXDR_PUT_U_LONG (buf, objp->dataSize);
- }
- return TRUE;
- } else if (xdrs->x_op == XDR_DECODE) {
- buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_int (xdrs, &objp->result))
- return FALSE;
- if (!xdr_int (xdrs, &objp->errNo))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->textStart))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->textSize))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->dataStart))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->dataSize))
- return FALSE;
- } else {
- objp->result = IXDR_GET_LONG (buf);
- objp->errNo = IXDR_GET_LONG (buf);
- objp->textStart = IXDR_GET_U_LONG (buf);
- objp->textSize = IXDR_GET_U_LONG (buf);
- objp->dataStart = IXDR_GET_U_LONG (buf);
- objp->dataSize = IXDR_GET_U_LONG (buf);
- }
- return TRUE;
- }
-
- if (!xdr_int (xdrs, &objp->result))
- return FALSE;
- if (!xdr_int (xdrs, &objp->errNo))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->textStart))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->textSize))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->dataStart))
- return FALSE;
- if (!xdr_u_long (xdrs, &objp->dataSize))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_one_signal (XDR * xdrs, one_signal * objp)
-{
- register int32_t *buf;
-
- if (!xdr_u_int (xdrs, &objp->number))
- return FALSE;
- if (!xdr_string (xdrs, &objp->name, ~0))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_all_signals (XDR * xdrs, all_signals * objp)
-{
- register int32_t *buf;
-
- if (!xdr_array
- (xdrs, (char **) &objp->all_signals_val,
- (u_int *) & objp->all_signals_len, ~0, sizeof (one_signal),
- (xdrproc_t) xdr_one_signal))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_get_signal_names_out (XDR * xdrs, get_signal_names_out * objp)
-{
- register int32_t *buf;
-
- if (!xdr_all_signals (xdrs, &objp->signals))
- return FALSE;
- return TRUE;
-}
-
- /*
- * now define the actual calls we support
- */
+ if (!xdr_u_int (xdrs, &objp->number))
+ return FALSE;
+ if (!xdr_string (xdrs, &objp->name, ~0))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_all_signals (XDR *xdrs, all_signals *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_array (xdrs, (char **)&objp->all_signals_val, (u_int *) &objp->all_signals_len, ~0,
+ sizeof (one_signal), (xdrproc_t) xdr_one_signal))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_get_signal_names_out (XDR *xdrs, get_signal_names_out *objp)
+{
+ register int32_t *buf;
+
+ if (!xdr_all_signals (xdrs, &objp->signals))
+ return FALSE;
+ return TRUE;
+}
+ /* now define the actual calls we support */
diff --git a/c/src/librdbg/src/powerpc/new_exception_processing/remdeb.h b/c/src/librdbg/src/powerpc/new_exception_processing/remdeb.h
index 07f50eed15..00260d8ac1 100644
--- a/c/src/librdbg/src/powerpc/new_exception_processing/remdeb.h
+++ b/c/src/librdbg/src/powerpc/new_exception_processing/remdeb.h
@@ -16,7 +16,7 @@ extern "C" {
#define RTEMS_PORT 2071
#define RTEMS_BACK_PORT 2073
#ifndef REMDEB_H
-#define RPCGENSRVNAME(a) a
+#define RPCGENSRVNAME(a) a
enum rpc_type {
SUNRPC = 0,
@@ -99,62 +99,62 @@ struct xdr_regs {
typedef struct xdr_regs xdr_regs;
/* now define register macros to apply to xdr_regs struct */
-#define R_PC 0
-#define R_MSR 1
-#define R_EXCEPNB 2
-#define R_R0 3
-#define R_R1 (R_R0 + 1)
-#define R_R2 (R_R0 + 2)
-#define R_R3 (R_R0 + 3)
-#define R_R4 (R_R0 + 4)
-#define R_R5 (R_R0 + 5)
-#define R_R6 (R_R0 + 6)
-#define R_R7 (R_R0 + 7)
-#define R_R8 (R_R0 + 8)
-#define R_R9 (R_R0 + 9)
-#define R_R10 (R_R0 + 10)
-#define R_R11 (R_R0 + 11)
-#define R_R12 (R_R0 + 12)
-#define R_R13 (R_R0 + 13)
-#define R_R14 (R_R0 + 14)
-#define R_R15 (R_R0 + 15)
-#define R_R16 (R_R0 + 16)
-#define R_R17 (R_R0 + 17)
-#define R_R18 (R_R0 + 18)
-#define R_R19 (R_R0 + 19)
-#define R_R20 (R_R0 + 20)
-#define R_R21 (R_R0 + 21)
-#define R_R22 (R_R0 + 22)
-#define R_R23 (R_R0 + 23)
-#define R_R24 (R_R0 + 24)
-#define R_R25 (R_R0 + 25)
-#define R_R26 (R_R0 + 26)
-#define R_R27 (R_R0 + 27)
-#define R_R28 (R_R0 + 28)
-#define R_R29 (R_R0 + 29)
-#define R_R30 (R_R0 + 30)
-#define R_R31 (R_R0 + 31)
-#define R_CR 35
-#define R_CTR 36
-#define R_XER 37
-#define R_LR 38
-#define R_MQ 39
+#define R_PC 0
+#define R_MSR 1
+#define R_EXCEPNB 2
+#define R_R0 3
+#define R_R1 (R_R0 + 1)
+#define R_R2 (R_R0 + 2)
+#define R_R3 (R_R0 + 3)
+#define R_R4 (R_R0 + 4)
+#define R_R5 (R_R0 + 5)
+#define R_R6 (R_R0 + 6)
+#define R_R7 (R_R0 + 7)
+#define R_R8 (R_R0 + 8)
+#define R_R9 (R_R0 + 9)
+#define R_R10 (R_R0 + 10)
+#define R_R11 (R_R0 + 11)
+#define R_R12 (R_R0 + 12)
+#define R_R13 (R_R0 + 13)
+#define R_R14 (R_R0 + 14)
+#define R_R15 (R_R0 + 15)
+#define R_R16 (R_R0 + 16)
+#define R_R17 (R_R0 + 17)
+#define R_R18 (R_R0 + 18)
+#define R_R19 (R_R0 + 19)
+#define R_R20 (R_R0 + 20)
+#define R_R21 (R_R0 + 21)
+#define R_R22 (R_R0 + 22)
+#define R_R23 (R_R0 + 23)
+#define R_R24 (R_R0 + 24)
+#define R_R25 (R_R0 + 25)
+#define R_R26 (R_R0 + 26)
+#define R_R27 (R_R0 + 27)
+#define R_R28 (R_R0 + 28)
+#define R_R29 (R_R0 + 29)
+#define R_R30 (R_R0 + 30)
+#define R_R31 (R_R0 + 31)
+#define R_CR 35
+#define R_CTR 36
+#define R_XER 37
+#define R_LR 38
+#define R_MQ 39
#include <libcpu/raw_exception.h>
-#define REG_PC tabreg[R_PC] /* PC register offset */
-#define REG_SP tabreg[R_R1] /* SP register offset */
-#define REG_FP tabreg[R_R1] /* SP register offset (no FP on PPC) */
-#define BREAK_SIZE 4 /* Breakpoint occupies 4 bytes */
-#define BREAK_ADJ 0 /* Nothing to subtract from address after bp */
-#define IS_BREAK(l) ((l) == 0x7d8d6808)
-#define SET_BREAK(l) (0x7d8d6808)
+#define REG_PC tabreg[R_PC] /* PC register offset */
+#define REG_SP tabreg[R_R1] /* SP register offset */
+#define REG_FP tabreg[R_R1] /* SP register offset (no FP on PPC) */
+#define BREAK_SIZE 4 /* Breakpoint occupies 4 bytes */
+#define BREAK_ADJ 0 /* Nothing to subtract from address after bp */
+#define IS_BREAK(l) ((l) == 0x7d8d6808)
+#define SET_BREAK(l) (0x7d8d6808)
#define ORG_BREAK(c,p) (p)
-#define IS_STEP(regs) (regs.tabreg[R_EXCEPNB] == ASM_TRACE_VECTOR) /* Was step and not break */
-#define TARGET_PROC_TYPE 3
+#define IS_STEP(regs) (regs.tabreg[R_EXCEPNB] == ASM_TRACE_VECTOR) /* Was step and not break */
+#define TARGET_PROC_TYPE 3
#define MAXDEBUGGEE 150
#define NAMEMAX 17
- /*
+ /*
* Memory data for read/write text or data. The size is in data. The target
* addr is in the addr field.
* Be careful before modifying because this value goes into internal
@@ -252,7 +252,7 @@ typedef struct {
} CHAR_DATA;
typedef char *one_arg;
- /* now open_connex() routine which establishes a connection to server */
+ /* now open_connex() routine which establishes a connection to server */
enum debug_type {
DEBTYP_PROCESS = 0,
@@ -261,7 +261,7 @@ enum debug_type {
DEBTYP_OTHER = 3,
};
typedef enum debug_type debug_type;
-#define DEBUGGER_IS_GDB 0x2 /* */
+#define DEBUGGER_IS_GDB 0x2 /* */
struct open_in {
u_char back_port[16];
@@ -281,7 +281,7 @@ struct open_out {
u_short server_vers;
};
typedef struct open_out open_out;
- /* now close_connex() routine which detaches from server */
+ /* now close_connex() routine which detaches from server */
enum close_control {
CLOSE_IGNORE = 0,
@@ -294,7 +294,7 @@ struct close_in {
close_control control;
};
typedef struct close_in close_in;
- /* now send_signal() routine which sends signals to processes like kill(2) */
+ /* now send_signal() routine which sends signals to processes like kill(2) */
struct signal_in {
int pid;
@@ -307,7 +307,7 @@ struct signal_out {
int errNo;
};
typedef struct signal_out signal_out;
- /* now wait_info() routine which returns results of polling the wait status
+ /* now wait_info() routine which returns results of polling the wait status
of a process/actor. It may return 0 if running, else pid or -1 */
enum stop_code {
@@ -342,8 +342,8 @@ struct wait_out {
u_long thread;
};
typedef struct wait_out wait_out;
- /* now ptrace() routine. This matches the Sun UNIX ptrace as well as
- some additions */
+ /* now ptrace() routine. This matches the Sun UNIX ptrace as well as
+ some additions */
#define PTRFLG_FORCE 1
#define PTRFLG_NON_OWNER 2
#define PTRFLG_FREE 4
@@ -411,7 +411,7 @@ struct get_signal_names_out {
all_signals signals;
};
typedef struct get_signal_names_out get_signal_names_out;
- /* now define the actual calls we support */
+ /* now define the actual calls we support */
#define REMDEB_H
#endif
diff --git a/c/src/librdbg/src/powerpc/new_exception_processing/remdeb_svc.c b/c/src/librdbg/src/powerpc/new_exception_processing/remdeb_svc.c
index 88c15cc708..e69de29bb2 100644
--- a/c/src/librdbg/src/powerpc/new_exception_processing/remdeb_svc.c
+++ b/c/src/librdbg/src/powerpc/new_exception_processing/remdeb_svc.c
@@ -1,120 +0,0 @@
-#include <rpc/types.h>
-#include <rpc/rpc.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <bsp.h>
-#include <rdbg/servrpc.h>
-#include <rdbg/remdeb.h>
-#define printf(c)
-/*HEADER_START*/
-#define RTEMS_PORT 2071
-#define RTEMS_BACK_PORT 2073
-/*
- * Sun request values for the remote ptrace system call
- */
-
- /*
- * Memory data for read/write text or data. The size is in data. The target
- * addr is in the addr field.
- * Be careful before modifying because this value goes into internal
- * pipes and is allocated on stack too. Pipes and/or the stack could
- * become too small if this value gets incremented.
- */
- /* now open_connex() routine which establishes a connection to server */
-#define DEBUGGER_IS_GDB 0x2 /* */
- /* now close_connex() routine which detaches from server */
- /* now send_signal() routine which sends signals to processes like kill(2) */
- /* now wait_info() routine which returns results of polling the wait status
- of a process/actor. It may return 0 if running, else pid or -1 */
- /* now ptrace() routine. This matches the Sun UNIX ptrace as well as
- some additions */
- /* now define the actual calls we support */
-const char* names [] = {
- "NULLPROC", "OPEN_CONNEX", "SEND_SIGNAL", "name3",
- "name4", "name5", "name6", "name7",
- "name8", "name9", "CLOSE_CONNEX", "PTRACE",
- "name12", "WAIT_INFO", "name14", "name15",
- "name16", "GET_SIGNAL_NAMES", "name18"
-};
-
-void
-remotedeb_2(struct svc_req *rqstp, register SVCXPRT *transp)
-{
- union {
- open_in open_connex_2_arg;
- signal_in send_signal_2_arg;
- close_in close_connex_2_arg;
- ptrace_in ptrace_2_arg;
- wait_in wait_info_2_arg;
- } argument;
- char *result;
- xdrproc_t _xdr_argument, _xdr_result;
- char *(*local)(char *, struct svc_req *);
-
- DPRINTF (("remotedeb_2: %s (%d)\n",
- (unsigned) rqstp->rq_proc <
- (unsigned) (sizeof names / sizeof names[0]) ?
- names [rqstp->rq_proc] : "???",
- (int) rqstp->rq_proc));
-
- switch (rqstp->rq_proc) {
- case NULLPROC:
- (void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL);
- return;
-
- case OPEN_CONNEX:
- _xdr_argument = (xdrproc_t) xdr_open_in;
- _xdr_result = (xdrproc_t) xdr_open_out;
- local = (char *(*)(char *, struct svc_req *)) open_connex_2_svc;
- break;
-
- case SEND_SIGNAL:
- _xdr_argument = (xdrproc_t) xdr_signal_in;
- _xdr_result = (xdrproc_t) xdr_signal_out;
- local = (char *(*)(char *, struct svc_req *)) send_signal_2_svc;
- break;
-
- case CLOSE_CONNEX:
- _xdr_argument = (xdrproc_t) xdr_close_in;
- _xdr_result = (xdrproc_t) xdr_void;
- local = (char *(*)(char *, struct svc_req *)) close_connex_2_svc;
- break;
-
- case PTRACE:
- _xdr_argument = (xdrproc_t) xdr_ptrace_in;
- _xdr_result = (xdrproc_t) xdr_ptrace_out;
- local = (char *(*)(char *, struct svc_req *)) ptrace_2_svc;
- break;
-
- case WAIT_INFO:
- _xdr_argument = (xdrproc_t) xdr_wait_in;
- _xdr_result = (xdrproc_t) xdr_wait_out;
- local = (char *(*)(char *, struct svc_req *)) wait_info_2_svc;
- break;
-
- case GET_SIGNAL_NAMES:
- _xdr_argument = (xdrproc_t) xdr_void;
- _xdr_result = (xdrproc_t) xdr_get_signal_names_out;
- local = (char *(*)(char *, struct svc_req *)) get_signal_names_2_svc;
- break;
-
- default:
- svcerr_noproc (transp);
- return;
- }
- memset ((char *)&argument, 0, sizeof (argument));
- if (!svc_getargs (transp, _xdr_argument, (caddr_t) &argument)) {
- svcerr_decode (transp);
- return;
- }
- result = (*local)((char *)&argument, rqstp);
- if (result != NULL && !svc_sendreply(transp, _xdr_result, result)) {
- svcerr_systemerr (transp);
- }
- if (!svc_freeargs (transp, _xdr_argument, (caddr_t) &argument)) {
- printf( "unable to free arguments");
- exit (1);
- }
- return;
-}
diff --git a/c/src/librdbg/src/powerpc/new_exception_processing/remdeb_xdr.c b/c/src/librdbg/src/powerpc/new_exception_processing/remdeb_xdr.c
index defadeca19..faa4989c29 100644
--- a/c/src/librdbg/src/powerpc/new_exception_processing/remdeb_xdr.c
+++ b/c/src/librdbg/src/powerpc/new_exception_processing/remdeb_xdr.c
@@ -97,7 +97,7 @@ xdr_xdr_regs (XDR *xdrs, xdr_regs *objp)
return FALSE;
return TRUE;
}
- /*
+ /*
* Memory data for read/write text or data. The size is in data. The target
* addr is in the addr field.
* Be careful before modifying because this value goes into internal
@@ -105,16 +105,16 @@ xdr_xdr_regs (XDR *xdrs, xdr_regs *objp)
* become too small if this value gets incremented.
*/
bool_t xdr_xdr_mem(xdrs, objp)
- XDR *xdrs;
- struct xdr_mem *objp;
+ XDR *xdrs;
+ struct xdr_mem *objp;
{
- if (!xdr_u_long(xdrs, &objp->addr)) {
- return (FALSE);
- }
- if (!xdr_u_int(xdrs, &objp->dataNb)) {
- return(FALSE);
- }
- return (xdr_opaque(xdrs, objp->data, objp->dataNb));
+ if (!xdr_u_long(xdrs, &objp->addr)) {
+ return (FALSE);
+ }
+ if (!xdr_u_int(xdrs, &objp->dataNb)) {
+ return(FALSE);
+ }
+ return (xdr_opaque(xdrs, objp->data, objp->dataNb));
}
bool_t
@@ -262,11 +262,11 @@ xdr_KernThread (XDR *xdrs, KernThread *objp)
return TRUE;
}
bool_t xdr_thread_list(xdrs, objp)
- XDR *xdrs;
- struct thread_list *objp;
+ XDR *xdrs;
+ struct thread_list *objp;
{
- return (xdr_array(xdrs, (char**)&objp->threads, &objp->nbThread,
- UTHREAD_MAX, sizeof(KernThread), xdr_KernThread));
+ return (xdr_array(xdrs, (char**)&objp->threads, &objp->nbThread,
+ UTHREAD_MAX, sizeof(KernThread), xdr_KernThread));
}
bool_t
@@ -396,7 +396,7 @@ xdr_one_arg (XDR *xdrs, one_arg *objp)
return FALSE;
return TRUE;
}
- /* now open_connex() routine which establishes a connection to server */
+ /* now open_connex() routine which establishes a connection to server */
bool_t
xdr_debug_type (XDR *xdrs, debug_type *objp)
@@ -407,7 +407,7 @@ xdr_debug_type (XDR *xdrs, debug_type *objp)
return FALSE;
return TRUE;
}
-#define DEBUGGER_IS_GDB 0x2 /* */
+#define DEBUGGER_IS_GDB 0x2 /* */
bool_t
xdr_open_in (XDR *xdrs, open_in *objp)
@@ -514,7 +514,7 @@ xdr_open_out (XDR *xdrs, open_out *objp)
return FALSE;
return TRUE;
}
- /* now close_connex() routine which detaches from server */
+ /* now close_connex() routine which detaches from server */
bool_t
xdr_close_control (XDR *xdrs, close_control *objp)
@@ -535,7 +535,7 @@ xdr_close_in (XDR *xdrs, close_in *objp)
return FALSE;
return TRUE;
}
- /* now send_signal() routine which sends signals to processes like kill(2) */
+ /* now send_signal() routine which sends signals to processes like kill(2) */
bool_t
xdr_signal_in (XDR *xdrs, signal_in *objp)
@@ -560,7 +560,7 @@ xdr_signal_out (XDR *xdrs, signal_out *objp)
return FALSE;
return TRUE;
}
- /* now wait_info() routine which returns results of polling the wait status
+ /* now wait_info() routine which returns results of polling the wait status
of a process/actor. It may return 0 if running, else pid or -1 */
bool_t
@@ -685,8 +685,8 @@ xdr_wait_out (XDR *xdrs, wait_out *objp)
return FALSE;
return TRUE;
}
- /* now ptrace() routine. This matches the Sun UNIX ptrace as well as
- some additions */
+ /* now ptrace() routine. This matches the Sun UNIX ptrace as well as
+ some additions */
bool_t
xdr_ptrace_in (XDR *xdrs, ptrace_in *objp)
@@ -866,4 +866,4 @@ xdr_get_signal_names_out (XDR *xdrs, get_signal_names_out *objp)
return FALSE;
return TRUE;
}
- /* now define the actual calls we support */
+ /* now define the actual calls we support */