gdb: Remove hard-coded line number from test
authorAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 13 Oct 2017 14:22:17 +0000 (15:22 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 19 Oct 2017 19:50:42 +0000 (20:50 +0100)
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
gdb/testsuite/gdb.linespec/ls-errs.exp

index e8f95ed..6a984ae 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-19  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * gdb.linespec/ls-errs.exp (do_test): Update comment, use line
+       number from variable rather than hard-coded.
+
 2017-10-19  Pedro Alves  <palves@redhat.com>
 
        * gdb.base/long-inferior-output.c: New file.
index f55cd0e..ee8bb08 100644 (file)
@@ -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