This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] gdb_get_line_number on unknown tags
- From: Keith Seitz <keiths at redhat dot com>
- To: "gdb-patches at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Thu, 08 Mar 2012 14:01:44 -0800
- Subject: [RFA] gdb_get_line_number on unknown tags
Hi,
I noticed that two tests in the test suite attempt to set a breakpoint
on line -1 of some source file. This is occurring because the two tests
which do it are using gdb_get_line_number on a tag which is not defined
in the source file. Consequently, gdb_get_line_number returns -1, and
gdb_breakpoint does "break srcfile:-1", which currently defaults to line 1.
I think this ambiguity should be avoided in the test suite, and I submit
the attached trivial patch to correct it.
Tested on x86_64-linux (Fedora 15) with no regressions.
Keith
testsuite/ChangeLog
2012-03-08 Keith Seitz <keiths@redhat.com>
* gdb.ada/array_bounds.exp: Get breakpoint for line
with "START", not "STOP".
* gdb.python/py-infthread.exp: Do not continue to
line marked "Break here.", which is undefined.
diff --git a/gdb/testsuite/gdb.ada/array_bounds.exp b/gdb/testsuite/gdb.ada/array_bounds.exp
index a726e71..493c7c3 100644
--- a/gdb/testsuite/gdb.ada/array_bounds.exp
+++ b/gdb/testsuite/gdb.ada/array_bounds.exp
@@ -27,7 +27,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
clean_restart ${testfile}
-set bp_location [gdb_get_line_number "STOP" ${testdir}/bar.adb]
+set bp_location [gdb_get_line_number "START" ${testdir}/bar.adb]
if ![runto "bar.adb:$bp_location" ] then {
perror "Couldn't run ${testfile}"
return
diff --git a/gdb/testsuite/gdb.python/py-infthread.exp b/gdb/testsuite/gdb.python/py-infthread.exp
index 5fa508f..491cc41 100644
--- a/gdb/testsuite/gdb.python/py-infthread.exp
+++ b/gdb/testsuite/gdb.python/py-infthread.exp
@@ -37,8 +37,6 @@ if ![runto_main] then {
return 0
}
-runto [gdb_get_line_number "Break here."]
-
# Test basic gdb.Inferior attributes and methods.
gdb_py_test_silent_cmd "python t0 = gdb.selected_thread ()" "test gdb.selected_thread" 1