This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
gdb does not stops inside a template function
- From: Nick Roberts <nickrob at snap dot net dot nz>
- To: "Dima Sorkin" <dima dot sorkin at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Tue, 20 Jun 2006 21:49:19 +1200
- Subject: gdb does not stops inside a template function
- References: <e40293600606200138j7d719a7dq45fe0c9fc229b182@mail.gmail.com>
> 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.
...
(gdb) break templ_dbg.cpp:4
I think you need to do:
(gdb) b int const f<int>(int const&)
(gdb) b double const f<double>(double const&)
if you want it to stop at both places. Completion makes them easier
to type:
(gdb) b int<TAB>
(gdb) b double<TAB>
(Although I can only see how to select a candidate using Emacs.)
--
Nick http://www.inet.net.nz/~nickrob