From 7ac9665fd3b12ceeca55254db1c055170579b01e Mon Sep 17 00:00:00 2001 From: "mostang.com!davidm" Date: Tue, 3 May 2005 09:13:17 +0000 Subject: [PATCH] (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) --- src/x86_64/Gget_proc_info.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/x86_64/Gget_proc_info.c b/src/x86_64/Gget_proc_info.c index 5130f5a7..213666e0 100644 --- a/src/x86_64/Gget_proc_info.c +++ b/src/x86_64/Gget_proc_info.c @@ -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; }