Mail Archives: djgpp-workers/2002/12/10/04:16:06
Hello.
Eli Zaretskii wrote:
>
> On Mon, 9 Dec 2002, Richard Dawe wrote:
>
> > Nope, it's still broken. I tested with gcc 3.2.1, gdb 5.2.1 and one of my
> > DJGPP development trees. I got the following, when I tried to debug a program
> > built against the libc tree with DWARF-2 debug info:
> >
> > "Dwarf Error: bad offset (0x15e
>
> Let me be sure I understand this correctly: are you saying that _any_
> program produced by GCC 3.2.1 with -gdwarf-2 cannot be debugged by GDB?
> Or does the problem happen only with C++ programs, or only with the CVS
> libc, or under some other special circumstances?
It appears that the problem above is only with executables produced by the
linking rules specified in src/makefile.inc in CVS. I tried a trivial program
and it worked fine.
I'm trying to debug a (new) test program in tests/libc/ansi/stdio. If I have
-gdwarf-2 (or -g, I guess) in gcc{,-l}.opt and I use the standard rules to
build the program, I get the error shown above. If I use a command-line like:
gcc `cat ../../../../src/gcc.opt` -I/path/to/djgpp/include \
-L/path/to/djgpp/lib -o mytest mytest.c
then gdb works fine on the program.
makefile.inc invokes 'ld' directly, to build the program. If I add -g to the
LDFLAGS (make LDFLAGS+=-g ...), then ld is passed -g. Unfortunately this makes
no difference, since ld ignores -g (according to the documentation).
The tests are also built using the linker script
/path/to/djgpp/installation/lib/djgpp.djl. (Note this is from my DJGPP
installation, not the DJGPP CVS tree.) Does that need updating, to work
properly with DWARF-2 debug info?
If I copy lib/gcc-lib/3.21/djgpp-x.djl to lib/djgpp.djl, I can build and debug
the test programs with DWARF-2 OK.
It seems like this is another side of the linker script issue.
Thanks, bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -