From 94b2dd2bc8c448525557b6329582f22e1585f9f0 Mon Sep 17 00:00:00 2001 From: Peter Tattam Date: Tue, 1 Oct 2002 04:13:12 +0000 Subject: [PATCH] Cleanup of extdb.* files. included in right places now. --- bochs/bochs.h | 7 ++++++- bochs/cpu/cpu.cc | 7 +------ bochs/cpu/exception.cc | 6 +----- bochs/cpu/extdb.cc | 3 ++- bochs/cpu/extdb.h | 23 +---------------------- 5 files changed, 11 insertions(+), 35 deletions(-) diff --git a/bochs/bochs.h b/bochs/bochs.h index f11fad1fa..94d0dc07f 100644 --- a/bochs/bochs.h +++ b/bochs/bochs.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: bochs.h,v 1.96 2002-09-22 20:56:11 cbothamy Exp $ +// $Id: bochs.h,v 1.97 2002-10-01 04:13:12 ptrumpet Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -435,6 +435,10 @@ extern logfunc_t *genlog; # include "cpu/cpu.h" #endif +#if BX_EXTERNAL_DEBUGGER +# include "cpu/extdb.h" +#endif + #if BX_DISASM # include "disasm/disasm.h" #endif @@ -444,6 +448,7 @@ extern logfunc_t *genlog; #endif + typedef struct { Boolean floppy; Boolean keyboard; diff --git a/bochs/cpu/cpu.cc b/bochs/cpu/cpu.cc index 3d714226c..8c54bae60 100644 --- a/bochs/cpu/cpu.cc +++ b/bochs/cpu/cpu.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: cpu.cc,v 1.57 2002-09-29 22:38:15 kevinlawton Exp $ +// $Id: cpu.cc,v 1.58 2002-10-01 04:13:12 ptrumpet Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -34,11 +34,6 @@ #define this (BX_CPU(0)) #endif -#if BX_EXTERNAL_DEBUGGER -#include "cpu/extdb.h" -#endif - - #if BX_SIM_ID == 0 // only need to define once // This array defines a look-up table for the even parity-ness diff --git a/bochs/cpu/exception.cc b/bochs/cpu/exception.cc index 318bfc588..0c3e42f50 100644 --- a/bochs/cpu/exception.cc +++ b/bochs/cpu/exception.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: exception.cc,v 1.22 2002-09-28 00:54:04 kevinlawton Exp $ +// $Id: exception.cc,v 1.23 2002-10-01 04:13:12 ptrumpet Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -30,10 +30,6 @@ #include "bochs.h" #define LOG_THIS BX_CPU_THIS_PTR -#if BX_EXTERNAL_DEBUGGER -#include "cpu/extdb.h" -#endif - /* Exception classes. These are used as indexes into the 'is_exception_OK' * array below, and are stored in the 'exception' array also diff --git a/bochs/cpu/extdb.cc b/bochs/cpu/extdb.cc index be1b07124..02c3e2f76 100644 --- a/bochs/cpu/extdb.cc +++ b/bochs/cpu/extdb.cc @@ -1,5 +1,4 @@ #include "bochs.h" -#include "cpu/extdb.h" #ifdef WIN32 # include #else @@ -67,6 +66,8 @@ void bx_external_debugger(BX_CPU_C *cpu) //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; regs.efer = (BX_CPU_THIS_PTR msr.sce << 0) | (BX_CPU_THIS_PTR msr.lme << 8) | (BX_CPU_THIS_PTR msr.lma << 10); diff --git a/bochs/cpu/extdb.h b/bochs/cpu/extdb.h index 24663726c..e6d0daaa6 100644 --- a/bochs/cpu/extdb.h +++ b/bochs/cpu/extdb.h @@ -1,41 +1,20 @@ -#if BX_SUPPORT_X86_64 -// I have no idea why one includes, one doesn't. Fixme. -#else -#include "bochs.h" -#endif - typedef struct { -#if BX_SUPPORT_X86_64 Bit64u base; Bit16u limit; Bit16u fill[3]; -#else - Bit32u base; - Bit16u limit; - Bit16u fill; -#endif } descbase; typedef struct { -#if BX_SUPPORT_X86_64 Bit64u rax,rcx,rdx,rbx,rsp,rbp,rsi,rdi, r8,r9,r10,r11,r12,r13,r14,r15, rip,rflags; Bit32u es,cs,ss,ds,fs,gs,tr,ldt; Bit64u cr0,cr1,cr2,cr3,cr4,cr5,cr6,cr7; + Bit64u fsbase,gsbase; descbase gdt,idt; Bit32u efer; Bit32u debug_eip,debug_cs,debug_counter; Bit8u debug_state; -#else - Bit32u eax,ecx,edx,ebx,esp,ebp,esi,edi,eip,eflags; - Bit32u es,cs,ss,ds,fs,gs,tr; - descbase gdt,idt; - Bit32u ldt; - Bit32u cr0,cr1,cr2,cr3; - Bit32u debug_eip,debug_cs,debug_counter; - Bit8u debug_state; -#endif #define debug_step 0 #define debug_run 1 #define debug_count 2