GDB for Xenix 386 with GCC (part 1 of 4)

Steve.Bleazard at RoboBar.Co.UK Steve.Bleazard at RoboBar.Co.UK
Tue May 8 21:17:38 AEST 1990


This is part one of a coordinated set of 4 patches for Xenix GCC, GAS and GDB.
GCC and GAS will need to be ALREADY PATCHED with ALL my Xenix 386 patches.
Please collect all parts before you start hacking :-)

No, I haven't made up the complete patch kit for sources.misc yet, but
that's because I'd like to share gdb with you first :-)

This is a preliminary release of a port to SCO Xenix of gdb support for
gcc.  The gdb work is partly based on Ron Kuris <ron at rdk386.UUCP>'s work,
but I've severely mangled it.

	* It no longer attempts to be compatible with SCO's sdb.
	  Trying to do that seems to be like hitting your head against
	  a <name your favourite immovable object> because the debugging
	  info format is both undocumented and CHANGES FROM RELEASE TO
	  RELEASE of SCO's compiler, or so it would seem.  So I gave
	  up and used dbx debugging info instead, which is much
	  better supported by the GNUfolk anyway.  So you can't mix and
	  match cc and gcc -g compiled programs for debugging, but ...

	* The GDB port is nearly a full one, structure types, all seem
	  to work fine, but I haven't got a 387 (you could donate one,
	  of course :-) so I can't test the floating point status support.
	  I can't hack the emulator at the moment--it doesn't seem to use
	  387 format.

	* The gdb fast initial partial-symbol-table read is supported,
	  as is incremental symbol loading.

This is part 1 which patches GCC, say |patch -p -d /usr/local/src/gcc-1.37.1
or whatever.  BTW it fixes the bug reported by bob at dhw68k.cts.com where
gcc didn't give the linker -l libraries in the right place.

As usual, all bug reports concerning these hacks are gratefully received.
Please send them to me, steve at robobar.co.uk or uunet!mcsun!ukc!robobar!steve.

#! /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 the files:
#	gcc-dbxpch.01
# This archive created: Tue May  8 09:32:38 1990
export PATH; PATH=/bin:$PATH
echo shar: extracting "'gcc-dbxpch.01'" '(8164 characters)'
if test -f 'gcc-dbxpch.01'
then
	echo shar: will not over-write existing file "'gcc-dbxpch.01'"
