]>
Commit | Line | Data |
---|---|---|
1d506c26 | 1 | # Copyright 2023-2024 Free Software Foundation, Inc. |
67efac36 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 | ||
16 | # Test "attach" with a remote target in DAP. | |
17 | ||
18 | load_lib gdbserver-support.exp | |
19 | load_lib dap-support.exp | |
20 | ||
21 | require allow_dap_tests allow_gdbserver_tests | |
22 | # We want to have control over where we start gdbserver. | |
23 | require {!is_remote target} | |
24 | ||
25 | # This test is only for remote targets. | |
26 | if {[target_info exists gdb_protocol] | |
27 | && [target_info gdb_protocol] != "remote"} { | |
28 | unsupported "requires remote" | |
29 | return | |
30 | } | |
31 | ||
32 | standard_testfile attach.c | |
33 | ||
34 | if {[build_executable ${testfile}.exp $testfile $srcfile] == -1} { | |
35 | return | |
36 | } | |
37 | ||
38 | set target_exec [gdb_remote_download target [standard_output_file $testfile]] | |
39 | ||
40 | lassign [gdbserver_start "" $target_exec] protocol port | |
41 | # Really should have been caught up above. | |
42 | gdb_assert {$protocol == "remote"} | |
43 | ||
44 | # We just want to test that attaching works at all. | |
45 | if {[dap_target_remote $port] != ""} { | |
46 | dap_shutdown true | |
47 | } | |
48 | ||
49 | close_gdbserver |