This is the mail archive of the
mailing list for the GDB project.
Re: GDB and compiler version.
- From: Michael Elizabeth Chastain <mec at shout dot net>
- To: gdb at sources dot redhat dot com, pdubuc at cas dot org
- Date: Fri, 26 Sep 2003 17:54:24 -0400
- Subject: Re: GDB and compiler version.
> My question is Are there any compiler or binutils dependencies in gdb?
> Should gdb 5.3 compiled with g++ 3.3.1 work as well on code that is
> compiled with g++ 2.95.3?
Yes. gdb is an Ansi C89 program, so it behaves the same no matter
which compiler is used to build it. Occasionally there are problems
getting it to match somebody's system header files, but by and large,
if gdb compiles and links, it will run.
The only case I know is an issue with 32 versus 64 bitness
on Solaris and HP/UX. Vaguely, I recall that gdb needs to be built
with the same word size as the inferior programs that it is going
to debug. Can someone else say something specific about this?
On the other hand -- gdb's behavior is very sensitive to the compiler
that is used to build the *inferior* program. Different compilers,
and different versions of the same compiler, generate different debug
info in the executable program. So that's the compiler version
we really want to see in bug reports, and the compiler version that
you have to worry about.
> Or do I always need to use a gdb that is built with the same version of
> GCC that is used to build the programs it debugs?
Nope. gdb has a bunch of explicit C code to read all the debug info
in your program, et cetera. That C code works the same with a variety
Hope this helps,
GDB QA Guy