gcc and gdb config files for stabs in coff on 386 System V systems

Michael Bloom mb at ttidca.TTI.COM
Sat Aug 18 10:15:09 AEST 1990


I'm enclosing configuration files for gcc and gdb for use on 386
System V systems with my "stabs-in-coff" patches for gas and gdb.

I'd appreciate it if people would try these out and let me know the
results.  If the results are good, I'll include these in the next
release of the "stabs-in-coff" patch set.

If you do not already have the stabs-in-coff patch set, it may be
obtained via either ftp or uucp as follows:

        UUCP: osu-cis!~/gnu/coff/gnu-coff.tar.Z
        FTP:  tut.cis.ohio-state.edu:/pub/gnu/coff/gnu-coff.tar.Z

 - Michael Bloom
   mb at ttidca.tti.com

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	UPDATE.README
#	gcc-patches
#	gdb-patches
#	m-i386gcoff.h
#	tm-i386gcoff.h
#	bugfix.patch
# This archive created: Fri Aug 17 16:59:40 1990
export PATH; PATH=/bin:/usr/bin:$PATH
echo shar: "extracting 'UPDATE.README'" '(671 characters)'
if test -f 'UPDATE.README'
then
	echo shar: "will not over-write existing file 'UPDATE.README'"
else
sed 's/^	X//' << \SHAR_EOF > 'UPDATE.README'
	XThis shar contains:
	X
	X	UPDATE.README	This file
	X	tm-i386gcoff.h	a gcc config file for 386 system V sytems.
	X	m-i386gcoff.h	a gdb config file for 386 system V sytems.
	X	gcc-patches	an update to "config.gcc"
	X	gdb-patches	an update to "config.gdb"
	X	bugfix.patch	a small bug fix including a patch to 
	X			dbxread.c that should be applied AFTER the 
	X			patches you've already applied from the 
	X			stabs-in-coff patch set.
	X
	XFor the time being, the config files listed above should be
	Xconsidered "test versions". If reports are good, I'll include them in
	Xthe next version of the coff patch set.
	X
	XThe bugfix patch applies to all systems using the coff patches, 
	Xnot just 386 systems.
SHAR_EOF
if test 671 -ne "`wc -c < 'UPDATE.README'`"
then
	echo shar: "error transmitting 'UPDATE.README'" '(should have been 671 characters)'
fi
fi
echo shar: "extracting 'gcc-patches'" '(479 characters)'
if test -f 'gcc-patches'
then
	echo shar: "will not over-write existing file 'gcc-patches'"
else
sed 's/^	X//' << \SHAR_EOF > 'gcc-patches'
	X*** orig/config.gcc	Tue Jul 24 21:09:50 1990
	X--- ./config.gcc	Tue Jul 24 21:11:41 1990
	X***************
	X*** 117,122 ****
	X--- 117,127 ----
	X  		configuration_file=xm-i386v.h
	X  		target_machine=tm-i386gas.h
	X  		;;		
	X+ 	i386-gcoff | i386gc)		# for Intel 80386's using gas with COFF
	X+ 		cpu_type=i386
	X+ 		configuration_file=xm-i386v.h
	X+ 		target_machine=tm-i386gcoff.h
	X+ 		;;		
	X  	i386-aix | ps2-aix | aix386 | ps2aix )		# for IBM PS/2 running AIX
	X  		machine=aix386
	X  		cpu_type=i386
SHAR_EOF
if test 479 -ne "`wc -c < 'gcc-patches'`"
then
	echo shar: "error transmitting 'gcc-patches'" '(should have been 479 characters)'
fi
chmod +x 'gcc-patches'
fi
echo shar: "extracting 'gdb-patches'" '(573 characters)'
if test -f 'gdb-patches'
then
	echo shar: "will not over-write existing file 'gdb-patches'"
else
sed 's/^	X//' << \SHAR_EOF > 'gdb-patches'
	X*** bloom/config.gdb	Wed Jul 25 22:11:05 1990
	X--- ./config.gdb	Wed Jul 25 22:09:44 1990
	X***************
	X*** 225,230 ****
	X--- 225,238 ----
	X  # of this file about unneeded files.
	X  	opcodefile=m-i386.h
	X  	;;
	X+ i386gcoff)
	X+ 	makedefine="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o -DM_COBJS=coff-dbx.o"
	X+ 	pinsnfile=i386-pinsn.c
	X+ 	depfile=i386-dep.c
	X+ # The following is a lie, but a necessary one.  See comment at beginning
	X+ # of this file about unneeded files.
	X+ 	opcodefile=m-i386.h
	X+ 	;;
	X  merlin)
	X  	echo ""
	X  	echo "To install GDB on this machine you must copy /bin/sh"
SHAR_EOF
if test 573 -ne "`wc -c < 'gdb-patches'`"
then
	echo shar: "error transmitting 'gdb-patches'" '(should have been 573 characters)'
