test-libunwind.c 711 B

123456789101112131415161718192021222324252627
  1. #include <libunwind.h>
  2. #include <stdlib.h>
  3. extern int UNW_OBJ(dwarf_search_unwind_table) (unw_addr_space_t as,
  4. unw_word_t ip,
  5. unw_dyn_info_t *di,
  6. unw_proc_info_t *pi,
  7. int need_unwind_info, void *arg);
  8. #define dwarf_search_unwind_table UNW_OBJ(dwarf_search_unwind_table)
  9. static unw_accessors_t accessors;
  10. int main(void)
  11. {
  12. unw_addr_space_t addr_space;
  13. addr_space = unw_create_addr_space(&accessors, 0);
  14. if (addr_space)
  15. return 0;
  16. unw_init_remote(NULL, addr_space, NULL);
  17. dwarf_search_unwind_table(addr_space, 0, NULL, NULL, 0, NULL);
  18. return 0;
  19. }