Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: drow@false.org (Daniel Jacobowitz),
	jan.kratochvil@redhat.com,        tromey@redhat.com
Cc: gdb-patches@sourceware.org
Subject: [rfc] Re: Remote testsuite problem: invalid executable cache
Date: Fri, 22 Jul 2011 17:53:00 -0000	[thread overview]
Message-ID: <201107221743.p6MHhYCs031716@d06av02.portsmouth.uk.ibm.com> (raw)
In-Reply-To: <CAN9gPaHTbKphO1hyKE+=cy57oJRDxR1JGuALC7gJWgNK2gtopQ@mail.gmail.com> from "Daniel Jacobowitz" at Jul 22, 2011 12:42:00 PM

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


  reply	other threads:[~2011-07-22 17:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-22 15:22 Ulrich Weigand
2011-07-22 16:35 ` Jan Kratochvil
2011-07-22 16:53 ` Daniel Jacobowitz
2011-07-22 17:53   ` Ulrich Weigand [this message]
2011-07-22 18:40     ` [rfc] " 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

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=201107221743.p6MHhYCs031716@d06av02.portsmouth.uk.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=tromey@redhat.com \
    /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