home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / gdb-4.9 / gdb / vx-share / xdr_ld.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-12  |  2.0 KB  |  85 lines

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