Add support for --start option in -exec-run GDB/MI command.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / dbx.exp
index f9b32d4fac3596b79a7c6ec9a6d0cd8243a3e776..7d89b81eacbdabd2127c83faa849589deacfdced 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1998, 1999, 2001, 2007, 2008 Free Software Foundation, Inc.
+# Copyright 1998-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
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
-if $tracelevel then {
-        strace $tracelevel
-}
-
-set testfile1 "average"
-set testfile2 "sum"
-set testfile "dbx-test"
-set binfile1 ${objdir}/${subdir}/${testfile1}
-set binfile2 ${objdir}/${subdir}/${testfile2}
-set binfile ${objdir}/${subdir}/${testfile}
-
+standard_testfile average.c sum.c
 
-
-if  { [gdb_compile "${srcdir}/${subdir}/average.c" "${binfile1}.o" object {debug}] != "" } {
-     untested dbx.exp
-     return -1
-}
-
-if  { [gdb_compile "${srcdir}/${subdir}/sum.c" "${binfile2}.o" object {debug}] != "" } {
-     untested dbx.exp
-     return -1
-}
-
-if  { [gdb_compile "${binfile1}.o ${binfile2}.o" ${binfile} executable {debug}] != "" } {
-     untested dbx.exp
-     return -1
+if {[build_executable $testfile.exp $testfile \
+        [list $srcfile $srcfile2] debug] == -1} {
+    untested $testfile.exp
+    return -1
 }
 
 #
@@ -48,11 +28,11 @@ if  { [gdb_compile "${binfile1}.o ${binfile2}.o" ${binfile} executable {debug}]
 proc dbx_gdb_start { } {
     global verbose
     global GDB
-    global GDBFLAGS
+    global INTERNAL_GDBFLAGS GDBFLAGS
     global prompt
     global spawn_id
     global timeout
-    verbose "Spawning $GDB -nw $GDBFLAGS"
+    verbose "Spawning $GDB -dbx $INTERNAL_GDBFLAGS $GDBFLAGS"
 
     if { [which $GDB] == 0 } then {
         perror "$GDB does not exist."
@@ -61,7 +41,7 @@ proc dbx_gdb_start { } {
 
     set oldtimeout $timeout
     set timeout [expr "$timeout + 60"]
-    eval "spawn $GDB -nw -dbx $GDBFLAGS"
+    eval "spawn $GDB -dbx $INTERNAL_GDBFLAGS $GDBFLAGS"
     gdb_expect {
         -re ".*\r\n$gdb_prompt $" {
             verbose "GDB initialized."
@@ -185,10 +165,10 @@ proc gdb_file_cmd {arg} {
     set last_loaded_file $arg
 
     if [is_remote host] {
-        set arg [remote_download host $arg];
+        set arg [remote_download host $arg]
         if { $arg == "" } {
             error "download failed"
-            return -1;
+            return -1
         }
     }
 
@@ -304,13 +284,13 @@ proc test_whereis { } {
 #test_func
 #
 proc test_func { } {
-    gdb_test "cont" "" "cont 1"
-    gdb_test "step" ""
+    gdb_test "cont" ".*" "cont 1"
+    gdb_test "step" ".*"
     # This always fails, but it's not clear why. -sts 1999-08-17
     setup_xfail "*-*-*"
     gdb_test "func sum" "'sum' not within current stack frame\."
     gdb_test "stop in sum" "Breakpoint.*at.*: file.*sum\.c, line 11\."
-    gdb_test "cont" "" "cont 2"
+    gdb_test "cont" ".*" "cont 2"
     # This always fails, but it's not clear why. -sts 1999-08-17
     setup_xfail "*-*-*"
     gdb_test "func print_average" ".*in print_average.*\\(list=.*, low=0, high=6\\).*at.*average\.c:24\r\n24\[ \t\]+total = sum\\(list, low, high\\);"
This page took 0.026937 seconds and 4 git commands to generate.