ruby-changes:71825
From: Peter <ko1@a...>
Date: Fri, 13 May 2022 23:48:04 +0900 (JST)
Subject: [ruby-changes:71825] 09c72f41ce (master): Print function name in backtrace when available
https://git.ruby-lang.org/ruby.git/commit/?id=09c72f41ce From 09c72f41ceeb6933e3b1da4eb581c4c22e9f1b89 Mon Sep 17 00:00:00 2001 From: Peter Zhu <peter@p...> Date: Fri, 13 May 2022 09:32:18 -0400 Subject: Print function name in backtrace when available If we don't have `saddr` but have `sname` we should output `sname`. --- addr2line.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addr2line.c b/addr2line.c index f660be9129..e102667602 100644 --- a/addr2line.c +++ b/addr2line.c @@ -2257,9 +2257,12 @@ print_line0(line_info_t *line, void *address) https://github.com/ruby/ruby/blob/trunk/addr2line.c#L2257 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); -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/