]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
This commit was manufactured by cvs2svn to create branch 'gdb_7_5-branch'.
authornobody <>
Thu, 11 Oct 2012 16:12:06 +0000 (16:12 +0000)
committernobody <>
Thu, 11 Oct 2012 16:12:06 +0000 (16:12 +0000)
Cherrypick from master 2012-10-11 16:12:05 UTC Doug Evans <dje@google.com> ' PR breakpoints/14643.':
    gdb/testsuite/gdb.linespec/thread.c
    gdb/testsuite/gdb.linespec/thread.exp

gdb/testsuite/gdb.linespec/thread.c [new file with mode: 0644]
gdb/testsuite/gdb.linespec/thread.exp [new file with mode: 0644]

diff --git a/gdb/testsuite/gdb.linespec/thread.c b/gdb/testsuite/gdb.linespec/thread.c
new file mode 100644 (file)
index 0000000..185e4a3
--- /dev/null
@@ -0,0 +1,31 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* http://sourceware.org/bugzilla/show_bug.cgi?id=14643 */
+
+static void
+thread ()
+{
+}
+
+int
+main ()
+{
+  int x = 0;
+  thread (); /* set breakpoint 1 here */
+  return x;
+}
diff --git a/gdb/testsuite/gdb.linespec/thread.exp b/gdb/testsuite/gdb.linespec/thread.exp
new file mode 100644 (file)
index 0000000..1e8ee46
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright 2012 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# http://sourceware.org/bugzilla/show_bug.cgi?id=14643
+# gdb 7.5 thinks "thread" is a linespec keyword.
+
+standard_testfile
+set exefile $testfile
+
+if {[prepare_for_testing $testfile $exefile $srcfile {debug}]} {
+    return -1
+}
+
+if ![runto_main] {
+    fail "Can't run to main"
+    return 0
+}
+
+set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
+
+gdb_test "break $srcfile:$bp_location1" \
+    "Breakpoint.*at.* file .*$srcfile, line $bp_location1\\." \
+    "breakpoint line number in file"
+
+gdb_continue_to_breakpoint "$bp_location1"
+
+gdb_breakpoint "thread" "message"
+
+gdb_continue_to_breakpoint "thread function"