1 # Copyright
2014-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 # Test that dcache behaves correctly when reading a
cache line fails.
20 if { [prepare_for_testing
"failed to prepare" ${testfile}] } {
28 # Issue the
"delete mem" command. This makes GDB ignore the
29 # target
-provided list
, if any.
35 gdb_test_multiple $test $test
{
36 -re
"Delete all memory regions.*y or n.*$" {
46 # Make the dcache line size bigger than the
pagesize.
47 set pagesize [get_integer_valueof
"pg_size" -1]
48 set linesize
[expr $
pagesize * 2]
50 gdb_test_no_output
"set dcache line-size $linesize" \
51 "set dcache line size to twice the pagesize"
53 gdb_test
"info dcache" \
54 "Dcache 4096 lines of $linesize bytes each.\r\nNo data cache available."
56 # Make sure dcache doesn
't automatically skip unmapped regions.
60 "Using user-defined memory regions.\r\nThere are no memory regions defined\."
62 # Given the line size is bigger than the page size, we have
63 # alternating mapped and unmapped pages, these make dcache fail to
64 # fill in the cache line. GDB used to have a bug where that failure
65 # would end up as user-visible error. The range being disassembled is
66 # wholly available, so GDB should succeed.
67 gdb_test "disassemble first_mapped_page, +10" "End of assembler dump\."
68 gdb_test "disassemble last_mapped_page, +10" "End of assembler dump\."