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)
Created attachment 91293 [details] main.C source code Contains main() and a non-template function foo() in which gdb has no problems stepping into.
Created attachment 91294 [details] source code for template function write().
I certainly see template line number information in readelf -wl and debug info in readelf -wi. Elena, can you please look at it?
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.
Created attachment 91304 [details] readelf -w for 2.96 compiled testcase
Created attachment 91305 [details] readelf -w output for file compiled with RHL9 gcc -- line table only
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?
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.
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.
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.