-# 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
}
# 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"
gdb_test "continue" ".*Breakpoint.*"
gdb_test "print ss" " = a=<1> b=<2>"
-
-remote_file host delete ${remote_python_file}