diff options
author | Eric Wong <mwrap-perl@80x24.org> | 2022-12-11 06:30:08 +0000 |
---|---|---|
committer | Eric Wong <mwrap-perl@80x24.org> | 2022-12-11 06:31:28 +0000 |
commit | 01f2efbe91a148442ad27a0e93961ba31b5e72f8 (patch) | |
tree | beb8cdf83e4e48c20f704347142f1e0499c4e0c3 /Mwrap.xs | |
parent | a62fd3fd047eeb2b4b085321082e210b97802044 (diff) | |
download | mwrap-01f2efbe91a148442ad27a0e93961ba31b5e72f8.tar.gz |
"'Tis better to emit than to parse" Since FreeBSD has backtrace_symbols_fmt(3) and glibc does not, we'll use the hard-coded glibc backtrace_symbols(3) format. This saves us the trouble of maintaining separate parsers. I consider the default glibc format superior, anyways, since the important piece (%f - filename) is up front, since the %a (address) is process-specific and not useful when viewed from a different process.
Diffstat (limited to 'Mwrap.xs')
-rw-r--r-- | Mwrap.xs | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -23,14 +23,9 @@ static SV *location_string(struct src_loc *l) else sv_setpvf(ret, "%s:%zu", l->f->fn, l->lineno); } else { - char **s = backtrace_symbols((void *)l->bt, (int)l->bt_len); - - if (!s) { - fprintf(stderr, "backtrace_symbols => NULL: %s\n", - strerror(errno)); - return &PL_sv_undef; - } + char **s = bt_syms(l->bt, l->bt_len); + if (!s) return &PL_sv_undef; ret = newSVpvn(s[0], strlen(s[0])); free(s); } |