Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Remote testsuite problem: invalid executable cache
@ 2011-07-22 15:22 Ulrich Weigand
  2011-07-22 16:35 ` Jan Kratochvil
  2011-07-22 16:53 ` Daniel Jacobowitz
  0 siblings, 2 replies; 12+ messages in thread
From: Ulrich Weigand @ 2011-07-22 15:22 UTC (permalink / raw)
  To: gdb-patches

Hello,

when running the test suite in remote mode against a gdbserver target,
the executable under test is built on the host using a cross-compiler
and then downloaded to the target before the test starts.

Apparently in an attempt to reduce test times across a slow download
connection, the gdbserver_download_current_prog skips that download
if it thinks the executable is already on the target (e.g. if a test
case restarts GDB on the same executable multiple times).

This case is detected by comparing file name and time stamp of the
executable under test against those values remembered from the last
executable that was downloaded.

This seems fine at first glance, but actually doesn't quite work:

- Some tests, in particular multiple gdb.python tests, re-compile
  the executable under test several times, reusing the same name.
  For example, py-value.exp recompiles the same source file first
  using the C compiler and then using the C++ compiler, and runs
  a couple of tests on each.

- The gdbserver_download_current_prog time stamp check uses Tcl
  [file mtime ...], which only provides a resolution of 1 second.
  If the test runs fast enough, the second rebuild of the executable
  might happen to carry the same time stamp as the first one.

- This may cause the test suite to erroneously skip copying the C++
  executable, and run the C++ tests on the C executable (which will
  usually fail since GDB on the host side does use the new binary,
  so that instruction addresses will not match up).

Some options to fix this problem might include:

- Rewrite the Pyhton tests to not overwrite the same exectuable
  file (just use different names).

- Remove the cache.  (How bad it the download time problem, really?)

- Use better markers to identify unchanged executables (more precise
  timestamp?  checksum?).  Any hints on how to portably implement
  something along those lines in Tcl would be appreciated!

- Create some sort of hook that would allow "gdb_compile" to notify
  the executable cache that a file was just rebuilt.

Thoughts?

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Remote testsuite problem: invalid executable cache
  2011-07-22 15:22 Remote testsuite problem: invalid executable cache Ulrich Weigand
@ 2011-07-22 16:35 ` Jan Kratochvil
  2011-07-22 16:53 ` Daniel Jacobowitz
  1 sibling, 0 replies; 12+ messages in thread
From: Jan Kratochvil @ 2011-07-22 16:35 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: gdb-patches

On Fri, 22 Jul 2011 17:06:35 +0200, Ulrich Weigand wrote:
> - Rewrite the Pyhton tests to not overwrite the same exectuable
>   file (just use different names).

This should be fixed anyway, so far I was writing tests such way so that one
can reproduce the problem by hand on existing executable(s) after the test has
finished.


Thanks,
Jan


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Remote testsuite problem: invalid executable cache
  2011-07-22 15:22 Remote testsuite problem: invalid executable cache Ulrich Weigand
  2011-07-22 16:35 ` Jan Kratochvil
@ 2011-07-22 16:53 ` Daniel Jacobowitz
  2011-07-22 17:53   ` [rfc] " Ulrich Weigand
  1 sibling, 1 reply; 12+ messages in thread
From: Daniel Jacobowitz @ 2011-07-22 16:53 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: gdb-patches

On Fri, Jul 22, 2011 at 11:06 AM, Ulrich Weigand <uweigand@de.ibm.com> wrote:
> Some options to fix this problem might include:
>
> - Rewrite the Pyhton tests to not overwrite the same exectuable
>  file (just use different names).

I am strongly in favor of this option.  If you do remote host testing
over NFS, multiple binaries with the same name can lead to bizarre
cache inconsistency.  (Sad but true.)

-- 
Thanks,
Daniel


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [rfc] Re: Remote testsuite problem: invalid executable cache
  2011-07-22 16:53 ` Daniel Jacobowitz
