Debugging egcs/gcc output

Debugging egcs/gcc output

Post by Christopher Wo » Sat, 28 Feb 1998 04:00:00



I recently built gcc (egcs 1.0.1 distribution) for SCO OSR5, with the
"--with-stabs" option. The question is, how do I build executables that
can be debugged, especially with gdb?

If I try: gcc -gstabs foo.c -o foo
I get errors like: /usr/tmp/cca004MH.s:12:unknown directive: .stabs

If I try "-gdwarf" or just "-g" gdb barfs with the message:

        "/tmp/foo": not in executable format: File format not recognized

I find that "-gcoff" works, but only with coff executables. And of
course, this will now work too well with C++. I seem to recall that the
SCO assembler is used, which may explain the "-gstabs" problem. Does
this mean that debugging with gcc is crippled under SCO? Any
suggestions? Thanks.

Chris

 
 
 

Debugging egcs/gcc output

Post by Marcus Giesse » Sat, 28 Feb 1998 04:00:00



> I recently built gcc (egcs 1.0.1 distribution) for SCO OSR5, with the
> "--with-stabs" option. The question is, how do I build executables that
> can be debugged, especially with gdb?

> If I try: gcc -gstabs foo.c -o foo
> I get errors like: /usr/tmp/cca004MH.s:12:unknown directive: .stabs

> If I try "-gdwarf" or just "-g" gdb barfs with the message:

>         "/tmp/foo": not in executable format: File format not recognized

Hi,

we are using the scods954c (named "GNU Development System (ver 95.4c)"
in custom) and compiling with "gcc -belf -gstabs+". Works fine for
debugging.

Bye
Marcus
--
--------------------------------------------------------------
To reply via email please remove _ in email address if present

 
 
 

Debugging egcs/gcc output

Post by Christopher Wo » Sun, 01 Mar 1998 04:00:00





>> I recently built gcc (egcs 1.0.1 distribution) for SCO OSR5, with the
>> "--with-stabs" option. The question is, how do I build executables that
>> can be debugged, especially with gdb?
>we are using the scods954c (named "GNU Development System (ver 95.4c)"
>in custom) and compiling with "gcc -belf -gstabs+". Works fine for
>debugging.

That package (by Robert Lipe ... thanks) is rather dated, which is why
I went for the egcs release. The Lipe package uses Gnu's assembler. I
understand that egcs does not and cannot use gas on OSR5.0.4, which is
why I am having trouble.

I just found out that the Skunkware gdb (4.15.1) will debug
executables built with -g and -gdwarf. The gdb that I built (4.16)
would not, but that is no great loss. Still, the gcc/gdb documentation
do make it clear that stabs is the way to go for C++. Unfortunately,
egcs 1.0.1 apparently will not do stabs.

Chris