fi
chmod +x 'gdb-patches'
fi
echo shar: "extracting 'm-i386gcoff.h'" '(4697 characters)'
if test -f 'm-i386gcoff.h'
then
	echo shar: "will not over-write existing file 'm-i386gcoff.h'"
else
sed 's/^	X//' << \SHAR_EOF > 'm-i386gcoff.h'
	X/* Macro defintions for i386, running System V 3.2,
	X   using the GNU assembler which generates COFF objects
	X   containing DBX symbols.
	X   Copyright (C) 1989 Free Software Foundation, Inc.
	X
	XThis file is part of GDB.
	X
	XGDB is free software; you can redistribute it and/or modify
	Xit under the terms of the GNU General Public License as published by
	Xthe Free Software Foundation; either version 1, or (at your option)
	Xany later version.
	X
	XGDB is distributed in the hope that it will be useful,
	Xbut WITHOUT ANY WARRANTY; without even the implied warranty of
	XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	XGNU General Public License for more details.
	X
	XYou should have received a copy of the GNU General Public License
	Xalong with GDB; see the file COPYING.  If not, write to
	Xthe Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
	X
	X#include "m-i386-sv32.h"
	X
	X/* We use DBX debugging information */
	X
	X#define READ_DBX_FORMAT
	X
	X/* COFF PARAMS: */
	X/* Macro to declare variables to hold the file's header data.  */
	X#define DECLARE_FILE_HEADERS  struct aouthdr hdr; 		\
	X	 FILHDR coffhdr; SCNHDR scn[10];/*char * extra_strings; */  \
	X	extern int text_scn, data_scn, bss_scn
	X
	X/* macro to declare the entry point of this file */
	X#define ENTRY_POINT hdr.entry
	X
	X/* Macro for number of symbol table entries */
	X#define NUMBER_OF_SYMBOLS (coffhdr.f_nsyms)
	X
	X/* Macro for file-offset of string table (in usual COFF format).  */
	X#define STRING_TABLE_OFFSET (coffhdr.f_symptr+coffhdr.f_nsyms*SYMESZ)
	X
	X/* Macro for file-offset of symbol table (in usual COFF format).  */
	X#define SYMBOL_TABLE_OFFSET (coffhdr.f_symptr)
	X
	X/* macro to distinguish relocatable object from non relocatable object */
	X#define IS_OBJECT_FILE ((hdr.f_flags & F_EXEC) == 0)
	X
	X/* Get the address in debugged memory of the start
	X   of the text segment.  */
	X#define ADDR_OF_TEXT_SEGMENT (scn[text_scn].s_vaddr)
	X
	X/* Macro for size of text segment */
	X#define SIZE_OF_TEXT_SEGMENT (scn[text_scn].s_size)
	X
	X/* Names of text data and bss sections. Do we still need these? */
	X
	X#define TEXT_SECTION_NAME ".text"
	X#define DATA_SECTION_NAME ".data"
	X#define BSS_SECTION_NAME  ".bss"
	X
	X/* Macro to read the header data from descriptor DESC and validate it.
	X   NAME is the file name, for error messages.  */
	X
	X#define READ_FILE_HEADERS(DESC, NAME)				\
	X{ int optsz,i;							\
	X  int val = myread (DESC, &coffhdr, sizeof coffhdr);		\
	X  if (val < 0)							\
	X    perror_with_name (NAME);					\
	X  if (!ISCOFF(coffhdr.f_magic))					\
	X    error ("File \"%s\" not in coff executable format.", NAME);	\
	X  number_of_symbols = coffhdr.f_nsyms;				\
	X  optsz = (coffhdr.f_opthdr> sizeof hdr)?sizeof hdr:coffhdr.f_opthdr; \
	X  val = myread (DESC, &hdr, optsz);				\
	X  if (val < 0)							\
	X    perror_with_name (NAME);					\
	X/*  if (N_BADMAG (hdr))						\
	X    error ("File \"%s\" not in executable format.", NAME); */   \
	X  bzero(&scn[0],sizeof(scn[0]));				\
	X  val = myread (DESC, &scn[1], sizeof scn[0]*coffhdr.f_nscns);	\
	X  if (val < 0)							\
	X    perror_with_name (NAME);					\
	X  clear_coff_sections();					\
	X  for (i = 1; i <=coffhdr.f_nscns;i++) 				\
	X    map_coff_section(i,&scn[i]);				\
	X}
	X
	X/* The type to set unwanted symbols to in coff-dbx.c's convert_symbuf() */
	X#define IGNORED_SYMBOL_TYPE ( 0xff)
	X
	X/* Auxents containing line table indexes are converted to symbols
	X   having this type: */
	X#define N_MULTI_LINE_TYPE ( 0xf0)
	X
	X/* Enstabbed coff private type that indicates number of line table entries
	X   to be processed at this point during symbol readin. */
	X#define N_LINE_COUNT_TYPE ( 0xf1)
	X
	X/* This is how dbxread recognizes symbols to be ignored */
	X#define IGNORE_SYMBOL(type) (IGNORED_SYMBOL_TYPE==type)
	X
	X/* this is the ON DISK size of a symbol. This may not be the same as the
	X   value sizeof() yields. On the sun 386i, they are not the same */
	X#define NLIST_STRUCT_SIZE SYMESZ
	X
	X/* This is how to increment a pointer to a symbol. often: p++ */
	X#define NLIST_INCR(p)  p = (struct nlist *) ((int)p + SYMESZ )
	X
	X/* This is how to index into an arrayof symbols. Often: ptr[index]  */
	X#define NLIST_INDEX(ptr,index) (* (struct nlist *) ((int)ptr + index*SYMESZ))
	X
	X/* define this if preprocessing needs to be done on a buffer of symbols. */
	X#define CONVERT_SYMBUF
	X
	X/* define this if absolute values are used for block symbols */
	X#define BLOCK_ADDRESS_ABSOLUTE
	X
	X/* Use the GNU stab definitions. There are no local ones. */
	X#define NO_NATIVE_STAB_INCLUDE
	X
	X/* Stabs come before the gcc_compiled. symbol.
	X   Don't do lseek that triggers bug */
	X
	X#define STABS_BEFORE_GCC_COMPILED
	X
	X/* no longer used, I think */
	X#define ADJUST_STARTUP_VALUES
	X
	X/* If compiled with GNU C, use the built-in alloca */
	X#ifdef __GNUC__
	X#define alloca __builtin_alloca
	X#endif
	X
	X
