public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCH] gdb: Remove hard-coded line number from test
Date: Thu, 19 Oct 2017 13:10:00 -0000	[thread overview]
Message-ID: <20171019131004.14544-1-andrew.burgess@embecosm.com> (raw)

Removes the use of a hard-coded line number from a test.

gdb/testsuite/ChangeLog:

	* gdb.linespec/ls-errs.exp (do_test): Update comment, use line
	number from variable rather than hard-coded.
---
 gdb/testsuite/ChangeLog                | 5 +++++
 gdb/testsuite/gdb.linespec/ls-errs.exp | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.linespec/ls-errs.exp b/gdb/testsuite/gdb.linespec/ls-errs.exp
index f55cd0e8e9..ee8bb087f0 100644
--- a/gdb/testsuite/gdb.linespec/ls-errs.exp
+++ b/gdb/testsuite/gdb.linespec/ls-errs.exp
@@ -117,10 +117,10 @@ proc do_test {lang} {
     foreach x $invalid_offsets {
 	set offset $x
 
-	# Relative offsets are relative to line 16.  Adjust
+	# Relative offsets are relative to the current line.  Adjust
 	# expected offset from error message accordingly.
 	if {[string index $x 0] == "+" || [string index $x 0] == "-"} {
-	    incr offset 24
+	    incr offset $bp_location
 	}
 	test_break $x invalid_offset $offset
 	test_break "-line $x" invalid_offset $offset
-- 
2.12.2

             reply	other threads:[~2017-10-19 13:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 13:10 Andrew Burgess [this message]
2017-10-19 14:17 ` Simon Marchi

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=20171019131004.14544-1-andrew.burgess@embecosm.com \
    --to=andrew.burgess@embecosm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).