Cleanup, fix checkpoint output.

This commit is contained in:
Glenn Maynard
2003-08-16 20:54:15 +00:00
parent 369780e9b3
commit cca9a68b95
3 changed files with 17 additions and 2 deletions
@@ -102,7 +102,7 @@ static void parent_process( int to_child, void **BacktracePointers, int SignalRe
}
/* 6. Write CHECKPOINTs. */
p = GetCheckpointLogs("$$");
p = GetCheckpointLogs("\n");
size = strlen(p)+1;
parent_write(to_child, &size, sizeof(size));
parent_write(to_child, p, size);
@@ -387,7 +387,8 @@ static void do_backtrace(void **buf, size_t size)
#warning Undefined BACKTRACE_METHOD_*
static void do_backtrace(void **buf, size_t size)
{
buf[0] = NULL;
buf[0] = BACKTRACE_METHOD_NOT_AVAILABLE;
buf[1] = NULL;
}
#endif
@@ -274,6 +274,18 @@ void BacktraceNames::FromAddr( void *p )
static void output_stack_trace( FILE *out, void **BacktracePointers )
{
if( BacktracePointers[0] == BACKTRACE_METHOD_NOT_AVAILABLE )
{
fprintf( out, "No backtrace method available.\n");
return;
}
if( !BacktracePointers[0] )
{
fprintf( out, "Backtrace was empty.\n");
return;
}
for( int i = 0; BacktracePointers[i]; ++i)
{
BacktraceNames bn;
@@ -4,5 +4,7 @@
#define BACKTRACE_MAX_SIZE 1024
#define CHILD_MAGIC_PARAMETER "--private-do-crash-handler"
#define BACKTRACE_METHOD_NOT_AVAILABLE ((void*) -1)
#endif