Added debug prints in case of exceptions
This commit is contained in:
parent
a545bf63ce
commit
6c8241da9a
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: stack_pro.cc,v 1.34 2007-12-16 21:40:44 sshwarts Exp $
|
||||
// $Id: stack_pro.cc,v 1.35 2007-12-16 21:46:39 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -229,11 +229,11 @@ BX_CPU_C::can_push(bx_descriptor_t *descriptor, Bit32u esp, Bit32u bytes)
|
||||
esp = ((esp-bytes) & 0xffff) + bytes;
|
||||
}
|
||||
if (esp < bytes) {
|
||||
BX_INFO(("can_push(): expand-up: esp < N"));
|
||||
BX_ERROR(("can_push(): expand-up: esp < N"));
|
||||
return(0);
|
||||
}
|
||||
if ((esp-1) > descriptor->u.segment.limit_scaled) {
|
||||
BX_INFO(("can_push(): expand-up: SP > limit"));
|
||||
BX_ERROR(("can_push(): expand-up: SP > limit"));
|
||||
return(0);
|
||||
}
|
||||
/* all checks pass */
|
||||
@ -261,7 +261,7 @@ bx_bool BX_CPU_C::can_pop(Bit32u bytes)
|
||||
}
|
||||
|
||||
if (BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].cache.valid==0) {
|
||||
BX_ERROR(("can_pop(): SS invalidated."));
|
||||
BX_ERROR(("can_pop(): SS invalidated"));
|
||||
return(0); /* never gets here */
|
||||
}
|
||||
|
||||
@ -284,7 +284,7 @@ bx_bool BX_CPU_C::can_pop(Bit32u bytes)
|
||||
BX_ERROR(("can_pop(): SS.limit = 0"));
|
||||
return(0);
|
||||
}
|
||||
if ( temp_ESP == expand_down_limit ) {
|
||||
if (temp_ESP == expand_down_limit) {
|
||||
BX_ERROR(("can_pop(): found SP=ffff"));
|
||||
return(0);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: vm8086.cc,v 1.31 2007-11-20 21:22:03 sshwarts Exp $
|
||||
// $Id: vm8086.cc,v 1.32 2007-12-16 21:46:39 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -84,7 +84,7 @@ void BX_CPU_C::stack_return_to_v86(Bit32u new_eip, Bit32u raw_cs_selector,
|
||||
|
||||
// top 36 bytes of stack must be within stack limits, else #SS(0)
|
||||
if ( !can_pop(36) ) {
|
||||
BX_INFO(("iret: VM: top 36 bytes not within limits"));
|
||||
BX_ERROR(("stack_return_to_v86: top 36 bytes not within limits"));
|
||||
exception(BX_SS_EXCEPTION, 0, 0);
|
||||
}
|
||||
|
||||
@ -128,8 +128,8 @@ void BX_CPU_C::iret16_stack_return_from_v86(bxInstruction_c *i)
|
||||
|
||||
if( !can_pop(6) )
|
||||
{
|
||||
BX_DEBUG(("iret16_stack_return_from_v86(): can't pop 6 bytes from the stack"));
|
||||
exception(BX_SS_EXCEPTION, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
pop_16(&ip);
|
||||
@ -142,7 +142,7 @@ void BX_CPU_C::iret16_stack_return_from_v86(bxInstruction_c *i)
|
||||
if (((flags16 & EFlagsIFMask) && BX_CPU_THIS_PTR get_VIP()) ||
|
||||
(flags16 & EFlagsTFMask))
|
||||
{
|
||||
BX_DEBUG(("iret16_stack_return_from_v86: #GP(0) in VME mode"));
|
||||
BX_DEBUG(("iret16_stack_return_from_v86(): #GP(0) in VME mode"));
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
|
||||
@ -185,8 +185,8 @@ void BX_CPU_C::iret32_stack_return_from_v86(bxInstruction_c *i)
|
||||
|
||||
if( !can_pop(12) )
|
||||
{
|
||||
BX_DEBUG(("iret32_stack_return_from_v86(): can't pop 12 bytes from the stack"));
|
||||
exception(BX_SS_EXCEPTION, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
pop_32(&eip);
|
||||
|
Loading…
Reference in New Issue
Block a user