Add support for --start option in -exec-run GDB/MI command.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / volatile.exp
index b5ff432ea90a7248d8982ef7f111f4819a40f45e..321d9ded56dd19b4cfee1b107c7abb212f5d425c 100644 (file)
@@ -1,5 +1,4 @@
-# Copyright 1997, 1998, 1999, 2003, 2004, 2007, 2008, 2009, 2010
-# Free Software Foundation, Inc.
+# Copyright 1997-2013 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 #           ... etc.  (you get the idea)
 # Mostly with char and unsigned char.                    
 
-if $tracelevel then {
-        strace $tracelevel
-        }
-
 #
 # test running programs
 #
-set prms_id 0
-set bug_id 0
 
 # Use the same test program constvars.c.
 
@@ -48,8 +41,8 @@ if { [prepare_for_testing volatile.exp volatile constvars.c] } {
 
 # Create and source the file that provides information about the compiler
 # used to compile the test case.
-if [get_compiler_info not-used] {
-    return -1;
+if [get_compiler_info] {
+    return -1
 }
 
 #
@@ -89,28 +82,17 @@ proc local_compiler_xfail_check_2 { } {
     }
 }
 
-send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
-
-    send_gdb "cont\n"
-    gdb_expect {
-        -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
-            send_gdb "up\n"
-            gdb_expect {
-                -re ".*$gdb_prompt $" {}
-                timeout { fail "up from marker1" }
-            }
-        }
-        -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" {
-           fail "continue to marker1 (demangling)"
-            send_gdb "up\n"
-            gdb_expect {
-                -re ".*$gdb_prompt $" {}
-                timeout { fail "up from marker1" }
-            }
-        }
-        -re "$gdb_prompt $" { fail "continue to marker1"  }
-        timeout { fail "(timeout) continue to marker1"  }
+gdb_test "break marker1" ".*" ""
+
+gdb_test_multiple "cont" "continue to marker1" {
+    -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
+       pass "continue to marker1"
+    }
+    -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" {
+       fail "continue to marker1 (demangling)"
     }
+}
+gdb_test "up" " in main .*" "up from marker1"
 
 # As of Feb 1999, GCC does not issue info about volatility of vars, so
 # these tests are all expected to fail if GCC is the compiler. -sts
@@ -173,7 +155,7 @@ local_compiler_xfail_check
 gdb_test "ptype veneer" "type = volatile short( int)? \\* volatile.*"
 
 local_compiler_xfail_check
-gdb_test "ptype video" "type = volatile (unsigned short|short unsigned)( int) \\* volatile.*"
+gdb_test "ptype video" "type = volatile (unsigned short|short unsigned) \\* volatile.*"
 
 local_compiler_xfail_check
 gdb_test "ptype vacuum" "type = volatile long( int)? \\* volatile.*"
@@ -250,11 +232,7 @@ gdb_test "ptype vendor" "type = const volatile unsigned char \\* const volatile.
 # test function parameters
 local_compiler_xfail_check
 local_compiler_xfail_check_2
-send_gdb "ptype qux2\n"
-gdb_expect {
-    -re "type = int \\(volatile unsigned char, const volatile int, volatile short( int)?, volatile long( int)? \\*, float \\* volatile, const volatile signed char \\* const volatile\\).*$gdb_prompt $" {
-        pass "ptype qux2"
-    }
-    -re ".*$gdb_prompt $" { fail "ptype qux2" }
-    timeout           { fail "(timeout) ptype qux2" }
-  }   
+
+gdb_test "ptype qux2" \
+    "type = int \\(volatile unsigned char, const volatile int, volatile short( int)?, volatile long( int)? \\*, float \\* volatile, const volatile signed char \\* const volatile\\)" \
+    "ptype qux2"
This page took 0.026359 seconds and 4 git commands to generate.