1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Print function name in backtrace when available

If we don't have `saddr` but have `sname` we should output `sname`.
This commit is contained in:
Peter Zhu 2022-05-13 09:32:18 -04:00
parent 55ba414405
commit 09c72f41ce
Notes: git 2022-05-13 23:48:10 +09:00

View file

@ -2257,9 +2257,12 @@ print_line0(line_info_t *line, void *address)
else if (!line->path) {
kprintf("[0x%"PRIxPTR"]\n", addr);
}
else if (!line->saddr || !line->sname) {
else if (!line->sname) {
kprintf("%s(0x%"PRIxPTR") [0x%"PRIxPTR"]\n", line->path, addr-line->base_addr, addr);
}
else if (!line->saddr) {
kprintf("%s(%s) [0x%"PRIxPTR"]\n", line->path, line->sname, addr);
}
else if (line->line <= 0) {
kprintf("%s(%s+0x%"PRIxPTR") [0x%"PRIxPTR"]\n", line->path, line->sname,
d, addr);