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]

Fix gcore-thread.exp FAIL -> ERROR


There's a path in gcore-thread.exp that if we get a FAIL, we
end up with core_supported never set, ending up with...

Running ../../../src/gdb/testsuite/gdb.threads/gcore-thread.exp ...
FAIL: gdb.threads/gcore-thread.exp: thread 2 is running (timeout)
FAIL: gdb.threads/gcore-thread.exp: save a corefile (timeout)
ERROR: tcl error sourcing ../../../src/gdb/testsuite/gdb.threads/gcore-thread.exp.
ERROR: can't read "core_supported": no such variable
    while executing
"if {!$core_supported} {
  return -1
}"
    (file "../../../src/gdb/testsuite/gdb.threads/gcore-thread.exp" line 118)
    invoked from within
"source ../../../src/gdb/testsuite/gdb.threads/gcore-thread.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source ../../../src/gdb/testsuite/gdb.threads/gcore-thread.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name""

This fixes it.  I grepped for core_supported, looking at the other places
that have a similar pattern, and saw that they all already have this fixed.

Applied.

-- 
Pedro Alves

2011-09-02  Pedro Alves  <pedro@codesourcery.com>

	gdb/testsuite/
	* gdb.threads/gcore-thread.exp: Set the global core_supported to
	0, before testing gcore.

---
 gdb/testsuite/gdb.threads/gcore-thread.exp |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Index: src/gdb/testsuite/gdb.threads/gcore-thread.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.threads/gcore-thread.exp	2011-05-09 14:52:32.000000000 +0100
+++ src/gdb/testsuite/gdb.threads/gcore-thread.exp	2011-08-24 16:58:04.533228275 +0100
@@ -100,6 +100,7 @@ gdb_test "continue" "Continuing.*Breakpo
 
 set escapedfilename [string_to_regexp $corefile]
 # Drop corefile
+set core_supported 0
 gdb_test_multiple "gcore $corefile" "save a corefile" \
 {
   -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
@@ -109,12 +110,9 @@ gdb_test_multiple "gcore $corefile" "sav
   }
   -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
     unsupported "save a corefile"
-    global core_supported
-    set core_supported 0
   }
 }
 
-global core_supported
 if {!$core_supported} {
   return -1
 }


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