Fix zero_ext documentation
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / bigcore.exp
index 6b23e7c7b8decb8ef29670a58c0423fdc13e5a5e..ae00d0aba03a0c063547a797649ea696c3a4f119 100644 (file)
@@ -1,5 +1,4 @@
-# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2004, 2005,
-# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright 1992-2016 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
 # This file is based on corefile.exp which was written by Fred
 # Fish. (fnf@cygnus.com)
 
-if $tracelevel then {
-       strace $tracelevel
-}
-
 
 # Are we on a target board?  As of 2004-02-12, GDB didn't have a
 # mechanism that would let it efficiently access a remote corefile.
@@ -32,11 +27,10 @@ if ![isnative] then {
 
 # Can the system run this test (in particular support sparse
 # corefiles)?  On systems that lack sparse corefile support this test
-# consumes too many resources - gigabytes worth of disk space and and
+# consumes too many resources - gigabytes worth of disk space and
 # I/O bandwith.
 
 if { [istarget "*-*-*bsd*"]
-     || [istarget "*-*-hpux*"]
      || [istarget "*-*-solaris*"] 
      || [istarget "*-*-darwin*"] 
      || [istarget "*-*-cygwin*"] } {
@@ -44,17 +38,8 @@ if { [istarget "*-*-*bsd*"]
     return
 }
 
-# This testcase causes too much stress (in terms of memory usage)
-# on certain systems...
-if { [istarget "*-*-*irix*"] } {
-    untested "Testcase too stressful for this system"
-    return
-}
-
-set testfile "bigcore"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-set corefile ${objdir}/${subdir}/${testfile}.corefile
+standard_testfile .c
+set corefile [standard_output_file ${binfile}.corefile]
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
      untested bigcore.exp
@@ -63,15 +48,18 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 
 # Run GDB on the bigcore program up-to where it will dump core.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 gdb_test_no_output "set print sevenbit-strings"
 gdb_test_no_output "set width 0"
 
+# Get the core into the output directory.
+if {![is_remote host]} {
+    gdb_test "cd [file dirname $corefile]" "Working directory .*" \
+       "cd to test directory"
+}
+
 if { ![runto_main] } then {
-    gdb_suppress_tests;
+    gdb_suppress_tests
 }
 set print_core_line [gdb_get_line_number "Dump core"]
 gdb_test "tbreak $print_core_line"
@@ -108,7 +96,7 @@ proc extract_heap { dir } {
            fail "$test (timeout)"
        }
     }
-    return $heap;
+    return $heap
 }
 set next_heap [extract_heap next]
 set prev_heap [extract_heap prev]
@@ -149,7 +137,7 @@ set timeout $oldtimeout
 # Find the corefile
 set file ""
 foreach pat [list core.${inferior_pid} ${testfile}.core core] {
-    set names [glob -nocomplain $pat]
+    set names [glob -nocomplain [standard_output_file $pat]]
     if {[llength $names] == 1} {
        set file [lindex $names 0]
        remote_exec build "mv $file $corefile"
@@ -198,7 +186,9 @@ if {! $core_ok} {
 # Now load up that core file
 
 set test "load corefile"
-gdb_test_multiple "core $corefile" "$test" {
+# We use [file tail] because gdb is still "cd"d to the
+# output directory.
+gdb_test_multiple "core [file tail $corefile]" "$test" {
     -re "A program is being debugged already.  Kill it. .y or n. " {
        send_gdb "y\n"
        exp_continue
This page took 0.026392 seconds and 4 git commands to generate.