# Copyright (C) 2019-2024 Free Software Foundation, Inc. # Copyright (C) 2019-2024 Advanced Micro Devices, Inc. All rights reserved. # This file is part of GDB. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . load_lib rocm.exp require allow_hip_tests standard_testfile .cpp if {[prepare_for_testing "failed to prepare ${testfile}" $testfile $srcfile {debug hip}]} { return -1 } with_rocm_gpu_lock { if ![runto_main] { fail "can't run to main" return -1 } # Set breakpoing in device code. gdb_breakpoint "bit_extract_kernel" "allow-pending" gdb_continue_to_breakpoint "bit_extract_kernel" # Check info agents # vega10 sample output "1 A (GPUID 39113) vega10 224 2240 44:00.0" gdb_test_sequence "info agents" "info agents" { {\s+Id\s+State\s+Target Id\s+Architecture\s+Device Name\s+Cores\s+Threads\s+Location} {\d+\s+[AU]\s+AMDGPU Agent \([^\)]*\)\s+\w+\s+[^\r\n]+\s+\d+\s+\d+\s+\w+:\w+:\d+\.\d} } # Check continue at device breakpoint in all-stop mode gdb_test "c" {.+hit\sBreakpoint\s[\d].+\sbit_extract_kernel\s\(.*\)\sat.*} # Check info threads gdb_test_sequence "info threads" "info threads" { "\\d+\\s+Thread" } }