]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.server/ext-wrapper.exp
GDB copyright headers update after running GDB's copyright.py script.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.server / ext-wrapper.exp
CommitLineData
8cfe207c
YQ
1# This testcase is part of GDB, the GNU debugger.
2
618f726f 3# Copyright 2015-2016 Free Software Foundation, Inc.
8cfe207c
YQ
4
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18load_lib gdbserver-support.exp
19
20standard_testfile wrapper.c
21
22if { [skip_gdbserver_tests] } {
23 return 0
24}
25
26if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
27 return -1
28}
29
30if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
31 return -1
32}
33
34# Make sure we're disconnected, in case we're testing with an
35# extended-remote board, therefore already connected.
36gdb_test "disconnect" ".*"
37
38set target_exec [gdbserver_download_current_prog]
39gdbserver_start_extended "--wrapper env TEST=1 --"
40
41gdb_test_no_output "set remote exec-file $target_exec" "set remote exec-file"
42
43gdb_breakpoint marker
44gdb_test "run" "Breakpoint.* marker .*" "run to marker"
45
46gdb_test "print d" "\\$${decimal} = ${hex} \"1\".*"
47
11e6c98f
YQ
48# Restart the process.
49with_test_prefix "restart" {
50 # Disable vRun packet and clear remote exec-file, so that GDB will
51 # use R packet to restart the process.
52 gdb_test_no_output "set remote run-packet off"
53 gdb_test_no_output "set remote exec-file"
54 set test "run to marker"
55 gdb_test_multiple "run" $test {
56 -re {Start it from the beginning\? \(y or n\) $} {
57 send_gdb "y\n"
58 exp_continue
59 }
60 -re "Breakpoint.* marker .*\r\n$gdb_prompt $" {
61 pass $test
62 }
63 }
64
65 gdb_test "print d" "\\$${decimal} = ${hex} \"1\".*"
66}
67
8cfe207c
YQ
68gdb_test "kill" "" "kill" "Kill the program being debugged.*" "y"
69
70gdb_test_no_output "monitor exit"