From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020408 Description of problem: In the attached code gdb misses a breakpoint when compiled with gcc3.1. When compiled with gcc2.96 the breakpoint is not missed. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. compile attached file with gcc3.1 (e.g., g++ -g -o random random_int.cc) 2. gdb random 3. put a breakpoint in at line 18 and let it run 4. gdb misses breakpoint Actual Results: Here is what happens when compiled with gcc3.1 $ /usr/gnu/gcc-3.1/bin/g++ --version g++ (GCC) 3.1 Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ /usr/gnu/gcc-3.1/bin/g++ -o random.gcc31 -g random_int.cc $ gdb random.gcc31 GNU gdb Red Hat Linux (5.1.90CVS-5) Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux"... (gdb) b 18 Breakpoint 1 at 0x8048583: file random_int.cc, line 18. (gdb) run Starting program: /home/eeeg/econ/tmp/random.gcc31 Program exited normally. (gdb) quit $ When compiled with gcc2.96 we get $ g++ --version 2.96 $ g++ -o random.gcc296 -g random_int.cc $ gdb random.gcc296 GNU gdb Red Hat Linux (5.1.90CVS-5) Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux"... (gdb) b 18 Breakpoint 1 at 0x8048576: file random_int.cc, line 18. (gdb) run Starting program: /home/eeeg/econ/tmp/random.gcc296 Breakpoint 1, random_int::random_int (this=0x8049848, idum=-2) at random_int.cc:19 19 idum--; (gdb) quit The program is running. Exit anyway? (y or n) y $ Expected Results: stop at breakpoint when compiled with 3.1 Additional info:
Created attachment 59167 [details] code
I thought my summary of the problem was poorly worded. I should have written 'gdb misses breakpoint on code compiled with gcc 3.1' Similarly, in the problem description, I should have written 'In the attached code gdb misses a breakpoint when the attached code is compiled with gcc3.1. When the attached code is compiled compiled with gcc2.96 the breakpoint is not missed.' Apologies
Use "-gstabs" if you want to use this compiler - gcc 3.1 has a new debug format.