home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1287 / gdb-x386.01
Encoding:
Text File  |  1990-12-28  |  38.5 KB  |  1,366 lines

  1. *** dist-gdb/Makefile.dist    Wed Jan 31 03:42:57 1990
  2. --- ./Makefile.dist    Tue May  8 12:33:40 1990
  3. ***************
  4. *** 19,24 ****
  5.    will be incorrectly compiled.  The "fixincludes" script in the gcc
  6.    distribution will fix your include files up. */
  7. ! /* CC=gcc -traditional */
  8. ! CC=cc
  9.   
  10.   /* It is also possible that you will need to add -I/usr/include/sys to the
  11. --- 19,24 ----
  12.    will be incorrectly compiled.  The "fixincludes" script in the gcc
  13.    distribution will fix your include files up. */
  14. ! CC=gcc -traditional
  15. ! /* CC=cc */
  16.   
  17.   /* It is also possible that you will need to add -I/usr/include/sys to the
  18. ***************
  19. *** 26,31 ****
  20.    is where it should be according to Posix).  */
  21.   
  22. ! YACC=bison -y -v
  23. ! /* YACC=yacc */
  24.   SHELL=/bin/sh
  25.   MAKE=make
  26. --- 26,31 ----
  27.    is where it should be according to Posix).  */
  28.   
  29. ! /* YACC=bison -y -v */
  30. ! YACC=yacc
  31.   SHELL=/bin/sh
  32.   MAKE=make
  33. ***************
  34. *** 43,51 ****
  35.   /* M_CFLAGS, if defined, has system-dependent CFLAGS.  */
  36.   #if !defined(M_CFLAGS)
  37. ! #define M_CFLAGS
  38.   #endif
  39.   
  40.   /* CFLAGS for both GDB and readline.  */
  41. ! GLOBAL_CFLAGS = -g M_CFLAGS
  42.   CFLAGS = -I. ${HAVE_VPRINTF_DEFINE} ${GLOBAL_CFLAGS}
  43.   /* None of the things in CFLAGS will do any harm, and on some systems
  44. --- 43,51 ----
  45.   /* M_CFLAGS, if defined, has system-dependent CFLAGS.  */
  46.   #if !defined(M_CFLAGS)
  47. ! #define M_CFLAGS -DM_SYSV
  48.   #endif
  49.   
  50.   /* CFLAGS for both GDB and readline.  */
  51. ! GLOBAL_CFLAGS = M_CFLAGS
  52.   CFLAGS = -I. ${HAVE_VPRINTF_DEFINE} ${GLOBAL_CFLAGS}
  53.   /* None of the things in CFLAGS will do any harm, and on some systems
  54. ***************
  55. *** 67,72 ****
  56.   REGEX1 = M_REGEX
  57.   #else
  58. ! REGEX = 
  59. ! REGEX1 = 
  60.   #endif
  61.   
  62. --- 67,72 ----
  63.   REGEX1 = M_REGEX
  64.   #else
  65. ! REGEX = regex.o
  66. ! REGEX1 = regex.o
  67.   #endif
  68.   
  69. ***************
  70. *** 113,117 ****
  71.    For example, -lPW for System V to get alloca().  */
  72.   #ifndef M_CLIBS
  73. ! #define M_CLIBS
  74.   #endif
  75.   CLIBS = ${ADD_FILES} ${TERMCAP} M_CLIBS
  76. --- 113,117 ----
  77.    For example, -lPW for System V to get alloca().  */
  78.   #ifndef M_CLIBS
  79. ! #define M_CLIBS -lx
  80.   #endif
  81.   CLIBS = ${ADD_FILES} ${TERMCAP} M_CLIBS
  82. ***************
  83. *** 125,129 ****
  84.        remote.c source.c stack.c standalone.c stuff.c symmisc.c symtab.c \
  85.        utils.c valarith.c valops.c valprint.c values.c version.c expread.y \
  86. !      xgdb.c
  87.   
  88.   DEPFILES = umax-dep.c gould-dep.c default-dep.c sun3-dep.c \
  89. --- 125,129 ----
  90.        remote.c source.c stack.c standalone.c stuff.c symmisc.c symtab.c \
  91.        utils.c valarith.c valops.c valprint.c values.c version.c expread.y \
  92. !      x386dbx.c xgdb.c
  93.   
  94.   DEPFILES = umax-dep.c gould-dep.c default-dep.c sun3-dep.c \
  95. ***************
  96. *** 174,178 ****
  97.   OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
  98.       values.o eval.o valops.o valarith.o valprint.o printcmd.o \
  99. !     symtab.o symmisc.o coffread.o dbxread.o infcmd.o infrun.o remote.o \
  100.       command.o utils.o expread.o expprint.o pinsn.o environ.o version.o \
  101.       copying.o ${READLINEOBS}
  102. --- 174,178 ----
  103.   OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
  104.       values.o eval.o valops.o valarith.o valprint.o printcmd.o \
  105. !     symtab.o symmisc.o coffread.o dbxread.o x386dbx.o infcmd.o infrun.o remote.o \
  106.       command.o utils.o expread.o expprint.o pinsn.o environ.o version.o \
  107.       copying.o ${READLINEOBS}
  108. ***************
  109. *** 259,265 ****
  110.       rm -f gdb.tar
  111.       mkdir dist-gdb
  112. !     cd dist-gdb ; for i in ${TARFILES} ; do ln -s ../$$i . ; done
  113.       mkdir dist-gdb/readline
  114. !     cd dist-gdb/readline ; for i in ${READLINE} ; do ln -s ../../readline/$$i . ; done
  115.       tar chf gdb.tar dist-gdb
  116.       rm -rf dist-gdb
  117. --- 259,265 ----
  118.       rm -f gdb.tar
  119.       mkdir dist-gdb
  120. !     cd dist-gdb ; for i in ${TARFILES} ; do ln -s "../$$i" . ; done
  121.       mkdir dist-gdb/readline
  122. !     cd dist-gdb/readline ; for i in ${READLINE} ; do ln -s "../../readline/$$i" . ; done
  123.       tar chf gdb.tar dist-gdb
  124.       rm -rf dist-gdb
  125. *** dist-gdb.old/breakpoint.c    Wed Jan 10 23:49:07 1990
  126. --- breakpoint.c    Sat May  5 14:59:30 1990
  127. ***************
  128. *** 1108,1112 ****
  129.       if (b->number == num)
  130.         {
  131. !         function (b);
  132.           goto win;
  133.         }
  134. --- 1108,1112 ----
  135.       if (b->number == num)
  136.         {
  137. !         (*function)(b);
  138.           goto win;
  139.         }
  140. *** dist-gdb.old/config.gdb    Tue Jan 30 20:35:46 1990
  141. --- config.gdb    Mon May  7 15:33:32 1990
  142. ***************
  143. *** 327,330 ****
  144. --- 327,336 ----
  145.       opcodefile=four
  146.       ;;
  147. + xenix386)
  148. +     pinsnfile=i386-pinsn.c
  149. + # The following is a lie, but a necessary one.  See comment at beginning
  150. + # of this file about unneeded files.
  151. +     opcodefile=m-xenix386.h
  152. +     ;;
  153.   *)
  154.       echo "Unknown machine type: \`$machine'"
  155. ***************
  156. *** 370,375 ****
  157.   echo "Editing Makefile"
  158.   cp Makefile.dist tmp.c
  159. ! cc -E >Makefile tmp.c $makedefine -DM_MAKEDEFINE="$makedefine"
  160. ! rm -f tmp.c
  161.   
  162.   echo "GDB is now set up for use with a $machine." \
  163. --- 376,381 ----
  164.   echo "Editing Makefile"
  165.   cp Makefile.dist tmp.c
  166. ! gcc -E >Makefile $makedefine -DM_MAKEDEFINE="$makedefine" tmp.c
  167. ! #rm -f tmp.c
  168.   
  169.   echo "GDB is now set up for use with a $machine." \
  170. *** dist-gdb.old/core.c    Wed Jan 10 23:55:17 1990
  171. --- core.c    Sat May  5 14:59:31 1990
  172. ***************
  173. *** 50,53 ****
  174. --- 50,57 ----
  175.   #include <sys/ptrace.h>
  176.   #else
  177. + #ifdef M_XENIX
  178. + #include <sys/page.h>
  179. + #include <sys/seg.h>
  180. + #endif
  181.   #include <sys/user.h>
  182.   #endif
  183. ***************
  184. *** 63,69 ****
  185. --- 67,77 ----
  186.   #ifndef COFF_FORMAT
  187.   #ifndef AOUTHDR
  188. + #ifdef M_XENIX
  189. + #define AOUTHDR        struct xexec
  190. + #else
  191.   #define AOUTHDR        struct exec
  192.   #endif
  193.   #endif
  194. + #endif
  195.   
  196.   extern char *sys_siglist[];
  197. ***************
  198. *** 201,208 ****
  199.       return;
  200.   
  201.         if (N_MAGIC (core_aouthdr) != 0
  202.         && bcmp (&core_aouthdr, &exec_aouthdr, sizeof core_aouthdr))
  203.       printf ("Warning: core file does not match specified executable file.\n");
  204. !       else if (exec_mtime > st_core.st_mtime)
  205.       printf ("Warning: exec file is newer than core file.\n");
  206.       }
  207. --- 209,220 ----
  208.       return;
  209.   
  210. + /* cannot validate core file against executable file on xenix */
  211. + #ifndef M_XENIX
  212.         if (N_MAGIC (core_aouthdr) != 0
  213.         && bcmp (&core_aouthdr, &exec_aouthdr, sizeof core_aouthdr))
  214.       printf ("Warning: core file does not match specified executable file.\n");
  215. !       else
  216. ! #endif
  217. !       if (exec_mtime > st_core.st_mtime)
  218.       printf ("Warning: exec file is newer than core file.\n");
  219.       }
  220. *** dist-gdb.old/dbxread.c    Sat Jan 27 07:30:54 1990
  221. --- dbxread.c    Sat May  5 15:44:39 1990
  222. ***************
  223. *** 41,44 ****
  224. --- 41,59 ----
  225.   #endif
  226.   
  227. + #ifdef M_XENIX
  228. + #include <sys/relsym.h>
  229. + #define nlist xenix_nlist    /* the system nlist is broken */
  230. + #include <a.out.h>
  231. + #undef nlist
  232. + #define nlist gas_nlist
  233. + #include "stab.gnu.h"
  234. + #include "gas-nlist.h"
  235. + #define STRING_SEG 4
  236. + #define SYMS_SEG   5
  237. + #define AOUTHDR    struct xexec
  238. + #else /* M_XENIX */
  239.   #ifdef COFF_ENCAPSULATE
  240.   #include "a.out.encap.h"
  241. ***************
  242. *** 48,51 ****
  243. --- 63,68 ----
  244.   #include <stab.h>
  245.   #endif
  246. + #endif /* M_XENIX */
  247.   #include <ctype.h>
  248.   
  249. ***************
  250. *** 168,171 ****
  251. --- 185,190 ----
  252.   static struct type **read_args ();
  253.   
  254. + #ifndef M_XENIX
  255.   /* Macro to determine which symbols to ignore when reading the first symbol
  256.      of a file.  Some machines override this definition. */
  257. ***************
  258. *** 284,287 ****
  259. --- 303,413 ----
  260.   #define BELIEVE_PCC_PROMOTION 0
  261.   #endif
  262. + #else    /* M_XENIX */
  263. + /* Macro to determine which symbols to ignore when reading the first symbol
  264. +    of a file.  Some machines override this definition. */
  265. + extern struct xseg *find_segment();
  266. + #ifndef IGNORE_SYMBOL
  267. + /* Don't ignore any symbols. */
  268. + #define IGNORE_SYMBOL(type) (0)
  269. + #endif 
  270. + /* Macro for number of symbol table entries (in usual a.out format).
  271. +    Some machines override this definition.  */
  272. + #ifndef NUMBER_OF_SYMBOLS
  273. + #define NUMBER_OF_SYMBOLS \
  274. +   ({ struct xseg *cseg; long z;\
  275. +      cseg = find_segment(XS_TSYMS, SYMS_SEG); \
  276. +      z = cseg ? cseg->xs_psize / sizeof(struct nlist) : 0; z;})
  277. + #endif
  278. + /* Macro for file-offset of symbol table (in usual a.out format).  */
  279. + #ifndef SYMBOL_TABLE_OFFSET
  280. + #define SYMBOL_TABLE_OFFSET \
  281. +   ({ struct xseg *cseg; long z;\
  282. +      cseg = find_segment(XS_TSYMS, SYMS_SEG); \
  283. +      z = cseg ? cseg->xs_filpos : 0; z;})
  284. + #endif
  285. + /* Macro for file-offset of string table (in usual a.out format).  */
  286. + #ifndef STRING_TABLE_OFFSET
  287. + #define STRING_TABLE_OFFSET \
  288. +   ({ struct xseg *cseg; long z;\
  289. +      cseg = find_segment(XS_TSYMS, STRING_SEG); \
  290. +      z = cseg ? cseg->xs_filpos : 0; z; })
  291. + #endif
  292. + /* Macro to store the length of the string table data in INTO.  */
  293. + #ifndef READ_STRING_TABLE_SIZE
  294. + #define READ_STRING_TABLE_SIZE(INTO)        \
  295. +   { struct xseg *cseg; \
  296. +      cseg = find_segment(XS_TSYMS, STRING_SEG); \
  297. +      INTO = cseg ? cseg->xs_psize : 0; }
  298. + #endif
  299. + /* Macro to declare variables to hold the file's header data.  */
  300. + #ifndef DECLARE_FILE_HEADERS
  301. + #define DECLARE_FILE_HEADERS  AOUTHDR hdr
  302. + #endif
  303. + #define N_BADMAG(hdr)\
  304. +   (hdr.x_magic != X_MAGIC && (hdr.x_cpu & XC_CPU) != XC_386 \
  305. +    && (hdr.x_renv & XE_SEG) == 0  && (hdr.x_renv & XE_EXEC) == 0)
  306. + /* Macro to read the header data from descriptor DESC and validate it.
  307. +    NAME is the file name, for error messages.  */
  308. + #ifndef READ_FILE_HEADERS
  309. + #define READ_FILE_HEADERS(DESC, NAME)        \
  310. + { val = myread (DESC, &hdr, sizeof hdr);    \
  311. +   if (val < 0) perror_with_name (NAME);        \
  312. +   if (N_BADMAG (hdr))                \
  313. +     error ("File \"%s\" not in executable format.", NAME);\
  314. +   process_a_out(DESC, NAME); }
  315. + #endif
  316. + #ifndef IS_OBJECT_FILE
  317. + #define IS_OBJECT_FILE 0
  318. + #endif
  319. + /* Macro for size of text segment */
  320. + #ifndef SIZE_OF_TEXT_SEGMENT
  321. + #define SIZE_OF_TEXT_SEGMENT hdr.x_text
  322. + #endif
  323. + /* Get the address in debugged memory of the start
  324. +    of the text segment.  */
  325. + #if !defined (ADDR_OF_TEXT_SEGMENT)
  326. + #define ADDR_OF_TEXT_SEGMENT 0
  327. + #endif /* no ADDR_OF_TEXT_SEGMENT */
  328. + /* Macro to get entry point from headers.  */
  329. + #ifndef ENTRY_POINT
  330. + #define ENTRY_POINT hdr.x_entry
  331. + #endif
  332. + /* Macro for name of symbol to indicate a file compiled with gcc. */
  333. + #ifndef GCC_COMPILED_FLAG_SYMBOL
  334. + #define GCC_COMPILED_FLAG_SYMBOL "gcc_compiled."
  335. + #endif
  336. + /* Convert stab register number (from `r' declaration) to a gdb REGNUM.  */
  337. + #ifndef STAB_REG_TO_REGNUM
  338. + #define STAB_REG_TO_REGNUM(VALUE) (VALUE)
  339. + #endif
  340. + /* Define this as 1 if a pcc declaration of a char or short argument
  341. +    gives the correct address.  Otherwise assume pcc gives the
  342. +    address of the corresponding int, which is not the same on a
  343. +    big-endian machine.  */
  344. + #ifndef BELIEVE_PCC_PROMOTION
  345. + #define BELIEVE_PCC_PROMOTION 0
  346. + #endif
  347. + #endif /* !M_XENIX */
  348.   
  349.   /* Nonzero means give verbose info on gdb action.  From main.c.  */
  350. ***************
  351. *** 1628,1631 ****
  352. --- 1754,1763 ----
  353.     make_cleanup (free_current_contents, &name);
  354.   
  355. + #ifdef M_XENIX
  356. + /* On xenix (with gcc) READ_FILE_HEADER reads the segment table,
  357. +  * fileinfo table and global symbol table as well. 
  358. +  */
  359. + #endif /* M_XENIX */
  360.     READ_FILE_HEADERS (desc, name);
  361.   
  362. ***************
  363. *** 1677,1680 ****
  364. --- 1809,1816 ----
  365.     if (val < 0)
  366.       perror_with_name (name);
  367. + #ifdef X_DEBUG
  368. +     printf("\nstring table offset = %d, size = %d, start = %s\n",
  369. +         STRING_TABLE_OFFSET, buffer, stringtab);
  370. + #endif
  371.     
  372.     /* Throw away the old symbol table.  */
  373. ***************
  374. *** 1721,1725 ****
  375. --- 1857,1865 ----
  376.     /* Go over the misc functions and install them in vector.  */
  377.   
  378. + #ifndef M_XENIX /* This has already been done at header read time */
  379.     condense_misc_bunches (0);
  380. + #else
  381. +   process_global_symbol_table(desc, name);
  382. + #endif /* M_XENIX */
  383.   
  384.     /* Don't allow char * to have a typename (else would get caddr_t.)  */
  385. ***************
  386. *** 1938,1941 ****
  387. --- 2078,2091 ----
  388.   #endif
  389.   
  390. + #ifdef M_XENIX
  391. +   long lsym_count = 0;
  392. +   long flsym_count = 0;
  393. +   long file_string_base = 0;
  394. +   long stringtab_offset = 0;
  395. +   long symtab_pos = 0;
  396. +   long filadd = 0;
  397. +   int file_count = 0;
  398. + #endif /* M_XENIX */
  399.     /* Current partial symtab */
  400.     struct partial_symtab *pst;
  401. ***************
  402. *** 1990,1993 ****
  403. --- 2140,2148 ----
  404.     symbuf_end = symbuf_idx = 0;
  405.   
  406. + #ifdef M_XENIX
  407. +   init_fileinfo_processing();   /* start processing the list of files */
  408. +   nlistlen += 10;         /* force the hack code to terminate the loop */
  409. + #endif /* M_XENIX */
  410.     for (symnum = 0; symnum < nlistlen; symnum++)
  411.       {
  412. ***************
  413. *** 1994,1997 ****
  414. --- 2149,2194 ----
  415.         /* Get the symbol for this run and pull out some info */
  416.         QUIT;    /* allow this to be interruptable */
  417. + #ifdef M_XENIX
  418. +       /* This is a gross hack.  Xenix places pointers to each files $$SYMBOLS
  419. +        * (containing the symbols for DBX) and $$TYPES (containing the strings
  420. +        * for DBX) in the file name table.  There is also a partial symbol
  421. +        * table record for each file produced by the loader - this is ignored
  422. +        * at present.
  423. +        */
  424. +        if (lsym_count == 0)
  425. +        {
  426. +      try_next_file:
  427. +      if (!get_next_fileinfo(&stringtab_offset, &flsym_count, &filadd,
  428. +                             &symtab_pos))
  429. +      {            /* all files proccessed */
  430. +        symnum = nlistlen;
  431. +        continue;
  432. +      }
  433. +      else
  434. +      {
  435. +        lseek(desc, symtab_pos, 0);
  436. +          stringtab_global = stringtab + stringtab_offset;
  437. +        symbuf_idx = symbuf_end;  /* force symbol reading */
  438. +        lsym_count = flsym_count;
  439. +      }
  440. +      
  441. +      file_count++;
  442. +      if (file_count == 2)
  443. +            startup_file_start = filadd;
  444. +      if (file_count == 3)
  445. +            startup_file_end = filadd;
  446. +          if (lsym_count == 0)    /* skip this file if no symbols in it */
  447. +        goto try_next_file;
  448. +        }
  449. +        
  450. +        lsym_count--;
  451. + #endif /* M_XENIX */
  452.         if (symbuf_idx == symbuf_end)
  453.       fill_symbuf ();
  454. ***************
  455. *** 2024,2028 ****
  456.       error ("Invalid symbol data: bad string table offset: %d",       \
  457.          bufp->n_un.n_strx);                                       \
  458. !   namestring = bufp->n_un.n_strx + stringtab
  459.   
  460.   #define    ADD_PSYMBOL_TO_LIST(NAME, NAMELENGTH, NAMESPACE, CLASS, LIST, VALUE)\
  461. --- 2221,2225 ----
  462.       error ("Invalid symbol data: bad string table offset: %d",       \
  463.          bufp->n_un.n_strx);                                       \
  464. !   namestring = bufp->n_un.n_strx + stringtab + stringtab_offset
  465.   
  466.   #define    ADD_PSYMBOL_TO_LIST(NAME, NAMELENGTH, NAMESPACE, CLASS, LIST, VALUE)\
  467. ***************
  468. *** 2052,2057 ****
  469.     } while (0);
  470.   
  471.   
  472. !       switch (bufp->n_type)
  473.       {
  474.         /*
  475. --- 2249,2259 ----
  476.     } while (0);
  477.   
  478. + #ifdef X_DEBUG
  479. + printf("%s = (%#x, %d, %#x)\n",
  480. +   bufp->n_un.n_strx ? bufp->n_un.n_strx+stringtab+stringtab_offset : "<NONE>",
  481. +   (unsigned char)bufp->n_type, bufp->n_desc, bufp->n_value);
  482. + #endif /* X_DEBUG */
  483.   
  484. !       switch ((unsigned char)bufp->n_type)
  485.       {
  486.         /*
  487. ***************
  488. *** 2058,2061 ****
  489. --- 2260,2264 ----
  490.          * Standard, non-debugger, symbols
  491.          */
  492. + #ifndef M_XENIX            /* these are not present with Xenix / GCC */
  493.   
  494.       case N_TEXT | N_EXT:
  495. ***************
  496. *** 2177,2180 ****
  497. --- 2380,2385 ----
  498.   #endif
  499.   
  500. + #endif /* M_XENIX */
  501.         /* Keep going . . .*/
  502.   
  503. ***************
  504. *** 2210,2213 ****
  505. --- 2415,2419 ----
  506.         if (pst && past_first_source_file)
  507.           {
  508. + #ifndef M_XENIX
  509.             end_psymtab (pst, psymtab_include_list, includes_used,
  510.                  symnum * sizeof (struct nlist), bufp->n_value,
  511. ***************
  512. *** 2214,2217 ****
  513. --- 2420,2429 ----
  514.                  dependency_list, dependencies_used,
  515.                  global_psymbols.next, static_psymbols.next);
  516. + #else
  517. +           end_psymtab (pst, psymtab_include_list, includes_used,
  518. +                symtab_pos + flsym_count * sizeof (struct nlist),
  519. +                bufp->n_value, dependency_list, dependencies_used,
  520. +                global_psymbols.next, static_psymbols.next);
  521. + #endif
  522.             pst = (struct partial_symtab *) 0;
  523.             includes_used = 0;
  524. ***************
  525. *** 2221,2227 ****
  526. --- 2433,2445 ----
  527.           past_first_source_file = 1;
  528.   
  529. + #ifndef M_XENIX
  530.         pst = start_psymtab (namestring, bufp->n_value,
  531.                      symnum * sizeof (struct nlist),
  532.                      global_psymbols.next, static_psymbols.next);
  533. + #else
  534. +       pst = start_psymtab (namestring, bufp->n_value, symtab_pos,
  535. +                    global_psymbols.next, static_psymbols.next,
  536. +                    stringtab_offset, flsym_count);
  537. + #endif /* M_XENIX */
  538.   
  539.         continue;
  540. ***************
  541. *** 2592,2595 ****
  542. --- 2810,2814 ----
  543.   
  544.     /* If there's stuff to be cleaned up, clean it up.  */
  545. + #ifndef M_XENIX
  546.     if (entry_point < bufp->n_value
  547.         && entry_point >= last_o_file_start)
  548. ***************
  549. *** 2598,2604 ****
  550. --- 2817,2825 ----
  551.         startup_file_end = bufp->n_value;
  552.       }
  553. + #endif /* M_XENIX */
  554.   
  555.     if (pst)
  556.       {
  557. + #ifndef M_XENIX
  558.         end_psymtab (pst, psymtab_include_list, includes_used,
  559.              symnum * sizeof (struct nlist), end_of_text_addr,
  560. ***************
  561. *** 2605,2608 ****
  562. --- 2826,2835 ----
  563.              dependency_list, dependencies_used,
  564.              global_psymbols.next, static_psymbols.next);
  565. + #else /* M_XENIX */
  566. +       end_psymtab (pst, psymtab_include_list, includes_used,
  567. +            symtab_pos + flsym_count * sizeof (struct nlist),
  568. +            end_of_text_addr, dependency_list, dependencies_used,
  569. +            global_psymbols.next, static_psymbols.next);
  570. + #endif /* M_XENIX */
  571.         includes_used = 0;
  572.         dependencies_used = 0;
  573. ***************
  574. *** 2654,2657 ****
  575. --- 2881,2885 ----
  576.    */
  577.   static struct partial_symtab *
  578. + #ifndef M_XENIX
  579.   start_psymtab (filename, textlow, ldsymoff, global_syms, static_syms)
  580.        char *filename;
  581. ***************
  582. *** 2660,2663 ****
  583. --- 2888,2902 ----
  584.        struct partial_symbol *global_syms;
  585.        struct partial_symbol *static_syms;
  586. + #else
  587. + start_psymtab (filename, textlow, ldsymoff, global_syms, static_syms, stroffset,
  588. +            symcount)
  589. +      char *filename;
  590. +      int textlow;
  591. +      int ldsymoff;
  592. +      struct partial_symbol *global_syms;
  593. +      struct partial_symbol *static_syms;
  594. +      int stroffset;
  595. +      int symcount;
  596. + #endif
  597.   {
  598.     struct partial_symtab *result =
  599. ***************
  600. *** 2672,2676 ****
  601.     result->textlow = textlow;
  602.     result->ldsymoff = ldsymoff;
  603.     result->readin = 0;
  604.   
  605. --- 2911,2917 ----
  606.     result->textlow = textlow;
  607.     result->ldsymoff = ldsymoff;
  608. ! #ifdef M_XENIX
  609. !   result->ldsymlen = symcount * sizeof(struct nlist);
  610. ! #endif
  611.     result->readin = 0;
  612.   
  613. ***************
  614. *** 2680,2683 ****
  615. --- 2921,2925 ----
  616.     result->n_global_syms = 0;
  617.     result->n_static_syms = 0;
  618. +   result->stringtab_off = stroffset;
  619.   
  620.     return result;
  621. ***************
  622. *** 2723,2727 ****
  623. --- 2965,2971 ----
  624.     int i;
  625.   
  626. + #ifndef M_XENIX
  627.     pst->ldsymlen = capping_symbol_offset - pst->ldsymoff;
  628. + #endif /* M_XENIX */
  629.     pst->texthigh = capping_text;
  630.   
  631. ***************
  632. *** 2831,2835 ****
  633. --- 3075,3081 ----
  634.   
  635.         /* Read in this files symbols */
  636. + #ifndef M_XENIX
  637.         lseek (desc, sym_offset, L_SET);
  638.         read_ofile_symtab (desc, stringtab, stringtab_size,
  639.                pst->ldsymoff,
  640. ***************
  641. *** 2836,2839 ****
  642. --- 3082,3092 ----
  643.                pst->ldsymlen, pst->textlow,
  644.                pst->texthigh - pst->textlow, 0);
  645. + #else  /* M_XENIX */
  646. +       read_ofile_symtab (desc, stringtab + pst->stringtab_off,
  647. +              stringtab_size - pst->stringtab_off,
  648. +              pst->ldsymoff,
  649. +              pst->ldsymlen, pst->textlow,
  650. +              pst->texthigh - pst->textlow, 0);
  651. + #endif  /* M_XENIX */
  652.         sort_symtab_syms (symtab_list); /* At beginning since just added */
  653.   
  654. ***************
  655. *** 2904,2908 ****
  656. --- 3157,3163 ----
  657.       error("Symbol file not readable");
  658.   
  659. + #ifndef M_XENIX    
  660.         READ_FILE_HEADERS (desc, name);
  661. + #endif /* M_XENIX */
  662.   
  663.         /* Read in the string table */
  664. ***************
  665. *** 3059,3062 ****
  666. --- 3314,3318 ----
  667.     symbuf_end = symbuf_idx = 0;
  668.   
  669. + #ifndef M_XENIX
  670.     /* It is necessary to actually read one symbol *before* the start
  671.        of this symtab's symbols, because the GCC_COMPILED_FLAG_SYMBOL
  672. ***************
  673. *** 3065,3068 ****
  674. --- 3321,3325 ----
  675.        Detecting this in read_dbx_symtab
  676.        would slow down initial readin, so we look for it here instead.  */
  677.     if (sym_offset >= sizeof (struct nlist))
  678.       {
  679. ***************
  680. *** 3088,3091 ****
  681. --- 3345,3355 ----
  682.         processing_gcc_compilation = 0;
  683.       }
  684. + #else /* M_XENIX */
  685. +     lseek(desc, sym_offset, L_SET);
  686. +     processing_gcc_compilation = 0;
  687. + #ifdef X_DEBUG
  688. +     printf("sym_offset = %d,  sym_size = %d\n", sym_offset, sym_size);
  689. + #endif /* X_DEBUG */
  690. + #endif /* M_XENIX */
  691.   
  692.     if (symbuf_idx == symbuf_end)
  693. ***************
  694. *** 3095,3098 ****
  695. --- 3359,3368 ----
  696.       fatal("First symbol in segment of executable not a source symbol");
  697.   
  698. + #ifdef X_DEBUG
  699. + printf("%s = (%#x, %d, %#x)\n",
  700. +   bufp->n_un.n_strx ? bufp->n_un.n_strx+stringtab : "<NONE>",
  701. +   (unsigned char)bufp->n_type, bufp->n_desc, bufp->n_value);
  702. + #endif /* X_DEBUG */
  703.     for (symnum = 0;
  704.          symnum < sym_size / sizeof(struct nlist);
  705. ***************
  706. *** 3104,3107 ****
  707. --- 3374,3382 ----
  708.         bufp = &symbuf[symbuf_idx++];
  709.         type = bufp->n_type;
  710. + #ifdef X_DEBUG
  711. + printf("%s = (%#x, %d, %#x)\n",
  712. +   bufp->n_un.n_strx ? bufp->n_un.n_strx+stringtab : "<NONE>",
  713. +   (unsigned char)bufp->n_type, bufp->n_desc, bufp->n_value);
  714. + #endif /* X_DEBUG */
  715.   
  716.         if (offset &&
  717. ***************
  718. *** 3477,3480 ****
  719. --- 3752,3757 ----
  720.   /* Read in another .o file and create a symtab entry for it.*/
  721.   
  722. + #ifndef M_XENIX /* Xenix can't do incremental loads */
  723.   static void
  724.   read_addl_syms (desc, stringtab, nlistlen, text_addr, text_size)
  725. ***************
  726. *** 3773,3776 ****
  727. --- 4050,4054 ----
  728.     fflush (stdout);
  729.   }
  730. + #endif /* M_XENIX */
  731.   
  732.   /* Read a number by which a type is referred to in dbx data,
  733. ***************
  734. *** 5466,5475 ****
  735.     undef_types = (struct type **) xmalloc (undef_types_allocated *
  736.                         sizeof (struct type *));
  737.     add_com ("symbol-file", class_files, symbol_file_command,
  738.          "Load symbol table (in dbx format) from executable file FILE.");
  739.   
  740.     add_com ("add-file", class_files, add_file_command,
  741.              "Load the symbols from FILE, assuming its code is at TEXT_START.") ;
  742.   }
  743.   
  744. --- 5744,5754 ----
  745.     undef_types = (struct type **) xmalloc (undef_types_allocated *
  746.                         sizeof (struct type *));
  747.     add_com ("symbol-file", class_files, symbol_file_command,
  748.          "Load symbol table (in dbx format) from executable file FILE.");
  749.   
  750. + #ifndef M_XENIX
  751.     add_com ("add-file", class_files, add_file_command,
  752.              "Load the symbols from FILE, assuming its code is at TEXT_START.") ;
  753. + #endif /* M_XENIX */
  754.   }
  755.   
  756. *** dist-gdb.old/eval.c    Sun Nov  5 18:01:52 1989
  757. --- eval.c    Sat May  5 14:59:35 1990
  758. ***************
  759. *** 412,419 ****
  760.       goto nosideret;
  761.         if (noside == EVAL_AVOID_SIDE_EFFECTS)
  762. !     return value_zero (lookup_struct_elt_type (TYPE_TARGET_TYPE
  763. !                            (VALUE_TYPE (arg1)),
  764. !                            &exp->elts[pc + 1].string),
  765. !                lval_memory);
  766.         else
  767.       return value_struct_elt (arg1, 0, &exp->elts[pc + 1].string, 0,
  768. --- 412,419 ----
  769.       goto nosideret;
  770.         if (noside == EVAL_AVOID_SIDE_EFFECTS)
  771. !     return value_zero (lookup_struct_elt_type
  772. !         (TYPE_TARGET_TYPE(VALUE_TYPE (arg1)),
  773. !             &exp->elts[pc + 1].string),
  774. !             lval_memory);
  775.         else
  776.       return value_struct_elt (arg1, 0, &exp->elts[pc + 1].string, 0,
  777. *** dist-gdb.old/gas-nlist.h    Thu Jan  1 00:00:00 1970
  778. --- gas-nlist.h    Sat May  5 14:59:35 1990
  779. ***************
  780. *** 0 ****
  781. --- 1,13 ----
  782. + #define N_STAB 0340
  783. + struct gas_nlist {
  784. +     union {
  785. +         char    *n_name;
  786. +         struct gas_nlist *n_next;
  787. +         long    n_strx;
  788. +     } n_un;
  789. +     char    n_type;
  790. +     char    n_other;
  791. +     short    n_desc;
  792. +     unsigned n_value;
  793. + };
  794. *** dist-gdb.old/inflow.c    Wed Jan 10 23:55:38 1990
  795. --- inflow.c    Sat May  5 14:59:36 1990
  796. ***************
  797. *** 30,33 ****
  798. --- 30,34 ----
  799.   /* Some USG-esque systems (some of which are BSD-esque enough so that USG
  800.      is not defined) want this header, and it won't do any harm.  */
  801. + /* rk@unify.UUCP: yes it will if you include it twice (line removed below) */
  802.   #include <fcntl.h>
  803.   
  804. ***************
  805. *** 47,51 ****
  806.   #else
  807.   #include <sys/ioctl.h>
  808. - #include <fcntl.h>
  809.   #include <sgtty.h>
  810.   #define TERMINAL struct sgttyb
  811. --- 48,51 ----
  812. ***************
  813. *** 299,303 ****
  814. --- 299,307 ----
  815.   
  816.     printf_filtered ("fcntl flags = 0x%x, sgttyb.sg_flags = 0x%x, owner pid = %d.\n",
  817. + #ifdef TIOCGPGRP
  818.         tflags_inferior, sg_inferior.sg_flags, pgrp_inferior);
  819. + #else
  820. +       tflags_inferior, sg_inferior.sg_flags, 0);
  821. + #endif
  822.   
  823.   #endif /* not HAVE_TERMIO */
  824. *** dist-gdb.old/infrun.c    Tue Jan 23 23:10:35 1990
  825. --- infrun.c    Sat May  5 14:59:36 1990
  826. ***************
  827. *** 147,150 ****
  828. --- 147,154 ----
  829.   #include <sys/param.h>
  830.   /* Needed by IN_SIGTRAMP on some machines (e.g. vax).  */
  831. + #ifdef M_XENIX
  832. + #include <sys/page.h>
  833. + #include <sys/seg.h>
  834. + #endif
  835.   #include <sys/user.h>
  836.   
  837. *** dist-gdb.old/m-xenix386.h    Thu Jan  1 00:00:00 1970
  838. --- m-xenix386.h    Sat May  5 14:59:38 1990
  839. ***************
  840. *** 0 ****
  841. --- 1,350 ----
  842. + /* Macro defintions for i386.
  843. +    Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
  844. + This file is part of GDB.
  845. + GDB is free software; you can redistribute it and/or modify
  846. + it under the terms of the GNU General Public License as published by
  847. + the Free Software Foundation; either version 1, or (at your option)
  848. + any later version.
  849. + GDB is distributed in the hope that it will be useful,
  850. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  851. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  852. + GNU General Public License for more details.
  853. + You should have received a copy of the GNU General Public License
  854. + along with GDB; see the file COPYING.  If not, write to
  855. + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  856. + /* Define the bit, byte, and word ordering of the machine.  */
  857. + /* #define BITS_BIG_ENDIAN  */
  858. + /* #define BYTES_BIG_ENDIAN */
  859. + /* #define WORDS_BIG_ENDIAN */
  860. + /*
  861. +  * Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu)
  862. +  * July 1988
  863. +  */
  864. + #ifndef i386
  865. + #define i386
  866. + #endif
  867. + /* This machine doesn't have the siginterrupt call.  */
  868. + #define NO_SIGINTERRUPT
  869. + #define ALIGN_STACK_ON_STARTUP
  870. + /* define USG if you are using sys5 /usr/include's */
  871. + #define USG
  872. + /* USG systems need these */
  873. + #define vfork() fork()
  874. + #define MAXPATHLEN 500
  875. + /* define this if you don't have the extension to coff that allows
  876. +  * file names to appear in the string table
  877. +  * (aux.x_file.x_foff)
  878. +  */
  879. + #define COFF_NO_LONG_FILE_NAMES
  880. + /* turn this on when rest of gdb is ready */
  881. + /* #define IEEE_FLOAT */
  882. + #define NBPG NBPC
  883. + #define UPAGES USIZE
  884. + /* #define HAVE_TERMIO */
  885. + /* Get rid of any system-imposed stack limit if possible.  */
  886. + /* #define SET_STACK_LIMIT_HUGE not in sys5 */
  887. + /* Define this if the C compiler puts an underscore at the front
  888. +    of external names before giving them to the linker.  */
  889. + #define NAMES_HAVE_UNDERSCORE
  890. + /* Specify debugger information format (only one)  */
  891. + #define READ_DBX_FORMAT
  892. + #undef COFF_FORMAT
  893. + /* number of traps that happen between exec'ing the shell 
  894. +  * to run an inferior, and when we finally get to 
  895. +  * the inferior code.  This is 2 on most implementations.
  896. +  */
  897. + #define START_INFERIOR_TRAPS_EXPECTED 2
  898. + /* Offset from address of function to start of its code.
  899. +    Zero on most machines.  */
  900. + #define FUNCTION_START_OFFSET 0
  901. + /* Advance PC across any function entry prologue instructions
  902. +    to reach some "real" code.  */
  903. + #define SKIP_PROLOGUE(frompc)   {(frompc) = i386_skip_prologue((frompc));}
  904. + /* Immediately after a function call, return the saved pc.
  905. +    Can't always go through the frames for this because on some machines
  906. +    the new frame is not set up until the new function executes
  907. +    some instructions.  */
  908. + #define SAVED_PC_AFTER_CALL(frame) \
  909. +   (read_memory_integer (read_register (SP_REGNUM), 4))
  910. + /* This is the amount to subtract from u.u_ar0
  911. +    to get the offset in the core file of the register values.  */
  912. + #define KERNEL_U_ADDR 0x06000000
  913. + /* Address of end of stack space.  */
  914. + #define STACK_END_ADDR 0x80000000
  915. + /* Stack grows downward.  */
  916. + #define INNER_THAN <
  917. + /* Sequence of bytes for breakpoint instruction.  */
  918. + #define BREAKPOINT {0xcc}
  919. + /* Amount PC must be decremented by after a breakpoint.
  920. +    This is often the number of bytes in BREAKPOINT
  921. +    but not always.  */
  922. + #define DECR_PC_AFTER_BREAK 1
  923. + /* Nonzero if instruction at PC is a return instruction.  */
  924. + #define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0xc3)
  925. + /* Return 1 if P points to an invalid floating point value.
  926. +    LEN is the length in bytes -- not relevant on the 386.  */
  927. + #define INVALID_FLOAT(p, len) (0)
  928. + /* code to execute to print interesting information about the
  929. +  * floating point processor (if any)
  930. +  * No need to define if there is nothing to do.
  931. +  */
  932. + #define FLOAT_INFO { i386_float_info (); }
  933. + /* Largest integer type */
  934. + #define LONGEST long
  935. + /* Name of the builtin type for the LONGEST type above. */
  936. + #define BUILTIN_TYPE_LONGEST builtin_type_long
  937. + /* Say how long (ordinary) registers are.  */
  938. + #define REGISTER_TYPE long
  939. + /* Number of machine registers */
  940. + #define NUM_REGS 16
  941. + /* Initializer for an array of names of registers.
  942. +    There should be NUM_REGS strings in this initializer.  */
  943. + /* the order of the first 8 registers must match the compiler's 
  944. +  * numbering scheme (which is the same as the 386 scheme)
  945. +  * also, this table must match regmap in i386-pinsn.c.
  946. +  */
  947. + #define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
  948. +              "esp", "ebp", "esi", "edi", \
  949. +              "eip", "ps", "cs", "ss", \
  950. +              "ds", "es", "fs", "gs", \
  951. +              }
  952. + /* Register numbers of various important registers.
  953. +    Note that some of these values are "real" register numbers,
  954. +    and correspond to the general registers of the machine,
  955. +    and some are "phony" register numbers which are too large
  956. +    to be actual register numbers as far as the user is concerned
  957. +    but do serve to get the desired values when passed to read_register.  */
  958. + #define FP_REGNUM 5        /* Contains address of executing stack frame */
  959. + #define SP_REGNUM 4        /* Contains address of top of stack */
  960. + #define PC_REGNUM 8
  961. + #define PS_REGNUM 9
  962. + #define REGISTER_U_ADDR(addr, blockend, regno) \
  963. +     (addr) = i386_register_u_addr ((blockend),(regno));
  964. + /* Total amount of space needed to store our copies of the machine's
  965. +    register state, the array `registers'.  */
  966. + #define REGISTER_BYTES (NUM_REGS * 4)
  967. + /* Index within `registers' of the first byte of the space for
  968. +    register N.  */
  969. + #define REGISTER_BYTE(N) ((N)*4)
  970. + /* Number of bytes of storage in the actual machine representation
  971. +    for register N.  */
  972. + #define REGISTER_RAW_SIZE(N) (4)
  973. + /* Number of bytes of storage in the program's representation
  974. +    for register N. */
  975. + #define REGISTER_VIRTUAL_SIZE(N) (4)
  976. + /* Largest value REGISTER_RAW_SIZE can have.  */
  977. + #define MAX_REGISTER_RAW_SIZE 4
  978. + /* Largest value REGISTER_VIRTUAL_SIZE can have.  */
  979. + #define MAX_REGISTER_VIRTUAL_SIZE 4
  980. + /* Nonzero if register N requires conversion
  981. +    from raw format to virtual format.  */
  982. + #define REGISTER_CONVERTIBLE(N) (0)
  983. + /* Convert data from raw format for register REGNUM
  984. +    to virtual format for register REGNUM.  */
  985. + #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) {bcopy ((FROM), (TO), 4);}
  986. + /* Convert data from virtual format for register REGNUM
  987. +    to raw format for register REGNUM.  */
  988. + #define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) {bcopy ((FROM), (TO), 4);}
  989. + /* Return the GDB type object for the "standard" data type
  990. +    of data in register N.  */
  991. + #define REGISTER_VIRTUAL_TYPE(N) (builtin_type_int)
  992. + /* Store the address of the place in which to copy the structure the
  993. +    subroutine will return.  This is called from call_function. */
  994. + #define STORE_STRUCT_RETURN(ADDR, SP) \
  995. +   { (SP) -= sizeof (ADDR);        \
  996. +     write_memory ((SP), &(ADDR), sizeof (ADDR)); }
  997. + /* Extract from an array REGBUF containing the (raw) register state
  998. +    a function return value of type TYPE, and copy that, in virtual format,
  999. +    into VALBUF.  */
  1000. + #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
  1001. +   bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE))
  1002. + /* Write into appropriate registers a function return value
  1003. +    of type TYPE, given in virtual format.  */
  1004. + #define STORE_RETURN_VALUE(TYPE,VALBUF) \
  1005. +   write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
  1006. + /* Extract from an array REGBUF containing the (raw) register state
  1007. +    the address in which a function should return its structure value,
  1008. +    as a CORE_ADDR (or an expression that can be used as one).  */
  1009. + #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
  1010. + /* Describe the pointer in each stack frame to the previous stack frame
  1011. +    (its caller).  */
  1012. + /* FRAME_CHAIN takes a frame's nominal address
  1013. +    and produces the frame's chain-pointer.
  1014. +    FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address
  1015. +    and produces the nominal address of the caller frame.
  1016. +    However, if FRAME_CHAIN_VALID returns zero,
  1017. +    it means the given frame is the outermost one and has no caller.
  1018. +    In that case, FRAME_CHAIN_COMBINE is not used.  */
  1019. + #define FRAME_CHAIN(thisframe) \
  1020. +   (outside_startup_file ((thisframe)->pc) ? \
  1021. +    read_memory_integer ((thisframe)->frame, 4) :\
  1022. +    0)
  1023. + #define FRAME_CHAIN_VALID(chain, thisframe) \
  1024. +   (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
  1025. + #define FRAME_CHAIN_COMBINE(chain, thisframe) (chain)
  1026. + /* Define other aspects of the stack frame.  */
  1027. + /* A macro that tells us whether the function invocation represented
  1028. +    by FI does not have a frame on the stack associated with it.  If it
  1029. +    does not, FRAMELESS is set to 1, else 0.  */
  1030. + #define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
  1031. +   FRAMELESS_LOOK_FOR_PROLOGUE(FI, FRAMELESS)
  1032. + #define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
  1033. + #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
  1034. + #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
  1035. + /* Return number of args passed to a frame.
  1036. +    Can return -1, meaning no way to tell.  */
  1037. + #define FRAME_NUM_ARGS(numargs, fi) (numargs) = i386_frame_num_args(fi)
  1038. + /* Return number of bytes at start of arglist that are not really args.  */
  1039. + #define FRAME_ARGS_SKIP 8
  1040. + /* Put here the code to store, into a struct frame_saved_regs,
  1041. +    the addresses of the saved registers of frame described by FRAME_INFO.
  1042. +    This includes special registers such as pc and fp saved in special
  1043. +    ways in the stack frame.  sp is even more special:
  1044. +    the address we return for it IS the sp for the next frame.  */
  1045. + #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
  1046. + { i386_frame_find_saved_regs ((frame_info), &(frame_saved_regs)); }
  1047. + /* Things needed for making the inferior call functions.  */
  1048. + /* Push an empty stack frame, to record the current PC, etc.  */
  1049. + #define PUSH_DUMMY_FRAME { i386_push_dummy_frame (); }
  1050. + /* Discard from the stack the innermost frame, restoring all registers.  */
  1051. + #define POP_FRAME  { i386_pop_frame (); }
  1052. + /* this is 
  1053. +  *   call 11223344 (32 bit relative)
  1054. +  *   int3
  1055. +  */
  1056. + #define CALL_DUMMY { 0x223344e8, 0xcc11 }
  1057. + #define CALL_DUMMY_LENGTH 8
  1058. + #define CALL_DUMMY_START_OFFSET 0  /* Start execution at beginning of dummy */
  1059. + /* Insert the specified number of args and function address
  1060. +    into a call sequence of the above form stored at DUMMYNAME.  */
  1061. + #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, type)   \
  1062. + { \
  1063. +     int from, to, delta, loc; \
  1064. +     loc = (int)(read_register (SP_REGNUM) - CALL_DUMMY_LENGTH); \
  1065. +     from = loc + 5; \
  1066. +     to = (int)(fun); \
  1067. +     delta = to - from; \
  1068. +     *(int *)((char *)(dummyname) + 1) = delta; \
  1069. + }
  1070. + #define CANNOT_EXECUTE_STACK
  1071. + /* missing stuff from SCO */
  1072. + #define X_OK 1            /* for access(2) */
  1073. + #define W_OK 2            /* for access(2) */
  1074. + #define R_OK 4            /* for access(2) */
  1075. *** dist-gdb.old/munch    Wed Jul  5 19:46:28 1989
  1076. --- munch    Sat May  5 14:59:38 1990
  1077. ***************
  1078. *** 6,11 ****
  1079.   echo 'void initialize_all_files () {'
  1080.   
  1081. ! if test "$1" = "-DSYSV" ; then
  1082.       shift;
  1083.       nm $* | egrep '^(.*[^a-zA-Z_]_|_)initialize_' | \
  1084.       sed -e 's/^.*\(_initialize_[a-zA-Z0-9_]*\)[^a-zA-Z0-9_].*$/   \1 ();/'
  1085. --- 6,15 ----
  1086.   echo 'void initialize_all_files () {'
  1087.   
  1088. ! if [ -f /xenix ]; then
  1089.       shift;
  1090. +     nm $* | egrep 'A *__initialize_' | \
  1091. +     sed -e 's/^.*A *_*\(.*\)/    _\1 ();/'
  1092. + else if test "$1" = "-DSYSV" ; then
  1093. +     shift;
  1094.       nm $* | egrep '^(.*[^a-zA-Z_]_|_)initialize_' | \
  1095.       sed -e 's/^.*\(_initialize_[a-zA-Z0-9_]*\)[^a-zA-Z0-9_].*$/   \1 ();/'
  1096. ***************
  1097. *** 13,16 ****
  1098. --- 17,21 ----
  1099.       nm -p $* | egrep 'T *__initialize_' | \
  1100.       sed -e 's/^.*T *_*\(.*\)/    _\1 ();/'
  1101. + fi
  1102.   fi
  1103.   
  1104. *** dist-gdb.old/readline/readline.c    Sun Nov 26 21:31:36 1989
  1105. --- readline/readline.c    Sat May  5 14:59:43 1990
  1106. ***************
  1107. *** 1044,1048 ****
  1108.   readline_default_bindings ()
  1109.   {
  1110. ! #ifdef TIOCGETP
  1111.     struct sgttyb ttybuff;
  1112.     int tty = fileno (rl_instream);
  1113. --- 1044,1048 ----
  1114.   readline_default_bindings ()
  1115.   {
  1116. ! #if 0 /* def TIOCGETP */
  1117.     struct sgttyb ttybuff;
  1118.     int tty = fileno (rl_instream);
  1119. *** dist-gdb.old/symtab.h    Fri Sep  8 00:59:14 1989
  1120. --- symtab.h    Sat May  5 14:59:43 1990
  1121. ***************
  1122. *** 150,153 ****
  1123. --- 150,156 ----
  1124.        how long errors take). */
  1125.     int statics_offset, n_static_syms;
  1126. + #ifdef M_XENIX
  1127. +   int stringtab_off;
  1128. + #endif /* M_XENIX */
  1129.   };
  1130.   
  1131. *** dist-gdb.old/test/fred.h    Thu Jan  1 00:00:00 1970
  1132. --- test/fred.h    Sat May  5 15:14:16 1990
  1133. ***************
  1134. *** 0 ****
  1135. --- 1,5 ----
  1136. + struct test_s {
  1137. +     long l;
  1138. +     int  i;
  1139. +     char c;
  1140. + };
  1141. *** dist-gdb.old/test/test.c    Thu Jan  1 00:00:00 1970
  1142. --- test/test.c    Sat May  5 15:48:37 1990
  1143. ***************
  1144. *** 0 ****
  1145. --- 1,32 ----
  1146. + #include <stdio.h>
  1147. + #include "fred.h"
  1148. + extern char **environ;
  1149. + int j = 100;
  1150. + struct test_s test_v;
  1151. + boo(char *p)
  1152. + {
  1153. +     return 0x3742;
  1154. + }
  1155. + #define alloca __builtin_alloca
  1156. + main(int argc, char **argv)
  1157. + {
  1158. +     int i;
  1159. +     char *p;
  1160. +     i = 1234;
  1161. +     test_v.l = 34;
  1162. +     test_v.i = 35;
  1163. +     test_v.c = 36;
  1164. +     foo(&test_v);
  1165. +     printf("%s: hello world (%d, %d)\n", *argv, i, j);
  1166. +     p = alloca(200000);
  1167. +     foo(p);
  1168. +     p = alloca(10);
  1169. +     strcpy(p, "FooBar");
  1170. +     *p = 'Z';
  1171. +     while (1) ;
  1172. + }
  1173. *** dist-gdb.old/test/test1.c    Thu Jan  1 00:00:00 1970
  1174. --- test/test1.c    Sat May  5 17:41:05 1990
  1175. ***************
  1176. *** 0 ****
  1177. --- 1,9 ----
  1178. + #include <stdio.h>
  1179. + #include "fred.h"
  1180. + foo(st)
  1181. + struct test_s *st;
  1182. + {
  1183. +     printf("%d %d %d\n", st->l, st->i, st->c);
  1184. +     while (1);
  1185. + }
  1186. *** dist-gdb.old/values.c    Sun Sep 10 03:39:19 1989
  1187. --- values.c    Sat May  5 17:28:02 1990
  1188. ***************
  1189. *** 1025,1028 ****
  1190.     add_info ("values", value_history_info,
  1191.           "Elements of value history (around item number IDX, or last ten).");
  1192. !   add_info_alias ("history", value_history_info, 0);
  1193.   }
  1194. --- 1025,1028 ----
  1195.     add_info ("values", value_history_info,
  1196.           "Elements of value history (around item number IDX, or last ten).");
  1197. ! /*  add_info_alias ("history", value_history_info, 0); */
  1198.   }
  1199.