es40_debug.h File Reference


Detailed Description

Contains macro's and prototypes for debugging.

Id
es40_debug.h,v 1.8 2008/03/14 15:30:52 iamcamiel Exp

X-1.7 Camiel Vanderhoeven 14-MAR-2008 1. More meaningful exceptions replace throwing (int) 1. 2. U64 macro replaces X64 macro.

X-1.6 Brian Wheeler 27-FEB-2008 Avoid compiler warnings.

X-1.5 Brian wheeler 26-FEB-2008 Pause before throwing an exception.

X-1.4 Camiel Vanderhoeven 28-DEC-2007 Throw exceptions rather than just exiting when errors occur.

X-1.3 Camiel Vanderhoeven 28-DEC-2007 Keep the compiler happy.

X-1.2 Camiel Vanderhoeven 15-NOV-2007 Included stdarg.h for Linux.

X-1.1 Camiel Vanderhoeven 14-NOV-2007 Initial creation.

Author:
Camiel Vanderhoeven (camiel@camicom.com / http://www.camicom.com)

Definition in file es40_debug.h.

#include <stdarg.h>

Go to the source code of this file.

Defines

#define INCLUDED_DEBUG_H
#define DEBUG_BUFSIZE   1024
#define DEBUG_INDENTATION   4
#define FAILURE(cls, error_msg)
#define FAILURE_1(cls, error_msg, a)
#define FAILURE_2(cls, error_msg, a, b)
#define FAILURE_3(cls, error_msg, a, b, c)
#define FAILURE_4(cls, error_msg, a, b, c, d)
#define FAILURE_5(cls, error_msg, a, b, c, d, e)
#define FAILURE_6(cls, error_msg, a, b, c, d, e, f)
#define CHECK_ALLOCATION(ptr)
#define CHECK_REALLOCATION(dst, src, type)

Functions

void debug_indentation (int diff)
void debug (char *fmt,...)
void fatal (char *fmt,...)


Define Documentation

#define CHECK_ALLOCATION ( ptr   ) 

Value:

{                                          \
    if((ptr) == NULL)                        \
      FAILURE(OutOfMemory, "Out of memory"); \
  }

Definition at line 127 of file es40_debug.h.

Referenced by CDisk::CDisk(), CDiskRam::CDiskRam(), CSystem::CSystem(), CSystemComponent::CSystemComponent(), CSystem::RegisterMemory(), and CSystem::ResetMem().

#define CHECK_REALLOCATION ( dst,
src,
type   ) 

Value:

{                                          \
    type*   rea_x;                           \
    rea_x = (type*) src;                     \
    if((rea_x) == NULL)                      \
    {                                        \
      FAILURE(OutOfMemory, "Out of memory"); \
    }                                        \
    else                                     \
    {                                        \
      dst = rea_x;                           \
    }                                        \
  }

Definition at line 133 of file es40_debug.h.

Referenced by bx_keymap_c::loadKeymap(), CDiskDevice::read_bytes(), and CDiskDevice::write_bytes().

#define DEBUG_BUFSIZE   1024

Definition at line 64 of file es40_debug.h.

Referenced by va_debug().

#define DEBUG_INDENTATION   4

Definition at line 65 of file es40_debug.h.

#define FAILURE ( cls,
error_msg   ) 

Value:

{                                                        \
    char  where_msg[800];                                  \
    sprintf(where_msg, "%s, line %i", __FILE__, __LINE__); \
    throw C##cls##Exception(error_msg, where_msg);         \
  }

Definition at line 77 of file es40_debug.h.

