From 8889a2a7b0af240588d848b2e5c3b23cb2f26789 Mon Sep 17 00:00:00 2001 From: miod Date: Fri, 15 Aug 2008 22:41:02 +0000 Subject: [PATCH] Correct disassembly of the start of a function: fix display layout and skip only the 2 bytes of the procedure entry mask, not 4 bytes. --- sys/arch/vax/vax/db_disasm.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/arch/vax/vax/db_disasm.c b/sys/arch/vax/vax/db_disasm.c index 708d388dc83..3cc3573b5e8 100644 --- a/sys/arch/vax/vax/db_disasm.c +++ b/sys/arch/vax/vax/db_disasm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_disasm.c,v 1.15 2007/02/14 00:53:47 jsg Exp $ */ +/* $OpenBSD: db_disasm.c,v 1.16 2008/08/15 22:41:02 miod Exp $ */ /* $NetBSD: db_disasm.c,v 1.10 1998/04/13 12:10:27 ragge Exp $ */ /* * Copyright (c) 2002, Miodrag Vallat. @@ -146,7 +146,7 @@ db_disasm(loc, altfmt) inst_buffer ib; bzero(&ib, sizeof(ib)); - ib.ppc = (void *) loc; + ib.ppc = (void *)loc; if (!altfmt) { /* ignore potential entry masks in altfmt */ diff = INT_MAX; @@ -154,12 +154,14 @@ db_disasm(loc, altfmt) sym = db_search_symbol(loc, DB_STGY_PROC, &diff); db_symbol_values(sym, &symname, 0); - if (symname && !diff) { /* symbol at loc */ - db_printf("function \"%s()\", entry-mask 0x%x\n\t\t", + if (symname && diff == 0) { /* symbol at loc */ + db_printf("function \"%s()\", entry-mask 0x%x\n", symname, (unsigned short) get_word(&ib)); - ib.ppc += 2; + db_printsym((db_addr_t)ib.ppc, DB_STGY_ANY, db_printf); + db_printf(":\t"); } } + get_opcode(&ib); get_operands(&ib); db_printf("%s\n", ib.dasm); -- 2.20.1