[gnu.gcc.bug] Don't compile gdb 3.1 with gcc 1.34!

rfg@MCC.COM (Ron Guilmette) (03/30/89)

I have just learned that it is *not* a good idea to use GCC 1.34
to compile GDB 3.1 (or GDB 3.1.1 from yahi for G++ fans).

Now I realize that the Makefile for GDB 3.1 invokes the "native"
/bin/cc command for compilations, but the Makefile for GDB 3.1.1
which I got from yahi.stanford.edu invokes GCC instead.

After trying 4 permutations, I have learned that on a Sun3 (using
SunOS 3.5) the compilation of either GDB 3.1 or GDB 3.1.1 with
GCC 1.34 causes the resulting program to malfunction, while
compiling either of these with the Sun (native) C compiler
causes the resulting GDB's to work correctly.

The specific bug which shows up in a GCC-compiled GDB is that
you cannot get the debugger to STOP when you type a control/C
(i.e. SIGINT).  The programm being debugged just keeps on running
as though nothing had happened.

As far as I could tell, this has something to do with the variable
"immediate_quit" not getting set.  When you type a control/C, you
are forced into the "quit()" routine in GDB, but if the "immediate_quit"
variable is not set, basically nothing happens.

If someone wants to look into this problem, it may help to have a little
program to test the debugger on, while trying to get control/C to
work.  I used the following small program which just keeps looping
for awhile (but not forever), while slowly printing out asterisks.

Until this problem is fixed, GDB 3.1.x should be compiled with the
"native" compiler on a Sun3.

--------------------------------------------------------------------
#include <stdio.h>

int k, l;

int main ()
{
	int i, j;

	for (i = 0; i < 50; i++) {
		for (j = 0; j < 200000; j++) {
			k = l + i + j;
		}
		printf ("%s", "*");
		fflush (stdout);
	}
}
---------------------------------------------------------------------

// Ron Guilmette  -  MCC  -  Experimental (parallel) Systems Kit Project
// 3500 West Balcones Center Drive,  Austin, TX  78759  -  (512)338-3740
// ARPA: rfg@mcc.com
// UUCP: {rutgers,uunet,gatech,ames,pyramid}!cs.utexas.edu!pp!rfg

exodus@cheers.UUCP (Greg Onufer) (03/31/89)

From article <8903291955.AA27964@riunite.aca.mcc.com>, by rfg@MCC.COM (Ron Guilmette):
> After trying 4 permutations, I have learned that on a Sun3 (using
> SunOS 3.5) the compilation of either GDB 3.1 or GDB 3.1.1 with
> GCC 1.34 causes the resulting program to malfunction, while
> compiling either of these with the Sun (native) C compiler
> causes the resulting GDB's to work correctly.

Works fine on a Sun-2 with SunOS 4.0, using gcc-1.34 with -O and 
-fstrength-reduce (possibly others).
-- 
Greg Onufer .. University of the Pacific .. Focus Semiconductor
.. greg@cheers.uucp .. cheers!greg@lll-winken.llnl.gov .. 209-957-3963