From 693f0b24f864ebad3b96d3c09ea3ffb0808e11c5 Mon Sep 17 00:00:00 2001 From: nobody <> Date: Thu, 11 Oct 2012 16:12:06 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create branch 'gdb_7_5-branch'. Cherrypick from master 2012-10-11 16:12:05 UTC Doug Evans ' PR breakpoints/14643.': gdb/testsuite/gdb.linespec/thread.c gdb/testsuite/gdb.linespec/thread.exp --- gdb/testsuite/gdb.linespec/thread.c | 31 ++++++++++++++++++++ gdb/testsuite/gdb.linespec/thread.exp | 41 +++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 gdb/testsuite/gdb.linespec/thread.c create mode 100644 gdb/testsuite/gdb.linespec/thread.exp diff --git a/gdb/testsuite/gdb.linespec/thread.c b/gdb/testsuite/gdb.linespec/thread.c new file mode 100644 index 00000000000..185e4a378ea --- /dev/null +++ b/gdb/testsuite/gdb.linespec/thread.c @@ -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://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 index 00000000000..1e8ee465a35 --- /dev/null +++ b/gdb/testsuite/gdb.linespec/thread.exp @@ -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://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" -- 2.47.2