From: Keith Seitz <keiths@redhat.com>
To: "gdb-patches@sourceware.org ml" <gdb-patches@sourceware.org>
Subject: [RFA] gdb_get_line_number on unknown tags
Date: Thu, 08 Mar 2012 22:02:00 -0000 [thread overview]
Message-ID: <4F592C48.7000500@redhat.com> (raw)
[-- 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
next reply other threads:[~2012-03-08 22:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-08 22:02 Keith Seitz [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F592C48.7000500@redhat.com \
--to=keiths@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox