From d59d26dc3a67d2c6e4c1410792eb934b7d2d0d6e Mon Sep 17 00:00:00 2001 From: bluhm Date: Thu, 6 Jun 2024 12:36:41 +0000 Subject: [PATCH] Fix call instruction disassembler in ddb. Disassembling the amd64 call instruction in ddb produced wrong output. The operand of e8 is only 4 bytes long, not 8. The shown address was off by 4 bytes. Following instructions were interpreted incorrectly. OK guenther@ --- sys/arch/amd64/amd64/db_disasm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arch/amd64/amd64/db_disasm.c b/sys/arch/amd64/amd64/db_disasm.c index f552a1c8818..ad3c95d1d58 100644 --- a/sys/arch/amd64/amd64/db_disasm.c +++ b/sys/arch/amd64/amd64/db_disasm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_disasm.c,v 1.24 2023/04/22 18:26:17 guenther Exp $ */ +/* $OpenBSD: db_disasm.c,v 1.25 2024/06/06 12:36:41 bluhm Exp $ */ /* $NetBSD: db_disasm.c,v 1.11 1996/05/03 19:41:58 christos Exp $ */ /* @@ -793,7 +793,7 @@ struct inst db_inst_table[256] = { /*e6*/ { "out", 0, BYTE, op2(A, Ib), 0 }, /*e7*/ { "out", 0, LONG, op2(A, Ib) , 0 }, -/*e8*/ { "call", 0, QUAD, op1(Dl), 0 }, +/*e8*/ { "call", 0, NONE, op1(Dl), 0 }, /*e9*/ { "jmp", 0, NONE, op1(Dl), 0 }, /*ea*/ { "", 0, NONE, op1(OS), 0 }, /*eb*/ { "jmp", 0, NONE, op1(Db), 0 }, -- 2.20.1