Fixed compilation error of extdb

This commit is contained in:
Stanislav Shwartsman 2006-06-25 21:44:46 +00:00
parent 38c6120338
commit c7aa53d044
5 changed files with 24 additions and 29 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.cc,v 1.164 2006-06-24 18:27:11 sshwarts Exp $
// $Id: cpu.cc,v 1.165 2006-06-25 21:44:46 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -259,7 +259,6 @@ void BX_CPU_C::cpu_loop(Bit32u max_instr_count)
// fetch and decode next instruction
bxInstruction_c *i = fetchInstruction(&iStorage, eipBiased);
bx_address next_RIP = RIP + i->ilen();
BxExecutePtr_tR resolveModRM = i->ResolveModrm; // Get as soon as possible for speculation
BxExecutePtr_t execute = i->execute; // fetch as soon as possible for speculation
if (resolveModRM)
@ -274,7 +273,7 @@ void BX_CPU_C::cpu_loop(Bit32u max_instr_count)
#endif
#if BX_EXTERNAL_DEBUGGER
if (regs.debug_state != debug_run) bx_external_debugger(BX_CPU_THIS);
bx_external_debugger(BX_CPU_THIS);
#endif
#if BX_DISASM
@ -290,7 +289,7 @@ void BX_CPU_C::cpu_loop(Bit32u max_instr_count)
// decoding instruction compeleted -> continue with execution
BX_INSTR_BEFORE_EXECUTION(BX_CPU_ID, i);
RIP = next_RIP;
RIP += i->ilen();
if ( !(i->repUsedL() && i->repeatableL()) ) {
// non repeating instruction
@ -780,7 +779,6 @@ void BX_CPU_C::deliver_SMI(void)
}
#if BX_EXTERNAL_DEBUGGER
void BX_CPU_C::ask(int level, const char *prefix, const char *fmt, va_list ap)
{
char buf1[1024];
@ -788,16 +786,7 @@ void BX_CPU_C::ask(int level, const char *prefix, const char *fmt, va_list ap)
printf ("%s %s\n", prefix, buf1);
trap_debugger(1);
}
void BX_CPU_C::trap_debugger(bx_bool callnow)
{
regs.debug_state = debug_step;
if (callnow) {
bx_external_debugger(BX_CPU_THIS);
}
}
#endif // #if BX_EXTERNAL_DEBUGGER
#endif
#if BX_DEBUGGER
extern unsigned dbg_show_mask;
@ -975,7 +964,7 @@ void BX_CPU_C::dbg_take_irq(void)
void BX_CPU_C::dbg_force_interrupt(unsigned vector)
{
// Used to force slave simulator to take an interrupt, without
// Used to force simulator to take an interrupt, without
// regard to IF
if (setjmp(BX_CPU_THIS_PTR jmp_buf_env) == 0) {

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.300 2006-06-17 12:09:55 sshwarts Exp $
// $Id: cpu.h,v 1.301 2006-06-25 21:44:46 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -1236,7 +1236,7 @@ public: // for now...
} address_xlation;
#if BX_EXTERNAL_DEBUGGER
virtual void ask (int level, const char *prefix, const char *fmt, va_list ap);
virtual void ask(int level, const char *prefix, const char *fmt, va_list ap);
#endif
BX_SMF void setEFlags(Bit32u val) BX_CPP_AttrRegparmN(1);
@ -2866,10 +2866,6 @@ public: // for now...
BX_SMF void debug_disasm_instruction(bx_address offset);
#endif
#if BX_EXTERNAL_DEBUGGER
BX_SMF void trap_debugger(bx_bool callnow);
#endif
#if BX_X86_DEBUGGER
// x86 hardware debug support
BX_SMF Bit32u hwdebug_compare(bx_address laddr, unsigned size,

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: extdb.cc,v 1.20 2006-04-27 15:11:45 sshwarts Exp $
// $Id: extdb.cc,v 1.21 2006-06-25 21:44:46 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
#include "bochs.h"
@ -9,8 +9,8 @@
# error "extdb.cc only supported in win32 environment"
#endif
#include "iodev/iodev.h"
#include "cpu.h"
#include "iodev/iodev.h"
#include "extdb.h"
TRegs regs;
@ -93,9 +93,6 @@ void bx_external_debugger(BX_CPU_C *cpu)
#if BX_CPU_LEVEL >= 4
regs.cr4 = cpu->cr4.getRegister();
#endif
//regs.cr5 = cpu->cr5;
//regs.cr6 = cpu->cr6;
//regs.cr7 = cpu->cr7;
regs.fsbase = cpu->sregs[BX_SEG_REG_FS].cache.u.segment.base;
regs.gsbase = cpu->sregs[BX_SEG_REG_GS].cache.u.segment.base;
#if BX_SUPPORT_X86_64
@ -117,3 +114,11 @@ void bx_external_debugger(BX_CPU_C *cpu)
call_debugger(&regs,cpu->mem->vector,cpu->mem->len);
}
}
void trap_debugger(bx_bool callnow)
{
regs.debug_state = debug_step;
if (callnow) {
bx_external_debugger(BX_CPU_THIS);
}
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: extdb.h,v 1.8 2006-04-27 15:11:45 sshwarts Exp $
// $Id: extdb.h,v 1.9 2006-06-25 21:44:46 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
#ifndef EXTDB_H
@ -33,5 +33,6 @@ extern TRegs regs;
extern char debug_loaded;
void bx_external_debugger(BX_CPU_C *cpu);
void trap_debugger(bx_bool callnow);
#endif

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: soft_int.cc,v 1.30 2006-06-09 22:29:07 sshwarts Exp $
// $Id: soft_int.cc,v 1.31 2006-06-25 21:44:46 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -30,6 +30,10 @@
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_EXTERNAL_DEBUGGER
#include "extdb.h"
#endif
void BX_CPU_C::BOUND_GwMa(bxInstruction_c *i)
{
if (i->modC0()) {