port instrument/examples to current version

This commit is contained in:
Dreg 2022-07-16 14:30:00 +02:00
parent 5e49bfd41f
commit d861786fd3
3 changed files with 3 additions and 7 deletions

View File

@ -24,7 +24,6 @@
#include "bochs.h"
#include "cpu/cpu.h"
#include "disasm/disasm.h"
// maximum size of an instruction
#define MAX_OPCODE_LENGTH 16
@ -37,8 +36,6 @@
// start this at 1 instead of 0.
static bool active = 1;
static disassembler bx_disassembler;
static struct instruction_t {
bool ready; // is current instruction ready to be printed
unsigned opcode_length;
@ -84,7 +81,7 @@ void bx_print_instruction(unsigned cpu, const instruction_t *i)
{
char disasm_tbuf[512]; // buffer for instruction disassembly
unsigned length = i->opcode_length, n;
bx_disassembler.disasm(i->is32, i->is64, 0, 0, i->opcode, disasm_tbuf);
bx_dbg_disasm_wrapper(i->is32, i->is64, 0, 0, i->opcode, disasm_tbuf);
if(length != 0)
{

View File

@ -23,11 +23,9 @@
#include "bochs.h"
#include "cpu/cpu.h"
#include "disasm/disasm.h"
bxInstrumentation *icpu = NULL;
static disassembler bx_disassembler;
void bx_instr_init_env(void) {}
void bx_instr_exit_env(void) {}
@ -54,7 +52,7 @@ void bxInstrumentation::bx_instr_reset(unsigned type)
void bxInstrumentation::bx_print_instruction(void)
{
char disasm_tbuf[512]; // buffer for instruction disassembly
bx_disassembler.disasm(is32, is64, 0, 0, opcode, disasm_tbuf);
bx_dbg_disasm_wrapper(is32, is64, 0, 0, opcode, disasm_tbuf);
if(opcode_length != 0)
{

View File

@ -24,6 +24,7 @@
#include "bochs.h"
#include "cpu/cpu.h"
#include "cpu/decoder/ia_opcodes.h"
#define BX_IA_STATS_ENTRIES (BX_IA_LAST*2) /* /r and /m form */