home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-12-28 | 38.5 KB | 1,366 lines |
- *** dist-gdb/Makefile.dist Wed Jan 31 03:42:57 1990
- --- ./Makefile.dist Tue May 8 12:33:40 1990
- ***************
- *** 19,24 ****
- will be incorrectly compiled. The "fixincludes" script in the gcc
- distribution will fix your include files up. */
- ! /* CC=gcc -traditional */
- ! CC=cc
-
- /* It is also possible that you will need to add -I/usr/include/sys to the
- --- 19,24 ----
- will be incorrectly compiled. The "fixincludes" script in the gcc
- distribution will fix your include files up. */
- ! CC=gcc -traditional
- ! /* CC=cc */
-
- /* It is also possible that you will need to add -I/usr/include/sys to the
- ***************
- *** 26,31 ****
- is where it should be according to Posix). */
-
- ! YACC=bison -y -v
- ! /* YACC=yacc */
- SHELL=/bin/sh
- MAKE=make
- --- 26,31 ----
- is where it should be according to Posix). */
-
- ! /* YACC=bison -y -v */
- ! YACC=yacc
- SHELL=/bin/sh
- MAKE=make
- ***************
- *** 43,51 ****
- /* M_CFLAGS, if defined, has system-dependent CFLAGS. */
- #if !defined(M_CFLAGS)
- ! #define M_CFLAGS
- #endif
-
- /* CFLAGS for both GDB and readline. */
- ! GLOBAL_CFLAGS = -g M_CFLAGS
- CFLAGS = -I. ${HAVE_VPRINTF_DEFINE} ${GLOBAL_CFLAGS}
- /* None of the things in CFLAGS will do any harm, and on some systems
- --- 43,51 ----
- /* M_CFLAGS, if defined, has system-dependent CFLAGS. */
- #if !defined(M_CFLAGS)
- ! #define M_CFLAGS -DM_SYSV
- #endif
-
- /* CFLAGS for both GDB and readline. */
- ! GLOBAL_CFLAGS = M_CFLAGS
- CFLAGS = -I. ${HAVE_VPRINTF_DEFINE} ${GLOBAL_CFLAGS}
- /* None of the things in CFLAGS will do any harm, and on some systems
- ***************
- *** 67,72 ****
- REGEX1 = M_REGEX
- #else
- ! REGEX =
- ! REGEX1 =
- #endif
-
- --- 67,72 ----
- REGEX1 = M_REGEX
- #else
- ! REGEX = regex.o
- ! REGEX1 = regex.o
- #endif
-
- ***************
- *** 113,117 ****
- For example, -lPW for System V to get alloca(). */
- #ifndef M_CLIBS
- ! #define M_CLIBS
- #endif
- CLIBS = ${ADD_FILES} ${TERMCAP} M_CLIBS
- --- 113,117 ----
- For example, -lPW for System V to get alloca(). */
- #ifndef M_CLIBS
- ! #define M_CLIBS -lx
- #endif
- CLIBS = ${ADD_FILES} ${TERMCAP} M_CLIBS
- ***************
- *** 125,129 ****
- remote.c source.c stack.c standalone.c stuff.c symmisc.c symtab.c \
- utils.c valarith.c valops.c valprint.c values.c version.c expread.y \
- ! xgdb.c
-
- DEPFILES = umax-dep.c gould-dep.c default-dep.c sun3-dep.c \
- --- 125,129 ----
- remote.c source.c stack.c standalone.c stuff.c symmisc.c symtab.c \
- utils.c valarith.c valops.c valprint.c values.c version.c expread.y \
- ! x386dbx.c xgdb.c
-
- DEPFILES = umax-dep.c gould-dep.c default-dep.c sun3-dep.c \
- ***************
- *** 174,178 ****
- OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
- values.o eval.o valops.o valarith.o valprint.o printcmd.o \
- ! symtab.o symmisc.o coffread.o dbxread.o infcmd.o infrun.o remote.o \
- command.o utils.o expread.o expprint.o pinsn.o environ.o version.o \
- copying.o ${READLINEOBS}
- --- 174,178 ----
- OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
- values.o eval.o valops.o valarith.o valprint.o printcmd.o \
- ! symtab.o symmisc.o coffread.o dbxread.o x386dbx.o infcmd.o infrun.o remote.o \
- command.o utils.o expread.o expprint.o pinsn.o environ.o version.o \
- copying.o ${READLINEOBS}
- ***************
- *** 259,265 ****
- rm -f gdb.tar
- mkdir dist-gdb
- ! cd dist-gdb ; for i in ${TARFILES} ; do ln -s ../$$i . ; done
- mkdir dist-gdb/readline
- ! cd dist-gdb/readline ; for i in ${READLINE} ; do ln -s ../../readline/$$i . ; done
- tar chf gdb.tar dist-gdb
- rm -rf dist-gdb
- --- 259,265 ----
- rm -f gdb.tar
- mkdir dist-gdb
- ! cd dist-gdb ; for i in ${TARFILES} ; do ln -s "../$$i" . ; done
- mkdir dist-gdb/readline
- ! cd dist-gdb/readline ; for i in ${READLINE} ; do ln -s "../../readline/$$i" . ; done
- tar chf gdb.tar dist-gdb
- rm -rf dist-gdb
- *** dist-gdb.old/breakpoint.c Wed Jan 10 23:49:07 1990
- --- breakpoint.c Sat May 5 14:59:30 1990
- ***************
- *** 1108,1112 ****
- if (b->number == num)
- {
- ! function (b);
- goto win;
- }
- --- 1108,1112 ----
- if (b->number == num)
- {
- ! (*function)(b);
- goto win;
- }
- *** dist-gdb.old/config.gdb Tue Jan 30 20:35:46 1990
- --- config.gdb Mon May 7 15:33:32 1990
- ***************
- *** 327,330 ****
- --- 327,336 ----
- opcodefile=four
- ;;
- + xenix386)
- + pinsnfile=i386-pinsn.c
- + # The following is a lie, but a necessary one. See comment at beginning
- + # of this file about unneeded files.
- + opcodefile=m-xenix386.h
- + ;;
- *)
- echo "Unknown machine type: \`$machine'"
- ***************
- *** 370,375 ****
- echo "Editing Makefile"
- cp Makefile.dist tmp.c
- ! cc -E >Makefile tmp.c $makedefine -DM_MAKEDEFINE="$makedefine"
- ! rm -f tmp.c
-
- echo "GDB is now set up for use with a $machine." \
- --- 376,381 ----
- echo "Editing Makefile"
- cp Makefile.dist tmp.c
- ! gcc -E >Makefile $makedefine -DM_MAKEDEFINE="$makedefine" tmp.c
- ! #rm -f tmp.c
-
- echo "GDB is now set up for use with a $machine." \
- *** dist-gdb.old/core.c Wed Jan 10 23:55:17 1990
- --- core.c Sat May 5 14:59:31 1990
- ***************
- *** 50,53 ****
- --- 50,57 ----
- #include <sys/ptrace.h>
- #else
- + #ifdef M_XENIX
- + #include <sys/page.h>
- + #include <sys/seg.h>
- + #endif
- #include <sys/user.h>
- #endif
- ***************
- *** 63,69 ****
- --- 67,77 ----
- #ifndef COFF_FORMAT
- #ifndef AOUTHDR
- + #ifdef M_XENIX
- + #define AOUTHDR struct xexec
- + #else
- #define AOUTHDR struct exec
- #endif
- #endif
- + #endif
-
- extern char *sys_siglist[];
- ***************
- *** 201,208 ****
- return;
-
- if (N_MAGIC (core_aouthdr) != 0
- && bcmp (&core_aouthdr, &exec_aouthdr, sizeof core_aouthdr))
- printf ("Warning: core file does not match specified executable file.\n");
- ! else if (exec_mtime > st_core.st_mtime)
- printf ("Warning: exec file is newer than core file.\n");
- }
- --- 209,220 ----
- return;
-
- + /* cannot validate core file against executable file on xenix */
- + #ifndef M_XENIX
- if (N_MAGIC (core_aouthdr) != 0
- && bcmp (&core_aouthdr, &exec_aouthdr, sizeof core_aouthdr))
- printf ("Warning: core file does not match specified executable file.\n");
- ! else
- ! #endif
- ! if (exec_mtime > st_core.st_mtime)
- printf ("Warning: exec file is newer than core file.\n");
- }
- *** dist-gdb.old/dbxread.c Sat Jan 27 07:30:54 1990
- --- dbxread.c Sat May 5 15:44:39 1990
- ***************
- *** 41,44 ****
- --- 41,59 ----
- #endif
-
- + #ifdef M_XENIX
- + #include <sys/relsym.h>
- + #define nlist xenix_nlist /* the system nlist is broken */
- + #include <a.out.h>
- + #undef nlist
- + #define nlist gas_nlist
- + #include "stab.gnu.h"
- + #include "gas-nlist.h"
- +
- + #define STRING_SEG 4
- + #define SYMS_SEG 5
- + #define AOUTHDR struct xexec
- +
- + #else /* M_XENIX */
- +
- #ifdef COFF_ENCAPSULATE
- #include "a.out.encap.h"
- ***************
- *** 48,51 ****
- --- 63,68 ----
- #include <stab.h>
- #endif
- + #endif /* M_XENIX */
- +
- #include <ctype.h>
-
- ***************
- *** 168,171 ****
- --- 185,190 ----
- static struct type **read_args ();
-
- + #ifndef M_XENIX
- +
- /* Macro to determine which symbols to ignore when reading the first symbol
- of a file. Some machines override this definition. */
- ***************
- *** 284,287 ****
- --- 303,413 ----
- #define BELIEVE_PCC_PROMOTION 0
- #endif
- +
- + #else /* M_XENIX */
- +
- + /* Macro to determine which symbols to ignore when reading the first symbol
- + of a file. Some machines override this definition. */
- +
- + extern struct xseg *find_segment();
- +
- + #ifndef IGNORE_SYMBOL
- + /* Don't ignore any symbols. */
- + #define IGNORE_SYMBOL(type) (0)
- + #endif
- +
- + /* Macro for number of symbol table entries (in usual a.out format).
- + Some machines override this definition. */
- + #ifndef NUMBER_OF_SYMBOLS
- + #define NUMBER_OF_SYMBOLS \
- + ({ struct xseg *cseg; long z;\
- + cseg = find_segment(XS_TSYMS, SYMS_SEG); \
- + z = cseg ? cseg->xs_psize / sizeof(struct nlist) : 0; z;})
- + #endif
- +
- + /* Macro for file-offset of symbol table (in usual a.out format). */
- + #ifndef SYMBOL_TABLE_OFFSET
- + #define SYMBOL_TABLE_OFFSET \
- + ({ struct xseg *cseg; long z;\
- + cseg = find_segment(XS_TSYMS, SYMS_SEG); \
- + z = cseg ? cseg->xs_filpos : 0; z;})
- + #endif
- +
- + /* Macro for file-offset of string table (in usual a.out format). */
- + #ifndef STRING_TABLE_OFFSET
- + #define STRING_TABLE_OFFSET \
- + ({ struct xseg *cseg; long z;\
- + cseg = find_segment(XS_TSYMS, STRING_SEG); \
- + z = cseg ? cseg->xs_filpos : 0; z; })
- + #endif
- +
- + /* Macro to store the length of the string table data in INTO. */
- + #ifndef READ_STRING_TABLE_SIZE
- + #define READ_STRING_TABLE_SIZE(INTO) \
- + { struct xseg *cseg; \
- + cseg = find_segment(XS_TSYMS, STRING_SEG); \
- + INTO = cseg ? cseg->xs_psize : 0; }
- + #endif
- +
- + /* Macro to declare variables to hold the file's header data. */
- + #ifndef DECLARE_FILE_HEADERS
- + #define DECLARE_FILE_HEADERS AOUTHDR hdr
- + #endif
- +
- + #define N_BADMAG(hdr)\
- + (hdr.x_magic != X_MAGIC && (hdr.x_cpu & XC_CPU) != XC_386 \
- + && (hdr.x_renv & XE_SEG) == 0 && (hdr.x_renv & XE_EXEC) == 0)
- +
- + /* Macro to read the header data from descriptor DESC and validate it.
- + NAME is the file name, for error messages. */
- + #ifndef READ_FILE_HEADERS
- + #define READ_FILE_HEADERS(DESC, NAME) \
- + { val = myread (DESC, &hdr, sizeof hdr); \
- + if (val < 0) perror_with_name (NAME); \
- + if (N_BADMAG (hdr)) \
- + error ("File \"%s\" not in executable format.", NAME);\
- + process_a_out(DESC, NAME); }
- + #endif
- +
- + #ifndef IS_OBJECT_FILE
- + #define IS_OBJECT_FILE 0
- + #endif
- +
- + /* Macro for size of text segment */
- + #ifndef SIZE_OF_TEXT_SEGMENT
- + #define SIZE_OF_TEXT_SEGMENT hdr.x_text
- + #endif
- +
- + /* Get the address in debugged memory of the start
- + of the text segment. */
- + #if !defined (ADDR_OF_TEXT_SEGMENT)
- + #define ADDR_OF_TEXT_SEGMENT 0
- + #endif /* no ADDR_OF_TEXT_SEGMENT */
- +
- + /* Macro to get entry point from headers. */
- + #ifndef ENTRY_POINT
- + #define ENTRY_POINT hdr.x_entry
- + #endif
- +
- + /* Macro for name of symbol to indicate a file compiled with gcc. */
- + #ifndef GCC_COMPILED_FLAG_SYMBOL
- + #define GCC_COMPILED_FLAG_SYMBOL "gcc_compiled."
- + #endif
- +
- + /* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
- +
- + #ifndef STAB_REG_TO_REGNUM
- + #define STAB_REG_TO_REGNUM(VALUE) (VALUE)
- + #endif
- +
- + /* Define this as 1 if a pcc declaration of a char or short argument
- + gives the correct address. Otherwise assume pcc gives the
- + address of the corresponding int, which is not the same on a
- + big-endian machine. */
- +
- + #ifndef BELIEVE_PCC_PROMOTION
- + #define BELIEVE_PCC_PROMOTION 0
- + #endif
- +
- + #endif /* !M_XENIX */
-
- /* Nonzero means give verbose info on gdb action. From main.c. */
- ***************
- *** 1628,1631 ****
- --- 1754,1763 ----
- make_cleanup (free_current_contents, &name);
-
- + #ifdef M_XENIX
- + /* On xenix (with gcc) READ_FILE_HEADER reads the segment table,
- + * fileinfo table and global symbol table as well.
- + */
- + #endif /* M_XENIX */
- +
- READ_FILE_HEADERS (desc, name);
-
- ***************
- *** 1677,1680 ****
- --- 1809,1816 ----
- if (val < 0)
- perror_with_name (name);
- + #ifdef X_DEBUG
- + printf("\nstring table offset = %d, size = %d, start = %s\n",
- + STRING_TABLE_OFFSET, buffer, stringtab);
- + #endif
-
- /* Throw away the old symbol table. */
- ***************
- *** 1721,1725 ****
- --- 1857,1865 ----
- /* Go over the misc functions and install them in vector. */
-
- + #ifndef M_XENIX /* This has already been done at header read time */
- condense_misc_bunches (0);
- + #else
- + process_global_symbol_table(desc, name);
- + #endif /* M_XENIX */
-
- /* Don't allow char * to have a typename (else would get caddr_t.) */
- ***************
- *** 1938,1941 ****
- --- 2078,2091 ----
- #endif
-
- + #ifdef M_XENIX
- + long lsym_count = 0;
- + long flsym_count = 0;
- + long file_string_base = 0;
- + long stringtab_offset = 0;
- + long symtab_pos = 0;
- + long filadd = 0;
- + int file_count = 0;
- + #endif /* M_XENIX */
- +
- /* Current partial symtab */
- struct partial_symtab *pst;
- ***************
- *** 1990,1993 ****
- --- 2140,2148 ----
- symbuf_end = symbuf_idx = 0;
-
- + #ifdef M_XENIX
- + init_fileinfo_processing(); /* start processing the list of files */
- + nlistlen += 10; /* force the hack code to terminate the loop */
- + #endif /* M_XENIX */
- +
- for (symnum = 0; symnum < nlistlen; symnum++)
- {
- ***************
- *** 1994,1997 ****
- --- 2149,2194 ----
- /* Get the symbol for this run and pull out some info */
- QUIT; /* allow this to be interruptable */
- + #ifdef M_XENIX
- +
- + /* This is a gross hack. Xenix places pointers to each files $$SYMBOLS
- + * (containing the symbols for DBX) and $$TYPES (containing the strings
- + * for DBX) in the file name table. There is also a partial symbol
- + * table record for each file produced by the loader - this is ignored
- + * at present.
- + */
- + if (lsym_count == 0)
- + {
- + try_next_file:
- + if (!get_next_fileinfo(&stringtab_offset, &flsym_count, &filadd,
- + &symtab_pos))
- + { /* all files proccessed */
- + symnum = nlistlen;
- + continue;
- + }
- + else
- + {
- + lseek(desc, symtab_pos, 0);
- + stringtab_global = stringtab + stringtab_offset;
- + symbuf_idx = symbuf_end; /* force symbol reading */
- + lsym_count = flsym_count;
- + }
- +
- + file_count++;
- +
- + if (file_count == 2)
- + startup_file_start = filadd;
- +
- + if (file_count == 3)
- + startup_file_end = filadd;
- +
- + if (lsym_count == 0) /* skip this file if no symbols in it */
- + goto try_next_file;
- +
- + }
- +
- +
- + lsym_count--;
- +
- + #endif /* M_XENIX */
- if (symbuf_idx == symbuf_end)
- fill_symbuf ();
- ***************
- *** 2024,2028 ****
- error ("Invalid symbol data: bad string table offset: %d", \
- bufp->n_un.n_strx); \
- ! namestring = bufp->n_un.n_strx + stringtab
-
- #define ADD_PSYMBOL_TO_LIST(NAME, NAMELENGTH, NAMESPACE, CLASS, LIST, VALUE)\
- --- 2221,2225 ----
- error ("Invalid symbol data: bad string table offset: %d", \
- bufp->n_un.n_strx); \
- ! namestring = bufp->n_un.n_strx + stringtab + stringtab_offset
-
- #define ADD_PSYMBOL_TO_LIST(NAME, NAMELENGTH, NAMESPACE, CLASS, LIST, VALUE)\
- ***************
- *** 2052,2057 ****
- } while (0);
-
-
- ! switch (bufp->n_type)
- {
- /*
- --- 2249,2259 ----
- } while (0);
-
- + #ifdef X_DEBUG
- + printf("%s = (%#x, %d, %#x)\n",
- + bufp->n_un.n_strx ? bufp->n_un.n_strx+stringtab+stringtab_offset : "<NONE>",
- + (unsigned char)bufp->n_type, bufp->n_desc, bufp->n_value);
- + #endif /* X_DEBUG */
-
- ! switch ((unsigned char)bufp->n_type)
- {
- /*
- ***************
- *** 2058,2061 ****
- --- 2260,2264 ----
- * Standard, non-debugger, symbols
- */
- + #ifndef M_XENIX /* these are not present with Xenix / GCC */
-
- case N_TEXT | N_EXT:
- ***************
- *** 2177,2180 ****
- --- 2380,2385 ----
- #endif
-
- + #endif /* M_XENIX */
- +
- /* Keep going . . .*/
-
- ***************
- *** 2210,2213 ****
- --- 2415,2419 ----
- if (pst && past_first_source_file)
- {
- + #ifndef M_XENIX
- end_psymtab (pst, psymtab_include_list, includes_used,
- symnum * sizeof (struct nlist), bufp->n_value,
- ***************
- *** 2214,2217 ****
- --- 2420,2429 ----
- dependency_list, dependencies_used,
- global_psymbols.next, static_psymbols.next);
- + #else
- + end_psymtab (pst, psymtab_include_list, includes_used,
- + symtab_pos + flsym_count * sizeof (struct nlist),
- + bufp->n_value, dependency_list, dependencies_used,
- + global_psymbols.next, static_psymbols.next);
- + #endif
- pst = (struct partial_symtab *) 0;
- includes_used = 0;
- ***************
- *** 2221,2227 ****
- --- 2433,2445 ----
- past_first_source_file = 1;
-
- + #ifndef M_XENIX
- pst = start_psymtab (namestring, bufp->n_value,
- symnum * sizeof (struct nlist),
- global_psymbols.next, static_psymbols.next);
- + #else
- + pst = start_psymtab (namestring, bufp->n_value, symtab_pos,
- + global_psymbols.next, static_psymbols.next,
- + stringtab_offset, flsym_count);
- + #endif /* M_XENIX */
-
- continue;
- ***************
- *** 2592,2595 ****
- --- 2810,2814 ----
-
- /* If there's stuff to be cleaned up, clean it up. */
- + #ifndef M_XENIX
- if (entry_point < bufp->n_value
- && entry_point >= last_o_file_start)
- ***************
- *** 2598,2604 ****
- --- 2817,2825 ----
- startup_file_end = bufp->n_value;
- }
- + #endif /* M_XENIX */
-
- if (pst)
- {
- + #ifndef M_XENIX
- end_psymtab (pst, psymtab_include_list, includes_used,
- symnum * sizeof (struct nlist), end_of_text_addr,
- ***************
- *** 2605,2608 ****
- --- 2826,2835 ----
- dependency_list, dependencies_used,
- global_psymbols.next, static_psymbols.next);
- + #else /* M_XENIX */
- + end_psymtab (pst, psymtab_include_list, includes_used,
- + symtab_pos + flsym_count * sizeof (struct nlist),
- + end_of_text_addr, dependency_list, dependencies_used,
- + global_psymbols.next, static_psymbols.next);
- + #endif /* M_XENIX */
- includes_used = 0;
- dependencies_used = 0;
- ***************
- *** 2654,2657 ****
- --- 2881,2885 ----
- */
- static struct partial_symtab *
- + #ifndef M_XENIX
- start_psymtab (filename, textlow, ldsymoff, global_syms, static_syms)
- char *filename;
- ***************
- *** 2660,2663 ****
- --- 2888,2902 ----
- struct partial_symbol *global_syms;
- struct partial_symbol *static_syms;
- + #else
- + start_psymtab (filename, textlow, ldsymoff, global_syms, static_syms, stroffset,
- + symcount)
- + char *filename;
- + int textlow;
- + int ldsymoff;
- + struct partial_symbol *global_syms;
- + struct partial_symbol *static_syms;
- + int stroffset;
- + int symcount;
- + #endif
- {
- struct partial_symtab *result =
- ***************
- *** 2672,2676 ****
- result->textlow = textlow;
- result->ldsymoff = ldsymoff;
- !
- result->readin = 0;
-
- --- 2911,2917 ----
- result->textlow = textlow;
- result->ldsymoff = ldsymoff;
- ! #ifdef M_XENIX
- ! result->ldsymlen = symcount * sizeof(struct nlist);
- ! #endif
- result->readin = 0;
-
- ***************
- *** 2680,2683 ****
- --- 2921,2925 ----
- result->n_global_syms = 0;
- result->n_static_syms = 0;
- + result->stringtab_off = stroffset;
-
- return result;
- ***************
- *** 2723,2727 ****
- --- 2965,2971 ----
- int i;
-
- + #ifndef M_XENIX
- pst->ldsymlen = capping_symbol_offset - pst->ldsymoff;
- + #endif /* M_XENIX */
- pst->texthigh = capping_text;
-
- ***************
- *** 2831,2835 ****
- --- 3075,3081 ----
-
- /* Read in this files symbols */
- + #ifndef M_XENIX
- lseek (desc, sym_offset, L_SET);
- +
- read_ofile_symtab (desc, stringtab, stringtab_size,
- pst->ldsymoff,
- ***************
- *** 2836,2839 ****
- --- 3082,3092 ----
- pst->ldsymlen, pst->textlow,
- pst->texthigh - pst->textlow, 0);
- + #else /* M_XENIX */
- + read_ofile_symtab (desc, stringtab + pst->stringtab_off,
- + stringtab_size - pst->stringtab_off,
- + pst->ldsymoff,
- + pst->ldsymlen, pst->textlow,
- + pst->texthigh - pst->textlow, 0);
- + #endif /* M_XENIX */
- sort_symtab_syms (symtab_list); /* At beginning since just added */
-
- ***************
- *** 2904,2908 ****
- --- 3157,3163 ----
- error("Symbol file not readable");
-
- + #ifndef M_XENIX
- READ_FILE_HEADERS (desc, name);
- + #endif /* M_XENIX */
-
- /* Read in the string table */
- ***************
- *** 3059,3062 ****
- --- 3314,3318 ----
- symbuf_end = symbuf_idx = 0;
-
- + #ifndef M_XENIX
- /* It is necessary to actually read one symbol *before* the start
- of this symtab's symbols, because the GCC_COMPILED_FLAG_SYMBOL
- ***************
- *** 3065,3068 ****
- --- 3321,3325 ----
- Detecting this in read_dbx_symtab
- would slow down initial readin, so we look for it here instead. */
- +
- if (sym_offset >= sizeof (struct nlist))
- {
- ***************
- *** 3088,3091 ****
- --- 3345,3355 ----
- processing_gcc_compilation = 0;
- }
- + #else /* M_XENIX */
- + lseek(desc, sym_offset, L_SET);
- + processing_gcc_compilation = 0;
- + #ifdef X_DEBUG
- + printf("sym_offset = %d, sym_size = %d\n", sym_offset, sym_size);
- + #endif /* X_DEBUG */
- + #endif /* M_XENIX */
-
- if (symbuf_idx == symbuf_end)
- ***************
- *** 3095,3098 ****
- --- 3359,3368 ----
- fatal("First symbol in segment of executable not a source symbol");
-
- + #ifdef X_DEBUG
- + printf("%s = (%#x, %d, %#x)\n",
- + bufp->n_un.n_strx ? bufp->n_un.n_strx+stringtab : "<NONE>",
- + (unsigned char)bufp->n_type, bufp->n_desc, bufp->n_value);
- + #endif /* X_DEBUG */
- +
- for (symnum = 0;
- symnum < sym_size / sizeof(struct nlist);
- ***************
- *** 3104,3107 ****
- --- 3374,3382 ----
- bufp = &symbuf[symbuf_idx++];
- type = bufp->n_type;
- + #ifdef X_DEBUG
- + printf("%s = (%#x, %d, %#x)\n",
- + bufp->n_un.n_strx ? bufp->n_un.n_strx+stringtab : "<NONE>",
- + (unsigned char)bufp->n_type, bufp->n_desc, bufp->n_value);
- + #endif /* X_DEBUG */
-
- if (offset &&
- ***************
- *** 3477,3480 ****
- --- 3752,3757 ----
- /* Read in another .o file and create a symtab entry for it.*/
-
- + #ifndef M_XENIX /* Xenix can't do incremental loads */
- +
- static void
- read_addl_syms (desc, stringtab, nlistlen, text_addr, text_size)
- ***************
- *** 3773,3776 ****
- --- 4050,4054 ----
- fflush (stdout);
- }
- + #endif /* M_XENIX */
-
- /* Read a number by which a type is referred to in dbx data,
- ***************
- *** 5466,5475 ****
- undef_types = (struct type **) xmalloc (undef_types_allocated *
- sizeof (struct type *));
- -
- add_com ("symbol-file", class_files, symbol_file_command,
- "Load symbol table (in dbx format) from executable file FILE.");
-
- add_com ("add-file", class_files, add_file_command,
- "Load the symbols from FILE, assuming its code is at TEXT_START.") ;
- }
-
- --- 5744,5754 ----
- undef_types = (struct type **) xmalloc (undef_types_allocated *
- sizeof (struct type *));
- add_com ("symbol-file", class_files, symbol_file_command,
- "Load symbol table (in dbx format) from executable file FILE.");
-
- + #ifndef M_XENIX
- add_com ("add-file", class_files, add_file_command,
- "Load the symbols from FILE, assuming its code is at TEXT_START.") ;
- + #endif /* M_XENIX */
- }
-
- *** dist-gdb.old/eval.c Sun Nov 5 18:01:52 1989
- --- eval.c Sat May 5 14:59:35 1990
- ***************
- *** 412,419 ****
- goto nosideret;
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- ! return value_zero (lookup_struct_elt_type (TYPE_TARGET_TYPE
- ! (VALUE_TYPE (arg1)),
- ! &exp->elts[pc + 1].string),
- ! lval_memory);
- else
- return value_struct_elt (arg1, 0, &exp->elts[pc + 1].string, 0,
- --- 412,419 ----
- goto nosideret;
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- ! return value_zero (lookup_struct_elt_type
- ! (TYPE_TARGET_TYPE(VALUE_TYPE (arg1)),
- ! &exp->elts[pc + 1].string),
- ! lval_memory);
- else
- return value_struct_elt (arg1, 0, &exp->elts[pc + 1].string, 0,
- *** dist-gdb.old/gas-nlist.h Thu Jan 1 00:00:00 1970
- --- gas-nlist.h Sat May 5 14:59:35 1990
- ***************
- *** 0 ****
- --- 1,13 ----
- + #define N_STAB 0340
- +
- + struct gas_nlist {
- + union {
- + char *n_name;
- + struct gas_nlist *n_next;
- + long n_strx;
- + } n_un;
- + char n_type;
- + char n_other;
- + short n_desc;
- + unsigned n_value;
- + };
- *** dist-gdb.old/inflow.c Wed Jan 10 23:55:38 1990
- --- inflow.c Sat May 5 14:59:36 1990
- ***************
- *** 30,33 ****
- --- 30,34 ----
- /* Some USG-esque systems (some of which are BSD-esque enough so that USG
- is not defined) want this header, and it won't do any harm. */
- + /* rk@unify.UUCP: yes it will if you include it twice (line removed below) */
- #include <fcntl.h>
-
- ***************
- *** 47,51 ****
- #else
- #include <sys/ioctl.h>
- - #include <fcntl.h>
- #include <sgtty.h>
- #define TERMINAL struct sgttyb
- --- 48,51 ----
- ***************
- *** 299,303 ****
- --- 299,307 ----
-
- printf_filtered ("fcntl flags = 0x%x, sgttyb.sg_flags = 0x%x, owner pid = %d.\n",
- + #ifdef TIOCGPGRP
- tflags_inferior, sg_inferior.sg_flags, pgrp_inferior);
- + #else
- + tflags_inferior, sg_inferior.sg_flags, 0);
- + #endif
-
- #endif /* not HAVE_TERMIO */
- *** dist-gdb.old/infrun.c Tue Jan 23 23:10:35 1990
- --- infrun.c Sat May 5 14:59:36 1990
- ***************
- *** 147,150 ****
- --- 147,154 ----
- #include <sys/param.h>
- /* Needed by IN_SIGTRAMP on some machines (e.g. vax). */
- + #ifdef M_XENIX
- + #include <sys/page.h>
- + #include <sys/seg.h>
- + #endif
- #include <sys/user.h>
-
- *** dist-gdb.old/m-xenix386.h Thu Jan 1 00:00:00 1970
- --- m-xenix386.h Sat May 5 14:59:38 1990
- ***************
- *** 0 ****
- --- 1,350 ----
- + /* Macro defintions for i386.
- + Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
- +
- + This file is part of GDB.
- +
- + GDB is free software; you can redistribute it and/or modify
- + it under the terms of the GNU General Public License as published by
- + the Free Software Foundation; either version 1, or (at your option)
- + any later version.
- +
- + GDB is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + GNU General Public License for more details.
- +
- + You should have received a copy of the GNU General Public License
- + along with GDB; see the file COPYING. If not, write to
- + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
- +
- + /* Define the bit, byte, and word ordering of the machine. */
- + /* #define BITS_BIG_ENDIAN */
- + /* #define BYTES_BIG_ENDIAN */
- + /* #define WORDS_BIG_ENDIAN */
- +
- + /*
- + * Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu)
- + * July 1988
- + */
- +
- +
- + #ifndef i386
- + #define i386
- + #endif
- +
- + /* This machine doesn't have the siginterrupt call. */
- + #define NO_SIGINTERRUPT
- +
- + #define ALIGN_STACK_ON_STARTUP
- +
- + /* define USG if you are using sys5 /usr/include's */
- + #define USG
- +
- + /* USG systems need these */
- + #define vfork() fork()
- + #define MAXPATHLEN 500
- +
- + /* define this if you don't have the extension to coff that allows
- + * file names to appear in the string table
- + * (aux.x_file.x_foff)
- + */
- + #define COFF_NO_LONG_FILE_NAMES
- +
- + /* turn this on when rest of gdb is ready */
- + /* #define IEEE_FLOAT */
- +
- + #define NBPG NBPC
- + #define UPAGES USIZE
- +
- + /* #define HAVE_TERMIO */
- +
- + /* Get rid of any system-imposed stack limit if possible. */
- +
- + /* #define SET_STACK_LIMIT_HUGE not in sys5 */
- +
- + /* Define this if the C compiler puts an underscore at the front
- + of external names before giving them to the linker. */
- +
- + #define NAMES_HAVE_UNDERSCORE
- +
- + /* Specify debugger information format (only one) */
- +
- + #define READ_DBX_FORMAT
- + #undef COFF_FORMAT
- +
- + /* number of traps that happen between exec'ing the shell
- + * to run an inferior, and when we finally get to
- + * the inferior code. This is 2 on most implementations.
- + */
- + #define START_INFERIOR_TRAPS_EXPECTED 2
- +
- + /* Offset from address of function to start of its code.
- + Zero on most machines. */
- +
- + #define FUNCTION_START_OFFSET 0
- +
- + /* Advance PC across any function entry prologue instructions
- + to reach some "real" code. */
- +
- + #define SKIP_PROLOGUE(frompc) {(frompc) = i386_skip_prologue((frompc));}
- +
- + /* Immediately after a function call, return the saved pc.
- + Can't always go through the frames for this because on some machines
- + the new frame is not set up until the new function executes
- + some instructions. */
- +
- + #define SAVED_PC_AFTER_CALL(frame) \
- + (read_memory_integer (read_register (SP_REGNUM), 4))
- +
- + /* This is the amount to subtract from u.u_ar0
- + to get the offset in the core file of the register values. */
- +
- + #define KERNEL_U_ADDR 0x06000000
- +
- + /* Address of end of stack space. */
- +
- + #define STACK_END_ADDR 0x80000000
- +
- + /* Stack grows downward. */
- +
- + #define INNER_THAN <
- +
- + /* Sequence of bytes for breakpoint instruction. */
- +
- + #define BREAKPOINT {0xcc}
- +
- + /* Amount PC must be decremented by after a breakpoint.
- + This is often the number of bytes in BREAKPOINT
- + but not always. */
- +
- + #define DECR_PC_AFTER_BREAK 1
- +
- + /* Nonzero if instruction at PC is a return instruction. */
- +
- + #define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0xc3)
- +
- + /* Return 1 if P points to an invalid floating point value.
- + LEN is the length in bytes -- not relevant on the 386. */
- +
- + #define INVALID_FLOAT(p, len) (0)
- +
- + /* code to execute to print interesting information about the
- + * floating point processor (if any)
- + * No need to define if there is nothing to do.
- + */
- + #define FLOAT_INFO { i386_float_info (); }
- +
- +
- + /* Largest integer type */
- + #define LONGEST long
- +
- + /* Name of the builtin type for the LONGEST type above. */
- + #define BUILTIN_TYPE_LONGEST builtin_type_long
- +
- + /* Say how long (ordinary) registers are. */
- +
- + #define REGISTER_TYPE long
- +
- + /* Number of machine registers */
- +
- + #define NUM_REGS 16
- +
- + /* Initializer for an array of names of registers.
- + There should be NUM_REGS strings in this initializer. */
- +
- + /* the order of the first 8 registers must match the compiler's
- + * numbering scheme (which is the same as the 386 scheme)
- + * also, this table must match regmap in i386-pinsn.c.
- + */
- + #define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
- + "esp", "ebp", "esi", "edi", \
- + "eip", "ps", "cs", "ss", \
- + "ds", "es", "fs", "gs", \
- + }
- +
- + /* Register numbers of various important registers.
- + Note that some of these values are "real" register numbers,
- + and correspond to the general registers of the machine,
- + and some are "phony" register numbers which are too large
- + to be actual register numbers as far as the user is concerned
- + but do serve to get the desired values when passed to read_register. */
- +
- + #define FP_REGNUM 5 /* Contains address of executing stack frame */
- + #define SP_REGNUM 4 /* Contains address of top of stack */
- +
- + #define PC_REGNUM 8
- + #define PS_REGNUM 9
- +
- + #define REGISTER_U_ADDR(addr, blockend, regno) \
- + (addr) = i386_register_u_addr ((blockend),(regno));
- +
- + /* Total amount of space needed to store our copies of the machine's
- + register state, the array `registers'. */
- + #define REGISTER_BYTES (NUM_REGS * 4)
- +
- + /* Index within `registers' of the first byte of the space for
- + register N. */
- +
- + #define REGISTER_BYTE(N) ((N)*4)
- +
- + /* Number of bytes of storage in the actual machine representation
- + for register N. */
- +
- + #define REGISTER_RAW_SIZE(N) (4)
- +
- + /* Number of bytes of storage in the program's representation
- + for register N. */
- +
- + #define REGISTER_VIRTUAL_SIZE(N) (4)
- +
- + /* Largest value REGISTER_RAW_SIZE can have. */
- +
- + #define MAX_REGISTER_RAW_SIZE 4
- +
- + /* Largest value REGISTER_VIRTUAL_SIZE can have. */
- +
- + #define MAX_REGISTER_VIRTUAL_SIZE 4
- +
- + /* Nonzero if register N requires conversion
- + from raw format to virtual format. */
- +
- + #define REGISTER_CONVERTIBLE(N) (0)
- +
- + /* Convert data from raw format for register REGNUM
- + to virtual format for register REGNUM. */
- +
- + #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) {bcopy ((FROM), (TO), 4);}
- +
- + /* Convert data from virtual format for register REGNUM
- + to raw format for register REGNUM. */
- +
- + #define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) {bcopy ((FROM), (TO), 4);}
- +
- + /* Return the GDB type object for the "standard" data type
- + of data in register N. */
- +
- + #define REGISTER_VIRTUAL_TYPE(N) (builtin_type_int)
- +
- + /* Store the address of the place in which to copy the structure the
- + subroutine will return. This is called from call_function. */
- +
- + #define STORE_STRUCT_RETURN(ADDR, SP) \
- + { (SP) -= sizeof (ADDR); \
- + write_memory ((SP), &(ADDR), sizeof (ADDR)); }
- +
- + /* Extract from an array REGBUF containing the (raw) register state
- + a function return value of type TYPE, and copy that, in virtual format,
- + into VALBUF. */
- +
- + #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- + bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE))
- +
- + /* Write into appropriate registers a function return value
- + of type TYPE, given in virtual format. */
- +
- + #define STORE_RETURN_VALUE(TYPE,VALBUF) \
- + write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
- +
- + /* Extract from an array REGBUF containing the (raw) register state
- + the address in which a function should return its structure value,
- + as a CORE_ADDR (or an expression that can be used as one). */
- +
- + #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
- +
- +
- + /* Describe the pointer in each stack frame to the previous stack frame
- + (its caller). */
- +
- + /* FRAME_CHAIN takes a frame's nominal address
- + and produces the frame's chain-pointer.
- +
- + FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address
- + and produces the nominal address of the caller frame.
- +
- + However, if FRAME_CHAIN_VALID returns zero,
- + it means the given frame is the outermost one and has no caller.
- + In that case, FRAME_CHAIN_COMBINE is not used. */
- +
- + #define FRAME_CHAIN(thisframe) \
- + (outside_startup_file ((thisframe)->pc) ? \
- + read_memory_integer ((thisframe)->frame, 4) :\
- + 0)
- +
- + #define FRAME_CHAIN_VALID(chain, thisframe) \
- + (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
- +
- + #define FRAME_CHAIN_COMBINE(chain, thisframe) (chain)
- +
- + /* Define other aspects of the stack frame. */
- +
- + /* A macro that tells us whether the function invocation represented
- + by FI does not have a frame on the stack associated with it. If it
- + does not, FRAMELESS is set to 1, else 0. */
- + #define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
- + FRAMELESS_LOOK_FOR_PROLOGUE(FI, FRAMELESS)
- +
- + #define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
- +
- + #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
- +
- + #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
- +
- + /* Return number of args passed to a frame.
- + Can return -1, meaning no way to tell. */
- +
- + #define FRAME_NUM_ARGS(numargs, fi) (numargs) = i386_frame_num_args(fi)
- +
- + /* Return number of bytes at start of arglist that are not really args. */
- +
- + #define FRAME_ARGS_SKIP 8
- +
- + /* Put here the code to store, into a struct frame_saved_regs,
- + the addresses of the saved registers of frame described by FRAME_INFO.
- + This includes special registers such as pc and fp saved in special
- + ways in the stack frame. sp is even more special:
- + the address we return for it IS the sp for the next frame. */
- +
- + #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
- + { i386_frame_find_saved_regs ((frame_info), &(frame_saved_regs)); }
- +
- +
- + /* Things needed for making the inferior call functions. */
- +
- + /* Push an empty stack frame, to record the current PC, etc. */
- +
- + #define PUSH_DUMMY_FRAME { i386_push_dummy_frame (); }
- +
- + /* Discard from the stack the innermost frame, restoring all registers. */
- +
- + #define POP_FRAME { i386_pop_frame (); }
- +
- + /* this is
- + * call 11223344 (32 bit relative)
- + * int3
- + */
- +
- + #define CALL_DUMMY { 0x223344e8, 0xcc11 }
- +
- + #define CALL_DUMMY_LENGTH 8
- +
- + #define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
- +
- + /* Insert the specified number of args and function address
- + into a call sequence of the above form stored at DUMMYNAME. */
- +
- + #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, type) \
- + { \
- + int from, to, delta, loc; \
- + loc = (int)(read_register (SP_REGNUM) - CALL_DUMMY_LENGTH); \
- + from = loc + 5; \
- + to = (int)(fun); \
- + delta = to - from; \
- + *(int *)((char *)(dummyname) + 1) = delta; \
- + }
- +
- + #define CANNOT_EXECUTE_STACK
- +
- + /* missing stuff from SCO */
- + #define X_OK 1 /* for access(2) */
- + #define W_OK 2 /* for access(2) */
- + #define R_OK 4 /* for access(2) */
- *** dist-gdb.old/munch Wed Jul 5 19:46:28 1989
- --- munch Sat May 5 14:59:38 1990
- ***************
- *** 6,11 ****
- echo 'void initialize_all_files () {'
-
- ! if test "$1" = "-DSYSV" ; then
- shift;
- nm $* | egrep '^(.*[^a-zA-Z_]_|_)initialize_' | \
- sed -e 's/^.*\(_initialize_[a-zA-Z0-9_]*\)[^a-zA-Z0-9_].*$/ \1 ();/'
- --- 6,15 ----
- echo 'void initialize_all_files () {'
-
- ! if [ -f /xenix ]; then
- shift;
- + nm $* | egrep 'A *__initialize_' | \
- + sed -e 's/^.*A *_*\(.*\)/ _\1 ();/'
- + else if test "$1" = "-DSYSV" ; then
- + shift;
- nm $* | egrep '^(.*[^a-zA-Z_]_|_)initialize_' | \
- sed -e 's/^.*\(_initialize_[a-zA-Z0-9_]*\)[^a-zA-Z0-9_].*$/ \1 ();/'
- ***************
- *** 13,16 ****
- --- 17,21 ----
- nm -p $* | egrep 'T *__initialize_' | \
- sed -e 's/^.*T *_*\(.*\)/ _\1 ();/'
- + fi
- fi
-
- *** dist-gdb.old/readline/readline.c Sun Nov 26 21:31:36 1989
- --- readline/readline.c Sat May 5 14:59:43 1990
- ***************
- *** 1044,1048 ****
- readline_default_bindings ()
- {
- ! #ifdef TIOCGETP
- struct sgttyb ttybuff;
- int tty = fileno (rl_instream);
- --- 1044,1048 ----
- readline_default_bindings ()
- {
- ! #if 0 /* def TIOCGETP */
- struct sgttyb ttybuff;
- int tty = fileno (rl_instream);
- *** dist-gdb.old/symtab.h Fri Sep 8 00:59:14 1989
- --- symtab.h Sat May 5 14:59:43 1990
- ***************
- *** 150,153 ****
- --- 150,156 ----
- how long errors take). */
- int statics_offset, n_static_syms;
- + #ifdef M_XENIX
- + int stringtab_off;
- + #endif /* M_XENIX */
- };
-
- *** dist-gdb.old/test/fred.h Thu Jan 1 00:00:00 1970
- --- test/fred.h Sat May 5 15:14:16 1990
- ***************
- *** 0 ****
- --- 1,5 ----
- + struct test_s {
- + long l;
- + int i;
- + char c;
- + };
- *** dist-gdb.old/test/test.c Thu Jan 1 00:00:00 1970
- --- test/test.c Sat May 5 15:48:37 1990
- ***************
- *** 0 ****
- --- 1,32 ----
- + #include <stdio.h>
- + #include "fred.h"
- +
- + extern char **environ;
- + int j = 100;
- +
- + struct test_s test_v;
- +
- + boo(char *p)
- + {
- + return 0x3742;
- + }
- +
- +
- + #define alloca __builtin_alloca
- + main(int argc, char **argv)
- + {
- + int i;
- + char *p;
- + i = 1234;
- + test_v.l = 34;
- + test_v.i = 35;
- + test_v.c = 36;
- + foo(&test_v);
- + printf("%s: hello world (%d, %d)\n", *argv, i, j);
- + p = alloca(200000);
- + foo(p);
- + p = alloca(10);
- + strcpy(p, "FooBar");
- + *p = 'Z';
- + while (1) ;
- + }
- *** dist-gdb.old/test/test1.c Thu Jan 1 00:00:00 1970
- --- test/test1.c Sat May 5 17:41:05 1990
- ***************
- *** 0 ****
- --- 1,9 ----
- + #include <stdio.h>
- + #include "fred.h"
- +
- + foo(st)
- + struct test_s *st;
- + {
- + printf("%d %d %d\n", st->l, st->i, st->c);
- + while (1);
- + }
- *** dist-gdb.old/values.c Sun Sep 10 03:39:19 1989
- --- values.c Sat May 5 17:28:02 1990
- ***************
- *** 1025,1028 ****
- add_info ("values", value_history_info,
- "Elements of value history (around item number IDX, or last ten).");
- ! add_info_alias ("history", value_history_info, 0);
- }
- --- 1025,1028 ----
- add_info ("values", value_history_info,
- "Elements of value history (around item number IDX, or last ten).");
- ! /* add_info_alias ("history", value_history_info, 0); */
- }
-