CVS commit: src/sys/arch/arm/amlogic

2021-11-18 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Fri Nov 19 07:04:27 UTC 2021

Modified Files:
src/sys/arch/arm/amlogic: meson_dwmac.c

Log Message:
PR port-evbarm/50416

Redo the previous change.  The  "snps,..." properties are on the ethernet
node and the "reset-..." properties are on the phy node.  Handle this by
creating a separate reset routine for each case.  Idea from Jared.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/amlogic/meson_dwmac.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/amlogic/meson_dwmac.c
diff -u src/sys/arch/arm/amlogic/meson_dwmac.c:1.13 src/sys/arch/arm/amlogic/meson_dwmac.c:1.14
--- src/sys/arch/arm/amlogic/meson_dwmac.c:1.13	Wed Nov 17 11:57:27 2021
+++ src/sys/arch/arm/amlogic/meson_dwmac.c	Fri Nov 19 07:04:27 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: meson_dwmac.c,v 1.13 2021/11/17 11:57:27 jdc Exp $ */
+/* $NetBSD: meson_dwmac.c,v 1.14 2021/11/19 07:04:27 jdc Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: meson_dwmac.c,v 1.13 2021/11/17 11:57:27 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: meson_dwmac.c,v 1.14 2021/11/19 07:04:27 jdc Exp $");
 
 #include 
 #include 
@@ -66,72 +66,69 @@ static const struct device_compatible_en
 };
 
 static int
-meson_dwmac_reset(const int phandle)
+meson_dwmac_reset_eth(const int phandle)
 {
 	struct fdtbus_gpio_pin *pin_reset;
 	const u_int *reset_delay_us;
-	const u_int *reset_assert_us, *reset_deassert_us, *reset_gpios;
 	bool reset_active_low;
 	int len, val;
 
-	/*
-	 * Depending on the DTS, we need to check either the "snps,...",
-	 * or the "reset-..." properties for the MAC reset information.
-	 */
-
 	pin_reset = fdtbus_gpio_acquire(phandle, "snps,reset-gpio",
 	GPIO_PIN_OUTPUT);
-	if (pin_reset != NULL) {
+	if (pin_reset == NULL)
+		return ENXIO;
 
-		reset_delay_us = fdtbus_get_prop(phandle,
-		"snps,reset-delays-us", );
-		if (reset_delay_us == NULL || len != 12)
-			return ENXIO;
+	reset_delay_us = fdtbus_get_prop(phandle, "snps,reset-delays-us", );
+	if (reset_delay_us == NULL || len != 12)
+		return ENXIO;
 
-		reset_active_low = of_hasprop(phandle, "snps,reset-active-low");
+	reset_active_low = of_hasprop(phandle, "snps,reset-active-low");
 
-		val = reset_active_low ? 1 : 0;
+	val = reset_active_low ? 1 : 0;
 
-		fdtbus_gpio_write(pin_reset, val);
-		delay(be32toh(reset_delay_us[0]));
-		fdtbus_gpio_write(pin_reset, !val);
-		delay(be32toh(reset_delay_us[1]));
-		fdtbus_gpio_write(pin_reset, val);
-		delay(be32toh(reset_delay_us[2]));
+	fdtbus_gpio_write(pin_reset, val);
+	delay(be32toh(reset_delay_us[0]));
+	fdtbus_gpio_write(pin_reset, !val);
+	delay(be32toh(reset_delay_us[1]));
+	fdtbus_gpio_write(pin_reset, val);
+	delay(be32toh(reset_delay_us[2]));
 
-		return 0;
-	}
+	return 0;
+}
+
+static int
+meson_dwmac_reset_phy(const int phandle)
+{
+	struct fdtbus_gpio_pin *pin_reset;
+	const u_int *reset_assert_us, *reset_deassert_us, *reset_gpios;
+	bool reset_active_low;
+	int len, val;
 
 	pin_reset = fdtbus_gpio_acquire(phandle, "reset-gpios",
 	GPIO_PIN_OUTPUT);
-	if (pin_reset != NULL) {
-		reset_assert_us = fdtbus_get_prop(phandle,
-		"reset-assert-us", );
-		if (reset_assert_us == NULL || len != 4)
-			return ENXIO;
-		reset_deassert_us = fdtbus_get_prop(phandle,
-		"reset-deassert-us", );
-		if (reset_deassert_us == NULL || len != 4)
-			return ENXIO;
-		reset_gpios = fdtbus_get_prop(phandle,
-		"reset-gpios", );
-		if (reset_gpios == NULL || len != 12)
-			return ENXIO;
-
-		reset_active_low = be32toh(reset_gpios[2]);
-
-		val = reset_active_low ? 1 : 0;
-
-
-		fdtbus_gpio_write(pin_reset, val);
-		delay(be32toh(reset_assert_us[0]));
-		fdtbus_gpio_write(pin_reset, !val);
-		delay(be32toh(reset_deassert_us[0]));
+	if (pin_reset == NULL)
+		return ENXIO;
 
-		return 0;
-	}
+	reset_assert_us = fdtbus_get_prop(phandle, "reset-assert-us", );
+	if (reset_assert_us == NULL || len != 4)
+		return ENXIO;
+	reset_deassert_us = fdtbus_get_prop(phandle, "reset-deassert-us", );
+	if (reset_deassert_us == NULL || len != 4)
+		return ENXIO;
+	reset_gpios = fdtbus_get_prop(phandle, "reset-gpios", );
+	if (reset_gpios == NULL || len != 12)
+		return ENXIO;
+
+	reset_active_low = be32toh(reset_gpios[2]);
+
+	val = reset_active_low ? 1 : 0;
+
+	fdtbus_gpio_write(pin_reset, val);
+	delay(be32toh(reset_assert_us[0]));
+	fdtbus_gpio_write(pin_reset, !val);
+	delay(be32toh(reset_deassert_us[0]));
 
-	return ENXIO;
+	return 0;
 }
 
 static void
@@ -276,8 +273,19 @@ meson_dwmac_attach(device_t parent, devi
 	}
 	aprint_normal_dev(self, "interrupting on %s\n", intrstr);
 
-	if (meson_dwmac_reset(phandle_phy) != 0)
-		aprint_error_dev(self, "PHY reset failed\n");
+	/*
+	 * Depending on the DTS, we need to check either the "snps,...",
+	 * properties on the ethernet node, or the "reset-..."
+	 * 

CVS commit: src/sys/arch/arm/amlogic

2021-11-18 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Fri Nov 19 07:04:27 UTC 2021

Modified Files:
src/sys/arch/arm/amlogic: meson_dwmac.c

Log Message:
PR port-evbarm/50416

Redo the previous change.  The  "snps,..." properties are on the ethernet
node and the "reset-..." properties are on the phy node.  Handle this by
creating a separate reset routine for each case.  Idea from Jared.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/amlogic/meson_dwmac.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/indent

2021-11-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Nov 18 23:26:58 UTC 2021

Modified Files:
src/usr.bin/indent: lexi.c

Log Message:
indent: prevent use-after-free bug

Triggered by the following artificial program:

 snip 
int *
f
( void)
{
}
 snap 


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/usr.bin/indent/lexi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.138 src/usr.bin/indent/lexi.c:1.139
--- src/usr.bin/indent/lexi.c:1.138	Sun Nov  7 18:26:17 2021
+++ src/usr.bin/indent/lexi.c	Thu Nov 18 23:26:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.138 2021/11/07 18:26:17 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.139 2021/11/18 23:26:58 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.138 2021/11/07 18:26:17 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.139 2021/11/18 23:26:58 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -708,8 +708,12 @@ lexi(void)
 
 	while (isalpha((unsigned char)*tp) ||
 		isspace((unsigned char)*tp)) {
-		if (++tp >= inp.e)
+		if (++tp >= inp.e) {
+		const char *s_before = inp.s;
 		inp_read_line();
+		if (inp.s != s_before)
+			abort();
+		}
 	}
 	if (*tp == '(')
 		ps.procname[0] = ' ';



CVS commit: src/usr.bin/indent

2021-11-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Nov 18 23:26:58 UTC 2021

Modified Files:
src/usr.bin/indent: lexi.c

Log Message:
indent: prevent use-after-free bug

Triggered by the following artificial program:

 snip 
int *
f
( void)
{
}
 snap 


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/usr.bin/indent/lexi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/usr.bin/indent

2021-11-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Nov 18 23:06:51 UTC 2021

Modified Files:
src/tests/usr.bin/indent: fmt_decl.c

Log Message:
tests/indent: demonstrate disappearing function name

Since 2019-04-04, as usual.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/usr.bin/indent/fmt_decl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/indent/fmt_decl.c
diff -u src/tests/usr.bin/indent/fmt_decl.c:1.14 src/tests/usr.bin/indent/fmt_decl.c:1.15
--- src/tests/usr.bin/indent/fmt_decl.c:1.14	Thu Nov 18 22:27:01 2021
+++ src/tests/usr.bin/indent/fmt_decl.c	Thu Nov 18 23:06:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fmt_decl.c,v 1.14 2021/11/18 22:27:01 rillig Exp $	*/
+/*	$NetBSD: fmt_decl.c,v 1.15 2021/11/18 23:06:51 rillig Exp $	*/
 /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
 
 /* See FreeBSD r303570 */
@@ -481,3 +481,39 @@ yy(void)
 {
 }
 #indent end
+
+
+/*
+ * Since 2019-04-04, the space between the '){' is missing.
+ */
+#indent input
+int *
+function_name_20304050
+(void)
+{}
+#indent end
+
+/* FIXME: The space between '){' is missing. */
+#indent run
+int	   *function_name_20304050
+		(void){
+}
+#indent end
+
+
+/*
+ * Since 2019-04-04, some function names are preserved and others are
+ * silently discarded.
+ */
+#indent input
+int *
+a
+(void)
+{}
+#indent end
+
+/* FIXME: The function name is missing. */
+#indent run
+int	   *(void){
+}
+#indent end



CVS commit: src/tests/usr.bin/indent

2021-11-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Nov 18 23:06:51 UTC 2021

Modified Files:
src/tests/usr.bin/indent: fmt_decl.c

Log Message:
tests/indent: demonstrate disappearing function name

Since 2019-04-04, as usual.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/usr.bin/indent/fmt_decl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/usr.bin/indent

2021-11-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Nov 18 22:27:01 UTC 2021

Modified Files:
src/tests/usr.bin/indent: fmt_decl.c

Log Message:
tests/indent: demonstrate another bug imported from FreeBSD

Side note: the newly added test crashes at least the following versions
of indent with a segmentation fault on x86_64:

2000.10.11.14.46.04
2000.10.14.18.07.10
2000.10.17.02.16.44
2000.10.19.14.48.53
2000.10.19.16.31.26
2001.03.16.06.23.20
2001.03.23.20.12.41
2001.06.16.21.47.42
2001.07.20.13.43.50
2001.08.20.12.00.55
2001.12.01.19.27.33
2002.05.26.22.53.38
2003.02.25.10.35.44


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tests/usr.bin/indent/fmt_decl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/usr.bin/indent

2021-11-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Nov 18 22:27:01 UTC 2021

Modified Files:
src/tests/usr.bin/indent: fmt_decl.c

Log Message:
tests/indent: demonstrate another bug imported from FreeBSD

Side note: the newly added test crashes at least the following versions
of indent with a segmentation fault on x86_64:

2000.10.11.14.46.04
2000.10.14.18.07.10
2000.10.17.02.16.44
2000.10.19.14.48.53
2000.10.19.16.31.26
2001.03.16.06.23.20
2001.03.23.20.12.41
2001.06.16.21.47.42
2001.07.20.13.43.50
2001.08.20.12.00.55
2001.12.01.19.27.33
2002.05.26.22.53.38
2003.02.25.10.35.44


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tests/usr.bin/indent/fmt_decl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/indent/fmt_decl.c
diff -u src/tests/usr.bin/indent/fmt_decl.c:1.13 src/tests/usr.bin/indent/fmt_decl.c:1.14
--- src/tests/usr.bin/indent/fmt_decl.c:1.13	Sun Nov  7 07:45:00 2021
+++ src/tests/usr.bin/indent/fmt_decl.c	Thu Nov 18 22:27:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fmt_decl.c,v 1.13 2021/11/07 07:45:00 rillig Exp $	*/
+/*	$NetBSD: fmt_decl.c,v 1.14 2021/11/18 22:27:01 rillig Exp $	*/
 /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
 
 /* See FreeBSD r303570 */
@@ -451,3 +451,33 @@ int a - 1;
 	int a - 1;
 }
 #indent end
+
+
+/*
+ * Since 2019-04-04, the indentation of the '*' depends on the function name,
+ * which does not make sense.
+ */
+#indent input
+int *
+f2(void)
+{
+}
+
+int *
+yy(void)
+{
+}
+#indent end
+
+/* FIXME: Both function definitions must be formatted in the same way. */
+#indent run
+int	   *
+f2(void)
+{
+}
+
+int *
+yy(void)
+{
+}
+#indent end



CVS commit: src

2021-11-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Nov 18 21:19:19 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/indent: Makefile
Added Files:
src/tests/usr.bin/indent: lsym_binary_op.c lsym_case_label.c
lsym_colon.c lsym_comma.c lsym_comment.c lsym_do.c lsym_else.c
lsym_eof.c lsym_for.c lsym_form_feed.c lsym_funcname.c lsym_if.c
lsym_lbrace.c lsym_lparen_or_lbracket.c lsym_newline.c
lsym_offsetof.c lsym_period.c lsym_postfix_op.c
lsym_preprocessing.c lsym_question.c lsym_rbrace.c lsym_return.c
lsym_rparen_or_rbracket.c lsym_semicolon.c lsym_sizeof.c
lsym_storage_class.c lsym_string_prefix.c lsym_switch.c lsym_tag.c
lsym_type_in_parentheses.c lsym_type_outside_parentheses.c
lsym_typedef.c lsym_unary_op.c lsym_while.c lsym_word.c psym_decl.c
psym_do.c psym_do_stmt.c psym_else.c psym_for_exprs.c
psym_if_expr.c psym_if_expr_stmt.c psym_if_expr_stmt_else.c
psym_lbrace.c psym_rbrace.c psym_semicolon.c psym_stmt.c
psym_stmt_list.c psym_switch_expr.c psym_while_expr.c

Log Message:
tests/indent: add skeletons for testing tokens and parser symbols

The constants that were previously defined in indent_codes.h were a wild
mixture of tokens from the lexer and symbols on the parser stack.  They
were split into separate types starting at indent.h 1.49 from 2021-10-25
and finishing at 1.73 from 2021-10-31.

To match the tests with the new token names, the old tests need to be
migrated to the newly added tests.  This will take some time so first
add the skeletons and migrate them in smaller steps, cleaning them up
and extending them on the way.


To generate a diff of this commit:
cvs rdiff -u -r1.1167 -r1.1168 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.33 -r1.34 src/tests/usr.bin/indent/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/indent/lsym_binary_op.c \
src/tests/usr.bin/indent/lsym_case_label.c \
src/tests/usr.bin/indent/lsym_colon.c \
src/tests/usr.bin/indent/lsym_comma.c \
src/tests/usr.bin/indent/lsym_comment.c \
src/tests/usr.bin/indent/lsym_do.c src/tests/usr.bin/indent/lsym_else.c \
src/tests/usr.bin/indent/lsym_eof.c src/tests/usr.bin/indent/lsym_for.c \
src/tests/usr.bin/indent/lsym_form_feed.c \
src/tests/usr.bin/indent/lsym_funcname.c \
src/tests/usr.bin/indent/lsym_if.c src/tests/usr.bin/indent/lsym_lbrace.c \
src/tests/usr.bin/indent/lsym_lparen_or_lbracket.c \
src/tests/usr.bin/indent/lsym_newline.c \
src/tests/usr.bin/indent/lsym_offsetof.c \
src/tests/usr.bin/indent/lsym_period.c \
src/tests/usr.bin/indent/lsym_postfix_op.c \
src/tests/usr.bin/indent/lsym_preprocessing.c \
src/tests/usr.bin/indent/lsym_question.c \
src/tests/usr.bin/indent/lsym_rbrace.c \
src/tests/usr.bin/indent/lsym_return.c \
src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c \
src/tests/usr.bin/indent/lsym_semicolon.c \
src/tests/usr.bin/indent/lsym_sizeof.c \
src/tests/usr.bin/indent/lsym_storage_class.c \
src/tests/usr.bin/indent/lsym_string_prefix.c \
src/tests/usr.bin/indent/lsym_switch.c \
src/tests/usr.bin/indent/lsym_tag.c \
src/tests/usr.bin/indent/lsym_type_in_parentheses.c \
src/tests/usr.bin/indent/lsym_type_outside_parentheses.c \
src/tests/usr.bin/indent/lsym_typedef.c \
src/tests/usr.bin/indent/lsym_unary_op.c \
src/tests/usr.bin/indent/lsym_while.c \
src/tests/usr.bin/indent/lsym_word.c src/tests/usr.bin/indent/psym_decl.c \
src/tests/usr.bin/indent/psym_do.c \
src/tests/usr.bin/indent/psym_do_stmt.c \
src/tests/usr.bin/indent/psym_else.c \
src/tests/usr.bin/indent/psym_for_exprs.c \
src/tests/usr.bin/indent/psym_if_expr.c \
src/tests/usr.bin/indent/psym_if_expr_stmt.c \
src/tests/usr.bin/indent/psym_if_expr_stmt_else.c \
src/tests/usr.bin/indent/psym_lbrace.c \
src/tests/usr.bin/indent/psym_rbrace.c \
src/tests/usr.bin/indent/psym_semicolon.c \
src/tests/usr.bin/indent/psym_stmt.c \
src/tests/usr.bin/indent/psym_stmt_list.c \
src/tests/usr.bin/indent/psym_switch_expr.c \
src/tests/usr.bin/indent/psym_while_expr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1167 src/distrib/sets/lists/tests/mi:1.1168
--- src/distrib/sets/lists/tests/mi:1.1167	Thu Nov 18 18:14:47 2021
+++ src/distrib/sets/lists/tests/mi	Thu Nov 18 21:19:18 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1167 2021/11/18 18:14:47 rillig Exp $
+# $NetBSD: mi,v 1.1168 2021/11/18 21:19:18 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4797,6 +4797,41 @@
 ./usr/tests/usr.bin/indent/lineno.0.stdouttests-obsolete		obsolete,atf
 

CVS commit: src

2021-11-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Nov 18 21:19:19 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/indent: Makefile
Added Files:
src/tests/usr.bin/indent: lsym_binary_op.c lsym_case_label.c
lsym_colon.c lsym_comma.c lsym_comment.c lsym_do.c lsym_else.c
lsym_eof.c lsym_for.c lsym_form_feed.c lsym_funcname.c lsym_if.c
lsym_lbrace.c lsym_lparen_or_lbracket.c lsym_newline.c
lsym_offsetof.c lsym_period.c lsym_postfix_op.c
lsym_preprocessing.c lsym_question.c lsym_rbrace.c lsym_return.c
lsym_rparen_or_rbracket.c lsym_semicolon.c lsym_sizeof.c
lsym_storage_class.c lsym_string_prefix.c lsym_switch.c lsym_tag.c
lsym_type_in_parentheses.c lsym_type_outside_parentheses.c
lsym_typedef.c lsym_unary_op.c lsym_while.c lsym_word.c psym_decl.c
psym_do.c psym_do_stmt.c psym_else.c psym_for_exprs.c
psym_if_expr.c psym_if_expr_stmt.c psym_if_expr_stmt_else.c
psym_lbrace.c psym_rbrace.c psym_semicolon.c psym_stmt.c
psym_stmt_list.c psym_switch_expr.c psym_while_expr.c

Log Message:
tests/indent: add skeletons for testing tokens and parser symbols

The constants that were previously defined in indent_codes.h were a wild
mixture of tokens from the lexer and symbols on the parser stack.  They
were split into separate types starting at indent.h 1.49 from 2021-10-25
and finishing at 1.73 from 2021-10-31.

To match the tests with the new token names, the old tests need to be
migrated to the newly added tests.  This will take some time so first
add the skeletons and migrate them in smaller steps, cleaning them up
and extending them on the way.


To generate a diff of this commit:
cvs rdiff -u -r1.1167 -r1.1168 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.33 -r1.34 src/tests/usr.bin/indent/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/indent/lsym_binary_op.c \
src/tests/usr.bin/indent/lsym_case_label.c \
src/tests/usr.bin/indent/lsym_colon.c \
src/tests/usr.bin/indent/lsym_comma.c \
src/tests/usr.bin/indent/lsym_comment.c \
src/tests/usr.bin/indent/lsym_do.c src/tests/usr.bin/indent/lsym_else.c \
src/tests/usr.bin/indent/lsym_eof.c src/tests/usr.bin/indent/lsym_for.c \
src/tests/usr.bin/indent/lsym_form_feed.c \
src/tests/usr.bin/indent/lsym_funcname.c \
src/tests/usr.bin/indent/lsym_if.c src/tests/usr.bin/indent/lsym_lbrace.c \
src/tests/usr.bin/indent/lsym_lparen_or_lbracket.c \
src/tests/usr.bin/indent/lsym_newline.c \
src/tests/usr.bin/indent/lsym_offsetof.c \
src/tests/usr.bin/indent/lsym_period.c \
src/tests/usr.bin/indent/lsym_postfix_op.c \
src/tests/usr.bin/indent/lsym_preprocessing.c \
src/tests/usr.bin/indent/lsym_question.c \
src/tests/usr.bin/indent/lsym_rbrace.c \
src/tests/usr.bin/indent/lsym_return.c \
src/tests/usr.bin/indent/lsym_rparen_or_rbracket.c \
src/tests/usr.bin/indent/lsym_semicolon.c \
src/tests/usr.bin/indent/lsym_sizeof.c \
src/tests/usr.bin/indent/lsym_storage_class.c \
src/tests/usr.bin/indent/lsym_string_prefix.c \
src/tests/usr.bin/indent/lsym_switch.c \
src/tests/usr.bin/indent/lsym_tag.c \
src/tests/usr.bin/indent/lsym_type_in_parentheses.c \
src/tests/usr.bin/indent/lsym_type_outside_parentheses.c \
src/tests/usr.bin/indent/lsym_typedef.c \
src/tests/usr.bin/indent/lsym_unary_op.c \
src/tests/usr.bin/indent/lsym_while.c \
src/tests/usr.bin/indent/lsym_word.c src/tests/usr.bin/indent/psym_decl.c \
src/tests/usr.bin/indent/psym_do.c \
src/tests/usr.bin/indent/psym_do_stmt.c \
src/tests/usr.bin/indent/psym_else.c \
src/tests/usr.bin/indent/psym_for_exprs.c \
src/tests/usr.bin/indent/psym_if_expr.c \
src/tests/usr.bin/indent/psym_if_expr_stmt.c \
src/tests/usr.bin/indent/psym_if_expr_stmt_else.c \
src/tests/usr.bin/indent/psym_lbrace.c \
src/tests/usr.bin/indent/psym_rbrace.c \
src/tests/usr.bin/indent/psym_semicolon.c \
src/tests/usr.bin/indent/psym_stmt.c \
src/tests/usr.bin/indent/psym_stmt_list.c \
src/tests/usr.bin/indent/psym_switch_expr.c \
src/tests/usr.bin/indent/psym_while_expr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/sets/lists/tests

2021-11-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Nov 18 18:14:47 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
distrib/sets: sort mi file


To generate a diff of this commit:
cvs rdiff -u -r1.1166 -r1.1167 src/distrib/sets/lists/tests/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1166 src/distrib/sets/lists/tests/mi:1.1167
--- src/distrib/sets/lists/tests/mi:1.1166	Thu Nov 18 15:03:19 2021
+++ src/distrib/sets/lists/tests/mi	Thu Nov 18 18:14:47 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1166 2021/11/18 15:03:19 thorpej Exp $
+# $NetBSD: mi,v 1.1167 2021/11/18 18:14:47 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3460,9 +3460,6 @@
 ./usr/tests/lib/libcurses/check_files/mvwins_wch.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/mvwins_wstr1.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/mvwins_wstr2.chk		tests-lib-tests		compattestfile,atf
-./usr/tests/lib/libcurses/check_files/wins_wstr3.chk		tests-lib-tests		compattestfile,atf
-./usr/tests/lib/libcurses/check_files/wins_wstr4.chk		tests-lib-tests		compattestfile,atf
-./usr/tests/lib/libcurses/check_files/wins_wstr5.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/notimeout.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/overlay1.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/overlay2.chk		tests-lib-tests		compattestfile,atf
@@ -3534,6 +3531,9 @@
 ./usr/tests/lib/libcurses/check_files/wins_wch3.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/wins_wstr1.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/wins_wstr2.chk		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/wins_wstr3.chk		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/wins_wstr4.chk		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/wins_wstr5.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/winsch1.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/winsch2.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/wprintw_refresh.chk	tests-lib-tests		compattestfile,atf



CVS commit: src/distrib/sets/lists/tests

2021-11-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Nov 18 18:14:47 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
distrib/sets: sort mi file


To generate a diff of this commit:
cvs rdiff -u -r1.1166 -r1.1167 src/distrib/sets/lists/tests/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/usr.bin/indent

2021-11-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Nov 18 17:11:13 UTC 2021

Modified Files:
src/tests/usr.bin/indent: t_options.awk

Log Message:
tests/indent: reorder code in test driver

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/t_options.awk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/indent/t_options.awk
diff -u src/tests/usr.bin/indent/t_options.awk:1.2 src/tests/usr.bin/indent/t_options.awk:1.3
--- src/tests/usr.bin/indent/t_options.awk:1.2	Sat Oct 23 20:35:18 2021
+++ src/tests/usr.bin/indent/t_options.awk	Thu Nov 18 17:11:13 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_options.awk,v 1.2 2021/10/23 20:35:18 rillig Exp $
+# $NetBSD: t_options.awk,v 1.3 2021/11/18 17:11:13 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -46,9 +46,26 @@
 #		the previous run.
 #
 # All text outside these directives is not passed to indent.
+#
+# The actual output from running indent is written to stdout, the expected
+# test output is written to 'expected.out'.
 
-# Read the test specification from stdin, output the actual test output on
-# stdout, write the expected test output to 'expected.out'.
+BEGIN {
+	warned = 0
+	died = 0
+
+	section = ""		# "", "input" or "run"
+	section_excl_comm = ""	# without dollar comments
+	section_incl_comm = ""	# with dollar comments
+
+	input_excl_comm = ""	# stdin for indent
+	input_incl_comm = ""	# used for duplicate checks
+	unused_input_lineno = 0
+
+	output_excl_comm = ""	# expected output
+	output_incl_comm = ""	# used for duplicate checks
+	output_lineno = 0
+}
 
 function die(lineno, msg)
 {
@@ -70,32 +87,6 @@ function quote(s)
 	return "'" s "'"
 }
 
-BEGIN {
-	warned = 0
-	died = 0
-
-	section = ""		# "", "input" or "run"
-	section_excl_comm = ""	# without dollar comments
-	section_incl_comm = ""	# with dollar comments
-
-	input_excl_comm = ""	# stdin for indent
-	input_incl_comm = ""	# used for duplicate checks
-	unused_input_lineno = 0
-
-	output_excl_comm = ""	# expected output
-	output_incl_comm = ""	# used for duplicate checks
-	output_lineno = 0
-}
-
-# Hide comments starting with dollar from indent; they are used for marking
-# bugs and adding other remarks directly in the input or output sections.
-/^[[:space:]]*\/[*][[:space:]]*[$].*[*]\/$/ ||
-/^[[:space:]]*\/\/[[:space:]]*[$]/ {
-	if (section != "")
-		section_incl_comm = section_incl_comm $0 "\n"
-	next
-}
-
 function check_unused_input()
 {
 	if (unused_input_lineno != 0)
@@ -113,6 +104,15 @@ function run_indent(inp,   i, cmd)
 	close(cmd)
 }
 
+# Hide comments starting with dollar from indent; they are used for marking
+# bugs and adding other remarks directly in the input or output sections.
+/^[[:space:]]*\/[*][[:space:]]*[$].*[*]\/$/ ||
+/^[[:space:]]*\/\/[[:space:]]*[$]/ {
+	if (section != "")
+		section_incl_comm = section_incl_comm $0 "\n"
+	next
+}
+
 /^#/ && $1 == "#indent" {
 	print $0
 	print $0 > "expected.out"



CVS commit: src/tests/usr.bin/indent

2021-11-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Nov 18 17:11:13 UTC 2021

Modified Files:
src/tests/usr.bin/indent: t_options.awk

Log Message:
tests/indent: reorder code in test driver

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/t_options.awk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/indent

2021-11-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Nov 18 16:54:35 UTC 2021

Added Files:
src/usr.bin/indent: README.md
Removed Files:
src/usr.bin/indent: README

Log Message:
indent: replace old license discussion with a brief history section


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/usr.bin/indent/README
cvs rdiff -u -r0 -r1.1 src/usr.bin/indent/README.md

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/usr.bin/indent/README.md
diff -u /dev/null src/usr.bin/indent/README.md:1.1
--- /dev/null	Thu Nov 18 16:54:35 2021
+++ src/usr.bin/indent/README.md	Thu Nov 18 16:54:34 2021
@@ -0,0 +1,21 @@
+# History
+
+This is NetBSD indent.  It originally came from the University of Illinois via
+some distribution tape for PDP-11 Unix.  It has subsequently been hacked upon 
+by James Gosling @ CMU.  At some point in the 1970s or even 1980s, it was 
+thought to be "the nicest C pretty printer around".  Around 1985, further
+additions to provide "Kernel Normal Form" were contributed by the folks at Sun 
+Microsystems.
+
+Between 2000 and 2019, FreeBSD maintained the code, adding several features.
+NetBSD imported these changes on 2019-04.04.
+
+In 2021, indent was updated to handle C99 comments, cleaning up the code.  It
+got a proper test suite, uncovering many inconsistencies and bugs that either
+had been there forever or had been introduced by importing the FreeBSD version
+in 2019.
+
+# References
+
+* https://github.com/freebsd/freebsd-src/tree/main/usr.bin/indent
+* https://github.com/pstef/freebsd_indent



CVS commit: src/usr.bin/indent

2021-11-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Nov 18 16:54:35 UTC 2021

Added Files:
src/usr.bin/indent: README.md
Removed Files:
src/usr.bin/indent: README

Log Message:
indent: replace old license discussion with a brief history section


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/usr.bin/indent/README
cvs rdiff -u -r0 -r1.1 src/usr.bin/indent/README.md

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/i386/stand/efiboot

2021-11-18 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Thu Nov 18 16:18:13 UTC 2021

Modified Files:
src/sys/arch/i386/stand/efiboot: devopen.c

Log Message:
Fix crash because of NULL pointer reference


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/efiboot/devopen.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/i386/stand/efiboot/devopen.c
diff -u src/sys/arch/i386/stand/efiboot/devopen.c:1.11 src/sys/arch/i386/stand/efiboot/devopen.c:1.12
--- src/sys/arch/i386/stand/efiboot/devopen.c:1.11	Sat Jan 18 19:25:58 2020
+++ src/sys/arch/i386/stand/efiboot/devopen.c	Thu Nov 18 16:18:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: devopen.c,v 1.11 2020/01/18 19:25:58 nonaka Exp $	 */
+/*	$NetBSD: devopen.c,v 1.12 2021/11/18 16:18:13 manu Exp $	 */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -288,8 +288,9 @@ neterr:
 	 * biosdisk
 	 */
 	if (strcmp(devname, "esp") == 0) {
+		const char *part_name = NULL;
 		bios2dev(boot_biosdev, boot_biossector, , ,
-		, NULL);
+		, _name);
 		if (efidisk_get_efi_system_partition(boot_biosdev, ))
 			return ENXIO;
 	}



CVS commit: src/sys/arch/i386/stand/efiboot

2021-11-18 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Thu Nov 18 16:18:13 UTC 2021

Modified Files:
src/sys/arch/i386/stand/efiboot: devopen.c

Log Message:
Fix crash because of NULL pointer reference


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/efiboot/devopen.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/i386/stand/efiboot

2021-11-18 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Thu Nov 18 16:17:41 UTC 2021

Modified Files:
src/sys/arch/i386/stand/efiboot: Makefile.efiboot

Log Message:
Do not pass BIOS geometry when booting using EFI

Recent Mac return garbage data that will crash the code handling it,
and EFI boot does not need it anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/i386/stand/efiboot/Makefile.efiboot

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/i386/stand/efiboot

2021-11-18 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Thu Nov 18 16:17:41 UTC 2021

Modified Files:
src/sys/arch/i386/stand/efiboot: Makefile.efiboot

Log Message:
Do not pass BIOS geometry when booting using EFI

Recent Mac return garbage data that will crash the code handling it,
and EFI boot does not need it anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/i386/stand/efiboot/Makefile.efiboot

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/i386/stand/efiboot/Makefile.efiboot
diff -u src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.18 src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.19
--- src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.18	Sun Sep  6 07:20:29 2020
+++ src/sys/arch/i386/stand/efiboot/Makefile.efiboot	Thu Nov 18 16:17:40 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.efiboot,v 1.18 2020/09/06 07:20:29 mrg Exp $
+# $NetBSD: Makefile.efiboot,v 1.19 2021/11/18 16:17:40 manu Exp $
 
 S=		${.CURDIR}/../../../../..
 
@@ -66,7 +66,8 @@ CPPFLAGS+= -DSUPPORT_BOOTP
 CPPFLAGS+= -DSUPPORT_DHCP
 CPPFLAGS+= -DSUPPORT_NFS
 CPPFLAGS+= -DSUPPORT_TFTP
-CPPFLAGS+= -DPASS_BIOSGEOM
+# Recent macs report garbage geometry
+#CPPFLAGS+= -DPASS_BIOSGEOM
 CPPFLAGS+= -DBIOSDISK_DEFAULT_SECSIZE=2048	# for bootinfo_biosgeom.c
 CPPFLAGS+= -DLIBSA_ENABLE_LS_OP
 



CVS commit: src

2021-11-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Nov 18 15:03:19 UTC 2021

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/tests/lib/libexecinfo: Makefile
Added Files:
src/tests/lib/libexecinfo: t_sig_backtrace.c

Log Message:
Add a test case for backtrace(3) across a signal handler.


To generate a diff of this commit:
cvs rdiff -u -r1.367 -r1.368 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1165 -r1.1166 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libexecinfo/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libexecinfo/t_sig_backtrace.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2021-11-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Nov 18 15:03:19 UTC 2021

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/tests/lib/libexecinfo: Makefile
Added Files:
src/tests/lib/libexecinfo: t_sig_backtrace.c

Log Message:
Add a test case for backtrace(3) across a signal handler.


To generate a diff of this commit:
cvs rdiff -u -r1.367 -r1.368 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1165 -r1.1166 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libexecinfo/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libexecinfo/t_sig_backtrace.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.367 src/distrib/sets/lists/debug/mi:1.368
--- src/distrib/sets/lists/debug/mi:1.367	Sat Oct 23 18:46:26 2021
+++ src/distrib/sets/lists/debug/mi	Thu Nov 18 15:03:19 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.367 2021/10/23 18:46:26 thorpej Exp $
+# $NetBSD: mi,v 1.368 2021/11/18 15:03:19 thorpej Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -2265,6 +2265,7 @@
 ./usr/libdata/debug/usr/tests/lib/libdes/t_des.debug			tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libevent/h_event.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libexecinfo/t_backtrace.debug		tests-lib-debug		debug,atf,compattestfile
+./usr/libdata/debug/usr/tests/lib/libexecinfo/t_sig_backtrace.debug	tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/liblutok/c_gate_test.debug		tests-lutok-debug	debug,atf,kyua,compattestfile
 ./usr/libdata/debug/usr/tests/lib/liblutok/debug_test.debug		tests-lutok-debug	debug,atf,kyua,compattestfile
 ./usr/libdata/debug/usr/tests/lib/liblutok/exceptions_test.debug	tests-lutok-debug	debug,atf,kyua,compattestfile

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1165 src/distrib/sets/lists/tests/mi:1.1166
--- src/distrib/sets/lists/tests/mi:1.1165	Wed Nov 17 04:33:26 2021
+++ src/distrib/sets/lists/tests/mi	Thu Nov 18 15:03:19 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1165 2021/11/17 04:33:26 kre Exp $
+# $NetBSD: mi,v 1.1166 2021/11/18 15:03:19 thorpej Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3776,6 +3776,7 @@
 ./usr/tests/lib/libexecinfo/Atffile			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libexecinfo/Kyuafile			tests-lib-tests		compattestfile,atf,kyua
 ./usr/tests/lib/libexecinfo/t_backtrace			tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libexecinfo/t_sig_backtrace		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libi386	tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libi386/Atffiletests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libi386/Kyuafile			tests-lib-tests		compattestfile,atf,kyua

Index: src/tests/lib/libexecinfo/Makefile
diff -u src/tests/lib/libexecinfo/Makefile:1.6 src/tests/lib/libexecinfo/Makefile:1.7
--- src/tests/lib/libexecinfo/Makefile:1.6	Sat Jan 31 20:55:43 2015
+++ src/tests/lib/libexecinfo/Makefile	Thu Nov 18 15:03:19 2021
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile,v 1.6 2015/01/31 20:55:43 nakayama Exp $
+# $NetBSD: Makefile,v 1.7 2021/11/18 15:03:19 thorpej Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/lib/libexecinfo
 
 TESTS_C+=	t_backtrace
+TESTS_C+=	t_sig_backtrace
 STRIPFLAG=
 
 LDADD+=		-lexecinfo -lelf

Added files:

Index: src/tests/lib/libexecinfo/t_sig_backtrace.c
diff -u /dev/null src/tests/lib/libexecinfo/t_sig_backtrace.c:1.1
--- /dev/null	Thu Nov 18 15:03:19 2021
+++ src/tests/lib/libexecinfo/t_sig_backtrace.c	Thu Nov 18 15:03:19 2021
@@ -0,0 +1,182 @@
+/*	$NetBSD: t_sig_backtrace.c,v 1.1 2021/11/18 15:03:19 thorpej Exp $	*/
+
+/*-
+ * Copyright (c) 2021 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN