libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libunwind-devel] unw_get_proc_info never gets unwind info


From: Doug Moore
Subject: Re: [Libunwind-devel] unw_get_proc_info never gets unwind info
Date: Tue, 11 Apr 2017 14:56:08 -0500

If I modify tests/Gtest-bt.c with this patch:

diff --git a/tests/Gtest-bt.c b/tests/Gtest-bt.c
index 802dd08..82d8317 100644
--- a/tests/Gtest-bt.c
+++ b/tests/Gtest-bt.c
@@ -86,9 +86,10 @@ do_backtrace (void)
 
          if (unw_get_proc_info (&cursor, &pi) == 0)
            {
-             printf ("\tproc=0x%lx-0x%lx\n\thandler=0x%lx lsda=0x%lx gp=0x%lx",
+             printf ("\tproc=0x%lx-0x%lx\n\thandler=0x%lx lsda=0x%lx gp=0x%lx 
uw=0x%lx",
                  (long) pi.start_ip, (long) pi.end_ip,
-                 (long) pi.handler, (long) pi.lsda, (long) pi.gp);
+                 (long) pi.handler, (long) pi.lsda, (long) pi.gp,
+                 (long) pi.unwind_info);
            }
 
 #if UNW_TARGET_IA64

and then I run 

./Gtest-bt foo  | grep uw

with ‘foo’ for verbose output, and looking for the unwind info added by the 
patch, I see that in every case, the unwind info is 0x0.

Doug



> On Apr 11, 2017, at 9:32 AM, Dave Watson <address@hidden> wrote:
> 
> On 04/11/17 12:16 AM, Doug Moore wrote:
>> 
>> For x86_64, specifically, and for dwarf generally, unw_get_proc_info does
>> not set the unwind_info field of the unw_proc_info_t to any non-NULL value,
>> ever.  That is because dwarf_make_proc_info passes 0 as the last argument to
>> fetch_proc_info, so that dwarf_extract_proc_info_from_fde ends up not
>> copying unwind info.
>> 
>> How can one get the actual unwind info out of unw_get_proc_info?
> 
> On current master, tdep_find_proc_info is always passed 1, regardless
> of whatever need_unwind_info is passed:
> 
> http://git.savannah.gnu.org/gitweb/?p=libunwind.git;a=blob;f=src/dwarf/Gparser.c;h=ede856e053e5d1716058d2e56165e9feb4a670e6;hb=HEAD#l441
> 
> Can you provide a unittest for the issue?  It looks like
> unw_get_proc_info is called from both test-ptrace and test-coredump
> already, and at least appears to pass on my machine (excepting the
> -m32 issue just reported).
> 
> !DSPAM:10223,58ece8fa39345642720838!
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]