libunwind-devel
[Top][All Lists]
Advanced

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

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


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

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.

 The compilation command is this.
gcc unwind.c -I /usr/include -L /usr/lib -lunwind -o unwind

This works fine on x86.On MIPS,compilation is success, but the execution shows 'Segmentation fault'
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();
}








reply via email to

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