summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/mb-templates.cc
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2007-09-24 07:40:32 +0000
committerVladimir Prus <vladimir@codesourcery.com>2007-09-24 07:40:32 +0000
commit6a251ebec6bd55e54aa0e477d68926587421c5e8 (patch)
tree84d9b4a185bfae2cdd3354b9d31b038844006523 /gdb/testsuite/gdb.cp/mb-templates.cc
parent1e82efdf59b0a6ac2efd39c00a9ca619a3533924 (diff)
downloadgdb-6a251ebec6bd55e54aa0e477d68926587421c5e8.tar.gz
* breakpoint.c (remove_sal): New.
(expand_line_sal_maybe): New. (create_breakpoints): Call expand_line_sal_maybe. (clear_command): Add comment. (breakpoint_re_set_one): Call expand_line_sal_maybe. * linespec.c (decode_indirect): Set explicit_pc to 1. (decode_all_digits): Set explicit_line to 1. (append_expanded_sal): New. (expand_line_sal): New. * linespec.h (expand_line_sal): Declare. * symtab.c (init_sal): Initialize explicit_pc and explicit_line. * symtab.h (struct symtab_and_line): New fields explicit_pc and explicit_line.
Diffstat (limited to 'gdb/testsuite/gdb.cp/mb-templates.cc')
-rw-r--r--gdb/testsuite/gdb.cp/mb-templates.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/mb-templates.cc b/gdb/testsuite/gdb.cp/mb-templates.cc
new file mode 100644
index 00000000000..a7d4e2e7138
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/mb-templates.cc
@@ -0,0 +1,19 @@
+
+#include <iostream>
+using namespace std;
+
+template<class T>
+void foo(T i)
+{
+ std::cout << "hi\n"; // set breakpoint here
+}
+
+int main()
+{
+ foo<int>(0);
+ foo<double>(0);
+ foo<int>(1);
+ foo<double>(1);
+ foo<int>(2);
+ foo<double>(2);
+}