mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-27 01:27:39 +01:00
(unw_get_proc_info): Don't freak out if dwarf_make_proc_info() fails.
Unfortunately, it must fail for current versions of libc since they fail to provide unwind-info for _start() and _dl_start(). (Logical change 1.290)
This commit is contained in:
parent
e7fba77e9d
commit
7ac9665fd3
1 changed files with 11 additions and 4 deletions
|
@ -31,11 +31,18 @@ PROTECTED int
|
|||
unw_get_proc_info (unw_cursor_t *cursor, unw_proc_info_t *pi)
|
||||
{
|
||||
struct cursor *c = (struct cursor *) cursor;
|
||||
int ret;
|
||||
|
||||
if (ret = dwarf_make_proc_info (&c->dwarf))
|
||||
return ret;
|
||||
|
||||
if (dwarf_make_proc_info (&c->dwarf) < 0)
|
||||
{
|
||||
/* On x86-64, some key routines such as _start() and _dl_start()
|
||||
are missing DWARF unwind info. We don't want to fail in that
|
||||
case, because those frames are uninteresting and just mark
|
||||
the end of the frame-chain anyhow. */
|
||||
memset (pi, 0, sizeof (*pi));
|
||||
pi->start_ip = c->dwarf.ip;
|
||||
pi->end_ip = c->dwarf.ip + 1;
|
||||
return 0;
|
||||
}
|
||||
*pi = c->dwarf.pi;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue