Module Name:    src
Committed By:   thorpej
Date:           Tue Nov 21 22:25:16 UTC 2023

Modified Files:
        src/sys/arch/alpha/alpha: db_disasm.c

Log Message:
pal_opname(): Make the static buffer for unknown PALcode ops large enough
to hold all possible values.
alpha_print_instruction(): Make this private if not-_KERNEL.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/alpha/alpha/db_disasm.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/alpha/alpha/db_disasm.c
diff -u src/sys/arch/alpha/alpha/db_disasm.c:1.19 src/sys/arch/alpha/alpha/db_disasm.c:1.20
--- src/sys/arch/alpha/alpha/db_disasm.c:1.19	Tue Nov 21 22:19:12 2023
+++ src/sys/arch/alpha/alpha/db_disasm.c	Tue Nov 21 22:25:16 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: db_disasm.c,v 1.19 2023/11/21 22:19:12 thorpej Exp $ */
+/* $NetBSD: db_disasm.c,v 1.20 2023/11/21 22:25:16 thorpej Exp $ */
 
 /*
  * Mach Operating System
@@ -48,7 +48,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.19 2023/11/21 22:19:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.20 2023/11/21 22:25:16 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -191,7 +191,7 @@ static const struct tbl pal_op_tbl[] = {
 static const char *
 pal_opname(int op)
 {
-	static char unk[8];
+	static char unk[11];
 	int i;
 
 	for (i = 0; pal_op_tbl[i].name != NULL; i++) {
@@ -199,7 +199,7 @@ pal_opname(int op)
 			return (pal_op_tbl[i].name);
 	}
 
-	snprintf(unk, sizeof(unk), "0x%x", op);
+	snprintf(unk, sizeof(unk), "0x%08x", op);
 	return (unk);
 }
 
@@ -813,6 +813,9 @@ insn_printf(struct alpha_print_instructi
  * next instruction.
  */
 
+#ifndef _KERNEL
+static
+#endif
 int
 alpha_print_instruction(struct alpha_print_instruction_context *ctx)
 {

Reply via email to