@ 2011-07-22 17:53   ` Ulrich Weigand
  2011-07-22 18:40     ` Tom Tromey
  2011-07-24 18:04     ` Mark Kettenis
  0 siblings, 2 replies; 12+ messages in thread
From: Ulrich Weigand @ 2011-07-22 17:53 UTC (permalink / raw)
  To: Daniel Jacobowitz, jan.kratochvil, tromey; +Cc: gdb-patches

Dan Jacobowitz wrote:
> On Fri, Jul 22, 2011 at 11:06 AM, Ulrich Weigand <uweigand@de.ibm.com> wrote:
> > Some options to fix this problem might include:
> >
> > - Rewrite the Pyhton tests to not overwrite the same exectuable
> >   file (just use different names).
> 
> I am strongly in favor of this option.  If you do remote host testing
> over NFS, multiple binaries with the same name can lead to bizarre
> cache inconsistency.  (Sad but true.)

Jan Kratochvil wrote:

> This should be fixed anyway, so far I was writing tests such way so that one
> can reproduce the problem by hand on existing executable(s) after the test has
> finished.

Seems there is consensus this is the way to go ...

The patch below implements this for all instances I could find in gdb.python.

Tom, does this look OK to you?

Thanks,
Ulrich

ChangeLog:

	* testsuite/gdb.python/py-mi.exp: Use different file names for
	different versions of the executable under test.
	* testsuite/gdb.python/py-prettyprint.exp: Likewise.
	* testsuite/gdb.python/py-symbol.exp: Likewise.
	* testsuite/gdb.python/py-template.exp: Likewise.
	* testsuite/gdb.python/py-type.exp: Likewise.
	* testsuite/gdb.python/py-value.exp: Likewise.

Index: gdb/testsuite/gdb.python/py-mi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-mi.exp,v
retrieving revision 1.11
diff -u -p -r1.11 py-mi.exp
--- gdb/testsuite/gdb.python/py-mi.exp	16 May 2011 13:56:40 -0000	1.11
+++ gdb/testsuite/gdb.python/py-mi.exp	22 Jul 2011 17:34:25 -0000
@@ -286,7 +286,7 @@ mi_list_varobj_children nstype2 {
 
 # C++ MI tests
 gdb_exit
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-c++" \
 	   executable {debug c++ additional_flags=-DMI}] != "" } {
     untested "Couldn't compile ${srcfile} in c++ mode"
     return -1
@@ -297,7 +297,7 @@ if [mi_gdb_start] {
 }
 mi_delete_breakpoints
 mi_gdb_reinitialize_dir $srcdir/$subdir
-mi_gdb_load ${binfile}
+mi_gdb_load ${binfile}-c++
 
 if {[lsearch -exact [mi_get_features] python] < 0} {
     unsupported "python support is disabled"
Index: gdb/testsuite/gdb.python/py-prettyprint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-prettyprint.exp,v
retrieving revision 1.20
diff -u -p -r1.20 py-prettyprint.exp
--- gdb/testsuite/gdb.python/py-prettyprint.exp	11 Jul 2011 13:07:38 -0000	1.20
+++ gdb/testsuite/gdb.python/py-prettyprint.exp	22 Jul 2011 17:34:25 -0000
@@ -35,7 +35,7 @@ if { [skip_python_tests] } { continue }
 
 proc run_lang_tests {lang} {
     global srcdir subdir srcfile binfile testfile hex
-    if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug $lang"] != "" } {
+    if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-${lang}" executable "debug $lang"] != "" } {
 	untested "Couldn't compile ${srcfile} in $lang mode"
 	return -1
     }
@@ -46,7 +46,7 @@ proc run_lang_tests {lang} {
     gdb_exit
     gdb_start
     gdb_reinitialize_dir $srcdir/$subdir
-    gdb_load ${binfile}
+    gdb_load ${binfile}-${lang}
 
     if ![runto_main ] then {
 	perror "couldn't run to breakpoint"
Index: gdb/testsuite/gdb.python/py-symbol.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-symbol.exp,v
retrieving revision 1.6
diff -u -p -r1.6 py-symbol.exp
--- gdb/testsuite/gdb.python/py-symbol.exp	17 Mar 2011 09:36:17 -0000	1.6
+++ gdb/testsuite/gdb.python/py-symbol.exp	22 Jul 2011 17:34:25 -0000
@@ -99,7 +99,7 @@ gdb_test "python print t\[0\].symtab" "g
 
 # C++ tests
 # Recompile binary.
- if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug c++"] != "" } {
+ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-c++" executable "debug c++"] != "" } {
      untested "Couldn't compile ${srcfile} in c++ mode"
      return -1
  }
@@ -108,7 +108,7 @@ gdb_test "python print t\[0\].symtab" "g
 gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+gdb_load ${binfile}-c++
 
 if ![runto_main] then {
     fail "Can't run to main"
Index: gdb/testsuite/gdb.python/py-template.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-template.exp,v
retrieving revision 1.7
diff -u -p -r1.7 py-template.exp
--- gdb/testsuite/gdb.python/py-template.exp	30 Jun 2011 08:53:38 -0000	1.7
+++ gdb/testsuite/gdb.python/py-template.exp	22 Jul 2011 17:34:25 -0000
@@ -40,15 +40,15 @@ gdb_reinitialize_dir $srcdir/$subdir
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-proc test_template_arg {type} {
+proc test_template_arg {name type} {
     global testfile srcdir subdir srcfile binfile
-    if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
+    if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-${name}" \
 		executable \
 	  	[list debug c++ additional_flags="-DTYPE=$type"]] != "" } {
 	untested $type
 	return -1
     }
-    gdb_load ${binfile}
+    gdb_load ${binfile}-${name}
     if ![runto_main ] then {
 	perror "couldn't run to breakpoint"
 	return
@@ -62,11 +62,11 @@ proc test_template_arg {type} {
     gdb_test "python print foo.type.template_argument(0)" $t $type
 }
 
-test_template_arg "const int"
-test_template_arg "volatile int"
-test_template_arg "const int &"
-test_template_arg "volatile int &"
-test_template_arg "volatile int * const"
-test_template_arg "volatile int * const *"
-test_template_arg "const int * volatile"
-test_template_arg "const int * volatile * const * volatile *"
+test_template_arg "ci" "const int"
+test_template_arg "vi" "volatile int"
+test_template_arg "cir" "const int &"
+test_template_arg "vir" "volatile int &"
+test_template_arg "vipc" "volatile int * const"
+test_template_arg "vipcp" "volatile int * const *"
+test_template_arg "cipv" "const int * volatile"
+test_template_arg "cipvpcpvp" "const int * volatile * const * volatile *"
Index: gdb/testsuite/gdb.python/py-type.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-type.exp,v
retrieving revision 1.11
diff -u -p -r1.11 py-type.exp
--- gdb/testsuite/gdb.python/py-type.exp	1 Jan 2011 15:33:49 -0000	1.11
+++ gdb/testsuite/gdb.python/py-type.exp	22 Jul 2011 17:34:25 -0000
@@ -34,20 +34,20 @@ if [get_compiler_info not-used c++] {
 proc build_inferior {lang} {
   global srcdir subdir srcfile binfile testfile hex
 
-  if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug $lang"] != "" } {
+  if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-${lang}" executable "debug $lang"] != "" } {
       untested "Couldn't compile ${srcfile} in $lang mode"
       return -1
   }
 }
 
 # Restart GDB.
-proc restart_gdb {} { 
+proc restart_gdb {lang} { 
   global srcdir subdir srcfile binfile testfile hex
 
   gdb_exit
   gdb_start
   gdb_reinitialize_dir $srcdir/$subdir
-  gdb_load ${binfile}
+  gdb_load ${binfile}-${lang}
 
   if ![runto_main ] then {
       perror "couldn't run to breakpoint"
@@ -162,7 +162,7 @@ proc test_template {} {
 
 # Perform C Tests.
 build_inferior "c"
-restart_gdb 
+restart_gdb "c"
 
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
@@ -172,7 +172,7 @@ test_fields "c"
 
 # Perform C++ Tests.
 build_inferior "c++"
-restart_gdb 
+restart_gdb "c++"
 runto_bp "break to inspect struct and array."
 test_fields "c++"
 test_base_class
Index: gdb/testsuite/gdb.python/py-value.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-value.exp,v
retrieving revision 1.20
diff -u -p -r1.20 py-value.exp
--- gdb/testsuite/gdb.python/py-value.exp	24 Apr 2011 09:04:38 -0000	1.20
+++ gdb/testsuite/gdb.python/py-value.exp	22 Jul 2011 17:34:25 -0000
@@ -326,7 +326,7 @@ proc test_value_after_death {} {
 proc test_subscript_regression {lang} {
 
  global srcdir subdir srcfile binfile testfile hex
- if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug $lang"] != "" } {
+ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-${lang}" executable "debug $lang"] != "" } {
      untested "Couldn't compile ${srcfile} in $lang mode"
      return -1
  }
@@ -335,7 +335,7 @@ proc test_subscript_regression {lang} {
  gdb_exit
  gdb_start
  gdb_reinitialize_dir $srcdir/$subdir
- gdb_load ${binfile}
+ gdb_load ${binfile}-${lang}
 
  if ![runto_main ] then {
      perror "couldn't run to breakpoint"



-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [rfc] Re: Remote testsuite problem: invalid executable cache
  2011-07-22 17:53   ` [rfc] " Ulrich Weigand
@ 2011-07-22 18:40     ` Tom Tromey
  2011-07-22 18:56       ` Ulrich Weigand
  2011-07-24 18:04     ` Mark Kettenis
  1 sibling, 1 reply; 12+ messages in thread
From: Tom Tromey @ 2011-07-22 18:40 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: Daniel Jacobowitz, jan.kratochvil, gdb-patches

>>>>> "Ulrich" == Ulrich Weigand <uweigand@de.ibm.com> writes:

Ulrich> Tom, does this look OK to you?

Ulrich> 	* testsuite/gdb.python/py-mi.exp: Use different file names for
Ulrich> 	different versions of the executable under test.
Ulrich> 	* testsuite/gdb.python/py-prettyprint.exp: Likewise.
Ulrich> 	* testsuite/gdb.python/py-symbol.exp: Likewise.
Ulrich> 	* testsuite/gdb.python/py-template.exp: Likewise.
Ulrich> 	* testsuite/gdb.python/py-type.exp: Likewise.
Ulrich> 	* testsuite/gdb.python/py-value.exp: Likewise.

Looks great, thanks.

Tom


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [rfc] Re: Remote testsuite problem: invalid executable cache
  2011-07-22 18:40     ` Tom Tromey
@ 2011-07-22 18:56       ` Ulrich Weigand
  0 siblings, 0 replies; 12+ messages in thread
From: Ulrich Weigand @ 2011-07-22 18:56 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Daniel Jacobowitz, jan.kratochvil, gdb-patches

Tom Tromey wrote:
> >>>>> "Ulrich" == Ulrich Weigand <uweigand@de.ibm.com> writes:
> 
> Ulrich> Tom, does this look OK to you?
> 
> Ulrich> 	* testsuite/gdb.python/py-mi.exp: Use different file names for
> Ulrich> 	different versions of the executable under test.
> Ulrich> 	* testsuite/gdb.python/py-prettyprint.exp: Likewise.
> Ulrich> 	* testsuite/gdb.python/py-symbol.exp: Likewise.
> Ulrich> 	* testsuite/gdb.python/py-template.exp: Likewise.
> Ulrich> 	* testsuite/gdb.python/py-type.exp: Likewise.
> Ulrich> 	* testsuite/gdb.python/py-value.exp: Likewise.
> 
> Looks great, thanks.

OK, I've checked this is as well now.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [rfc] Re: Remote testsuite problem: invalid executable cache
  2011-07-22 17:53   ` [rfc] " Ulrich Weigand
  2011-07-22 18:40     ` Tom Tromey
@ 2011-07-24 18:04     ` Mark Kettenis
  2011-07-25 18:33       ` Ulrich Weigand
  1 sibling, 1 reply; 12+ messages in thread
From: Mark Kettenis @ 2011-07-24 18:04 UTC (permalink / raw)
  To: uweigand; +Cc: drow, jan.kratochvil, tromey, gdb-patches

> Date: Fri, 22 Jul 2011 19:43:34 +0200 (CEST)
> From: "Ulrich Weigand" <uweigand@de.ibm.com>
>
> Index: gdb/testsuite/gdb.python/py-mi.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-mi.exp,v
> retrieving revision 1.11
> diff -u -p -r1.11 py-mi.exp
> --- gdb/testsuite/gdb.python/py-mi.exp	16 May 2011 13:56:40 -0000	1.11
> +++ gdb/testsuite/gdb.python/py-mi.exp	22 Jul 2011 17:34:25 -0000
> @@ -286,7 +286,7 @@ mi_list_varobj_children nstype2 {
>  
>  # C++ MI tests
>  gdb_exit
> -if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
> +if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-c++" \
>  	   executable {debug c++ additional_flags=-DMI}] != "" } {
>      untested "Couldn't compile ${srcfile} in c++ mode"
>      return -1
> @@ -297,7 +297,7 @@ if [mi_gdb_start] {
>  }
>  mi_delete_breakpoints
>  mi_gdb_reinitialize_dir $srcdir/$subdir
> -mi_gdb_load ${binfile}
> +mi_gdb_load ${binfile}-c++

Using the '+' character in filenames may not be the best idea.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [rfc] Re: Remote testsuite problem: invalid executable cache
  2011-07-24 18:04     ` Mark Kettenis
