Bug 89622

Summary: can't step inside template function with
Product: [Retired] Red Hat Linux Reporter: Need Real Name <minutsil>
Component: gdbAssignee: Elena Zannoni <ezannoni>
Status: CLOSED CANTFIX QA Contact: Jay Turner <jturner>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: mattdm, srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-01-02 18:44:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
main.C source code
none
source code for template function write().
none
readelf -w for 2.96 compiled testcase
none
readelf -w output for file compiled with RHL9 gcc -- line table only none

Description Need Real Name 2003-04-25 08:02:03 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.7 (X11; Linux i686; U;) Gecko/20030131

Description of problem:
Occasionally gdb won't step inside a template function. There are no problem
stepping inside non-template functions. According to the debugger, there's no
line number information on the line with the template function we're trying to
step into.


Version-Release number of selected component (if applicable):
gcc-3.2.2-5, gdb-5.3post-0.20021129.18

How reproducible:
Sometimes

Steps to Reproduce:
1. Write a main.C file and a bar.C file with a template function bar() defined
in bar.C, and include bar.C in main.C.
See sample attachments (main.C and write.C).

2. g++ -o main -g -Wall main.C
3. gdb main , etc.
    

Actual Results:  Can't step inside write().

Expected Results:  should step.

Additional info:

Running vanilla RH9.0. 

(gdb) s
0x08048880 in void write<int>(int const&, char const*) (X=@0xbfffe2e4, 
    ofile=0x80489d4 "x")
(gdb) s
Single stepping until exit from function _Z5writeIiEvRKT_PKc, 
which has no line number information.
main (argc=1, argv=0xbfffe334) at main.C:18
(gdb)

Comment 1 Need Real Name 2003-04-25 08:07:02 UTC
Created attachment 91293 [details]
main.C source code

Contains main() and a non-template function foo() in which gdb has no problems
stepping into.

Comment 2 Need Real Name 2003-04-25 08:08:04 UTC
Created attachment 91294 [details]
source code for template function write().

Comment 3 Jakub Jelinek 2003-04-25 08:19:48 UTC
I certainly see template line number information in readelf -wl and debug
info in readelf -wi.
Elena, can you please look at it?

Comment 4 Elena Zannoni 2003-04-25 16:19:24 UTC
Hmm, I compiled the testcase with 
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
using -gdwarf-2

I also compiled it with 
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)


I used RHL9 gdb to debug both -- GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)

I can reproduce the problem with the program compiled with the more recent
version of gcc, and is worked fine with the old one.

I am attaching the output of readelf -w for both programs. 
Jakub, can you look at the diffs? I wonder if the line table for the write.C
file is the problem, it is a bit different between the two versions. 

I see however that the FSF gdb can step inside the new version of write<> just
fine, so I suspect that there is a patch for gdb that I need to import.
Nevertheless I'd appreciate if you could take a look at the diffs anyway, Jakub.


Comment 5 Elena Zannoni 2003-04-25 16:23:23 UTC
Created attachment 91304 [details]
readelf -w for 2.96 compiled testcase

Comment 6 Elena Zannoni 2003-04-25 16:27:17 UTC
Created attachment 91305 [details]
readelf -w output for file compiled with RHL9 gcc -- line table only

Comment 7 Need Real Name 2003-04-25 18:21:43 UTC
I also tried gdb-5.3 from gnu.org (compiled from sources) and the problem
persists, whether or not I use -gdwarf-2. Is the FSF gdb that Elena mentioned
different than the gnu gdb?

Comment 8 Need Real Name 2003-04-30 23:27:13 UTC
So what's going on with this bug, any hopes of being fixed? I'm getting more  
examples where the bug occurs. The code is too big to post. 

Comment 9 Bill Nottingham 2006-08-05 03:54:46 UTC
Red Hat apologizes that these issues have not been resolved yet. We do want to
make sure that no important bugs slip through the cracks.

Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
They are maintained by the Fedora Legacy project (http://www.fedoralegacy.org/)
for security updates only. If this is a security issue, please reassign to the
'Fedora Legacy' product in bugzilla. Please note that Legacy security update
support for these products will stop on December 31st, 2006.

If this is not a security issue, please check if this issue is still present
in a current Fedora Core release. If so, please change the product and version
to match, and check the box indicating that the requested information has been
provided.

If you are currently still running Red Hat Linux 7.3 or 9, please note that
Fedora Legacy security update support for these products will stop on December
31st, 2006. You are strongly advised to upgrade to a current Fedora Core release
or Red Hat Enterprise Linux or comparable. Some information on which option may
be right for you is available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Any bug still open against Red Hat Linux 7.3 or 9 at the end of 2006 will be
closed 'CANTFIX'. Again, if this bug still exists in a current release, or is a
security issue, please change the product as necessary. We thank you for your
help, and apologize again that we haven't handled these issues to this point.


Comment 11 Bill Nottingham 2007-01-02 18:44:24 UTC
Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
f you are currently still running Red Hat Linux 7.3 or 9, you are strongly
advised to upgrade to a current Fedora Core release or Red Hat Enterprise Linux
or comparable. Some information on which option may be right for you is
available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Closing as CANTFIX.