Don't remove files copied to host
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.python / py-objfile-script.exp
index e79c0b879809e46447a453af5c19b34217ece933..298bc3e42ea566404182694a40be14ebb5204245 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2011 Free Software Foundation, Inc.
+# Copyright (C) 2011-2014 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 part of the GDB testsuite.  It tests automagic loading of
 # -gdb.py scripts.
 
-if $tracelevel then {
-    strace $tracelevel
-}
+standard_testfile
 
-set testfile "py-objfile-script"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-    untested "Couldn't compile ${srcfile}"
+if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
     return -1
 }
 
@@ -38,13 +32,16 @@ if { [skip_python_tests] } { continue }
 # Make the -gdb.py script available to gdb, it is automagically loaded by gdb.
 # Care is taken to put it in the same directory as the binary so that
 # gdb will find it.
-set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}-gdb.py.in ${subdir}/${testfile}-gdb.py]
+set remote_python_file [remote_download host \
+                           ${srcdir}/${subdir}/${testfile}-gdb.py.in \
+                           [standard_output_file ${testfile}-gdb.py]]
 
 gdb_reinitialize_dir $srcdir/$subdir
+gdb_test_no_output "set auto-load safe-path ${remote_python_file}" "set auto-load safe-path"
 gdb_load ${binfile}
 
 # Verify gdb loaded the script.
-gdb_test "info auto-load-scripts" "Yes.*/${testfile}-gdb.py.*"
+gdb_test "info auto-load python-scripts" "Yes.*/${testfile}-gdb.py.*"
 
 if ![runto_main] {
     perror "couldn't run to main"
@@ -56,5 +53,3 @@ gdb_test "b [gdb_get_line_number {break to inspect} ${testfile}.c ]" \
 gdb_test "continue" ".*Breakpoint.*"
 
 gdb_test "print ss" " = a=<1> b=<2>"
-
-remote_file host delete ${remote_python_file}
This page took 0.025695 seconds and 4 git commands to generate.