@ 2011-07-25 18:33       ` Ulrich Weigand
  2011-07-26  1:01         ` Stan Shebs
  0 siblings, 1 reply; 12+ messages in thread
From: Ulrich Weigand @ 2011-07-25 18:33 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: drow, jan.kratochvil, tromey, gdb-patches

Mark Kettenis wrote:

> > +mi_gdb_load ${binfile}-c++
> 
> Using the '+' character in filenames may not be the best idea.

Is this really a problem?  I thought '+' was supported just about
everywhere ...  (There's filenames containing '+' in the GDB source
repository, for example.)

It's trivial to change this instance, but in other places I'm
just using ${binfile}-${lang}; those would require a more elaborate
change.  If this is really a problem, I'll of course implement the
change, but if it isn't, I'd prefer to avoid that ...

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [rfc] Re: Remote testsuite problem: invalid executable cache
  2011-07-25 18:33       ` Ulrich Weigand
@ 2011-07-26  1:01         ` Stan Shebs
  2011-07-26 17:31           ` [rfc] Avoid '+' in file names (Re: [rfc] Re: Remote testsuite problem: invalid executable cache) Ulrich Weigand
  0 siblings, 1 reply; 12+ messages in thread
From: Stan Shebs @ 2011-07-26  1:01 UTC (permalink / raw)
  To: gdb-patches

On 7/25/11 10:40 AM, Ulrich Weigand wrote:
> Mark Kettenis wrote:
>
>>> +mi_gdb_load ${binfile}-c++
>> Using the '+' character in filenames may not be the best idea.
> Is this really a problem?  I thought '+' was supported just about
> everywhere ...  (There's filenames containing '+' in the GDB source
> repository, for example.)

I would be inclined to avoid '+' myself, not because of the filesystem, 
but because of potential tcl/dejagnu regexp hell.  (Yes, it can be 
worked around, but it gets annoying when 54 backslashes in a row is not 
enough :-) )

Stan
stan@codesourcery.com


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [rfc] Avoid '+' in file names (Re: [rfc] Re: Remote testsuite problem: invalid executable cache)
  2011-07-26  1:01         ` Stan Shebs
