mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-21 16:52:58 +02:00
Print call stack if an error occurs in a user-defined function.
This commit is contained in:
+10
-1
@@ -237,9 +237,18 @@ print_callstack(FILE *fp)
|
||||
int done = 0;
|
||||
cs *entry = callstack;
|
||||
while(entry) {
|
||||
(void) fprintf(fp, "%s(%d): %s\n", entry->filename, entry->lineno, entry->func);
|
||||
(void) fprintf(fp, "%s(%d): In function `%s'\n", entry->filename, entry->lineno, entry->func);
|
||||
done = 1;
|
||||
entry = entry->next;
|
||||
}
|
||||
return done;
|
||||
}
|
||||
void
|
||||
pop_call(void)
|
||||
{
|
||||
cs *entry = callstack;
|
||||
if (entry) {
|
||||
callstack = entry->next;
|
||||
destroy_cs(entry);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user