Commit | Line | Data |
---|---|---|
dd3b648e RP |
1 | /* xdr_ld.c - xdr routines for remote dbx interface to VxWorks */ |
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 | 01a,05jun90,llk extracted from xdr_dbx.c. | |
10 | */ | |
11 | ||
12 | /* | |
13 | DESCRIPTION | |
14 | This module contains the eXternal Data Representation (XDR) routines | |
15 | for object files that are downloaded to VxWorks. They are used by | |
16 | remote debuggers that use RPC (such as dbxWorks and vxGdb). | |
17 | */ | |
18 | ||
19 | #include "vxWorks.h" | |
20 | #include "rpc/rpc.h" | |
21 | #include "xdr_ld.h" | |
22 | ||
23 | /* forward declarations */ | |
24 | ||
25 | bool_t xdr_String(); /* xdr routine for argument list */ | |
26 | ||
27 | ||
28 | /******************************************************************************* | |
29 | * | |
30 | * xdr_String - xdr routine for strings. | |
31 | * | |
32 | * Used by xdr_arg_info to handle the actual argument | |
33 | * strings. normally calls xdr_string - but does something | |
34 | * reasonable encode of null pointer. | |
35 | */ | |
36 | ||
37 | bool_t xdr_String (xdrs, strp) | |
38 | XDR *xdrs; | |
39 | char **strp; | |
40 | ||
41 | { | |
42 | if ((*strp == NULL) & (xdrs->x_op == XDR_ENCODE)) | |
43 | return(FALSE); | |
44 | else | |
45 | return(xdr_string(xdrs, strp, MAXSTRLEN)); | |
46 | } | |
47 | /******************************************************************************* | |
48 | * | |
49 | * xdr_ldfile - xdr routine for a single element in the load table | |
50 | */ | |
51 | ||
52 | bool_t xdr_ldfile (xdrs, objp) | |
53 | XDR *xdrs; | |
54 | ldfile *objp; | |
55 | ||
56 | { | |
57 | if (! xdr_String(xdrs, &objp->name)) | |
58 | return(FALSE); | |
59 | if (! xdr_int(xdrs, &objp->txt_addr)) | |
60 | return(FALSE); | |
61 | if (! xdr_int(xdrs, &objp->data_addr)) | |
62 | return(FALSE); | |
63 | if (! xdr_int(xdrs, &objp->bss_addr)) | |
64 | return(FALSE); | |
65 | ||
66 | return(TRUE); | |
67 | } | |
68 | /******************************************************************************* | |
69 | * | |
70 | * xdr_ldtabl - | |
71 | * | |
72 | * xdr routine for a list of files and load addresses loaded into VxWorks. | |
73 | */ | |
74 | ||
75 | bool_t xdr_ldtabl (xdrs,objp) | |
76 | XDR *xdrs; | |
77 | ldtabl *objp; | |
78 | ||
79 | { | |
80 | return (xdr_array (xdrs, (char *) &objp->tbl_ent, (UINT *) &objp->tbl_size, | |
81 | MAXTBLSZ, sizeof(ldfile), xdr_ldfile)); | |
82 | } |