Classes | Functions
vul_debug.h File Reference
#include <exception>

Go to the source code of this file.

Classes

class  vul_debug_windows_structured_exception
 A translated structured exception. More...
 

Functions

bool vul_debug_core_dump (const char *filename)
 Dump a core file. More...
 
bool vul_debug_core_dump_in_windows_se (const char *filename, void *pep)
 Force a core dump whilst inside a Structured Exception Handler in a windows program. More...
 
void vul_debug_set_coredump_and_throw_on_windows_se (const char *filename)
 Setup the system to core dump and throw a C++ exception on detection of a Structured Exception. More...
 
void vul_debug_set_coredump_and_throw_on_out_of_memory (const char *filename)
 Setup the system to core dump and throw a C++ exception on detection of out of memory. More...
 

Detailed Description

Author
Ian Scott

Definition in file vul_debug.h.

Function Documentation

◆ vul_debug_core_dump()

bool vul_debug_core_dump ( const char *  filename)

Dump a core file.

Parameters
filenamecan have up to one "%d" option, which will be given a different index number on each core dump.
Returns
true on success, false when coredump could not be taken

Definition at line 184 of file vul_debug.cxx.

◆ vul_debug_core_dump_in_windows_se()

bool vul_debug_core_dump_in_windows_se ( const char *  filename,
void *  pep 
)

Force a core dump whilst inside a Structured Exception Handler in a windows program.

To get a core dump from a Windows structured exceptions

 void main()
 {
   __try
   {
     // Rest of program
   }
   __except(vul_debug_core_dump2(filename, GetExceptionInformation()))
   {}
 }
Parameters
filenamecan have up to one "%d" option, which will be given a different index number on each core dump.
Returns
true on success, false when coredump could not be taken

◆ vul_debug_set_coredump_and_throw_on_out_of_memory()

void vul_debug_set_coredump_and_throw_on_out_of_memory ( const char *  filename)

Setup the system to core dump and throw a C++ exception on detection of out of memory.

The system will throw std::bad_alloc.

Parameters
filenamecan have up to one "%d" option, which will be given a different index number on each core dump.

The system will throw std::bad_alloc.

Definition at line 227 of file vul_debug.cxx.

◆ vul_debug_set_coredump_and_throw_on_windows_se()

void vul_debug_set_coredump_and_throw_on_windows_se ( const char *  )

Setup the system to core dump and throw a C++ exception on detection of a Structured Exception.

The system will throw vul_debug_windows_structured_exception. You must compile your code with /EHa to get the compiler to correctly handle SEs.

Parameters
filenamecan have up to one "%d" option, which will be given a different index number on each core dump.
Exceptions
vul_debug_windows_structured_exception.

Definition at line 205 of file vul_debug.cxx.