]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.mi/mi-fill-memory.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.mi / mi-fill-memory.exp
1 # Copyright (C) 2012-2023 Free Software Foundation, Inc.
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 #
17 # added for testing the -data-write-memory-bytes MI command enhancements
18 #
19
20 load_lib mi-support.exp
21 set MIFLAGS "-i=mi"
22
23 standard_testfile "mi-read-memory"
24
25 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}.c" "${binfile}" executable {debug}] != "" } {
26 untested "failed to compile"
27 return -1
28 }
29
30 mi_clean_restart $binfile
31 mi_runto_main
32 mi_next_to "main" "" "mi-read-memory.c" "20" "next at main"
33
34 mi_gdb_test "1-data-write-memory-bytes"\
35 "1\\\^error,msg=\"Usage: ADDR DATA \\\[COUNT\\\]\.\""\
36 "no arguments"
37
38 mi_gdb_test "2-data-write-memory-bytes 8"\
39 "2\\\^error,msg=\"Usage: ADDR DATA \\\[COUNT\\\]\.\""\
40 "one argument missing"
41
42 mi_gdb_test "3-data-write-memory-bytes \$pc ab"\
43 "3\\\^done" \
44 "memory successfully written"
45
46 mi_gdb_test "4-data-write-memory-bytes \$pc ab 8"\
47 "4\\\^done" \
48 "memory successfully filled (8 bytes)"
49
50 mi_gdb_test "5-interpreter-exec console \"x \$pc\"" \
51 ".*0xabababab.*" \
52 "pattern correctly read from memory"
53
54 mi_gdb_exit