Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] gdb_get_line_number on unknown tags
@ 2012-03-08 22:02 Keith Seitz
  2012-03-08 22:08 ` Tom Tromey
  0 siblings, 1 reply; 8+ messages in thread
From: Keith Seitz @ 2012-03-08 22:02 UTC (permalink / raw)
  To: gdb-patches@sourceware.org ml

[-- Attachment #1: Type: text/plain, Size: 797 bytes --]

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.

[-- Attachment #2: negative-bp.patch --]
[-- Type: text/x-patch, Size: 1039 bytes --]

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-03-09  4:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-08 22:02 [RFA] gdb_get_line_number on unknown tags Keith Seitz
2012-03-08 22:08 ` Tom Tromey
2012-03-08 22:20   ` Keith Seitz
2012-03-08 22:24   ` Joel Brobecker
2012-03-08 23:15     ` Keith Seitz
2012-03-08 23:30       ` Joel Brobecker
2012-03-09  2:55         ` Tom Tromey
2012-03-09  4:39           ` Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox