Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/2] gdb.rocm/watchpoint-basic: adjustments
@ 2026-07-24 19:20 Shahab Vahedi
  2026-07-24 19:20 ` [PATCH 1/2] gdb.rocm/watchpoint-basic: use gdb_continue_to_end Shahab Vahedi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shahab Vahedi @ 2026-07-24 19:20 UTC (permalink / raw)
  To: gdb-patches; +Cc: Shahab Vahedi, Lancelot SIX, Simon Marchi, Shahab Vahedi

A series of 2 patches that improve the gdb.rocm/watchpoint-basic.exp
test.

1. Use 'gdb_continue_to_end' instead of 'gdb_test "continue" ...'
2. The test fails on some systems due to GPU driver issues.
   Mark those as expected failures.

Shahab Vahedi (2):
  gdb.rocm/watchpoint-basic: use gdb_continue_to_end
  gdb.rocm/watchpoint-basic: add XFAILs for known configurations

 gdb/testsuite/gdb.rocm/watchpoint-basic.exp | 106 ++++++++++++++------
 1 file changed, 73 insertions(+), 33 deletions(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] gdb.rocm/watchpoint-basic: use gdb_continue_to_end
  2026-07-24 19:20 [PATCH 0/2] gdb.rocm/watchpoint-basic: adjustments Shahab Vahedi
@ 2026-07-24 19:20 ` Shahab Vahedi
  2026-07-24 19:20 ` [PATCH 2/2] gdb.rocm/watchpoint-basic: add XFAILs for known configurations Shahab Vahedi
  2026-07-27  8:19 ` [PATCH 0/2] gdb.rocm/watchpoint-basic: adjustments Luis
  2 siblings, 0 replies; 4+ messages in thread
From: Shahab Vahedi @ 2026-07-24 19:20 UTC (permalink / raw)
  To: gdb-patches; +Cc: Shahab Vahedi, Lancelot SIX, Simon Marchi, Shahab Vahedi

Turn:
  gdb_test "continue" \
      "Inferior 1 .* exited normally.*" \
      "continue to end"

into:
  gdb_continue_to_end [ "" continue 1 ]

Change-Id: I91404df3f4c29f9c6e58d085dd4d36c317d134d2
---
 gdb/testsuite/gdb.rocm/watchpoint-basic.exp | 28 ++++++---------------
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/gdb/testsuite/gdb.rocm/watchpoint-basic.exp b/gdb/testsuite/gdb.rocm/watchpoint-basic.exp
index 8d19b0dcba2..9626b32d5d2 100644
--- a/gdb/testsuite/gdb.rocm/watchpoint-basic.exp
+++ b/gdb/testsuite/gdb.rocm/watchpoint-basic.exp
@@ -53,9 +53,7 @@ proc_with_prefix test_host_watchpoint_before_runtime_load {} {
 
 	continue_to_watchpoint_hit 5 17 "continue to watchpoint hit"
 
-	gdb_test "continue" \
-	    "Inferior 1 .* exited normally.*" \
-	    "continue to end"
+	gdb_continue_to_end "" continue 1
     }
 }
 
@@ -76,9 +74,7 @@ proc_with_prefix test_host_watchpoint_after_runtime_load {} {
 
 	continue_to_watchpoint_hit 5 17 "continue to watchpoint hit"
 
-	gdb_test "continue" \
-	    "Inferior 1 .* exited normally.*" \
-	    "continue to end"
+	gdb_continue_to_end "" continue 1
     }
 }
 
@@ -102,9 +98,7 @@ proc_with_prefix test_watchpoint_before_kernel {} {
 	continue_to_watchpoint_hit 30 40 "continue to watchpoint hit 3"
 	continue_to_watchpoint_hit 40 60 "continue to watchpoint hit 4"
 
-	gdb_test "continue" \
-	    "Inferior 1 .* exited normally.*" \
-	    "continue to end"
+	gdb_continue_to_end "" continue 1
     }
 }
 
@@ -132,9 +126,7 @@ proc_with_prefix test_watchpoint_inside_kernel {} {
 	continue_to_watchpoint_hit 300 400 "continue to watchpoint hit 3"
 	continue_to_watchpoint_hit 400 600 "continue to watchpoint hit 4"
 
-	gdb_test "continue" \
-	    "Inferior 1 .* exited normally.*" \
-	    "continue to end"
+	gdb_continue_to_end "" continue 1
     }
 }
 
@@ -156,9 +148,7 @@ proc_with_prefix test_remove_watchpoint_inside_kernel {} {
 	continue_to_watchpoint_hit 0 10 "continue to watchpoint hit"
 	gdb_test "with confirm off -- delete" "" "delete all breakpoints"
 
-	gdb_test "continue" \
-	    "Inferior 1 .* exited normally.*" \
-	    "continue to end"
+	gdb_continue_to_end "" continue 1
     }
 }
 
@@ -189,9 +179,7 @@ proc_with_prefix test_multiple_watchpoints {} {
 	continue_to_watchpoint_hit 40 60 "continue to watchpoint hit 7"
 	continue_to_watchpoint_hit 400 600 "continue to watchpoint hit 8"
 
-	gdb_test "continue" \
-	    "Inferior 1 .* exited normally.*" \
-	    "continue to end"
+	gdb_continue_to_end "" continue 1
     }
 }
 
@@ -239,9 +227,7 @@ proc_with_prefix test_disable_enable_watchpoint {} {
 
 	continue_to_watchpoint_hit 400 600 "continue to watchpoint hit 6"
 
-	gdb_test "continue" \
-	    "Inferior 1 .* exited normally.*" \
-	    "continue to end"
+	gdb_continue_to_end "" continue 1
     }
 }
 
-- 
2.55.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] gdb.rocm/watchpoint-basic: add XFAILs for known configurations
  2026-07-24 19:20 [PATCH 0/2] gdb.rocm/watchpoint-basic: adjustments Shahab Vahedi
  2026-07-24 19:20 ` [PATCH 1/2] gdb.rocm/watchpoint-basic: use gdb_continue_to_end Shahab Vahedi
@ 2026-07-24 19:20 ` Shahab Vahedi
  2026-07-27  8:19 ` [PATCH 0/2] gdb.rocm/watchpoint-basic: adjustments Luis
  2 siblings, 0 replies; 4+ messages in thread
From: Shahab Vahedi @ 2026-07-24 19:20 UTC (permalink / raw)
  To: gdb-patches; +Cc: Shahab Vahedi, Lancelot SIX, Simon Marchi, Shahab Vahedi

Some of the tests in gdb.rom/watchpoint-basic are destined to fail
due to a problem in KFD.  This patch marks those tests as such on
configurations that this can happen.

Change-Id: Iafd40b18bf8eb7004c8653bca1407b8d86ca0032
---
 gdb/testsuite/gdb.rocm/watchpoint-basic.exp | 78 +++++++++++++++++----
 1 file changed, 66 insertions(+), 12 deletions(-)

diff --git a/gdb/testsuite/gdb.rocm/watchpoint-basic.exp b/gdb/testsuite/gdb.rocm/watchpoint-basic.exp
index 9626b32d5d2..bc30726515e 100644
--- a/gdb/testsuite/gdb.rocm/watchpoint-basic.exp
+++ b/gdb/testsuite/gdb.rocm/watchpoint-basic.exp
@@ -26,14 +26,25 @@ if {[build_executable "failed to prepare" $testfile $srcfile {debug hip}]} {
 }
 
 proc continue_to_watchpoint_hit { old_value new_value test } {
-    gdb_test "continue" \
-	[multi_line \
-	    "hit Hardware watchpoint $::decimal:.*" \
-	    "" \
-	    "Old value = $old_value" \
-	    "New value = $new_value" \
-	    ".*"] \
-	$test
+    set hit_re [multi_line \
+		   "hit Hardware watchpoint $::decimal:.*" \
+		   "" \
+		   "Old value = $old_value" \
+		   "New value = $new_value" \
+		   ".*"]
+
+    set ret false
+    gdb_test_multiple "continue" "$test" {
+	-re -wrap $hit_re {
+	    pass "$gdb_test_name"
+	    set ret true
+	}
+	-re -wrap ".*$::inferior_exited_re.*" {
+	    fail "$gdb_test_name"
+	    set ret false
+	}
+    }
+    return $ret
 }
 
 # Test inserting a watchpoint on a host variable before the runtime loads, and
@@ -78,6 +89,37 @@ proc_with_prefix test_host_watchpoint_after_runtime_load {} {
     }
 }
 
+# On some systems, KFD corrupts the watchpoint configurations
+# during the first dispatch's queue mapping.  This leads to
+# watchpoints not being triggered, if they were set before the
+# first dispatch.  As a result, those test scenarios run to the
+# end and exit prematurely.
+
+gdb_caching_proc target_has_xfail {} {
+    set xfail_arches {gfx1201}
+
+    set targets [find_amdgpu_devices]
+    if {[llength $targets] == 0} {
+	# Can't determine GPU type, don't set up xfail.  The test will probably
+	# not run correctly anyway.
+	return 0
+    }
+
+    # The test will run on GPU-0, so it should be the first of the list.
+    set target [lindex $targets 0]
+
+    return [expr {[lsearch -exact $xfail_arches $target] != -1}]
+}
+
+# This is used when dealing with the first watchpoints that are
+# set before the first dispatch.
+
+proc maybe_xfail {} {
+    if {[target_has_xfail]} {
+	setup_xfail "*-*-*" "watchpoint configuration corruption in kfd."
+    }
+}
+
 # Test inserting a watchpoint before the kernel is launched, then hitting
 # it when the kernel runs.
 
@@ -93,7 +135,10 @@ proc_with_prefix test_watchpoint_before_kernel {} {
 	    "Hardware watchpoint $::decimal: .*" \
 	    "set watchpoint on *ptr1"
 
-	continue_to_watchpoint_hit 0 10 "continue to watchpoint hit 1"
+	maybe_xfail
+	if {![continue_to_watchpoint_hit 0 10 "continue to watchpoint hit 1"]} {
+	    return
+	}
 	continue_to_watchpoint_hit 10 30 "continue to watchpoint hit 2"
 	continue_to_watchpoint_hit 30 40 "continue to watchpoint hit 3"
 	continue_to_watchpoint_hit 40 60 "continue to watchpoint hit 4"
@@ -145,7 +190,10 @@ proc_with_prefix test_remove_watchpoint_inside_kernel {} {
 	    "Hardware watchpoint $::decimal: .*" \
 	    "set watchpoint"
 
-	continue_to_watchpoint_hit 0 10 "continue to watchpoint hit"
+	maybe_xfail
+	if {![continue_to_watchpoint_hit 0 10 "continue to watchpoint hit"]} {
+	    return
+	}
 	gdb_test "with confirm off -- delete" "" "delete all breakpoints"
 
 	gdb_continue_to_end "" continue 1
@@ -170,7 +218,10 @@ proc_with_prefix test_multiple_watchpoints {} {
 	    "Hardware watchpoint $::decimal: .*" \
 	    "set watchpoint on *ptr2"
 
-	continue_to_watchpoint_hit 0 10 "continue to watchpoint hit 1"
+	maybe_xfail
+	if {![continue_to_watchpoint_hit 0 10 "continue to watchpoint hit 1"]} {
+	    return
+	}
 	continue_to_watchpoint_hit 0 100 "continue to watchpoint hit 2"
 	continue_to_watchpoint_hit 10 30 "continue to watchpoint hit 3"
 	continue_to_watchpoint_hit 100 300 "continue to watchpoint hit 4"
@@ -210,7 +261,10 @@ proc_with_prefix test_disable_enable_watchpoint {} {
 	    }
 	}
 
-	continue_to_watchpoint_hit 0 10 "continue to watchpoint hit 1"
+	maybe_xfail
+	if {![continue_to_watchpoint_hit 0 10 "continue to watchpoint hit 1"]} {
+	    return
+	}
 
 	gdb_test_no_output "disable $wp1_num" "disable watchpoint"
 
-- 
2.55.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] gdb.rocm/watchpoint-basic: adjustments
  2026-07-24 19:20 [PATCH 0/2] gdb.rocm/watchpoint-basic: adjustments Shahab Vahedi
  2026-07-24 19:20 ` [PATCH 1/2] gdb.rocm/watchpoint-basic: use gdb_continue_to_end Shahab Vahedi
  2026-07-24 19:20 ` [PATCH 2/2] gdb.rocm/watchpoint-basic: add XFAILs for known configurations Shahab Vahedi
@ 2026-07-27  8:19 ` Luis
  2 siblings, 0 replies; 4+ messages in thread
