This is the mail archive of the gdb-prs@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/1171: GDB 5.3 misreads the symbol table for very big executables


The following reply was made to PR gdb/1171; it has been noted by GNATS.

From: Leonid A Broukhis <leob@mailcom.com>
To: gdb-gnats@sources.redhat.com
Cc:  
Subject: Re: gdb/1171: GDB 5.3 misreads the symbol table for very big executables
Date: Tue, 6 May 2003 16:41:40 -0700

 Here's how to reproduce the bug:
 --- cut here ---
 struct XX { virtual int foo() = 0; };
 
 template <int a> struct X : public XX {
         int foo() { return a; }
 };
 
 // perl -e 'for ($i = 0; $i < 5000; $i++) { print "X<$i> x$i;\n"; }'
 X<0> x0;
 X<1> x1;
 X<2> x2;
 X<3> x3;
 X<4> x4;
 ...
 X<4999> x4999;
 
 int bar(XX & x) { return x.foo(); }
 
 int main() { return bar(x1234); }
 
 --- cut here ---
 
 Compile with gcc version 3.2.2 (split into 5 or more files,
 as the compilation is very slow). I've used flags -g -O . 
 
 This results in more than 25000 sections, and gdb does not
 show the address of 'main' properly:
 
 nm: 001b5988 T main
 
 gdb (info addr main): Symbol "main" is a function at address 0x130d328.
 
 If the number of variables is reduced to 4000, the bug disappears.
 
 


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