Index | Thread | Search

From:
Christian Ludwig <christian_ludwig@genua.de>
Subject:
regress/btrace: Add test for undefined arguments
To:
<tech@openbsd.org>
Date:
Fri, 2 Feb 2024 16:24:41 +0100

Download raw body.

Thread
This is a test case for the fix in btrace.c,v 1.83 that exercises the
use of undefined probe arguments.
---
 regress/usr.sbin/btrace/Makefile | 4 ++--
 regress/usr.sbin/btrace/argn.bt  | 6 ++++++
 regress/usr.sbin/btrace/argn.ok  | 1 +
 3 files changed, 9 insertions(+), 2 deletions(-)
 create mode 100644 regress/usr.sbin/btrace/argn.bt
 create mode 100644 regress/usr.sbin/btrace/argn.ok

diff --git a/regress/usr.sbin/btrace/Makefile b/regress/usr.sbin/btrace/Makefile
index 6f0bb76d387..8bbe7a2c8d3 100644
--- a/regress/usr.sbin/btrace/Makefile
+++ b/regress/usr.sbin/btrace/Makefile
@@ -4,8 +4,8 @@ BTRACE?=		 /usr/sbin/btrace
 ALLOWDT!=		sysctl -n kern.allowdt 2>/dev/null
 
 # scripts that don't need /dev/dt
-BT_LANG_SCRIPTS=	arithm beginend beginend-argn boolean comments delete \
-			exit histempty if \
+BT_LANG_SCRIPTS=	argn arithm beginend beginend-argn boolean comments \
+			delete exit histempty if \
 			map mapclear mapempty mapsyntax mapzero map-unnamed \
 			maxoperand min+max+sum multismts nsecs+var \
 			precedence print read-map-after-clear staticv-empty \
diff --git a/regress/usr.sbin/btrace/argn.bt b/regress/usr.sbin/btrace/argn.bt
new file mode 100644
index 00000000000..0477806fb80
--- /dev/null
+++ b/regress/usr.sbin/btrace/argn.bt
@@ -0,0 +1,6 @@
+interval:hz:1
+{
+	printf("%d %s %d %s %d %s %d %s %d %s\n",
+	       arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
+	exit();
+}
diff --git a/regress/usr.sbin/btrace/argn.ok b/regress/usr.sbin/btrace/argn.ok
new file mode 100644
index 00000000000..d3e1a999aba
--- /dev/null
+++ b/regress/usr.sbin/btrace/argn.ok
@@ -0,0 +1 @@
+0 0 0 0 0 0 0 0 0 0
-- 
2.34.1