#include <gandalf/common/gan_err_trace.h>
Public Attributes | |
Gan_ErrorTrace * | prev |
int | f_static_record |
int | f_static_message |
int | f_spare |
const char * | func_name |
int | err_code |
const char * | file_name |
int | line_number |
char * | message |
int | number |
Error trace is a last in, first out stack of structures containing details of recorded errors. The stack is implemented as a linked list that is traversed by following 'prev' links.
The bottom (oldest) and 2nd to bottom record of the error trace are statically allocated, while all others are dynamically allocated (malloc'd). Important that gan_et_flush doesn't try to free() the statically allocated records.
prev | Address of previous (next oldest) record in error trace Prev for last record is NULL. | |
f_static_record | Is this record statically or dynamically allocated If it's static, don't try and free() it. | |
f_static_message | Is the text message in this record is contained in a statically or dynamically allocated char array. If it's static, don't try and free() it. | |
f_spare | Whether is record contains details for an error, or is spare. | |
func_name | Name of function in which error occurs | |
err_code | Numeric code of error. Default set is defined in gan_exception_codes*.h | |
file_name | Name of file in which error occurs | |
line_number | Line in file at which error occurs | |
message | Message string describing error | |
number | Number attached to error |
The text message pointed to by "message" normally resides in a dynamically allocated char array, except for the deep error message which resides in a static char array. Therefore if the error code is EC_DFT_DEEP_ERROR, then the message char array should never be subjected to free()
.
|
( GAN_ET_YES | GAN_ET_NO ) |
|
( GAN_ET_YES | GAN_ET_NO ) |
|
( GAN_ET_YES | GAN_ET_NO ) |
|
Prev => last in, first out |