Bug 65814 - gdb misses breakpoint when compiled with gcc 3.1
Summary: gdb misses breakpoint when compiled with gcc 3.1
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gdb
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact: Aaron Brown
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-05-31 22:22 UTC by eeeg
Modified: 2007-04-18 16:42 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-06-04 01:49:25 UTC
Embargoed:


Attachments (Terms of Use)
code (476 bytes, text/plain)
2002-05-31 22:24 UTC, eeeg
no flags Details

Description eeeg 2002-05-31 22:22:39 UTC
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:

Comment 1 eeeg 2002-05-31 22:24:03 UTC
Created attachment 59167 [details]
code

Comment 2 eeeg 2002-06-04 01:49:19 UTC
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

Comment 3 Trond Eivind Glomsrxd 2002-06-04 14:37:42 UTC
Use "-gstabs" if you want to use this compiler - gcc 3.1 has a new debug format.


Note You need to log in before you can comment on or make changes to this bug.