]>
Commit | Line | Data |
---|---|---|
1d506c26 | 1 | # Copyright 2021-2024 Free Software Foundation, Inc. |
fde1a9a3 AB |
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 the 'set source open on|off' command. | |
17 | ||
18 | standard_testfile | |
19 | ||
20 | if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { | |
21 | return -1 | |
22 | } | |
23 | ||
24 | gdb_test "show source open" "Source opening is \"on\"\\." \ | |
25 | "source opening is initially on" | |
26 | gdb_test_no_output "set listsize 1" | |
27 | gdb_test_no_output "set source open on" | |
28 | gdb_test "list 18" "18\t#include <stdio.h>" "source reading on" | |
29 | ||
30 | # File opening is turned off therefore source lines are not printed. | |
31 | gdb_test_no_output "set source open off" | |
32 | gdb_test "show source open" "Source opening is \"off\"\\." \ | |
33 | "source opening is now off" | |
34 | gdb_test "list 18" "18\tin .*/${srcfile}" "source reading off" | |
35 | ||
36 | gdb_test "forward-search main" "source code access disabled" | |
37 | gdb_test "reverse-search main" "source code access disabled" | |
38 | ||
39 | # And finally, turn source code reading back on. | |
40 | gdb_test_no_output "set source open on" \ | |
41 | "turn source reading back on" | |
42 | gdb_test "show source open" "Source opening is \"on\"\\." \ | |
43 | "source opening is on again" | |
44 | gdb_test "list 18" "18\t#include <stdio.h>" "source reading on again" |