@ 2011-07-26 17:31           ` Ulrich Weigand
  2011-07-26 18:20             ` Tom Tromey
  0 siblings, 1 reply; 12+ messages in thread
From: Ulrich Weigand @ 2011-07-26 17:31 UTC (permalink / raw)
  To: Stan Shebs, mark.kettenis, tromey; +Cc: gdb-patches

Stan Shebs wrote:
> On 7/25/11 10:40 AM, Ulrich Weigand wrote:
> > Mark Kettenis wrote:
> >
> >>> +mi_gdb_load ${binfile}-c++
> >> Using the '+' character in filenames may not be the best idea.
> > Is this really a problem?  I thought '+' was supported just about
> > everywhere ...  (There's filenames containing '+' in the GDB source
> > repository, for example.)
> 
> I would be inclined to avoid '+' myself, not because of the filesystem, 
> but because of potential tcl/dejagnu regexp hell.  (Yes, it can be 
> worked around, but it gets annoying when 54 backslashes in a row is not 
> enough :-) )

OK, so this patch avoids use of '+' in filenames.  The Python test now
always calls the C version of the generated executable file "${binfile}",
and the C++ version "${binfile}-cxx".  As convention, the subroutines
in those tests now receive the filename under test as extra parameter
and do not attempt to reconstruct it from the language argument.

Some tests used to build the C version twice, once as ${binfile} and
once as ${binfile}-c, which seems unnecessary.  The patch removes the
second re-compile as C in those cases.

Tested on arm-linux-gnueabi target from a i386-linux host.

Tom, is this version still OK with you?

Bye,
Ulrich


