This is the mail archive of the gdb-patches@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]

Re: [RFA v3 1/4] Make ctxobj.exp and print-file-var.exp work on all platforms.


On Mon, 04 Jun 2012 19:24:15 +0200, Joel Brobecker wrote:
> --- a/gdb/testsuite/gdb.base/ctxobj-f.c
> +++ b/gdb/testsuite/gdb.base/ctxobj-f.c
> @@ -23,5 +23,10 @@ extern int this_version_num;
>  int
>  GET_VERSION (void)
>  {
> -  return this_version_num;
> +  int v = this_version_num;
> +
> +  if (v > 999)
> +    v = 999;

I do not much understand this 999 part; but I do not mind much.


> +
> +  return v;  /* STOP */
>  }

Just I got:

$ runtest gdb.base/ctxobj.exp gdb.base/print-file-var.exp
[...]
ERROR: tcl error sourcing ./gdb.base/print-file-var.exp.
ERROR: couldn't open "./gdb.base/./gdb.base/print-file-var-main.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" "${srcdir}/${subdir}/${executable}.c""
    invoked from within
"set bp_location \
    [gdb_get_line_number "STOP" "${srcdir}/${subdir}/${executable}.c"]"
    (file "./gdb.base/print-file-var.exp" line 69)
    invoked from within
"source ./gdb.base/print-file-var.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source ./gdb.base/print-file-var.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name""

which I needed to patch by the patch below.


I am OK with the patch otherwise.


Thanks,
Jan



diff --git a/gdb/testsuite/gdb.base/ctxobj.exp b/gdb/testsuite/gdb.base/ctxobj.exp
index 93af8b8..391ac38 100644
--- a/gdb/testsuite/gdb.base/ctxobj.exp
+++ b/gdb/testsuite/gdb.base/ctxobj.exp
@@ -57,7 +57,7 @@ if ![runto_main] {
     return -1
 }
 
-set bp_location [gdb_get_line_number "STOP" "${srcdir}/${subdir}/ctxobj-f.c"]
+set bp_location [gdb_get_line_number "STOP" "ctxobj-f.c"]
 gdb_test "break ctxobj-f.c:$bp_location" \
          "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: .*" \
          "break in get_version functions"
diff --git a/gdb/testsuite/gdb.base/print-file-var.exp b/gdb/testsuite/gdb.base/print-file-var.exp
index 91819ed..d0ab575 100644
--- a/gdb/testsuite/gdb.base/print-file-var.exp
+++ b/gdb/testsuite/gdb.base/print-file-var.exp
@@ -67,7 +67,7 @@ if ![runto_main] {
 # Get past the initialization of variables 'v1' and 'v2'.
 
 set bp_location \
-    [gdb_get_line_number "STOP" "${srcdir}/${subdir}/${executable}.c"]
+    [gdb_get_line_number "STOP" "${executable}.c"]
 gdb_test "break $executable.c:$bp_location" \
          "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: .*" \
          "breapoint past v1 & v2 initialization"


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