Module Name:    src
Committed By:   hans
Date:           Fri Feb 28 18:08:51 UTC 2025

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

Log Message:
vax/ddb(4): fix disassembly of functions

On the VAX, functions normally begin with a 16bit entry mask
specifying which registers need to be saved on the stack by
the CALLS/CALLG instructions. The VAX disassembler tries to
take this into account, but the code didn't work as intended.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/vax/vax/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/vax/vax/db_disasm.c
diff -u src/sys/arch/vax/vax/db_disasm.c:1.24 src/sys/arch/vax/vax/db_disasm.c:1.25
--- src/sys/arch/vax/vax/db_disasm.c:1.24	Sat Jul 24 21:31:36 2021
+++ src/sys/arch/vax/vax/db_disasm.c	Fri Feb 28 18:08:51 2025
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_disasm.c,v 1.24 2021/07/24 21:31:36 andvar Exp $ */
+/*	$NetBSD: db_disasm.c,v 1.25 2025/02/28 18:08:51 hans Exp $ */
 /*
  * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.24 2021/07/24 21:31:36 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.25 2025/02/28 18:08:51 hans Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -157,9 +157,9 @@ db_disasm(db_addr_t loc, bool altfmt)
 		db_symbol_values(sym, &symname, 0);
 
 		if (symname && !diff) { /* symbol at loc */
-			db_printf("function \"%s()\", entry-mask 0x%x\n\t\t",
+			db_printf("function \"%s()\", entry-mask 0x%x\n",
 				  symname, (unsigned short) get_word(&ib));
-			ib.ppc += 2;
+			return ((u_int) ib.ppc);
 		}
 	}
 	get_opcode(&ib);

Reply via email to