ChangeLog:

	* gdb.python/py-mi.exp: Avoid '+' in filenames.  Call C version of
	executable file "${binfile}", C++ version "${binfile}-cxx".
	* gdb.python/py-prettyprint.exp: Likewise.
	* gdb.python/py-symbol.exp: Likewise.
	* gdb.python/py-type.exp: Likewise.
	* gdb.python/py-value.exp: Likewise.
	* gdb.python/py-template.exp (test_template_arg): Pass full executable
	file name instead of just suffix.

Index: gdb/testsuite/gdb.python/py-mi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-mi.exp,v
retrieving revision 1.12
diff -u -p -r1.12 py-mi.exp
--- gdb/testsuite/gdb.python/py-mi.exp	22 Jul 2011 18:01:43 -0000	1.12
+++ gdb/testsuite/gdb.python/py-mi.exp	26 Jul 2011 17:02:01 -0000
@@ -286,7 +286,7 @@ mi_list_varobj_children nstype2 {
 
 # C++ MI tests
 gdb_exit
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-c++" \
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-cxx" \
 	   executable {debug c++ additional_flags=-DMI}] != "" } {
     untested "Couldn't compile ${srcfile} in c++ mode"
     return -1
@@ -297,7 +297,7 @@ if [mi_gdb_start] {
 }
 mi_delete_breakpoints
 mi_gdb_reinitialize_dir $srcdir/$subdir
-mi_gdb_load ${binfile}-c++
+mi_gdb_load ${binfile}-cxx
 
 if {[lsearch -exact [mi_get_features] python] < 0} {
     unsupported "python support is disabled"
Index: gdb/testsuite/gdb.python/py-prettyprint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-prettyprint.exp,v
retrieving revision 1.21
diff -u -p -r1.21 py-prettyprint.exp
--- gdb/testsuite/gdb.python/py-prettyprint.exp	22 Jul 2011 18:01:43 -0000	1.21
+++ gdb/testsuite/gdb.python/py-prettyprint.exp	26 Jul 2011 17:02:01 -0000
@@ -33,9 +33,9 @@ gdb_start
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-proc run_lang_tests {lang} {
-    global srcdir subdir srcfile binfile testfile hex
-    if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-${lang}" executable "debug $lang"] != "" } {
+proc run_lang_tests {exefile lang} {
+    global srcdir subdir srcfile testfile hex
+    if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${exefile}" executable "debug $lang"] != "" } {
 	untested "Couldn't compile ${srcfile} in $lang mode"
 	return -1
     }
@@ -46,7 +46,7 @@ proc run_lang_tests {lang} {
     gdb_exit
     gdb_start
     gdb_reinitialize_dir $srcdir/$subdir
-    gdb_load ${binfile}-${lang}
+    gdb_load ${exefile}
 
     if ![runto_main ] then {
 	perror "couldn't run to breakpoint"
@@ -113,16 +113,11 @@ proc run_lang_tests {lang} {
     remote_file host delete ${remote_python_file}
 }
 
-run_lang_tests "c"
-run_lang_tests "c++"
+run_lang_tests "${binfile}" "c"
+run_lang_tests "${binfile}-cxx" "c++"
 
 # Run various other tests.
 
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug"] != "" } {
-    untested "Couldn't compile ${srcfile}"
-    return -1
-}
-
 # Start with a fresh gdb.
 gdb_exit
 gdb_start
Index: gdb/testsuite/gdb.python/py-symbol.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-symbol.exp,v
retrieving revision 1.7
diff -u -p -r1.7 py-symbol.exp
--- gdb/testsuite/gdb.python/py-symbol.exp	22 Jul 2011 18:01:43 -0000	1.7
+++ gdb/testsuite/gdb.python/py-symbol.exp	26 Jul 2011 17:02:01 -0000
@@ -99,7 +99,7 @@ gdb_test "python print t\[0\].symtab" "g
 
 # C++ tests
 # Recompile binary.
- if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-c++" executable "debug c++"] != "" } {
+ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-cxx" executable "debug c++"] != "" } {
      untested "Couldn't compile ${srcfile} in c++ mode"
      return -1
  }
@@ -108,7 +108,7 @@ gdb_test "python print t\[0\].symtab" "g
 gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}-c++
+gdb_load ${binfile}-cxx
 
 if ![runto_main] then {
     fail "Can't run to main"
Index: gdb/testsuite/gdb.python/py-template.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-template.exp,v
retrieving revision 1.8
diff -u -p -r1.8 py-template.exp
--- gdb/testsuite/gdb.python/py-template.exp	22 Jul 2011 18:01:43 -0000	1.8
+++ gdb/testsuite/gdb.python/py-template.exp	26 Jul 2011 17:02:01 -0000
@@ -40,15 +40,15 @@ gdb_reinitialize_dir $srcdir/$subdir
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-proc test_template_arg {name type} {
-    global testfile srcdir subdir srcfile binfile
-    if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-${name}" \
+proc test_template_arg {exefile type} {
+    global testfile srcdir subdir srcfile
+    if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${exefile}" \
 		executable \
 	  	[list debug c++ additional_flags="-DTYPE=$type"]] != "" } {
 	untested $type
 	return -1
     }
-    gdb_load ${binfile}-${name}
+    gdb_load ${exefile}
     if ![runto_main ] then {
 	perror "couldn't run to breakpoint"
 	return
@@ -62,11 +62,11 @@ proc test_template_arg {name type} {
     gdb_test "python print foo.type.template_argument(0)" $t $type
 }
 
-test_template_arg "ci" "const int"
-test_template_arg "vi" "volatile int"
-test_template_arg "cir" "const int &"
-test_template_arg "vir" "volatile int &"
-test_template_arg "vipc" "volatile int * const"
-test_template_arg "vipcp" "volatile int * const *"
-test_template_arg "cipv" "const int * volatile"
-test_template_arg "cipvpcpvp" "const int * volatile * const * volatile *"
+test_template_arg "${binfile}-ci" "const int"
+test_template_arg "${binfile}-vi" "volatile int"
+test_template_arg "${binfile}-cir" "const int &"
+test_template_arg "${binfile}-vir" "volatile int &"
+test_template_arg "${binfile}-vipc" "volatile int * const"
+test_template_arg "${binfile}-vipcp" "volatile int * const *"
+test_template_arg "${binfile}-cipv" "const int * volatile"
+test_template_arg "${binfile}-cipvpcpvp" "const int * volatile * const * volatile *"
Index: gdb/testsuite/gdb.python/py-type.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-type.exp,v
retrieving revision 1.12
diff -u -p -r1.12 py-type.exp
--- gdb/testsuite/gdb.python/py-type.exp	22 Jul 2011 18:01:43 -0000	1.12
+++ gdb/testsuite/gdb.python/py-type.exp	26 Jul 2011 17:02:01 -0000
@@ -31,23 +31,23 @@ if [get_compiler_info not-used c++] {
 }
 
 # Build inferior to language specification.
-proc build_inferior {lang} {
-  global srcdir subdir srcfile binfile testfile hex
+proc build_inferior {exefile lang} {
+  global srcdir subdir srcfile testfile hex
 
-  if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-${lang}" executable "debug $lang"] != "" } {
+  if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${exefile}" executable "debug $lang"] != "" } {
       untested "Couldn't compile ${srcfile} in $lang mode"
       return -1
   }
 }
 
 # Restart GDB.
-proc restart_gdb {lang} { 
-  global srcdir subdir srcfile binfile testfile hex
+proc restart_gdb {exefile} { 
+  global srcdir subdir srcfile testfile hex
 
   gdb_exit
   gdb_start
   gdb_reinitialize_dir $srcdir/$subdir
-  gdb_load ${binfile}-${lang}
+  gdb_load ${exefile}
 
   if ![runto_main ] then {
       perror "couldn't run to breakpoint"
@@ -161,8 +161,8 @@ proc test_template {} {
 }
 
 # Perform C Tests.
-build_inferior "c"
-restart_gdb "c"
+build_inferior "${binfile}" "c"
+restart_gdb "${binfile}"
 
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
@@ -171,8 +171,8 @@ runto_bp "break to inspect struct and ar
 test_fields "c"
 
 # Perform C++ Tests.
-build_inferior "c++"
-restart_gdb "c++"
+build_inferior "${binfile}-cxx" "c++"
+restart_gdb "${binfile}-cxx"
 runto_bp "break to inspect struct and array."
 test_fields "c++"
 test_base_class
Index: gdb/testsuite/gdb.python/py-value.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-value.exp,v
retrieving revision 1.21
diff -u -p -r1.21 py-value.exp
--- gdb/testsuite/gdb.python/py-value.exp	22 Jul 2011 18:01:43 -0000	1.21
+++ gdb/testsuite/gdb.python/py-value.exp	26 Jul 2011 17:02:01 -0000
@@ -25,9 +25,15 @@ load_lib gdb-python.exp
 set testfile "py-value"
 set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-    untested "Couldn't compile ${srcfile}"
-    return -1
+
+# Build inferior to language specification.
+proc build_inferior {exefile lang} {
+  global srcdir subdir srcfile testfile hex
+
+  if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${exefile}" executable "debug $lang"] != "" } {
+      untested "Couldn't compile ${srcfile} in $lang mode"
+      return -1
+  }
 }
 
 proc test_value_creation {} {
@@ -323,19 +329,15 @@ proc test_value_after_death {} {
 # the type of the value was not being checked before allowing a
 # subscript operation to proceed.
 
-proc test_subscript_regression {lang} {
+proc test_subscript_regression {exefile lang} {
 
- global srcdir subdir srcfile binfile testfile hex
- if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-${lang}" executable "debug $lang"] != "" } {
-     untested "Couldn't compile ${srcfile} in $lang mode"
-     return -1
- }
+ global srcdir subdir
 
  # Start with a fresh gdb.
  gdb_exit
  gdb_start
  gdb_reinitialize_dir $srcdir/$subdir
- gdb_load ${binfile}-${lang}
+ gdb_load ${exefile}
 
  if ![runto_main ] then {
      perror "couldn't run to breakpoint"
@@ -426,6 +428,9 @@ proc test_value_hash {} {
     gdb_test "python print one.__hash__() == hash(one)" "True" "Test inbuilt hash"
 }
 
+# Build C and C++ versions of executable
+build_inferior "${binfile}" "c"
+build_inferior "${binfile}-cxx" "c++"
 
 # Start with a fresh gdb.
 
@@ -457,7 +462,6 @@ test_inferior_function_call
 test_lazy_strings
 test_value_after_death
 
-# The following test recompiles the binary to test either C or C++
-# values. 
-test_subscript_regression "c++"
-test_subscript_regression "c"
+# Test either C or C++ values. 
+test_subscript_regression "${binfile}" "c"
+test_subscript_regression "${binfile}-cxx" "c++"

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [rfc] Avoid '+' in file names (Re: [rfc] Re: Remote testsuite problem: invalid executable cache)
  2011-07-26 17:31           ` [rfc] Avoid '+' in file names (Re: [rfc] Re: Remote testsuite problem: invalid executable cache) Ulrich Weigand
@ 2011-07-26 18:20             ` Tom Tromey
  2011-07-26 19:20               ` Ulrich Weigand
  0 siblings, 1 reply; 12+ messages in thread
From: Tom Tromey @ 2011-07-26 18:20 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: Stan Shebs, mark.kettenis, gdb-patches

Ulrich> Tom, is this version still OK with you?

Yes, thanks.

Tom


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [rfc] Avoid '+' in file names (Re: [rfc] Re: Remote testsuite problem: invalid executable cache)
  2011-07-26 18:20             ` Tom Tromey
@ 2011-07-26 19:20               ` Ulrich Weigand
  0 siblings, 0 replies; 12+ messages in thread
From: Ulrich Weigand @ 2011-07-26 19:20 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Stan Shebs, mark.kettenis, gdb-patches

Tom Tromey wrote:
> Ulrich> Tom, is this version still OK with you?
> 
> Yes, thanks.

OK, I've checked it in now.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-07-26 18:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-22 15:22 Remote testsuite problem: invalid executable cache Ulrich Weigand
2011-07-22 16:35 ` Jan Kratochvil
2011-07-22 16:53 ` Daniel Jacobowitz
2011-07-22 17:53   ` [rfc] " Ulrich Weigand
2011-07-22 18:40     ` Tom Tromey
2011-07-22 18:56       ` Ulrich Weigand
2011-07-24 18:04     ` Mark Kettenis
2011-07-25 18:33       ` Ulrich Weigand
2011-07-26  1:01         ` Stan Shebs
2011-07-26 17:31           ` [rfc] Avoid '+' in file names (Re: [rfc] Re: Remote testsuite problem: invalid executable cache) Ulrich Weigand
2011-07-26 18:20             ` Tom Tromey
2011-07-26 19:20               ` Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox