* inftarg.c (child_create_inferior, child_attach,
[deliverable/binutils-gdb.git] / gdb / vx-share / xdr_ptrace.c
1 /* xdr_ptrace.c - xdr routines for remote ptrace calls */
2
3 /* Copyright 1984,1985,1986,1987,1988,1989 Wind River Systems, Inc. */
4 /* extern char copyright_wind_river[]; static char *copyright=copyright_wind_river;*/
5
6 /*
7 modification history
8 --------------------
9 01b,25may91,maf now uses counted bytes struct to transfer registers.
10 removed xdr_regs_ptr (), xdr_fp_status_ptr (), and
11 xdr_fpa_regs_ptr ().
12 01a,05jun90,llk extracted from xdr_ptrace.h, version 01c.
13 */
14
15 #include "vxWorks.h"
16 #include <rpc/rpc.h>
17 #include "xdr_ptrace.h"
18
19 #define MAX_LEN 32000
20
21 /********************************************************************
22 *
23 * xdr_c_bytes -
24 *
25 * xdr routine for counted bytes
26 *
27 */
28 bool_t xdr_c_bytes(xdrs,objp)
29 XDR *xdrs;
30 C_bytes *objp;
31 {
32 return(xdr_bytes(xdrs, &objp->bytes, (u_int *) &objp->len, MAX_LEN));
33 } /* xdr_c_bytes */
34
35 /********************************************************************
36 *
37 * xdr_c_bytes_ptr -
38 *
39 * xdr routine for counted bytes branch of ptrace_info
40 *
41 */
42
43 LOCAL bool_t xdr_c_bytes_ptr(xdrs,objp)
44 XDR *xdrs;
45 C_bytes **objp;
46 {
47 return(xdr_pointer(xdrs, (char **) objp, sizeof(C_bytes), xdr_c_bytes));
48 } /* xdr_c_bytes_ptr */
49
50 /********************************************************************
51 *
52 * xdr_ptrace_info -
53 *
54 * xdr routine for discriminated union ptrace_info
55 *
56 */
57
58 bool_t xdr_ptrace_info(xdrs,objp)
59 XDR *xdrs;
60 Ptrace_info *objp;
61 {
62 static struct xdr_discrim choices[] =
63 {
64 { (int) DATA, xdr_c_bytes_ptr },
65 { __dontcare__, NULL }
66 };
67
68 return(xdr_union(xdrs, (enum_t *) &objp->ttype,
69 (char *) &objp->more_data, choices, xdr_void));
70 } /* xdr_ptrace_info */
71
72 /********************************************************************
73 *
74 * xdr_rptrace -
75 *
76 * xdr routine for remote ptrace data into server
77 *
78 */
79
80 bool_t xdr_rptrace(xdrs,objp)
81 XDR *xdrs;
82 Rptrace *objp;
83 {
84 if (! xdr_int(xdrs, &objp->pid))
85 return(FALSE);
86 if (! xdr_int(xdrs, &objp->data))
87 return(FALSE);
88 if (! xdr_int(xdrs, &objp->addr))
89 return(FALSE);
90 if (! xdr_ptrace_info(xdrs, &objp->info))
91 return(FALSE);
92
93 return(TRUE);
94 } /* xdr_rptrace */
95
96 /********************************************************************
97 *
98 * xdr_ptrace_return -
99 *
100 * xdr routine for remote ptrace data returned by server
101 *
102 */
103
104 bool_t xdr_ptrace_return(xdrs, objp)
105 XDR *xdrs;
106 Ptrace_return *objp;
107 {
108 if (! xdr_int(xdrs, &objp->status))
109 return(FALSE);
110 if (! xdr_int(xdrs, &objp->errno))
111 return(FALSE);
112 if (! xdr_ptrace_info(xdrs, &objp->info))
113 return(FALSE);
114
115 return(TRUE);
116 } /* xdr_ptrace_return */
This page took 0.031725 seconds and 4 git commands to generate.