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.
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 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 |
| #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, | |||||
| a | ) |
Value:
{ \
char what_msg[800]; \
sprintf(what_msg, error_msg, a); \
FAILURE(cls, what_msg); \
}
Definition at line 85 of file es40_debug.h.
Referenced by CDiskDevice::CDiskDevice(), CDiskFile::CDiskFile(), bx_sdl_gui_c::dimension_update(), CDisk::do_scsi_command(), CAliM1543C_ide::execute(), CSym53C895::execute_tc_op(), CSym53C810::execute_tc_op(), CS3Trio64::init(), CDEC21143::init(), CCirrus::init(), CS3Trio64::io_read(), CCirrus::io_read(), CS3Trio64::io_write_b(), CCirrus::io_write_b(), CS3Trio64::read_b_3c1(), CCirrus::read_b_3c1(), CS3Trio64::read_b_3c5(), CCirrus::read_b_3c5(), CS3Trio64::read_b_3cf(), CCirrus::read_b_3cf(), CS3Trio64::read_b_3d5(), CCirrus::read_b_3d5(), CSym53C895::set_interrupt(), CSym53C810::set_interrupt(), CS3Trio64::update(), CCirrus::update(), CS3Trio64::vga_mem_write(), CCirrus::vga_mem_write(), CSerial::WaitForConnection(), CS3Trio64::write_b_3c5(), CCirrus::write_b_3c5(), CS3Trio64::write_b_3cf(), and CCirrus::write_b_3cf().
| #define FAILURE_2 | ( | cls, | |||
| error_msg, | |||||
| a, | |||||
| b | ) |
Value:
{ \
char what_msg[800]; \
sprintf(what_msg, error_msg, a, b); \
FAILURE(cls, what_msg); \
}
Definition at line 92 of file es40_debug.h.
Referenced by CConfigurator::CConfigurator(), CDiskDevice::CDiskDevice(), CDisk::do_scsi_command(), CDisk::do_scsi_message(), CConfigurator::get_bool_value(), CConfigurator::get_num_value(), CConfigurator::initialize(), CSym53C895::ReadMem_Bar(), CSym53C810::ReadMem_Bar(), CPCIDevice::ReadMem_Legacy(), CDisk::scsi_expected_xfer_me(), CDisk::scsi_xfer_done_me(), CDisk::scsi_xfer_ptr_me(), CSym53C895::WriteMem_Bar(), CSym53C810::WriteMem_Bar(), and CPCIDevice::WriteMem_Legacy().
| #define FAILURE_3 | ( | cls, | |||
| error_msg, | |||||
| a, | |||||
| b, | |||||
| c | ) |
Value:
{ \
char what_msg[800]; \
sprintf(what_msg, error_msg, a, b, c); \
FAILURE(cls, what_msg); \
}
Definition at line 99 of file es40_debug.h.
Referenced by CConfigurator::CConfigurator(), CDiskDevice::CDiskDevice(), bx_sdl_gui_c::dimension_update(), CFastMutex::lock(), CMutex::lock(), CRWMutex::readLock(), CPCIDevice::ReadMem_Bar(), CFastMutex::tryLock(), CMutex::tryLock(), CRWMutex::tryReadLock(), CRWMutex::tryWriteLock(), CRWMutex::unlock(), CFastMutex::unlock(), CMutex::unlock(), CRWMutex::writeLock(), and CPCIDevice::WriteMem_Bar().
| #define FAILURE_4 | ( | cls, | |||
| error_msg, | |||||
| a, | |||||
| b, | |||||
| c, | |||||
| d | ) |
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, | |||||
| e | ) |
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, | |||||
| f | ) |
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.
| void debug | ( | char * | fmt, | |
| ... | ||||
| ) |
| void debug_indentation | ( | int | diff | ) |
| void fatal | ( | char * | fmt, | |
| ... | ||||
| ) |