Re: Using dwfl to enumerate frames of current thread

2015-08-20 Thread Mark Wielaard
On Thu, 2015-08-20 at 19:32 +0200, Mark Wielaard wrote: > On Thu, 2015-08-20 at 10:06 -0700, Josh Stone wrote: > > On 08/20/2015 08:32 AM, Mark Wielaard wrote: > > > See Dwarf 4 2.17 Code Addresses and Ranges. In particular elfutils takes > > > advantage of: > > > "If an entity has no associated ma

Re: Using dwfl to enumerate frames of current thread

2015-08-20 Thread Mark Wielaard
On Thu, 2015-08-20 at 10:06 -0700, Josh Stone wrote: > On 08/20/2015 08:32 AM, Mark Wielaard wrote: > > See Dwarf 4 2.17 Code Addresses and Ranges. In particular elfutils takes > > advantage of: > > "If an entity has no associated machine code, none of these attributes > > are specified." > > (A -

Re: Using dwfl to enumerate frames of current thread

2015-08-20 Thread Josh Stone
On 08/20/2015 08:32 AM, Mark Wielaard wrote: > See Dwarf 4 2.17 Code Addresses and Ranges. In particular elfutils takes > advantage of: > "If an entity has no associated machine code, none of these attributes > are specified." (A -> B) does not give you (B -> A)! That is, the spec does *not* say

Re: Using dwfl to enumerate frames of current thread

2015-08-20 Thread Mark Wielaard
On Thu, 2015-08-20 at 17:02 +0200, Ben Gamari wrote: > Fair enough. However, I was basing my original statement not on the > output of elfutils' readelf but instead on libdwfl data structures > dumped in gdb. > > As you may have realized by now, the problem begins in > dwfl_module_getsrc, which re

Re: Using dwfl to enumerate frames of current thread

2015-08-20 Thread Ben Gamari
Mark Wielaard writes: > On Thu, 2015-08-20 at 16:13 +0200, Ben Gamari wrote: >> Mark Wielaard writes: >> > Could you post the binary somewhere? >> > Then I will take a look at what is going wrong. >> > >> It can be found here (sorry for the size), >> >> http://home.smart-cactus.org/~ben/ghc

Re: Using dwfl to enumerate frames of current thread

2015-08-20 Thread Mark Wielaard
On Thu, 2015-08-20 at 16:13 +0200, Ben Gamari wrote: > Mark Wielaard writes: > > Could you post the binary somewhere? > > Then I will take a look at what is going wrong. > > > It can be found here (sorry for the size), > > http://home.smart-cactus.org/~ben/ghc-stage2 Thanks. > With binutils

Re: Using dwfl to enumerate frames of current thread

2015-08-20 Thread Ben Gamari
Mark Wielaard writes: > On Thu, 2015-08-20 at 13:09 +0200, Ben Gamari wrote: >> It turns out that libbacktrace only uses DWARF line information, not >> the .debug_frames unwinding information. > > It might indeed be that libbacktrace only handles .eh_frame. > If you already generate .debug_frame

Re: Using dwfl to enumerate frames of current thread

2015-08-20 Thread Mark Wielaard
On Thu, 2015-08-20 at 13:09 +0200, Ben Gamari wrote: > It turns out that libbacktrace only uses DWARF line information, not > the .debug_frames unwinding information. It might indeed be that libbacktrace only handles .eh_frame. If you already generate .debug_frame it should be easy to generate .eh

Re: Using dwfl to enumerate frames of current thread

2015-08-20 Thread Ben Gamari
Mark Wielaard writes: > On Thu, 2015-08-20 at 14:47 +0200, Ben Gamari wrote: >> Using elfutils 0.163, built by me with all dependencies available, >> >> $ /opt/exp/elfutils-root/bin/addr2line --version >> addr2line (elfutils) 0.163 >> Copyright (C) 2012 Red Hat, Inc. >> This is f

Re: Using dwfl to enumerate frames of current thread

2015-08-20 Thread Mark Wielaard
On Thu, 2015-08-20 at 14:47 +0200, Ben Gamari wrote: > Using elfutils 0.163, built by me with all dependencies available, > > $ /opt/exp/elfutils-root/bin/addr2line --version > addr2line (elfutils) 0.163 > Copyright (C) 2012 Red Hat, Inc. > This is free software; see the source for

Re: Using dwfl to enumerate frames of current thread

2015-08-20 Thread Ben Gamari
Ben Gamari writes: > Ben Gamari writes: > snip > > Moreover, I have also implemented unwinding of the Haskell evaluation > stack (the stack used by Haskell code). While the unwinding and symbol > lookup work, I'm not getting any line information out of libdw. I'm > quite certain that my object (

Re: Using dwfl to enumerate frames of current thread

2015-08-20 Thread Ben Gamari
Ben Gamari writes: > Mark Wielaard writes: > >> On Wed, 2015-08-19 at 14:11 +0200, Ben Gamari wrote: >>> I am adding full DWARF unwinding-based backtrace support to the Glasgow >>> Haskell Compiler's (GHC) runtime system. GHC now emits DWARF information >>> in the object files it produces [1] an