[PATCH 16/57][Arm][GAS] Add support for MVE instructions: vdup, vddup, vdwdup, vidup...
[binutils-gdb.git] / gdb / testsuite / gdb.mi / mi-logging.exp
blob1a5f67342a63fe65558888f41028d703da08f9c3
1 # Copyright 2012-2019 Free Software Foundation, Inc.
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.
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.
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/>.
16 load_lib mi-support.exp
17 set MIFLAGS "-i=mi"
19 gdb_exit
20 if [mi_gdb_start] {
21     continue
24 standard_testfile basics.c
25 set opts {debug}
27 if [build_executable $testfile.exp $testfile $srcfile $opts] {
28     untested "failed to compile"
29     return -1
32 if {[mi_run_to_main] < 0} {
33     return -1
36 set milogfile [standard_output_file "milog.txt"]
38 mi_gdb_test "-gdb-set logging file $milogfile" ".*"
40 mi_gdb_test "-gdb-set logging overwrite on" ".*"
42 mi_gdb_test "-gdb-set logging on" ".*" "logging on"
44 mi_step "logged step"
46 mi_next "logged next"
48 mi_gdb_test "-gdb-set logging off" ".*" "logging off"
50 set chan [open $milogfile]
51 set logcontent [read $chan]
52 close $chan
54 set mi_log_prompt "\[(\]gdb\[)\] \[\r\n\]+"
56 if [regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
57     pass "log file contents"
58 } else {
59     fail "log file contents"
62 # Now try the redirect, which writes into the file only.
64 mi_gdb_test "-gdb-set logging redirect on" ".*" "redirect logging on"
66 # Since all output will be going into the file, just keep sending commands
67 # and don't expect anything to appear until logging is turned off.
69 send_gdb "1001-gdb-set logging on\n"
70 send_gdb "1002-exec-step\n"
71 send_gdb "1003-exec-next\n"
73 mi_gdb_test "1004-gdb-set logging off" ".*" "redirect logging off"
75 set chan [open $milogfile]
76 set logcontent [read $chan]
77 close $chan
79 if [regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
80     pass "redirect log file contents"
81 } else {
82     fail "redirect log file contents"
85 # Now try enabling a redirect while GDB is already logging.  This used
86 # to crash GDB.
87 with_test_prefix "redirect while already logging" {
88     mi_gdb_test "-gdb-set logging redirect off" ".*" \
89         "logging redirect off"
90     mi_gdb_test "-gdb-set logging on" ".*" \
91         "logging on"
92     mi_gdb_test "-gdb-set logging redirect on" \
93         ".*warning: Currently logging .*Turn the logging off and on to make the new setting effective.*" \
94         "logging redirect on"
95     mi_gdb_test "-gdb-set logging off" ".*" \
96         "logging off"
99 mi_gdb_exit
101 remote_file host delete $milogfile