This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GDB and compiler version.


Hi Paul,

> 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
of compilers.

Hope this helps,

Michael C
GDB QA Guy


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]