diff options
author | Jakob Kaivo <jkk@ung.org> | 2023-11-27 14:08:35 -0500 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2023-11-27 14:08:35 -0500 |
commit | 43bc9bea0773cce280c4d4442a494fe24f8e92bd (patch) | |
tree | 3fbc8ec51783b86d6eb8fbfc2ddc14d2fc46c40f /src/stdlib | |
parent | 4d16801b9a6727d39a49dde70daa29eeac15a16c (diff) |
add framework for marking function call location in diagnostics
Diffstat (limited to 'src/stdlib')
-rw-r--r-- | src/stdlib/abort_handler_s.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/stdlib/abort_handler_s.c b/src/stdlib/abort_handler_s.c index c35148a7..f6471151 100644 --- a/src/stdlib/abort_handler_s.c +++ b/src/stdlib/abort_handler_s.c @@ -4,6 +4,7 @@ //#include <errno.h> #include "errno/errno_t.h" #include "_stdlib.h" +#include "_assert.h" void abort_handler_s(const char * restrict msg, void * restrict ptr, errno_t error) { @@ -11,8 +12,15 @@ void abort_handler_s(const char * restrict msg, void * restrict ptr, errno_t err puts(msg); if (ci) { - printf("In call to %s\n", ci->func); - printf("value %x\n", ci->value); + printf("In call to %s()", ci->func); + if (__checked_call.file) { + printf(" ("); + if (__checked_call.func) { + printf("in %s(), ", __checked_call.func); + } + printf("at %s:%llu)", __checked_call.file, __checked_call.line); + } + printf(", value %x\n", ci->value); } if (error != 0) { printf("Provided error: %s (%d)\n", strerror(error), error); |