#include <stdio.h>
#include <stdarg.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include "errorp.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
Go to the source code of this file.
Define Documentation
#define ERROR_TOKEN "ERROR: " |
#define STACK_EOF "\n*** eof stack ***\n\n" |
#define STACK_START "*** start stack ***\n" |
#define TOKENS_FILEOFFSET 2 |
#define TOKENS_PERMISSIONS 1 |
Function Documentation
void error_dump_string |
( |
const char * |
msg, |
|
|
char * |
buff, |
|
|
size_t |
buff_size |
|
) |
| |
Definition at line 98 of file errorp.c.
{
#if __linux__
void *sframes[ STACK_FRAMES + 1 ];
int nframes, i;
#endif
write( FD_OUT , msg , strlen( msg ) );
#if __linux__
nframes = backtrace( sframes, STACK_FRAMES + 1); \
write( FD_OUT, STACK_START, strlen( STACK_START ) );
nframes = backtrace( sframes, STACK_FRAMES );
for (i=0; i<nframes; i++) {
snprintf( buff, buff_size, "frame %d ip: %p\n", i, sframes[ i ]);
write( FD_OUT , buff, strlen( buff ) );
}
dump_modules( buff, buff_size );
write( FD_OUT, STACK_EOF, strlen( STACK_EOF ) );
#endif
}
Variable Documentation