]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.btrace/multi-inferior.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.btrace / multi-inferior.exp
CommitLineData
d89edf9b
MM
1# This testcase is part of GDB, the GNU debugger.
2#
213516ef 3# Copyright 2020-2023 Free Software Foundation, Inc.
d89edf9b
MM
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
18# Test that recording is per-inferior.
19#
20# When recording an inferior, threads from other inferiors, both existing
21# and newly created, are not automatically recorded.
22#
23# Each inferior can be recorded separately.
24
25if { [skip_btrace_tests] } {
26 unsupported "target does not support record-btrace"
27 return -1
28}
29
806e7575
MM
30if { [use_gdb_stub] } {
31 unsupported "test creates multiple inferiors"
32 return -1
33}
34
d89edf9b
MM
35standard_testfile
36if [prepare_for_testing "failed to prepare" $testfile {} {debug}] {
37 return -1
38}
39
40with_test_prefix "inferior 1" {
41 if ![runto_main] {
d89edf9b
MM
42 return -1
43 }
44}
45
46with_test_prefix "inferior 2" {
8d840e05
AB
47 gdb_test "add-inferior -exec ${binfile}" "Added inferior 2.*" \
48 "add second inferior"
d89edf9b
MM
49 gdb_test "inferior 2" "Switching to inferior 2.*"
50
51 if ![runto_main] {
d89edf9b
MM
52 return -1
53 }
54
55 gdb_test_no_output "record btrace" "record btrace"
56}
57
58with_test_prefix "inferior 1" {
59 gdb_test "inferior 1" "Switching to inferior 1.*"
60
98d837f0 61 gdb_test "info record" "No recording is currently active\\."
d89edf9b
MM
62 gdb_test_no_output "record btrace" "record btrace"
63}
64
65with_test_prefix "inferior 3" {
8d840e05
AB
66 gdb_test "add-inferior -exec ${binfile}" "Added inferior 3.*" \
67 "add third inferior"
d89edf9b
MM
68 gdb_test "inferior 3" "Switching to inferior 3.*"
69
70 if ![runto_main] {
d89edf9b
MM
71 return -1
72 }
73
98d837f0 74 gdb_test "info record" "No recording is currently active\\."
d89edf9b
MM
75 gdb_test_no_output "record btrace" "record btrace"
76}