aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-07-13 20:07:44 +0000
committerTom Tromey <tromey@redhat.com>2010-07-13 20:07:44 +0000
commit0f5238edfdd060ff07a15df61aafdfe21fb6427f (patch)
treeadfbbce9ef20143b41a4b028e22ffdca16fb20fe /gdb/testsuite
parent131687b4ade7fdff127269e3b92b01ec3d0872c7 (diff)
downloadgdb-0f5238edfdd060ff07a15df61aafdfe21fb6427f.zip
gdb-0f5238edfdd060ff07a15df61aafdfe21fb6427f.tar.gz
gdb-0f5238edfdd060ff07a15df61aafdfe21fb6427f.tar.bz2
gdb
PR breakpoints/8357: * symtab.h (domain_enum_tag) <LABEL_DOMAIN>: Update comment. * linespec.c (decode_line_1): Update comment. Call decode_label. (decode_label): New function. (symbol_found): Handle LOC_LABEL. * dwarf2read.c (new_symbol) <DW_TAG_label>: Set symbol's type and domain. Call add_symbol_to_list. gdb/doc * gdb.texinfo (Specify Location): Document labels. gdb/testsuite * gdb.base/label.exp: New file. * gdb.base/label.c: New file.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/label.c21
-rw-r--r--gdb/testsuite/gdb.base/label.exp59
3 files changed, 85 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 803e74d..92fb577 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-13 Tom Tromey <tromey@redhat.com>
+
+ * gdb.base/label.exp: New file.
+ * gdb.base/label.c: New file.
+
2010-07-12 Ulrich Weigand <uweigand@de.ibm.com>
H.J. Lu <hongjiu.lu@intel.com>
diff --git a/gdb/testsuite/gdb.base/label.c b/gdb/testsuite/gdb.base/label.c
new file mode 100644
index 0000000..f9cd8c3
--- /dev/null
+++ b/gdb/testsuite/gdb.base/label.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+
+int
+main (int argc, char *argv)
+{
+ int i = 0;
+ goto there;
+
+here:
+ printf("not here\n");
+ i = 1;
+
+there:
+ printf("but here\n");
+ if (i == 0)
+ goto here;
+
+done:
+ return 0;
+}
+
diff --git a/gdb/testsuite/gdb.base/label.exp b/gdb/testsuite/gdb.base/label.exp
new file mode 100644
index 0000000..9e30520
--- /dev/null
+++ b/gdb/testsuite/gdb.base/label.exp
@@ -0,0 +1,59 @@
+# Copyright 2010 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/>.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+
+if [is_remote target] then {
+ return 0
+}
+
+
+#
+# test running programs
+#
+
+set testfile "label"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [prepare_for_testing ${testfile}.exp $testfile ${testfile}.c debug] } {
+ untested label.exp
+ return -1
+}
+
+
+if {![runto_main]} {
+ fail "label tests suppressed"
+ return -1
+}
+
+gdb_test "break here" \
+ "Breakpoint.*at.*" \
+ "breakpoint here"
+
+gdb_test "break there" \
+ "Breakpoint.*at.*" \
+ "breakpoint there"
+
+gdb_test "cont" \
+ "Breakpoint 3,.*" \
+ "continue to 'there'"
+
+gdb_test "cont" \
+ "Breakpoint 2,.*" \
+ "continue to 'here'"