aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLancelot Six <lancelot.six@amd.com>2023-07-31 09:59:44 +0000
committerLancelot SIX <lancelot.six@amd.com>2023-07-31 15:27:19 +0100
commit38797d2e73da87422d883bcec61ed791f0fc1894 (patch)
treecf9f98a59250b42998f39a5d99d9cfbdc84ee7d1
parentf717822dd7b07c8b1cb92a19bc4778bd9c967116 (diff)
downloadgdb-38797d2e73da87422d883bcec61ed791f0fc1894.zip
gdb-38797d2e73da87422d883bcec61ed791f0fc1894.tar.gz
gdb-38797d2e73da87422d883bcec61ed791f0fc1894.tar.bz2
gdb/testsuite/rocm: Add the hip_devices_support_debug_multi_process proc
It is not possible to debug multiple processes simultaneously on all generations of AMDGPU devices. As some tests will need to debug multiple inferiors using AMDGPU devices, we need to ensure that all devices available have the required capability. Failing to do so would result in GDB not being able to debug all inferiors properly. Add the hip_devices_support_debug_multi_process helper function used to ensure that all devices available can debug multiple processes. Approved-By: Pedro Alves <pedro@palves.net>
-rw-r--r--gdb/testsuite/lib/rocm.exp20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/rocm.exp b/gdb/testsuite/lib/rocm.exp
index 389d73b..98a3b30 100644
--- a/gdb/testsuite/lib/rocm.exp
+++ b/gdb/testsuite/lib/rocm.exp
@@ -166,3 +166,23 @@ proc with_rocm_gpu_lock { body } {
return -code $code $result
}
}
+
+# Return true if all the devices support debugging multiple processes
+# using the GPU.
+
+proc hip_devices_support_debug_multi_process {} {
+ set unsupported_targets \
+ {gfx900 gfx906 gfx908 gfx1010 gfx1011 gfx1012 gfx1030 gfx1031 gfx1032}
+
+ set targets [hcc_amdgpu_targets]
+ if { [llength $targets] == 0 } {
+ return 0
+ }
+
+ foreach target $targets {
+ if { [lsearch -exact $unsupported_targets $target] != -1 } {
+ return 0
+ }
+ }
+ return 1
+}