[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libunwind-devel] unw_get_proc_info never gets unwind info
From: |
Dave Watson |
Subject: |
Re: [Libunwind-devel] unw_get_proc_info never gets unwind info |
Date: |
Wed, 12 Apr 2017 08:50:45 -0700 |
User-agent: |
Mutt/1.6.0 (2016-04-01) |
On 04/11/17 02:56 PM, Doug Moore wrote:
> 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.
Ah, thanks for the example.
So it looks like this happens because put_unwind_info is called at the
end of dwarf_make_proc_info, to free the memory. I don't think this
has changed recently - we would need an API to release the proc info
somehow, that I don't think currently exists?