From: Luis @ 2026-07-27  8:19 UTC (permalink / raw)
  To: Shahab Vahedi; +Cc: gdb-patches, Shahab Vahedi, Lancelot SIX, Simon Marchi

[-- Attachment #1: Type: text/plain, Size: 695 bytes --]

Thanks. This is OK.

Approved-By: Luis Machado <luis.machado.foss@gmail.com>

On Fri, Jul 24, 2026, 20:21 Shahab Vahedi <shahab.vahedi@amd.com> wrote:

> A series of 2 patches that improve the gdb.rocm/watchpoint-basic.exp
> test.
>
> 1. Use 'gdb_continue_to_end' instead of 'gdb_test "continue" ...'
> 2. The test fails on some systems due to GPU driver issues.
>    Mark those as expected failures.
>
> Shahab Vahedi (2):
>   gdb.rocm/watchpoint-basic: use gdb_continue_to_end
>   gdb.rocm/watchpoint-basic: add XFAILs for known configurations
>
>  gdb/testsuite/gdb.rocm/watchpoint-basic.exp | 106 ++++++++++++++------
>  1 file changed, 73 insertions(+), 33 deletions(-)
>
> --
> 2.55.0
>
>

[-- Attachment #2: Type: text/html, Size: 1168 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-27  8:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-24 19:20 [PATCH 0/2] gdb.rocm/watchpoint-basic: adjustments Shahab Vahedi
2026-07-24 19:20 ` [PATCH 1/2] gdb.rocm/watchpoint-basic: use gdb_continue_to_end Shahab Vahedi
2026-07-24 19:20 ` [PATCH 2/2] gdb.rocm/watchpoint-basic: add XFAILs for known configurations Shahab Vahedi
2026-07-27  8:19 ` [PATCH 0/2] gdb.rocm/watchpoint-basic: adjustments Luis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox