summaryrefslogtreecommitdiffstats
path: root/gdb/vx-share/xdr_ld.c
blob: f849505969dd593fb8d5d6efbb78554d189aec39 (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
/* xdr_ld.c  - xdr routines for remote dbx interface to VxWorks  */

/*  Copyright 1984, 1985, 1986, 1987, 1988, 1989, 1992 Free Software Foundation, Inc.

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

/*
modification history
--------------------
01a,05jun90,llk  extracted from xdr_dbx.c.
*/

/*
DESCRIPTION
This module contains the eXternal Data Representation (XDR) routines
for object files that are downloaded to VxWorks.  They are used by
remote debuggers that use RPC (such as dbxWorks and vxGdb).
*/

#include "defs.h"
#include "vxWorks.h"
#include "rpc/rpc.h"
#include "xdr_ld.h"

/* forward declarations */

bool_t xdr_String();   	/* xdr routine for argument list */


/*******************************************************************************
*
* xdr_String - xdr routine for strings.
* 
* Used by xdr_arg_info to handle the actual argument
* strings.  normally calls xdr_string - but does something 
* reasonable encode of null pointer.
*/

bool_t xdr_String (xdrs, strp)
    XDR	*xdrs;
    char **strp;

    {
    if ((*strp == NULL) & (xdrs->x_op == XDR_ENCODE)) 
	return(FALSE);
    else 
	return(xdr_string(xdrs, strp, MAXSTRLEN));
    }
/*******************************************************************************
*
* xdr_ldfile - xdr routine for a single element in the load table 
*/

bool_t xdr_ldfile (xdrs, objp)
    XDR *xdrs;
    ldfile *objp;

    {
    if (! xdr_String(xdrs, &objp->name)) 
	return(FALSE);
    if (! xdr_int(xdrs, &objp->txt_addr)) 
	return(FALSE);
    if (! xdr_int(xdrs, &objp->data_addr)) 
	return(FALSE);
    if (! xdr_int(xdrs, &objp->bss_addr)) 
	return(FALSE);

    return(TRUE);
    }
/*******************************************************************************
*
* xdr_ldtabl -
*
* xdr routine for a list of files and load addresses loaded into VxWorks.
*/

bool_t xdr_ldtabl (xdrs,objp)
    XDR *xdrs;
    ldtabl *objp;

    {
    return (xdr_array (xdrs, (char *) &objp->tbl_ent, (UINT *) &objp->tbl_size, 
	    MAXTBLSZ, sizeof(ldfile), xdr_ldfile));
    }
OpenPOWER on IntegriCloud