This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] gdb.base/dso2dso.exp sometimes broken


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ea8812bceab054cab438bb51916f1d81118811b3

commit ea8812bceab054cab438bb51916f1d81118811b3
Author: Keith Seitz <keiths@redhat.com>
Date:   Wed Aug 12 18:31:11 2015 -0700

    gdb.base/dso2dso.exp sometimes broken
    
    Keith reported that gdb.base/dso2dso.exp is broken, with the following
    error:
    
    | $ make check RUNTESTFLAGS=dso2dso.exp
    | [snip]
    | Running ../../../src/gdb/testsuite/gdb.base/dso2dso.exp ...
    | ERROR: tcl error sourcing ../../../src/gdb/testsuite/gdb.base/dso2dso.exp.
    | ERROR: couldn't open
    | "../../../src/gdb/testsuite/gdb.base/../../../src/gdb/testsuite/gdb.base/dso2dso-dso1.c":
    | no such file or directory
    |     while executing
    | "error "$message""
    |     (procedure "gdb_get_line_number" line 14)
    |     invoked from within
    | "gdb_get_line_number "STOP HERE" $srcfile_libdso1"
    |     (file "../../../src/gdb/testsuite/gdb.base/dso2dso.exp" line 60)
    |     invoked from within
    | "source ../../../src/gdb/testsuite/gdb.base/dso2dso.exp"
    |     ("uplevel" body line 1)
    |     invoked from within
    | "uplevel #0 source ../../../src/gdb/testsuite/gdb.base/dso2dso.exp"
    |     invoked from within
    | "catch "uplevel #0 source $test_file_name""
    
    This happens because gdb_get_line_number will prepend $srcdir/$subdir
    if the given filename does not start with "/", and this happens when
    GDB was configured using a relative path to the configure script.
    When using an absolute path like I do, we avoid the pre-pending that
    Keith is seeing.
    
    gdb/testsuite/ChangeLog:
    
            Keith Seitz  <keiths@redhat.com>:
            * gdb.base/dso2dso.exp: Pass basename of source file in call
            to gdb_get_line_number.
    
    Tested on x86_64-linux with both scenarios.

Diff:
---
 gdb/testsuite/ChangeLog            | 5 +++++
 gdb/testsuite/gdb.base/dso2dso.exp | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 738c927..b44869d 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-12  Keith Seitz  <keiths@redhat.com>
+
+	* gdb.base/dso2dso.exp: Pass basename of source file in call to
+	gdb_get_line_number.
+
 2015-08-12  Joel Brobecker  <brobecker@adacore.com>
 
 	* gdb.base/dso2dso-dso2.c, gdb.base/dso2dso-dso2.h,
diff --git a/gdb/testsuite/gdb.base/dso2dso.exp b/gdb/testsuite/gdb.base/dso2dso.exp
index b604012..e11606c 100644
--- a/gdb/testsuite/gdb.base/dso2dso.exp
+++ b/gdb/testsuite/gdb.base/dso2dso.exp
@@ -57,7 +57,7 @@ if { ![runto_main] } {
 # libdso2) make from sub1 (provided by libdso1), and land at
 # the expected location.
 
-set bp_location [gdb_get_line_number "STOP HERE" $srcfile_libdso1]
+set bp_location [gdb_get_line_number "STOP HERE" [file tail $srcfile_libdso1]]
 gdb_breakpoint ${srcfile_libdso1}:${bp_location}
 
 gdb_continue_to_breakpoint "at call to sub2" \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]