From b069f2c3689fec5ee34ef37840fbcee59b4e36bc Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Tue, 30 Jun 2026 14:37:51 +0100 Subject: [PATCH 1/5] run-tests: Add `strace` sub command for generated test reproduction scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tim Düsterhus --- run-tests.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/run-tests.php b/run-tests.php index 89bd8ffb797c..84c4a8b12a2f 100755 --- a/run-tests.php +++ b/run-tests.php @@ -2928,6 +2928,10 @@ function run_test(string $php, $file, array $env): string "valgrind") USE_ZEND_ALLOC=0 valgrind $2 {$orig_cmd} ;; +"strace") + shift + strace "$@" {$orig_cmd} + ;; "rr") rr record $2 {$orig_cmd} ;; From 2cf25d7e6a502606e0b238fc67629371b6cceec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 5 Aug 2026 14:32:46 +0200 Subject: [PATCH 2/5] run-tests: Pass all provided arguments to `valgrind` --- run-tests.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run-tests.php b/run-tests.php index 84c4a8b12a2f..32eb24bfe28a 100755 --- a/run-tests.php +++ b/run-tests.php @@ -2926,7 +2926,8 @@ function run_test(string $php, $file, array $env): string lldb -- {$orig_cmd} ;; "valgrind") - USE_ZEND_ALLOC=0 valgrind $2 {$orig_cmd} + shift + USE_ZEND_ALLOC=0 valgrind "$@" {$orig_cmd} ;; "strace") shift From d2f22177f1e35ba4277341260237f196f0dca0d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 5 Aug 2026 14:34:41 +0200 Subject: [PATCH 3/5] run-tests: Pass all provided arguments to `gdb` --- run-tests.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run-tests.php b/run-tests.php index 32eb24bfe28a..3e47e437168c 100755 --- a/run-tests.php +++ b/run-tests.php @@ -2920,7 +2920,8 @@ function run_test(string $php, $file, array $env): string {$exported_environment} case "$1" in "gdb") - gdb -ex 'unset environment LINES' -ex 'unset environment COLUMNS' --args {$orig_cmd} + shift + gdb -ex 'unset environment LINES' -ex 'unset environment COLUMNS' "$@" --args {$orig_cmd} ;; "lldb") lldb -- {$orig_cmd} From 70ae84f361a78179fdb938ffd186a73d2b7c6df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 5 Aug 2026 14:39:51 +0200 Subject: [PATCH 4/5] run-tests: Pass all provided arguments to `lldb` --- run-tests.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run-tests.php b/run-tests.php index 3e47e437168c..64649708a159 100755 --- a/run-tests.php +++ b/run-tests.php @@ -2924,7 +2924,8 @@ function run_test(string $php, $file, array $env): string gdb -ex 'unset environment LINES' -ex 'unset environment COLUMNS' "$@" --args {$orig_cmd} ;; "lldb") - lldb -- {$orig_cmd} + shift + lldb "$@" -- {$orig_cmd} ;; "valgrind") shift From f1bd5a0aea9e830f4752c970f29552b26d97c84a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 5 Aug 2026 14:45:35 +0200 Subject: [PATCH 5/5] run-tests: `exec` into test reproduction helpers This avoids needlessly carrying around the shell and provides more direct access to the running executable. --- run-tests.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/run-tests.php b/run-tests.php index 64649708a159..89b5882f6674 100755 --- a/run-tests.php +++ b/run-tests.php @@ -2921,25 +2921,26 @@ function run_test(string $php, $file, array $env): string case "$1" in "gdb") shift - gdb -ex 'unset environment LINES' -ex 'unset environment COLUMNS' "$@" --args {$orig_cmd} + exec gdb -ex 'unset environment LINES' -ex 'unset environment COLUMNS' "$@" --args {$orig_cmd} ;; "lldb") shift - lldb "$@" -- {$orig_cmd} + exec lldb "$@" -- {$orig_cmd} ;; "valgrind") + export USE_ZEND_ALLOC=0 shift - USE_ZEND_ALLOC=0 valgrind "$@" {$orig_cmd} + exec valgrind "$@" {$orig_cmd} ;; "strace") shift - strace "$@" {$orig_cmd} + exec strace "$@" {$orig_cmd} ;; "rr") - rr record $2 {$orig_cmd} + exec rr record $2 {$orig_cmd} ;; *) - {$orig_cmd} + exec {$orig_cmd} ;; esac SH;