From: "Dima Sorkin" <dima.sorkin@gmail.com>
To: gdb@sourceware.org
Subject: gdb does not stops inside a template function
Date: Tue, 20 Jun 2006 09:50:00 -0000 [thread overview]
Message-ID: <e40293600606200138j7d719a7dq45fe0c9fc229b182@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 424 bytes --]
Hi.
I have the following problem with gdb6.3 :
If I put a breakpoint on a line inside a function template,
the gdb not always stops there.
Please see attached ".cpp" file and the gdb session transcript
(file: "templ_dbg.1.output").
It can be seen that gdb stops on first call to "f",
but not on second.
Regards and thank you,
Dima.
P.S.
I use various versions of gcc compiler (3.3.6, 4.0.0),
the result was the same.
[-- Attachment #2: templ_dbg.lines_numbered.cpp --]
[-- Type: text/plain, Size: 335 bytes --]
1 // templ_dbg.cpp -*-c++-*-
2
3 template<typename T> T const f(T const &t){
4 return t+t;
5 }
6
7 #include<iostream>
8 using namespace std;
9
10 int main(){
11 int i(5);
12 cout << f(i) << '\n';
13
14 double d(0.3);
15 cout << f(d) << '\n';
16
17 return 0;
18 }
19
[-- Attachment #3: templ_dbg.1.output --]
[-- Type: text/plain, Size: 458 bytes --]
(gdb) break templ_dbg.cpp:4
Breakpoint 1 at 0x804870b: file templ_dbg.cpp, line 4.
(gdb) run
Starting program: /home/dima/templ_dbg
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0x50d000
Breakpoint 1, f<int> (t=@0xbfa784c4) at templ_dbg.cpp:4
4 return t+t;
(gdb) print t
$1 = (const int &) @0xbfa784c4: 5
(gdb) continue
Continuing.
10
0.6
Program exited normally.
(gdb)
[-- Attachment #4: gdb.version --]
[-- Type: text/plain, Size: 418 bytes --]
GNU gdb Red Hat Linux (6.3.0.0-1.21rh)
Copyright 2004 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-gnu".
next reply other threads:[~2006-06-20 8:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-20 9:50 Dima Sorkin [this message]
2006-06-20 12:21 ` Nick Roberts
2006-06-20 12:27 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e40293600606200138j7d719a7dq45fe0c9fc229b182@mail.gmail.com \
--to=dima.sorkin@gmail.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox