warn if "source" fails to open the file when from_tty == 0
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / jit-simple.exp
CommitLineData
28e7fd62 1# Copyright 2012-2013 Free Software Foundation, Inc.
03bef283
TT
2
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 3 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16if {[skip_shlib_tests]} {
17 untested jit-simple.exp
18 return -1
19}
20
4c93b1db 21if {[get_compiler_info]} {
03bef283
TT
22 warning "Could not get compiler info"
23 untested jit-simple.exp
24 return 1
25}
26
27#
28# test running programs
29#
30
f8b41b00
TT
31standard_testfile
32
33if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
03bef283
TT
34 untested jit-simple.exp
35 return -1
36}
37
38# A helper for jit_test_reread that invokes gdb_run_cmd.
39proc jit_run {msg} {
40 global decimal gdb_prompt
41
42 gdb_run_cmd
43 gdb_expect {
44 -re "Inferior .* exited.*$gdb_prompt $" {
45 pass $msg
46 }
47 -re ".*$gdb_prompt $" {
48 fail $msg
49 }
50 }
51}
52
53# Test re-running an inferior with a JIT descriptor, where the JIT
54# descriptor changes address between runs.
55# http://sourceware.org/bugzilla/show_bug.cgi?id=13431
56proc jit_test_reread {} {
57 global testfile binfile subdir srcfile srcdir
58
59 clean_restart $testfile
60
61 # jit_run "initial run"
62 runto_main
63
64 gdb_test "print &__jit_debug_descriptor" "= .*" "blah 1"
65
66 gdb_rename_execfile $binfile ${binfile}x
67
68 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DSPACER}] != "" } {
69 fail "recompile $srcfile"
70 } else {
71 pass "recompile $srcfile"
72
73 # jit_run "second run"
74
75 runto_main
76 gdb_test "print &__jit_debug_descriptor" "= .*" "blah 1"
77 }
78}
79
80jit_test_reread
This page took 0.24579 seconds and 4 git commands to generate.