SHAR_EOF
if test 4697 -ne "`wc -c < 'm-i386gcoff.h'`"
then
	echo shar: "error transmitting 'm-i386gcoff.h'" '(should have been 4697 characters)'
fi
fi
echo shar: "extracting 'tm-i386gcoff.h'" '(3474 characters)'
if test -f 'tm-i386gcoff.h'
then
	echo shar: "will not over-write existing file 'tm-i386gcoff.h'"
else
sed 's/^	X//' << \SHAR_EOF > 'tm-i386gcoff.h'
	X/* Definitions for Intel 386 running system V with gnu tools
	X   Copyright (C) 1988 Free Software Foundation, Inc.
	X
	XThis file is part of GNU CC.
	X
	XGNU CC is free software; you can redistribute it and/or modify
	Xit under the terms of the GNU General Public License as published by
	Xthe Free Software Foundation; either version 1, or (at your option)
	Xany later version.
	X
	XGNU CC is distributed in the hope that it will be useful,
	Xbut WITHOUT ANY WARRANTY; without even the implied warranty of
	XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	XGNU General Public License for more details.
	X
	XYou should have received a copy of the GNU General Public License
	Xalong with GNU CC; see the file COPYING.  If not, write to
	Xthe Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
	X
	X
	X#include "tm-i386.h"
	X
	X/* Use the bsd assembler syntax.  */
	X/* we need to do this because gas is really a bsd style assembler,
	X * and so doesn't work well this these att-isms:
	X *
	X *  ASM_OUTPUT_SKIP is .set .,.+N, which isn't implemented in gas
	X *  ASM_OUTPUT_LOCAL is done with .set .,.+N, but that can't be
	X *   used to define bss static space
	X *
	X * Next is the question of whether to uses underscores.  RMS didn't
	X * like this idea at first, but since it is now obvious that we
	X * need this separate tm file for use with gas, at least to get
	X * dbx debugging info, I think we should also switch to underscores.
	X * We can keep tm-i386v for real att style output, and the few
	X * people who want both form will have to compile twice.
	X */
	X
	X#include "tm-bsd386.h"
	X
	X/* these come from tm-bsd386.h, but are specific to sequent */
	X#undef DBX_NO_XREFS
	X#undef DBX_CONTIN_LENGTH
	X
	X/* By default, target has a 80387.  */
	X
	X#define TARGET_DEFAULT 1
	X
	X/* Specify predefined symbols in preprocessor.  */
	X
	X#define CPP_PREDEFINES "-Dunix -Di386"
	X
	X/* Allow #sccs in preprocessor.  */
	X
	X#define SCCS_DIRECTIVE
	X
	X/* Output #ident as a .ident.  */
	X
	X#define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME);
	X
	X/* We do not want to output SDB debugging information.  */
	X
	X#undef SDB_DEBUGGING_INFO
	X
	X/* We want to output DBX debugging information.  */
	X
	X#define DBX_DEBUGGING_INFO
	X
	X/* Implicit library calls should use memcpy, not bcopy, etc.  */
	X
	X#define TARGET_MEM_FUNCTIONS
	X
	X/* Tell GAS to emit COFF modules */
	X
	X#define ASM_SPEC "-C"
	X
	X/* When using gas, .align N aligns to an N-byte boundary.  */
	X
	X#undef ASM_OUTPUT_ALIGN
	X#define ASM_OUTPUT_ALIGN(FILE,LOG)	\
	X     if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
	X
	X/* Align labels, etc. at 4-byte boundaries.  */
	X
	X#define ASM_OUTPUT_ALIGN_CODE(FILE) \
	X     fprintf ((FILE), "\t.align 4\n");
	X
	X/* Machines that use the AT&T assembler syntax
	X   also return floating point values in an FP register.  */
	X/* Define how to find the value returned by a function.
	X   VALTYPE is the data type of the value (as a tree).
	X   If the precise function being called is known, FUNC is its FUNCTION_DECL;
	X   otherwise, FUNC is 0.  */
	X
	X#define VALUE_REGNO(MODE) \
	X  (((MODE)==SFmode || (MODE)==DFmode) ? FIRST_FLOAT_REG : 0)
	X
	X/* 1 if N is a possible register number for a function value. */
	X
	X#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0 || (N)== FIRST_FLOAT_REG)
	X
	X#undef ASM_FILE_START
	X#define ASM_FILE_START(FILE) \
	X  fprintf (FILE, "\t.file\t\"%s\"\n", dump_base_name);
	X
	X/* This is how to output a reference to a user-level label named NAME.  */
	X
	X#undef ASM_OUTPUT_LABELREF
	X#define ASM_OUTPUT_LABELREF(FILE,NAME)	\
	X  fprintf (FILE, "%s", NAME)
