aboutsummaryrefslogtreecommitdiff
path: root/gdb/vx-share/xdr_rdb.c
blob: 0520f7f6e7a78b3bcf2fbe8b7c28fe27b04dc782 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
/* xdr_rdb.c  - xdr routines for Remote Debug interface to VxWorks  */

/* Copyright 1992 Free Software Foundation, Inc.

   This code was donated by Wind River Systems, Inc. */

/*
modification history
--------------------
01a,21mar90,llk  created using modification 01d of xdr_dbx.c.
*/

/*
DESCRIPTION
This module contains the eXternal Data Representation (XDR) routines
for the RDB interface for VxWorks.
*/

#include "defs.h"
#include "vxWorks.h"
#include <rpc/rpc.h>
#include "xdr_rdb.h"

/* forward declarations */

bool_t
xdr_arg_type(xdrs, objp)
        XDR *xdrs;
        arg_type *objp;
{
        if (!xdr_enum(xdrs, (enum_t *)objp)) {
                return (FALSE);
        }
        return (TRUE);
}

bool_t
xdr_arg_value(xdrs, objp)
        XDR *xdrs;
        arg_value *objp;
{
        if (!xdr_arg_type(xdrs, &objp->type)) {
                return (FALSE);
        }
        switch (objp->type) {
        case T_BYTE:
                if (!xdr_char(xdrs, &objp->arg_value_u.v_byte)) {
                        return (FALSE);
                }
                break;
        case T_WORD:
                if (!xdr_short(xdrs, &objp->arg_value_u.v_word)) {
                        return (FALSE);
                }
                break;
        case T_INT:
                if (!xdr_int(xdrs, &objp->arg_value_u.v_int)) {
                        return (FALSE);
                }
                break;
        case T_FLOAT:
                if (!xdr_float(xdrs, &objp->arg_value_u.v_fp)) {
                        return (FALSE);
                }
                break;
        case T_DOUBLE:
                if (!xdr_double(xdrs, &objp->arg_value_u.v_dp)) {
                        return (FALSE);
                }
                break;
        case T_UNKNOWN:
                break;
        }
        return (TRUE);
}

bool_t
xdr_func_call(xdrs, objp)
        XDR *xdrs;
        func_call *objp;
{
        if (!xdr_int(xdrs, &objp->func_addr)) {
                return (FALSE);
        }
        if (!xdr_array(xdrs, (char **)&objp->args.args_val, (u_int *)&objp->args.args_len, MAX_FUNC_ARGS, sizeof(arg_value), xdr_arg_value)) {
                return (FALSE);
        }
        return (TRUE);
}

bool_t
xdr_arg_one(xdrs, objp)
        XDR *xdrs;
        arg_one *objp;
{
        if (!xdr_string(xdrs, objp, MAX_ARG_LEN)) {
                return (FALSE);
        }
        return (TRUE);
}




bool_t
xdr_arg_array(xdrs, objp)
        XDR *xdrs;
        arg_array *objp;
{
        if (!xdr_array(xdrs, (char **)&objp->arg_array_val, (u_int *)&objp->arg_array_len, MAX_ARG_CNT, sizeof(arg_one), xdr_arg_one)) {
                return (FALSE);
        }
        return (TRUE);
}

/*********************************************************************
*
* xdr_EVENT_TYPE -
*
*/

bool_t xdr_EVENT_TYPE(xdrs, objp)
    XDR *xdrs;
    EVENT_TYPE *objp;

    {
    if (!xdr_enum (xdrs, (enum_t *) objp))
	return (FALSE);
    return (TRUE);
    }

/*********************************************************************
*
* xdr_RDB_EVENT -
*
*/

bool_t xdr_RDB_EVENT (xdrs, objp)
    XDR *xdrs;
    RDB_EVENT *objp;

    {
    if (!xdr_int (xdrs, &objp->status))
	return (FALSE);
    if (!xdr_int (xdrs, &objp->taskId))
	return (FALSE);
    if (!xdr_EVENT_TYPE (xdrs, &objp->eventType))
	return (FALSE);
    if (!xdr_int (xdrs, &objp->sigType))
	return (FALSE);
    return (TRUE);
    }        

/*********************************************************************
*
* xdr_TASK_START -
*
*/

bool_t
xdr_TASK_START (xdrs, objp)
    XDR *xdrs;
    TASK_START *objp;

    {
    if (!xdr_int (xdrs, &objp->status))
	return (FALSE);
    if (!xdr_int (xdrs, &objp->pid))
	return (FALSE);
    return (TRUE);
    }


/*********************************************************************
*
* xdr_SYMBOL_ADDR -
*
*/

bool_t
xdr_SYMBOL_ADDR (xdrs, objp)
    XDR *xdrs;
    SYMBOL_ADDR *objp;

    {
    if (!xdr_int (xdrs, &objp->status))
	return (FALSE);
    if (!xdr_u_int (xdrs, &objp->addr))
	return (FALSE);
    return (TRUE);
    }

/*********************************************************************
*
* xdr_SOURCE_STEP -
*
*/

bool_t
xdr_SOURCE_STEP (xdrs, objp)
    XDR *xdrs;
    SOURCE_STEP *objp;

    {
    if (!xdr_int (xdrs, &objp->taskId))
	return (FALSE);
    if (!xdr_u_int (xdrs, &objp->startAddr))
	return (FALSE);
    if (!xdr_u_int (xdrs, &objp->endAddr))
	return (FALSE);
    return (TRUE);
    }