Mail Archives: djgpp/1999/07/20/09:04:05

Date: Tue, 20 Jul 1999 15:03:32 +0200
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Message-Id: <>
To: djgpp AT delorie DOT com
Subject: Re: Bizarre debugging format problem
Newsgroups: comp.os.msdos.djgpp
Organization: RWTH Aachen, III. physikalisches Institut B
X-Newsreader: TIN [version 1.2 PL2]
Reply-To: djgpp AT delorie DOT com

In article <379249F0 DOT D17518C AT tudor21 DOT net> you wrote:
> Eli Zaretskii wrote:
> > On Sat, 17 Jul 1999, Richard Dawe wrote:
> > > I compiled & linked with
> > > gcc's -g flag, but gdb could not find the line number information for
> > > any of the functions. I tried changing -g to -g3, but this made no
> > > difference. Trying -ggdb allowed me to do 'l main' and similar
> > > successfully. Why is this?

> I tried (most of) the FAQ's suggestions - my first port of call ;) I
> looked at the gcc, gdb docs too, which lead me to try '-ggdb'. I've tried
> more switches since then (see below).

'-ggdb' is a superset of '-gstabs' for the binutils-2.8.1 and gcc-2.8.1.

> Anyway, there's a test Makefile and testit.c below. From trying various
> switches, it appears that gcc 2.8.1 is emitting debug info in COFF format.

Yes, that's the default. 

> So my solution is to use one of -gstabs, -gstabs+, -ggdb. -gstabs doesn't
> use any gdb extensions, so I'll use that.

It doesn't make any noticeable differences, anyway: there is no known
debugger for DJGPP apps supporting stabs, except gdb itself, anyway.
So once you use stabs, you can just as easily use gdb extensions,
right away.

One thing you should try, before jumping to further conclusions, is
the exact version of binutils and gdb you're using. E.g.: are you sure
you're using the DJGPP gdb, and not the one that comes with Cygwin,

There is a definite problem with resolution of source line information
in COFF format which I observed in binutils-2.8.1, as available from the
net, and it's sitting in the BFD library, which is used by both gdb
and binutils.

Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019