SHAR_EOF
if test 3474 -ne "`wc -c < 'tm-i386gcoff.h'`"
then
	echo shar: "error transmitting 'tm-i386gcoff.h'" '(should have been 3474 characters)'
fi
fi
echo shar: "extracting 'bugfix.patch'" '(1346 characters)'
if test -f 'bugfix.patch'
then
	echo shar: "will not over-write existing file 'bugfix.patch'"
else
sed 's/^	X//' << \SHAR_EOF > 'bugfix.patch'
	Xdiff -c /tmp/checkout/dbxread.c ./dbxread.c
	X*** /tmp/checkout/dbxread.c	Fri Aug 17 16:20:42 1990
	X--- ./dbxread.c	Fri Aug 17 16:21:08 1990
	X***************
	X*** 3254,3259 ****
	X--- 3255,3261 ----
	X    conv_symnum = 0;
	X    symnum_limit = sym_size / NLIST_STRUCT_SIZE;
	X  
	X+ #ifndef STABS_BEFORE_GCC_COMPILED
	X    if (sym_offset >= NLIST_STRUCT_SIZE)
	X      {
	X        lseek (desc, sym_offset - NLIST_STRUCT_SIZE, L_INCR);
	X***************
	X*** 3267,3272 ****
	X--- 3269,3275 ----
	X  	 && !strcmp (namestring, GCC_COMPILED_FLAG_SYMBOL));
	X      }
	X    else
	X+ #endif /* not STABS_BEFORE_GCC_COMPILED */
	X      {
	X        /* The N_SO starting this symtab is the first symbol, so we
	X  	 better not check the symbol before it.  I'm not this can
	Xdiff -c /tmp/checkout/m-pbb.h ./m-pbb.h
	X*** /tmp/checkout/m-pbb.h	Fri Aug 17 16:23:19 1990
	X--- ./m-pbb.h	Fri Aug 17 16:23:39 1990
	X***************
	X*** 734,736 ****
	X--- 735,739 ----
	X  #define NO_NATIVE_STAB_INCLUDE
	X  
	X  #define EXTRA_MISC_INIT extra_misc_init() ; /* move to dep */
	X+ 
	X+ #define STABS_BEFORE_GCC_COMPILED
	Xdiff -c /tmp/checkout/m-sun386i.h ./m-sun386i.h
	X*** /tmp/checkout/m-sun386i.h	Fri Aug 17 16:20:42 1990
	X--- ./m-sun386i.h	Fri Aug 17 16:20:56 1990
	X***************
	X*** 417,419 ****
	X--- 417,421 ----
	X  #define BLOCK_ADDRESS_ABSOLUTE
	X  
	X  #define SYMENT_HAS_EXPLICIT_DESC
	X+ 
	X+ #define STABS_BEFORE_GCC_COMPILED
SHAR_EOF
if test 1346 -ne "`wc -c < 'bugfix.patch'`"
then
	echo shar: "error transmitting 'bugfix.patch'" '(should have been 1346 characters)'
fi
fi
exit 0
#	End of shell archive



More information about the Comp.unix.i386 mailing list