1 # Copyright 2020-2024 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 # Check that GDB can find the variables in a lexical block with a 17 # DW_FORM_rnglistx DW_AT_ranges field. This test is intended for DWARF-5, 18 # compiled with clang++. 19 20 standard_testfile .cc 21 22 # This test is intended for targets which support DWARF-5. 23 # Since we pass an explicit -gdwarf-5 to the compiler, 24 # we let that be the test of whether the target supports it. 25 26 if { [prepare_for_testing "failed to prepare" "${testfile}" \ 27 $srcfile {debug c++ dwarf5 additional_flags=-O0}] } { 28 return -1 29 } 30 31 if ![runto_main] { 32 return -1 33 } 34 35 gdb_breakpoint [gdb_get_line_number "break-here"] 36 gdb_continue_to_breakpoint "break-here" ".* break-here .*" 37 38 gdb_test "print curr" "\\\(node \\\*\\\) $hex <node_array>" 39 gdb_test "print *curr" "= {id = 35, left = $hex <node_array\\+$decimal>, right = $hex <node_array\\+$decimal>, visited = false}" 40