From 7a3518d32503835966c6a229ae02ebae96a862f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Mon, 4 Jun 2018 17:03:51 +0200 Subject: [PATCH] eh_elf: actually use eh_elf in unw_step --- src/x86_64/Gstep.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/x86_64/Gstep.c b/src/x86_64/Gstep.c index 84b37280..81fcc64b 100644 --- a/src/x86_64/Gstep.c +++ b/src/x86_64/Gstep.c @@ -26,6 +26,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "unwind_i.h" +#include "../eh_elf/eh_elf.h" #include /* Recognise PLT entries such as: @@ -66,6 +67,16 @@ unw_step (unw_cursor_t *cursor) Debug (1, "(cursor=%p, ip=0x%016lx, cfa=0x%016lx)\n", c, c->dwarf.ip, c->dwarf.cfa); + // Try eh_elf based unwinding... + ret = eh_elf_step_cursor(&c); + + if(ret < 0) { + Debug(2, "eh_elf unwinding failed (%d), falling back\n", ret); + } + else { + return ret; + } + /* Try DWARF-based unwinding... */ c->sigcontext_format = X86_64_SCF_NONE; ret = dwarf_step (&c->dwarf);