Referenced by CAliM1543C::CAliM1543C(), CAliM1543C_ide::CAliM1543C_ide(), CDPR::CDPR(), CFlash::CFlash(), CSym53C895::check_state(), CSym53C810::check_state(), CSerial::check_state(), CS3Trio64::check_state(), CKeyboard::check_state(), CDEC21143::check_state(), CCirrus::check_state(), CAlphaCPU::check_state(), CAliM1543C_ide::check_state(), CAliM1543C::check_state(), CKeyboard::CKeyboard(), CKeyboard::controller_enQ(), CSystem::CSystem(), CVGA::CVGA(), CAliM1543C_ide::do_dma_transfer(), CPCIDevice::do_pci_read(), CPCIDevice::do_pci_write(), endian_bits(), CAliM1543C_ide::execute(), CSym53C895::execute_bm_op(), CSym53C810::execute_bm_op(), CSCSIBus::free_bus(), CKeyboard::SKb_state::SAli_mouse::get_resolution_byte(), bx_sdl_gui_c::handle_events(), bx_x11_gui_c::handle_events(), CAliM1543C_ide::ide_busmaster_read(), CDEC21143::init(), CS3Trio64::io_read(), CCirrus::io_read(), CS3Trio64::io_write(), CCirrus::io_write(), CSystem::LoadROM(), CFastMutex::lock(), CMutex::lock(), main(), CSystem::panic(), CS3Trio64::read_b_3c0(), CCirrus::read_b_3c0(), CRWMutex::readLock(), CKeyboard::ReadMem(), CDMA::ReadMem(), CDiskController::register_disk(), CSystem::RestoreState(), CSystem::Run(), s2i(), CSCSIDevice::scsi_expected_xfer_me(), CSCSIBus::scsi_register(), CSCSIDevice::scsi_select_me(), CSCSIBus::scsi_unregister(), CSCSIDevice::scsi_xfer_done_me(), CDisk::scsi_xfer_done_me(), CSCSIDevice::scsi_xfer_ptr_me(), CSCSIBus::select(), CSerial::serial_menu(), CSCSIBus::set_phase(), bx_sdl_gui_c::specific_init(), terminateEmul(), CS3Trio64::update(), CCirrus::update(), CAlphaCPU::vmspal_ent_ext_int(), CSym53C895::write_b_ctest3(), CSym53C810::write_b_ctest3(), CSym53C895::write_b_ctest4(), CSym53C810::write_b_ctest4(), CSym53C895::write_b_ctest5(), CSym53C810::write_b_ctest5(), CSym53C895::write_b_scntl0(), CSym53C810::write_b_scntl0(), CSym53C895::write_b_stest2(), CSym53C810::write_b_stest2(), CDiskDevice::write_bytes(), CRWMutex::writeLock(), CKeyboard::WriteMem(), and CDMA::WriteMem().

#define FAILURE_1 ( cls,
error_msg,
 ) 

#define FAILURE_2 ( cls,
error_msg,
a,
 ) 

#define FAILURE_3 ( cls,
error_msg,
a,
b,
 ) 

#define FAILURE_4 ( cls,
error_msg,
a,
b,
c,
 ) 

Value:

{                                           \
    char  what_msg[800];                      \
    sprintf(what_msg, error_msg, a, b, c, d); \
    FAILURE(cls, what_msg);                   \
  }

Definition at line 106 of file es40_debug.h.

Referenced by CAliM1543C::ReadMem_Legacy(), and CAliM1543C::WriteMem_Legacy().

#define FAILURE_5 ( cls,
error_msg,
a,
b,
c,
d,
 ) 

Value:

{                                              \
    char  what_msg[800];                         \
    sprintf(what_msg, error_msg, a, b, c, d, e); \
    FAILURE(cls, what_msg);                      \
  }

Definition at line 113 of file es40_debug.h.

Referenced by CPCIDevice::ReadMem().

#define FAILURE_6 ( cls,
error_msg,
a,
b,
c,
d,
e,
 ) 

Value:

{                                                 \
    char  what_msg[800];                            \
    sprintf(what_msg, error_msg, a, b, c, d, e, f); \
    FAILURE(cls, what_msg);                         \
  }

Definition at line 120 of file es40_debug.h.

Referenced by CPCIDevice::WriteMem().

#define INCLUDED_DEBUG_H

Definition at line 62 of file es40_debug.h.


Function Documentation

void debug ( char *  fmt,
  ... 
)

Definition at line 116 of file es40_debug.cpp.

References quiet_mode, and va_debug().

void debug_indentation ( int  diff  ) 

Definition at line 104 of file es40_debug.cpp.

References debug_indent.

void fatal ( char *  fmt,
  ... 
)

Definition at line 134 of file es40_debug.cpp.

References va_debug().


SourceForge.net Logo
Project space on SourceForge.net