libunwind-devel
[Top][All Lists]
Advanced

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

Re: [Libunwind-devel] Fw: Libunwind-devel] Testing libunwind


From: Bincy K Philip
Subject: Re: [Libunwind-devel] Fw: Libunwind-devel] Testing libunwind
Date: Tue, 19 Feb 2013 17:18:22 +0800 (SGT)

I tried these steps.But its not giving any debugging information.
gcc unwind.c -I /usr/include -L /usr/lib -lunwind -o unwind
export UNW_DEBUG_LEVEL=99
./unwind --enable-debug

Thanks
Bincy


From: Tommi Rantala <address@hidden>
To: Bincy K Philip <address@hidden>
Cc: Paul Pluzhnikov <address@hidden>; "address@hidden" <address@hidden>
Sent: Tuesday, 19 February 2013 1:25 PM
Subject: Re: [Libunwind-devel] Fw: Libunwind-devel] Testing libunwind

2013/2/19 Bincy K Philip <address@hidden>:
> Hi,
>
> Thank you for the reply.
>
>
> You are  right.I am getting error at run time only.
> My libunwind version 1.0.1
> gcc version 4.7.0
> OS is Linux
>
> My target does not have gdb support.
>
> On an arm target I found the compile time option is
>
> gcc unwind.c -I /usr/include -L /usr/lib  -lunwind -lunwind-arm -g
> -funwind-tables -o unwind
>
> and on x86, this is
> gcc unwind.c -I /usr/include -L /usr/lib -lunwind -o unwind
>
> But am not sure about compile time options on mips architecture.
> Please help.

You can get some runtime debugging information from libunwind by
configuring it with --enable-debug.

Before running your program on the MIPS machine, set:
export UNW_DEBUG_LEVEL=99

You should now see several lines coming from libunwind on the screen.
This might give some hint where the problem is.

Tommi

> Regards
> Bincy
>
> ________________________________
> From: Paul Pluzhnikov <address@hidden>
> To: Bincy K Philip <address@hidden>
> Sent: Tuesday, 19 February 2013 10:57 AM
> Subject: Re: [Libunwind-devel] Fw: Libunwind-devel] Testing libunwind
>
> off-list
>
> On Mon, Feb 18, 2013 at 9:17 PM, Bincy K Philip <address@hidden>
> wrote:
>
> Hi,
>
> If anybody know the mips specific compilation parameters please help.
>
> Regards
> Bincy
>
> ----- Forwarded Message -----
> From: Bincy K Philip <address@hidden>
> To: "address@hidden" <address@hidden>
> Sent: Monday, 18 February 2013 5:40 PM
> Subject: Libunwind-devel] Testing libunwind
>
> Hi,
> I got some issues while compiling a program with libunwind on a MIPS target.
>
>
> No, you haven't. Your program compiles and links fine. It's at runtime that
> you have a problem.
>
>
>
>  The compilation command is this.
> gcc unwind.c -I /usr/include -L /usr/lib -lunwind -o unwind
>
>
> This tells us approximately nothing.
>
> For a start, which version of libunwind are you using?
> Version of GCC, and the OS might be relevant as well.
>
>
>
> This works fine on x86.On MIPS,compilation is success, but the execution
> shows 'Segmentation fault'
>
>
> And the crash stack trace from GDB is?
>
>
> Do I need to add  any gcc options specific to MIPS??
>
> Thanks
> Bincy
>
> Program
> -------
> #define UNW_LOCAL_ONLY
> #include <libunwind.h>
> #include<stdio.h>
> void show_backtrace (void) {
>  unw_cursor_t cursor; unw_context_t uc;
>  unw_word_t ip, sp;
>
>  unw_getcontext(&uc);
>  unw_init_local(&cursor, &uc);
>  while (unw_step(&cursor) > 0) {
>    unw_get_reg(&cursor, UNW_REG_IP, &ip);
>    unw_get_reg(&cursor, UNW_REG_SP, &sp);
>    printf ("ip = %lx, sp = %lx\n", (long) ip, (long) sp);
>  }
> }
>
> int main()
> {
> show_backtrace();
> }
>
>
>
>
>
>
>
>
> _______________________________________________
> Libunwind-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/libunwind-devel
>
>
>
>
> --
> Paul Pluzhnikov
>
>
>
> _______________________________________________
> Libunwind-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/libunwind-devel
>



reply via email to

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