Show the Checkpoints in the crashinfo.txt.

This commit is contained in:
Steve Checkoway
2003-08-07 19:58:15 +00:00
parent db6659ba91
commit 75e75fde23
2 changed files with 16 additions and 0 deletions
@@ -100,6 +100,12 @@ static void parent_process( int to_child, void **BacktracePointers, int SignalRe
parent_write(to_child, &size, sizeof(size));
parent_write(to_child, ps[i], size);
}
/* 6. Write CHECKPOINTs. */
p = GetCheckpointLogs("$$");
size = strlen(p)+1;
parent_write(to_child, &size, sizeof(size));
parent_write(to_child, p, size);
close(to_child);
}
@@ -313,6 +313,13 @@ static void child_process()
ret = read(3, Recent[i], size);
}
/* 6. Read CHECKPOINTs. */
ret = read(3, &size, sizeof(size));
char *temp = new char [size];
ret = read(3, temp, size);
CStringArray Checkpoints;
split(temp, "$$", Checkpoints);
/* Wait for the child to either finish cleaning up or die. XXX:
* This should time out, in case something deadlocks. */
@@ -392,6 +399,9 @@ static void child_process()
fprintf(CrashDump, "\nPartial log:\n");
for( int i = 0; i < cnt; ++i )
fprintf(CrashDump, "%s\n", Recent[i] );
fprintf(CrashDump, "\nCheckpoints:\n");
for (unsigned i=0; i<Checkpoints.size(); ++i)
fprintf(CrashDump, Checkpoints[i]);
fprintf(CrashDump, "\n");
fprintf(CrashDump, "-- End of report\n");
fclose(CrashDump);