[comp.sys.atari.st] Using GDB

dinapoli@rodan.acs.syr.edu (Ron DiNapoli) (02/02/91)

Howdy!  I've been having a problem getting GDB to work on my MEGA 4.

If I compile with the -gg switch, the resulting symbol files cause 
gdb to crash when I attempt to load them.

If I compile with the -g switch I get the following error message when
I attempt to link the executable...

Bogon alert!  wrote 213 symbols, expected to write 235

I'm not sure about those numbers, but that was the general error message.
the executable is produced, and the symbol file created with sym_ld does
load properly into gdb.  But when I attepmt to run the executable from gdb,
I get "Program terminated with code #ffffff95" (again, not sure  of the 
number).

Does anyone know how to create good symbol files and good executables???
I can't use the -mshort flag because I need to have 32-bit ints (if that
makes a difference).

thanks for your help!

Ron D.

gjh@hplb.hpl.hp.com (Graham Higgins) (02/04/91)

Ron DiNapoli writes about using GDB:

++ I get "Program terminated with code #ffffff95" (again, not sure  of the 
++ number).

++ Does anyone know how to create good symbol files and good executables???
++ I can't use the -mshort flag because I need to have 32-bit ints (if that
++ makes a difference).

I've seen both problems experienced by Ron DiNapoli. I've recently been trying
to port Elk (a Scheme implementation) to the ST. It compiles up but bombs out
with a bus error (2 bombs), so I tried using jrd's GDB to debug it. 

First reports of GDB indicated that it wouldn't work with GCC 1.37.1, later
reports suggested otherwise.

My own experience suggests that GDB works fine on the set of test data supplied
with jrd's GDB port. However, I've not managed to get it to work properly on
the compiled Elk code.

I am currently oscillating between gulam and ksh-under-mint. (The Elk code
tests the executability of argv[0], for some reason it can't find anything
there under gulam but can with ksh, anyway ...)

GDB crashes out under KSH when reading symbols from the sym file. Scratch one
route. Under gulam, it reads the exec and the sym file OK, arrives at the start
after "run", reports "info functions", etc fine, but either 2-bombs out on
"cont", or reports "Program terminated with code #ffffff95". Once, I got it to
"cont" but it wasn't behaving *anything* like the way it does with the
(precompiled) test code set. I chased down Edgar Roeder's uni-sb version of
GCC, which has been reported as supporting GDB. Didn't seem to make much
difference. 

CFLAGS were:

-gg -O -DGEM -D__NO_INLINE__ -mshort -fcombine-regs -fstrength-reduce 
-fomit-frame-pointer

are any of the above flags inimical to GDB?

the .ttp and .sym files were produced ..

gcc-ld -o scheme.ttp c:\gnu\lib\gcrt0.o $(O) -lpml16 -lgnu16
sym-ld -r -o scheme.sym c:\gnu\lib\gcrt0.o $(O) -lpml16 -lgnu16

I am using crt0.o and gcrt0.o assembled from the .s files distributed with Eric
Smith's Mint libraries. The Mint libraries are not linked in to the Elk code.

Grateful for any suggestions.

BTW, when GCC compiling under gulam, "make" seems to 2-bomb out after some
arbitrary period of happy mass compilation, ditto Ksh but less frequently.
Under Ksh, problem seems to go away after the third/fourth round of mass
compilation (with -g, without -g, with -gg, without -gg, ad nauseam) but return
after a warm boot. Anyone shed any light on this --- I have a suspicion that
it's a malloc() problem, but it's outside my field.

Cheers,

Graham
======

------------------------------------------------------------------
Graham Higgins             	|  Phone: (0272) 799910 x 24060
Hewlett-Packard Labs    	|  gjh%ghiggins@hpl.hp.co.uk
Bristol                       	|  gjh%ghiggins@hplb.hpl.hp.com
U.K.                          	|  
------------------------------------------------------------------
Disclaimer: My opinions above are exactly that, mine and opinions.
------------------------------------------------------------------

david@doe.utoronto.ca (David Megginson) (02/05/91)

In article <GJH.91Feb4115042@ghiggins.hpl.hp.com> gjh@hplb.hpl.hp.com (Graham Higgins) writes:
>
>CFLAGS were:
>
>-gg -O -DGEM -D__NO_INLINE__ -mshort -fcombine-regs -fstrength-reduce 
>-fomit-frame-pointer
>
>are any of the above flags inimical to GDB?
>
I have had some success with gdb under the uni-sb gcc compiler and
linker, but I have used

gcc -c -g test.c
gcc_ld -o test.tos test.o
sym_ld -r -o test.sym $GNULIB/crt0.o test.o -lgnu

(or something like that). I took a look at the gdb source, and it actually
seems to support -g and not -gg (ie. dbx, not the native gdb format).

>BTW, when GCC compiling under gulam, "make" seems to 2-bomb out after some
>arbitrary period of happy mass compilation, ditto Ksh but less frequently.
>Under Ksh, problem seems to go away after the third/fourth round of mass
>compilation (with -g, without -g, with -gg, without -gg, ad nauseam) but return
>after a warm boot. Anyone shed any light on this --- I have a suspicion that
>it's a malloc() problem, but it's outside my field.
>
Aha! I suspect the 40-folder limit. You should be able to find a fix
for it on your local BBS. If you already have foldrxxx.prg (or whatever
it's called) installed, raise the number.

David

-- 
////////////////////////////////////////////////////////////////////////
/  David Megginson                      david@doe.utoronto.ca          /
/  Centre for Medieval Studies          meggin@vm.epas.utoronto.ca     /
////////////////////////////////////////////////////////////////////////