[commit/testsuite] Fix macscp.exp when macro info is missing

Daniel Jacobowitz drow@false.org
Thu Nov 12 19:37:00 GMT 2009


A test cleanup both Tom and I had been meaning to make since May.
Pierre implemented support for skipping this test if macro information
was missing, but one FAIL was still generated.  This patch removes
that initial FAIL.

RealView does support generating macro debug information, but for some
reason (at least in my environment) the linker doesn't pass it through
to the executable.

Tested on arm-none-eabi and x86_64-linux.  Checked in.

2009-11-12  Daniel Jacobowitz  <dan@codesourcery.com>

	gdb/testsuite/
	* gdb.base/macscp.exp: Avoid the first FAIL if macro information
	is missing.

---
 gdb/testsuite/gdb.base/macscp.exp |   39 +++++++++++++++++---------------------
 1 file changed, 18 insertions(+), 21 deletions(-)

Index: gdb-mainline/gdb/testsuite/gdb.base/macscp.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/macscp.exp	2009-06-03 00:37:08.000000000 -0700
+++ gdb-mainline/gdb/testsuite/gdb.base/macscp.exp	2009-11-11 09:33:39.000000000 -0800
@@ -204,30 +204,27 @@ proc list_and_check_macro {func macro ex
     return [check_macro $macro $expected "after `list $func'"]
 }
 
-
-if {[list_and_check_macro main WHERE {macscp1.c {before macscp1_3}}]} {
-    global verbose
-    set macro_support "unknown"
-    send_gdb "info source\n"
-    gdb_test_multiple "info source" "Test macro information"  {
-	-re "Includes preprocessor macro info\..*$gdb_prompt $" {
-	    set macro_support 1
-	    verbose "Source has macro information"
-	}
-	-re "Does not include preprocessor macro info\..*$gdb_prompt $" {
-	    set macro_support 0
-	    verbose "Source has no macro information"
-	}
-	default {
-	    warning "couldn't check macro support (no valid response)."
-	}
-    }
-    if {$macro_support == 0} {
-	unsupported "Skipping test because debug information does not include macro information."
-	return 0
+gdb_test "list main" ".*main.*" "list main for support check"
+set macro_support "unknown"
+gdb_test_multiple "info source" "Test macro information"  {
+    -re "Includes preprocessor macro info\..*$gdb_prompt $" {
+	set macro_support 1
+	verbose "Source has macro information"
+    }
+    -re "Does not include preprocessor macro info\..*$gdb_prompt $" {
+	set macro_support 0
+	verbose "Source has no macro information"
+    }
+    default {
+	warning "couldn't check macro support (no valid response)."
     }
 }
+if {$macro_support == 0} {
+    unsupported "Skipping test because debug information does not include macro information."
+    return 0
+}
  
+list_and_check_macro main WHERE {macscp1.c {before macscp1_3}}
 list_and_check_macro macscp2_2 WHERE {macscp2.h macscp1.c {before macscp2_2}}
 list_and_check_macro macscp3_2 WHERE {macscp3.h macscp1.c {before macscp3_2}}
 

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb-patches mailing list