else
sed 's/^X//' << \SHAR_EOF > 'gcc-dbxpch.01'
X*** gcc.c.old	Mon May  7 15:42:23 1990
X--- gcc.c	Mon May  7 17:13:16 1990
X***************
X*** 96,104 ****
X   %{|S:X} like %{S:X}, but if no S switch, substitute `-'.
X   %{|!S:X} like %{!S:X}, but if there is an S switch, substitute `-'.
X- *ifdef M_XENIX
X-  %Z	substitute the names of the libraries specified with -l, each
X- 	name is prefixed with 'Slib'and has .a appended; the resultant
X- 	name is searched for in the standard list of directories.
X- *endif
X  
X  The conditional text X in a %{S:X} or %{!S:X} construct may contain
X--- 96,99 ----
X***************
X*** 249,256 ****
X  
X  #ifdef M_XENIX
X  /* Microsoft C 5.1 (Beta) and earlier (and probaly latter!) do not
X   * grok very long strings.  So here is the .c compilation spec
X   * string in a form it does grok!  The only difference between this
X!  * and the standard one is 'as' is replaced with 'gas'.
X   */
X  static char c_string[] = {
X--- 244,253 ----
X  
X  #ifdef M_XENIX
X+ #ifndef __GNUC__
X  /* Microsoft C 5.1 (Beta) and earlier (and probaly latter!) do not
X   * grok very long strings.  So here is the .c compilation spec
X   * string in a form it does grok!  The only difference between this
X!  * and the standard one is 'as' is replaced with 'gas' and %{gg:...}
X!  * with %{g}.
X   */
X  static char c_string[] = {
X***************
X*** 325,341 ****
X  	0x20,0x25,0x7b,0x6a,0x7d,0x20,0x25,0x7b,0x4a,0x7d,
X  	0x20,0x25,0x7b,0x68,0x7d,0x20,0x25,0x7b,0x64,0x32,
X! 	0x7d,0x20,0x25,0x61,0x20,0x25,0x7b,0x67,0x67,0x3a,
X! 	0x2d,0x47,0x20,0x25,0x67,0x2e,0x73,0x79,0x6d,0x7d,
X! 	0x9,0x9,0x20,0x20,0x20,0x20,0x20,0x20,0x25,0x7b,
X! 	0x63,0x3a,0x25,0x7b,0x6f,0x2a,0x7d,0x25,0x7b,0x21,
X! 	0x6f,0x2a,0x3a,0x2d,0x6f,0x20,0x25,0x77,0x25,0x62,
X! 	0x2e,0x6f,0x7d,0x7d,0x25,0x7b,0x21,0x63,0x3a,0x2d,
X! 	0x6f,0x20,0x25,0x64,0x25,0x77,0x25,0x62,0x2e,0x6f,
X! 	0x7d,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
X  	0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
X! 	0x20,0x20,0x20,0x25,0x7b,0x21,0x70,0x69,0x70,0x65,
X! 	0x3a,0x25,0x67,0x2e,0x73,0x7d,0xa,0x20,0x7d,0x7d,
X! 	0x7d,0x0
X  };
X  #endif /* M_XENIX */
X  
X--- 322,338 ----
X  	0x20,0x25,0x7b,0x6a,0x7d,0x20,0x25,0x7b,0x4a,0x7d,
X  	0x20,0x25,0x7b,0x68,0x7d,0x20,0x25,0x7b,0x64,0x32,
X! 	0x7d,0x20,0x25,0x61,0x20,0x25,0x7b,0x67,0x7d,0x9,
X! 	0x9,0x20,0x20,0x20,0x20,0x20,0x20,0x25,0x7b,0x63,
X! 	0x3a,0x25,0x7b,0x6f,0x2a,0x7d,0x25,0x7b,0x21,0x6f,
X! 	0x2a,0x3a,0x2d,0x6f,0x20,0x25,0x77,0x25,0x62,0x2e,
X! 	0x6f,0x7d,0x7d,0x25,0x7b,0x21,0x63,0x3a,0x2d,0x6f,
X! 	0x20,0x25,0x64,0x25,0x77,0x25,0x62,0x2e,0x6f,0x7d,
X  	0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
X! 	0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
X! 	0x20,0x20,0x25,0x7b,0x21,0x70,0x69,0x70,0x65,0x3a,
X! 	0x25,0x67,0x2e,0x73,0x7d,0xa,0x20,0x7d,0x7d,0x7d,
X! 	0x0
X  };
X+ #endif /* __GNUC__ */
X  #endif /* M_XENIX */
X  
X***************
X*** 359,363 ****
X--- 356,377 ----
X                        %{!pipe:%g.s}\n }}}"
X  #else /* M_XENIX */
X+ #ifdef __GNUC__
X+   "cpp %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{i*} %{trigraphs} -undef \
X+         -D__GNUC__ %{ansi:-trigraphs -$ -D__STRICT_ANSI__} %{!ansi:%p} %P\
X+         %c %{O:-D__OPTIMIZE__} %{traditional} %{pedantic}\
X+ 	%{Wcomment*} %{Wtrigraphs} %{Wall} %C\
X+         %i %{!M*:%{!E:%{!pipe:%g.cpp}}}%{E:%{o*}}%{M*:%{o*}} |\n\
X+     %{!M*:%{!E:cc1 %{!pipe:%g.cpp} %1 \
X+ 		   %{!Q:-quiet} -dumpbase %i %{Y*} %{d*} %{m*} %{f*} %{a}\
X+ 		   %{g} %{O} %{W*} %{w} %{pedantic} %{ansi} %{traditional}\
X+ 		   %{v:-version} %{gg:-symout %g.sym} %{pg:-p} %{p}\
X+ 		   %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
X+ 		   %{S:%{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
X+               %{!S:gas %{R} %{j} %{J} %{h} %{d2} %a %{g}\
X+ 		      %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\
X+                       %{!pipe:%g.s}\n }}}"
X+ #else /* __GNUC__ */
X     c_string
X+ #endif /* __GNUC__ */
X  #endif /* not M_XENIX */
X    },
X***************
X*** 392,396 ****
X  	%{v:-version} %{gg:-symout %g.sym} %{pg:-p} %{p}\
X  	%{S:%{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
X!     %{!S:gas %{R} %{j} %{J} %{h} %{d2} %a %{gg:-G %g.sym}\
X              %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %{!pipe:%g.s}\n }"},
X  #endif /* not M_XENIX */
X--- 406,410 ----
X  	%{v:-version} %{gg:-symout %g.sym} %{pg:-p} %{p}\
X  	%{S:%{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
X!     %{!S:gas %{R} %{j} %{J} %{h} %{d2} %a %{g}\
X              %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %{!pipe:%g.s}\n }"},
X  #endif /* not M_XENIX */
X***************
X*** 400,404 ****
X              %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i\n }"},
X  #else /* M_XENIX */
X!    "%{!S:gas %{R} %{j} %{J} %{h} %{d2} %a \
X              %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i\n }"},
X  #endif /* not M_XENIX */
X--- 414,418 ----
X              %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i\n }"},
X  #else /* M_XENIX */
X!    "%{!S:gas %{R} %{j} %{J} %{h} %{d2} %a %{g}\
X              %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i\n }"},
X  #endif /* not M_XENIX */
X***************
X*** 419,423 ****
X  	%{Wcomment*} %{Wtrigraphs} %{Wall} %C\
X          %i %{!M*:%{!E:%{!pipe:%g.s}}}%{E:%{o*}}%{M*:%{o*}} |\n\
X!     %{!M*:%{!E:%{!S:gas %{R} %{j} %{J} %{h} %{d2} %a \
X                      %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\
X  		    %{!pipe:%g.s}\n }}}"},
X--- 433,437 ----
X  	%{Wcomment*} %{Wtrigraphs} %{Wall} %C\
X          %i %{!M*:%{!E:%{!pipe:%g.s}}}%{E:%{o*}}%{M*:%{o*}} |\n\
X!     %{!M*:%{!E:%{!S:gas %{R} %{j} %{J} %{h} %{d2} %a %{g}\
X                      %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\
X  		    %{!pipe:%g.s}\n }}}"},
X***************
X*** 431,435 ****
X  char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l %{g:-g} \
X   %{A} %{F} %{r} %{s} %{u*} \
X!  %{!nostdlib:%S} %{!o:-o a.out} %o %Z %{!nostdlib:gnulib%s %L }\n }}}}";
X  #else /* not M_XENIX */
X  char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l\
X--- 445,449 ----
X  char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l %{g:-g} \
X   %{A} %{F} %{r} %{s} %{u*} \
X!  %{!nostdlib:%S} %{!o:-o a.out} %o %{!nostdlib:gnulib%s %L }\n }}}}";
X  #else /* not M_XENIX */
X  char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l\
X***************
X*** 1071,1084 ****
X  char **outfiles;
X  
X- #ifdef M_XENIX
X- 
X- /* A vector of library files (from -llibrary) */
X- 
X- char **libraries;
X- 
X- int n_libraries;
X- 
X- #endif /* M_XENIX */
X- 
X  /* Create the vector `switches' and its contents.
X     Store its length in `n_switches'.  */
X--- 1085,1088 ----
X***************
X*** 1093,1099 ****
X    n_switches = 0;
X    n_infiles = 0;
X- #ifdef M_XENIX
X-   n_libraries = 0;
X- #endif /* M_XENIX */
X  
X    env_exec_prefix = getenv ("GCC_EXEC_PREFIX");
X--- 1097,1100 ----
X***************
X*** 1105,1113 ****
X    for (i = 1; i < argc; i++)
X      {
X- #ifdef M_XENIX
X-       if (argv[i][0] == '-' && argv[i][1] == 'l')
X- 	n_libraries++;
X-       else
X- #endif /* M_XENIX */
X        if (argv[i][0] == '-' && argv[i][1] != 'l')
X  	{
X--- 1106,1109 ----
X***************
X*** 1147,1154 ****
X    switches = ((struct switchstr *)
X  	      xmalloc ((n_switches + 1) * sizeof (struct switchstr)));
X- #ifdef M_XENIX
X-   libraries = (char **) xmalloc ((n_libraries + 1) * sizeof (char *));
X-   n_libraries = 0;
X- #endif /* M_XENIX */
X    infiles = (char **) xmalloc ((n_infiles + 1) * sizeof (char *));
X    n_switches = 0;
X--- 1143,1146 ----
X***************
X*** 1161,1169 ****
X    for (i = 1; i < argc; i++)
X      {
X- #ifdef M_XENIX
X-       if (argv[i][0] == '-' && argv[i][1] == 'l')
X- 	libraries[n_libraries++] = &argv[i][2];
X-       else
X- #endif /* M_XENIX */
X        if (argv[i][0] == '-' && argv[i][1] != 'l')
X  	{
X--- 1153,1156 ----
X***************
X*** 1183,1186 ****
X--- 1170,1178 ----
X  	}
X        else
X+ #ifdef M_XENIX
X+       if (argv[i][0] == '-' && argv[i][1] == 'l')
X+ 	infiles[n_infiles++] = find_lib(&argv[i][2]);
X+       else
X+ #endif /* M_XENIX */
X  	infiles[n_infiles++] = argv[i];
X      }
X***************
X*** 1432,1445 ****
X  	    obstack_1grow (&obstack, '%');
X  	    break;
X- 
X- #ifdef M_XENIX
X- 	  case 'Z':
X- 	    {
X- 	      register int f;
X- 	      for (f = 0; f < n_libraries; f++)
X- 		store_arg (find_lib(libraries[f]), 0, 0);
X- 	    }
X- 	    break;
X- #endif /* M_XENIX */
X  
X  
X--- 1424,1427 ----
SHAR_EOF
if test 8164 -ne "`wc -c < 'gcc-dbxpch.01'`"
then
	echo shar: error transmitting "'gcc-dbxpch.01'" '(should have been 8164 characters)'
fi
fi # end of overwriting check
#	End of shell archive
exit 0



More information about the Comp.unix.xenix mailing list