├── .github └── workflows │ ├── CI-unix.yml │ └── CI-win.yml ├── .gitignore ├── AUTHORS ├── CMakeLists.txt ├── COPYING ├── ChangeLog ├── LICENSE ├── Makefile.am ├── NEWS ├── README ├── README.md ├── TODO ├── configure.ac ├── doc ├── Makefile.am ├── NOTES ├── _U_dyn_cancel.man ├── _U_dyn_cancel.tex ├── _U_dyn_register.man ├── _U_dyn_register.tex ├── common.tex.in ├── libunwind-dynamic.man ├── libunwind-dynamic.tex ├── libunwind-ia64.man ├── libunwind-ia64.tex ├── libunwind-ptrace.man ├── libunwind-ptrace.tex ├── libunwind-setjmp.man ├── libunwind-setjmp.tex ├── libunwind.man ├── libunwind.tex ├── libunwind.trans ├── unw_apply_reg_state.man ├── unw_apply_reg_state.tex ├── unw_backtrace.man ├── unw_backtrace.tex ├── unw_backtrace2.man ├── unw_create_addr_space.man ├── unw_create_addr_space.tex ├── unw_destroy_addr_space.man ├── unw_destroy_addr_space.tex ├── unw_flush_cache.man ├── unw_flush_cache.tex ├── unw_get_accessors.man ├── unw_get_accessors.tex ├── unw_get_fpreg.man ├── unw_get_fpreg.tex ├── unw_get_proc_info.man ├── unw_get_proc_info.tex ├── unw_get_proc_info_by_ip.man ├── unw_get_proc_info_by_ip.tex ├── unw_get_proc_info_in_range.man ├── unw_get_proc_info_in_range.tex ├── unw_get_proc_name.man ├── unw_get_proc_name.tex ├── unw_get_proc_name_by_ip.man ├── unw_get_proc_name_by_ip.tex ├── unw_get_reg.man ├── unw_get_reg.tex ├── unw_getcontext.man ├── unw_getcontext.tex ├── unw_init_local.man ├── unw_init_local.tex ├── unw_init_local2.man ├── unw_init_remote.man ├── unw_init_remote.tex ├── unw_is_fpreg.man ├── unw_is_fpreg.tex ├── unw_is_signal_frame.man ├── unw_is_signal_frame.tex ├── unw_reg_states_iterate.man ├── unw_reg_states_iterate.tex ├── unw_regname.man ├── unw_regname.tex ├── unw_resume.man ├── unw_resume.tex ├── unw_set_cache_size.man ├── unw_set_cache_size.tex ├── unw_set_caching_policy.man ├── unw_set_caching_policy.tex ├── unw_set_fpreg.man ├── unw_set_fpreg.tex ├── unw_set_reg.man ├── unw_set_reg.tex ├── unw_step.man ├── unw_step.tex ├── unw_strerror.man └── unw_strerror.tex ├── include ├── compiler.h ├── config.h.cmake.in ├── dwarf-eh.h ├── dwarf.h ├── dwarf_i.h ├── libunwind-aarch64.h ├── libunwind-arm.h ├── libunwind-common.h.in ├── libunwind-coredump.h ├── libunwind-dynamic.h ├── libunwind-hppa.h ├── libunwind-ia64.h ├── libunwind-loongarch64.h ├── libunwind-mips.h ├── libunwind-ppc32.h ├── libunwind-ppc64.h ├── libunwind-ptrace.h ├── libunwind-riscv.h ├── libunwind-s390x.h ├── libunwind-sh.h ├── libunwind-tilegx.h ├── libunwind-x86.h ├── libunwind-x86_64.h ├── libunwind.h.in ├── libunwind_i.h ├── mempool.h ├── remote.h ├── remote │ ├── elf.h │ ├── endian.h │ ├── freebsd-elf32.h │ ├── freebsd-elf64.h │ ├── freebsd-elf_common.h │ ├── mac │ │ └── ucontext.h │ └── win │ │ ├── fakestdalign.h.in │ │ ├── fakestdatomic.h.in │ │ ├── pthread.h │ │ ├── signal.h │ │ ├── sys │ │ ├── mman.h │ │ ├── stat.h │ │ ├── syscall.h │ │ ├── types.h │ │ └── ucontext.h │ │ ├── ucontext.h │ │ └── unistd.h ├── tdep-aarch64 │ ├── dwarf-config.h │ ├── jmpbuf.h │ └── libunwind_i.h ├── tdep-arm │ ├── dwarf-config.h │ ├── ex_tables.h │ ├── jmpbuf.h │ └── libunwind_i.h ├── tdep-hppa │ ├── dwarf-config.h │ ├── jmpbuf.h │ └── libunwind_i.h ├── tdep-ia64 │ ├── jmpbuf.h │ ├── libunwind_i.h │ ├── rse.h │ └── script.h ├── tdep-loongarch64 │ ├── dwarf-config.h │ ├── jmpbuf.h │ └── libunwind_i.h ├── tdep-mips │ ├── dwarf-config.h │ ├── jmpbuf.h │ └── libunwind_i.h ├── tdep-ppc32 │ ├── dwarf-config.h │ ├── jmpbuf.h │ └── libunwind_i.h ├── tdep-ppc64 │ ├── dwarf-config.h │ ├── jmpbuf.h │ └── libunwind_i.h ├── tdep-riscv │ ├── dwarf-config.h │ ├── jmpbuf.h │ └── libunwind_i.h ├── tdep-s390x │ ├── dwarf-config.h │ ├── jmpbuf.h │ └── libunwind_i.h ├── tdep-sh │ ├── dwarf-config.h │ ├── jmpbuf.h │ └── libunwind_i.h ├── tdep-tilegx │ ├── dwarf-config.h │ ├── jmpbuf.h │ └── libunwind_i.h ├── tdep-x86 │ ├── dwarf-config.h │ ├── jmpbuf.h │ └── libunwind_i.h ├── tdep-x86_64 │ ├── dwarf-config.h │ ├── jmpbuf.h │ └── libunwind_i.h ├── tdep │ ├── dwarf-config.h │ ├── jmpbuf.h │ └── libunwind_i.h.in ├── unwind.h └── x86 │ └── jmpbuf.h ├── scripts ├── kernel-diff.sh ├── kernel-files.txt ├── make-L-files └── qemu-test-driver ├── src ├── CMakeLists.txt ├── Makefile.am ├── aarch64 │ ├── Gapply_reg_state.c │ ├── Gcreate_addr_space.c │ ├── Gget_proc_info.c │ ├── Gget_save_loc.c │ ├── Gglobal.c │ ├── Ginit.c │ ├── Ginit_local.c │ ├── Ginit_remote.c │ ├── Gis_signal_frame.c │ ├── Greg_states_iterate.c │ ├── Gregs.c │ ├── Gresume.c │ ├── Gstash_frame.c │ ├── Gstep.c │ ├── Gtrace.c │ ├── Lapply_reg_state.c │ ├── Lcreate_addr_space.c │ ├── Lget_proc_info.c │ ├── Lget_save_loc.c │ ├── Lglobal.c │ ├── Linit.c │ ├── Linit_local.c │ ├── Linit_remote.c │ ├── Lis_signal_frame.c │ ├── Lreg_states_iterate.c │ ├── Lregs.c │ ├── Lresume.c │ ├── Lstash_frame.c │ ├── Lstep.c │ ├── Ltrace.c │ ├── gen-offsets.c │ ├── getcontext.S │ ├── init.h │ ├── is_fpreg.c │ ├── offsets.h │ ├── regname.c │ ├── siglongjmp.S │ └── unwind_i.h ├── arm │ ├── Gapply_reg_state.c │ ├── Gcreate_addr_space.c │ ├── Gex_tables.c │ ├── Gget_proc_info.c │ ├── Gget_save_loc.c │ ├── Gglobal.c │ ├── Ginit.c │ ├── Ginit_local.c │ ├── Ginit_remote.c │ ├── Gos-freebsd.c │ ├── Gos-linux.c │ ├── Gos-other.c │ ├── Greg_states_iterate.c │ ├── Gregs.c │ ├── Gresume.c │ ├── Gstash_frame.c │ ├── Gstep.c │ ├── Gtrace.c │ ├── Lapply_reg_state.c │ ├── Lcreate_addr_space.c │ ├── Lex_tables.c │ ├── Lget_proc_info.c │ ├── Lget_save_loc.c │ ├── Lglobal.c │ ├── Linit.c │ ├── Linit_local.c │ ├── Linit_remote.c │ ├── Lis_signal_frame.c │ ├── Los-freebsd.c │ ├── Los-linux.c │ ├── Los-other.c │ ├── Lreg_states_iterate.c │ ├── Lregs.c │ ├── Lresume.c │ ├── Lstash_frame.c │ ├── Lstep.c │ ├── Ltrace.c │ ├── gen-offsets.c │ ├── getcontext.S │ ├── init.h │ ├── is_fpreg.c │ ├── offsets.h │ ├── regname.c │ ├── siglongjmp.S │ └── unwind_i.h ├── coredump │ ├── README │ ├── _UCD_access_mem.c │ ├── _UCD_access_reg_freebsd.c │ ├── _UCD_access_reg_linux.c │ ├── _UCD_accessors.c │ ├── _UCD_corefile_elf.c │ ├── _UCD_create.c │ ├── _UCD_destroy.c │ ├── _UCD_elf_map_image.c │ ├── _UCD_find_proc_info.c │ ├── _UCD_get_mapinfo_generic.c │ ├── _UCD_get_mapinfo_linux.c │ ├── _UCD_get_proc_name.c │ ├── _UCD_get_threadinfo_prstatus.c │ ├── _UCD_internal.h │ ├── _UCD_lib.h │ ├── _UPT_access_fpreg.c │ ├── _UPT_elf.c │ ├── _UPT_get_dyn_info_list_addr.c │ ├── _UPT_put_unwind_info.c │ ├── _UPT_resume.c │ ├── libunwind-coredump.pc.in │ ├── ucd_file_table.c │ └── ucd_file_table.h ├── dl-iterate-phdr.c ├── dwarf │ ├── Gexpr.c │ ├── Gfde.c │ ├── Gfind_proc_info-lsb.c │ ├── Gfind_unwind_table.c │ ├── Gparser.c │ ├── Gpe.c │ ├── Lexpr.c │ ├── Lfde.c │ ├── Lfind_proc_info-lsb.c │ ├── Lfind_unwind_table.c │ ├── Lparser.c │ ├── Lpe.c │ └── global.c ├── elf32.c ├── elf32.h ├── elf64.c ├── elf64.h ├── elfxx.c ├── elfxx.h ├── hppa │ ├── Gapply_reg_state.c │ ├── Gcreate_addr_space.c │ ├── Gget_proc_info.c │ ├── Gget_save_loc.c │ ├── Gglobal.c │ ├── Ginit.c │ ├── Ginit_local.c │ ├── Ginit_remote.c │ ├── Gis_signal_frame.c │ ├── Greg_states_iterate.c │ ├── Gregs.c │ ├── Gresume.c │ ├── Gstep.c │ ├── Lapply_reg_state.c │ ├── Lcreate_addr_space.c │ ├── Lget_proc_info.c │ ├── Lget_save_loc.c │ ├── Lglobal.c │ ├── Linit.c │ ├── Linit_local.c │ ├── Linit_remote.c │ ├── Lis_signal_frame.c │ ├── Lreg_states_iterate.c │ ├── Lregs.c │ ├── Lresume.c │ ├── Lstep.c │ ├── get_accessors.c │ ├── getcontext.S │ ├── init.h │ ├── offsets.h │ ├── regname.c │ ├── setcontext.S │ ├── siglongjmp.S │ ├── tables.c │ └── unwind_i.h ├── ia64 │ ├── Gapply_reg_state.c │ ├── Gcreate_addr_space.c │ ├── Gfind_unwind_table.c │ ├── Gget_proc_info.c │ ├── Gget_save_loc.c │ ├── Gglobal.c │ ├── Ginit.c │ ├── Ginit_local.c │ ├── Ginit_remote.c │ ├── Ginstall_cursor.S │ ├── Gis_signal_frame.c │ ├── Gparser.c │ ├── Grbs.c │ ├── Greg_states_iterate.c │ ├── Gregs.c │ ├── Gresume.c │ ├── Gscript.c │ ├── Gstep.c │ ├── Gtables.c │ ├── Lapply_reg_state.c │ ├── Lcreate_addr_space.c │ ├── Lfind_unwind_table.c │ ├── Lget_proc_info.c │ ├── Lget_save_loc.c │ ├── Lglobal.c │ ├── Linit.c │ ├── Linit_local.c │ ├── Linit_remote.c │ ├── Linstall_cursor.S │ ├── Lis_signal_frame.c │ ├── Lparser.c │ ├── Lrbs.c │ ├── Lreg_states_iterate.c │ ├── Lregs.c │ ├── Lresume.c │ ├── Lscript.c │ ├── Lstep.c │ ├── Ltables.c │ ├── NOTES │ ├── dyn_info_list.S │ ├── getcontext.S │ ├── init.h │ ├── longjmp.S │ ├── mk_Gcursor_i.c │ ├── mk_Lcursor_i.c │ ├── mk_cursor_i │ ├── offsets.h │ ├── regname.c │ ├── regs.h │ ├── setjmp.S │ ├── siglongjmp.S │ ├── sigsetjmp.S │ ├── ucontext_i.h │ ├── unwind_decoder.h │ └── unwind_i.h ├── libunwind-generic.pc.in ├── loongarch64 │ ├── Gapply_reg_state.c │ ├── Gcreate_addr_space.c │ ├── Gget_proc_info.c │ ├── Gget_save_loc.c │ ├── Gglobal.c │ ├── Ginit.c │ ├── Ginit_local.c │ ├── Ginit_remote.c │ ├── Gis_signal_frame.c │ ├── Greg_states_iterate.c │ ├── Gregs.c │ ├── Gresume.c │ ├── Gstep.c │ ├── Lapply_reg_state.c │ ├── Lcreate_addr_space.c │ ├── Lget_proc_info.c │ ├── Lget_save_loc.c │ ├── Lglobal.c │ ├── Linit.c │ ├── Linit_local.c │ ├── Linit_remote.c │ ├── Lis_signal_frame.c │ ├── Lreg_states_iterate.c │ ├── Lregs.c │ ├── Lresume.c │ ├── Lstep.c │ ├── getcontext.S │ ├── init.h │ ├── is_fpreg.c │ ├── offsets.h │ ├── regname.c │ ├── siglongjmp.S │ └── unwind_i.h ├── mi │ ├── Gdestroy_addr_space.c │ ├── Gdyn-extract.c │ ├── Gdyn-remote.c │ ├── Gfind_dynamic_proc_info.c │ ├── Gget_accessors.c │ ├── Gget_fpreg.c │ ├── Gget_proc_info_by_ip.c │ ├── Gget_proc_info_in_range.c │ ├── Gget_proc_name.c │ ├── Gget_reg.c │ ├── Gput_dynamic_unwind_info.c │ ├── Gset_cache_size.c │ ├── Gset_caching_policy.c │ ├── Gset_fpreg.c │ ├── Gset_reg.c │ ├── Ldestroy_addr_space.c │ ├── Ldyn-extract.c │ ├── Ldyn-remote.c │ ├── Lfind_dynamic_proc_info.c │ ├── Lget_accessors.c │ ├── Lget_fpreg.c │ ├── Lget_proc_info_by_ip.c │ ├── Lget_proc_info_in_range.c │ ├── Lget_proc_name.c │ ├── Lget_reg.c │ ├── Lput_dynamic_unwind_info.c │ ├── Lset_cache_size.c │ ├── Lset_caching_policy.c │ ├── Lset_fpreg.c │ ├── Lset_reg.c │ ├── _ReadSLEB.c │ ├── _ReadULEB.c │ ├── backtrace.c │ ├── dyn-cancel.c │ ├── dyn-info-list.c │ ├── dyn-register.c │ ├── flush_cache.c │ ├── init.c │ ├── mempool.c │ └── strerror.c ├── mips │ ├── Gapply_reg_state.c │ ├── Gcreate_addr_space.c │ ├── Gget_proc_info.c │ ├── Gget_save_loc.c │ ├── Gglobal.c │ ├── Ginit.c │ ├── Ginit_local.c │ ├── Ginit_remote.c │ ├── Gis_signal_frame.c │ ├── Greg_states_iterate.c │ ├── Gregs.c │ ├── Gresume.c │ ├── Gstep.c │ ├── Lapply_reg_state.c │ ├── Lcreate_addr_space.c │ ├── Lget_proc_info.c │ ├── Lget_save_loc.c │ ├── Lglobal.c │ ├── Linit.c │ ├── Linit_local.c │ ├── Linit_remote.c │ ├── Lis_signal_frame.c │ ├── Lreg_states_iterate.c │ ├── Lregs.c │ ├── Lresume.c │ ├── Lstep.c │ ├── elfxx.c │ ├── gen-offsets.c │ ├── getcontext.S │ ├── init.h │ ├── is_fpreg.c │ ├── offsets.h │ ├── regname.c │ ├── siglongjmp.S │ └── unwind_i.h ├── os-freebsd.c ├── os-hpux.c ├── os-linux.c ├── os-linux.h ├── os-qnx.c ├── os-solaris.c ├── ppc │ ├── Gapply_reg_state.c │ ├── Gget_proc_info.c │ ├── Gget_save_loc.c │ ├── Ginit_local.c │ ├── Ginit_remote.c │ ├── Gis_signal_frame.c │ ├── Greg_states_iterate.c │ ├── Lapply_reg_state.c │ ├── Lget_proc_info.c │ ├── Lget_save_loc.c │ ├── Linit_local.c │ ├── Linit_remote.c │ ├── Lis_signal_frame.c │ ├── Lreg_states_iterate.c │ ├── longjmp.S │ └── siglongjmp.S ├── ppc32 │ ├── Gapply_reg_state.c │ ├── Gcreate_addr_space.c │ ├── Gglobal.c │ ├── Ginit.c │ ├── Greg_states_iterate.c │ ├── Gregs.c │ ├── Gresume.c │ ├── Gstep.c │ ├── Lapply_reg_state.c │ ├── Lcreate_addr_space.c │ ├── Lglobal.c │ ├── Linit.c │ ├── Lreg_states_iterate.c │ ├── Lregs.c │ ├── Lresume.c │ ├── Lstep.c │ ├── Make-arch.in │ ├── get_func_addr.c │ ├── init.h │ ├── is_fpreg.c │ ├── regname.c │ ├── ucontext_i.h │ └── unwind_i.h ├── ppc64 │ ├── Gapply_reg_state.c │ ├── Gcreate_addr_space.c │ ├── Gglobal.c │ ├── Ginit.c │ ├── Greg_states_iterate.c │ ├── Gregs.c │ ├── Gresume.c │ ├── Gstep.c │ ├── Lapply_reg_state.c │ ├── Lcreate_addr_space.c │ ├── Lglobal.c │ ├── Linit.c │ ├── Lreg_states_iterate.c │ ├── Lregs.c │ ├── Lresume.c │ ├── Lstep.c │ ├── get_func_addr.c │ ├── init.h │ ├── is_fpreg.c │ ├── regname.c │ ├── ucontext_i.h │ └── unwind_i.h ├── ptrace │ ├── _UPT_access_fpreg.c │ ├── _UPT_access_mem.c │ ├── _UPT_access_reg.c │ ├── _UPT_accessors.c │ ├── _UPT_create.c │ ├── _UPT_destroy.c │ ├── _UPT_elf.c │ ├── _UPT_find_proc_info.c │ ├── _UPT_get_dyn_info_list_addr.c │ ├── _UPT_get_proc_name.c │ ├── _UPT_internal.h │ ├── _UPT_put_unwind_info.c │ ├── _UPT_reg_offset.c │ ├── _UPT_resume.c │ └── libunwind-ptrace.pc.in ├── remote │ ├── mac │ │ └── missing-functions.c │ └── win │ │ └── missing-functions.c ├── riscv │ ├── Gapply_reg_state.c │ ├── Gcreate_addr_space.c │ ├── Gget_proc_info.c │ ├── Gget_save_loc.c │ ├── Gglobal.c │ ├── Ginit.c │ ├── Ginit_local.c │ ├── Ginit_remote.c │ ├── Gis_signal_frame.c │ ├── Greg_states_iterate.c │ ├── Gregs.c │ ├── Gresume.c │ ├── Gstep.c │ ├── Lapply_reg_state.c │ ├── Lcreate_addr_space.c │ ├── Lget_proc_info.c │ ├── Lget_save_loc.c │ ├── Lglobal.c │ ├── Linit.c │ ├── Linit_local.c │ ├── Linit_remote.c │ ├── Lis_signal_frame.c │ ├── Lreg_states_iterate.c │ ├── Lregs.c │ ├── Lresume.c │ ├── Lstep.c │ ├── asm.h │ ├── getcontext.S │ ├── init.h │ ├── is_fpreg.c │ ├── offsets.h │ ├── regname.c │ ├── setcontext.S │ ├── siglongjmp.S │ └── unwind_i.h ├── s390x │ ├── Gapply_reg_state.c │ ├── Gcreate_addr_space.c │ ├── Gget_proc_info.c │ ├── Gget_save_loc.c │ ├── Gglobal.c │ ├── Ginit.c │ ├── Ginit_local.c │ ├── Ginit_remote.c │ ├── Gis_signal_frame.c │ ├── Greg_states_iterate.c │ ├── Gregs.c │ ├── Gresume.c │ ├── Gstep.c │ ├── Lapply_reg_state.c │ ├── Lcreate_addr_space.c │ ├── Lget_proc_info.c │ ├── Lget_save_loc.c │ ├── Lglobal.c │ ├── Linit.c │ ├── Linit_local.c │ ├── Linit_remote.c │ ├── Lis_signal_frame.c │ ├── Lreg_states_iterate.c │ ├── Lregs.c │ ├── Lresume.c │ ├── Lstep.c │ ├── getcontext.S │ ├── init.h │ ├── is_fpreg.c │ ├── regname.c │ ├── setcontext.S │ └── unwind_i.h ├── setjmp │ ├── libunwind-setjmp.pc.in │ ├── longjmp.c │ ├── setjmp.c │ ├── setjmp_i.h │ ├── siglongjmp.c │ └── sigsetjmp.c ├── sh │ ├── Gapply_reg_state.c │ ├── Gcreate_addr_space.c │ ├── Gget_proc_info.c │ ├── Gget_save_loc.c │ ├── Gglobal.c │ ├── Ginit.c │ ├── Ginit_local.c │ ├── Ginit_remote.c │ ├── Gis_signal_frame.c │ ├── Greg_states_iterate.c │ ├── Gregs.c │ ├── Gresume.c │ ├── Gstep.c │ ├── Lapply_reg_state.c │ ├── Lcreate_addr_space.c │ ├── Lget_proc_info.c │ ├── Lget_save_loc.c │ ├── Lglobal.c │ ├── Linit.c │ ├── Linit_local.c │ ├── Linit_remote.c │ ├── Lis_signal_frame.c │ ├── Lreg_states_iterate.c │ ├── Lregs.c │ ├── Lresume.c │ ├── Lstep.c │ ├── gen-offsets.c │ ├── init.h │ ├── is_fpreg.c │ ├── offsets.h │ ├── regname.c │ ├── siglongjmp.S │ └── unwind_i.h ├── tilegx │ ├── Gapply_reg_state.c │ ├── Gcreate_addr_space.c │ ├── Gget_proc_info.c │ ├── Gget_save_loc.c │ ├── Gglobal.c │ ├── Ginit.c │ ├── Ginit_local.c │ ├── Ginit_remote.c │ ├── Gis_signal_frame.c │ ├── Greg_states_iterate.c │ ├── Gregs.c │ ├── Gresume.c │ ├── Gstep.c │ ├── Lapply_reg_state.c │ ├── Lcreate_addr_space.c │ ├── Lget_proc_info.c │ ├── Lget_save_loc.c │ ├── Lglobal.c │ ├── Linit.c │ ├── Linit_local.c │ ├── Linit_remote.c │ ├── Lis_signal_frame.c │ ├── Lreg_states_iterate.c │ ├── Lregs.c │ ├── Lresume.c │ ├── Lstep.c │ ├── elfxx.c │ ├── gen-offsets.c │ ├── getcontext.S │ ├── init.h │ ├── is_fpreg.c │ ├── offsets.h │ ├── regname.c │ ├── siglongjmp.S │ └── unwind_i.h ├── unwind │ ├── Backtrace.c │ ├── DeleteException.c │ ├── FindEnclosingFunction.c │ ├── ForcedUnwind.c │ ├── GetBSP.c │ ├── GetCFA.c │ ├── GetDataRelBase.c │ ├── GetGR.c │ ├── GetIP.c │ ├── GetIPInfo.c │ ├── GetLanguageSpecificData.c │ ├── GetRegionStart.c │ ├── GetTextRelBase.c │ ├── RaiseException.c │ ├── Resume.c │ ├── Resume_or_Rethrow.c │ ├── SetGR.c │ ├── SetIP.c │ ├── libunwind.pc.in │ └── unwind-internal.h ├── x86 │ ├── Gapply_reg_state.c │ ├── Gcreate_addr_space.c │ ├── Gget_proc_info.c │ ├── Gget_save_loc.c │ ├── Gglobal.c │ ├── Ginit.c │ ├── Ginit_local.c │ ├── Ginit_remote.c │ ├── Gos-freebsd.c │ ├── Gos-linux.c │ ├── Greg_states_iterate.c │ ├── Gregs.c │ ├── Gresume.c │ ├── Gstep.c │ ├── Lapply_reg_state.c │ ├── Lcreate_addr_space.c │ ├── Lget_proc_info.c │ ├── Lget_save_loc.c │ ├── Lglobal.c │ ├── Linit.c │ ├── Linit_local.c │ ├── Linit_remote.c │ ├── Los-freebsd.c │ ├── Los-linux.c │ ├── Lreg_states_iterate.c │ ├── Lregs.c │ ├── Lresume.c │ ├── Lstep.c │ ├── getcontext-freebsd.S │ ├── getcontext-linux.S │ ├── init.h │ ├── is_fpreg.c │ ├── longjmp.S │ ├── offsets.h │ ├── regname.c │ ├── siglongjmp.S │ └── unwind_i.h └── x86_64 │ ├── Gapply_reg_state.c │ ├── Gcreate_addr_space.c │ ├── Gget_proc_info.c │ ├── Gget_save_loc.c │ ├── Gglobal.c │ ├── Ginit.c │ ├── Ginit_local.c │ ├── Ginit_remote.c │ ├── Gos-freebsd.c │ ├── Gos-linux.c │ ├── Gos-solaris.c │ ├── Greg_states_iterate.c │ ├── Gregs.c │ ├── Gresume.c │ ├── Gstash_frame.c │ ├── Gstep.c │ ├── Gtrace.c │ ├── Lapply_reg_state.c │ ├── Lcreate_addr_space.c │ ├── Lget_proc_info.c │ ├── Lget_save_loc.c │ ├── Lglobal.c │ ├── Linit.c │ ├── Linit_local.c │ ├── Linit_remote.c │ ├── Los-freebsd.c │ ├── Los-linux.c │ ├── Los-solaris.c │ ├── Lreg_states_iterate.c │ ├── Lregs.c │ ├── Lresume.c │ ├── Lstash_frame.c │ ├── Lstep.c │ ├── Ltrace.c │ ├── getcontext.S │ ├── init.h │ ├── is_fpreg.c │ ├── longjmp.S │ ├── offsets.h │ ├── regname.c │ ├── setcontext.S │ ├── siglongjmp.S │ ├── ucontext_i.h │ └── unwind_i.h └── tests ├── Garm64-test-sve-signal.c ├── Gia64-test-nat.c ├── Gia64-test-rbs.c ├── Gia64-test-readonly.c ├── Gia64-test-stack.c ├── Gperf-simple.c ├── Gperf-trace.c ├── Gtest-bt.c ├── Gtest-concurrent.c ├── Gtest-dyn1.c ├── Gtest-exc.c ├── Gtest-init.cxx ├── Gtest-nomalloc.c ├── Gtest-resume-sig-rt.c ├── Gtest-resume-sig.c ├── Gtest-trace.c ├── Gx64-test-dwarf-expressions.c ├── Larm64-test-sve-signal.c ├── Lia64-test-nat.c ├── Lia64-test-rbs.c ├── Lia64-test-readonly.c ├── Lia64-test-stack.c ├── Lperf-simple.c ├── Lperf-trace.c ├── Lrs-race.c ├── Ltest-bt.c ├── Ltest-concurrent.c ├── Ltest-cxx-exceptions.cxx ├── Ltest-dyn1.c ├── Ltest-exc.c ├── Ltest-init-local-signal-lib.c ├── Ltest-init-local-signal.c ├── Ltest-init.cxx ├── Ltest-mem-validate.c ├── Ltest-nocalloc.c ├── Ltest-nomalloc.c ├── Ltest-resume-sig-rt.c ├── Ltest-resume-sig.c ├── Ltest-trace.c ├── Ltest-varargs.c ├── Lx64-test-dwarf-expressions.c ├── Makefile.am ├── check-namespace.sh.in ├── crasher.c ├── flush-cache.S ├── flush-cache.h ├── forker.c ├── ia64-dyn-asm.S ├── ia64-test-dyn1.c ├── ia64-test-nat-asm.S ├── ia64-test-rbs-asm.S ├── ia64-test-rbs.h ├── ia64-test-readonly-asm.S ├── ia64-test-setjmp.c ├── ia64-test-sig.c ├── ia64-test-stack-asm.S ├── ia64-test-stack.h ├── ident.c ├── mapper.c ├── perf-startup ├── ppc64-test-altivec-utils.c ├── ppc64-test-altivec.c ├── run-check-namespace ├── run-coredump-unwind ├── run-coredump-unwind-mdi ├── run-ia64-test-dyn1 ├── run-ptrace-mapper ├── run-ptrace-misc ├── test-async-sig.c ├── test-coredump-unwind.c ├── test-flush-cache.c ├── test-init-remote.c ├── test-mem.c ├── test-proc-info.c ├── test-ptrace-misc.c ├── test-ptrace.c ├── test-reg-state.c ├── test-setjmp.c ├── test-static-link-gen.c ├── test-static-link-loc.c ├── test-strerror.c ├── x64-test-dwarf-expressions.S └── x64-unwind-badjmp-signal-frame.c /.github/workflows/CI-win.yml: -------------------------------------------------------------------------------- 1 | name: CI - Windows 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - '**' 7 | - '!README' 8 | - '!INSTALL' 9 | - '!NEWS' 10 | - '!doc/**' 11 | - '!.**' 12 | - '.github/workflows/CI-win.yml' 13 | push: 14 | branches: 15 | - v[0-9].* 16 | - master 17 | 18 | jobs: 19 | build-windows: 20 | runs-on: windows-${{ matrix.config.server }} 21 | name: build ${{ matrix.config.TARGET }} 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | config: 26 | - {toolchain: Visual Studio 17 2022, arch: Win32, server: 2022, TARGET: arm-linux-gnueabihf} 27 | - {toolchain: Visual Studio 17 2022, arch: x64, server: 2022, TARGET: aarch64-linux-gnu} 28 | - {toolchain: Visual Studio 17 2022, arch: x64, server: 2022, TARGET: x86_64-linux-gnu} 29 | steps: 30 | - uses: actions/checkout@v2 31 | - name: Build 32 | shell: cmd 33 | env: 34 | TARGET: ${{ matrix.config.TARGET }} 35 | run: | 36 | cmake -G "${{ matrix.config.toolchain }}" -A ${{ matrix.config.arch }} -S . -B bin/windows-${{ matrix.config.arch }}/${{ matrix.config.TARGET }} 37 | cmake --build bin/windows-${{ matrix.config.arch }}/${{ matrix.config.TARGET }} 38 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | David Mosberger 2 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002 Hewlett-Packard Co. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | *********************************************************** 2 | 3 | Discontinued. See git log instead at 4 | 5 | https://github.com/libunwind/libunwind/commits/master 6 | 7 | *********************************************************** 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining 2 | a copy of this software and associated documentation files (the 3 | "Software"), to deal in the Software without restriction, including 4 | without limitation the rights to use, copy, modify, merge, publish, 5 | distribute, sublicense, and/or sell copies of the Software, and to 6 | permit persons to whom the Software is furnished to do so, subject to 7 | the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be 10 | included in all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 13 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 14 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 16 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 17 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 18 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | README -------------------------------------------------------------------------------- /doc/_U_dyn_cancel.man: -------------------------------------------------------------------------------- 1 | '\" t 2 | .\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007 3 | .\" NOTE: This file is generated, DO NOT EDIT. 4 | .de Vb 5 | .ft CW 6 | .nf 7 | .. 8 | .de Ve 9 | .ft R 10 | 11 | .fi 12 | .. 13 | .TH "\\_U\\_DYN\\_CANCEL" "3" "16 August 2007" "Programming Library " "Programming Library " 14 | .SH NAME 15 | _U_dyn_cancel 16 | \-\- cancel unwind\-info for dynamically generated code 17 | .PP 18 | .SH SYNOPSIS 19 | 20 | .PP 21 | #include 22 | .br 23 | .PP 24 | void 25 | _U_dyn_cancel(unw_dyn_info_t *di); 26 | .br 27 | .PP 28 | .SH DESCRIPTION 29 | 30 | .PP 31 | The _U_dyn_cancel() 32 | routine cancels the registration of the 33 | unwind\-info for a dynamically generated procedure. Argument di 34 | is the pointer to the unw_dyn_info_t 35 | structure that 36 | describes the procedure\&'s unwind\-info. 37 | .PP 38 | The _U_dyn_cancel() 39 | routine is guaranteed to execute in 40 | constant time (in the absence of contention from concurrent calls to 41 | _U_dyn_register() 42 | or _U_dyn_cancel()). 43 | .PP 44 | .SH THREAD AND SIGNAL SAFETY 45 | 46 | .PP 47 | _U_dyn_cancel() 48 | is thread\-safe but \fInot\fP 49 | safe to use 50 | from a signal handler. 51 | .PP 52 | .SH SEE ALSO 53 | 54 | .PP 55 | libunwind\-dynamic(3), 56 | _U_dyn_register(3) 57 | .PP 58 | .SH AUTHOR 59 | 60 | .PP 61 | David Mosberger\-Tang 62 | .br 63 | Email: \fBdmosberger@gmail.com\fP 64 | .br 65 | WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&. 66 | .\" NOTE: This file is generated, DO NOT EDIT. 67 | -------------------------------------------------------------------------------- /doc/_U_dyn_cancel.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage[fancyhdr,pdf]{latex2man} 3 | 4 | \input{common.tex} 5 | 6 | \begin{document} 7 | 8 | \begin{Name}{3}{\_U\_dyn\_cancel}{David Mosberger-Tang}{Programming Library}{\_U\_dyn\_cancel}\_U\_dyn\_cancel -- cancel unwind-info for dynamically generated code 9 | \end{Name} 10 | 11 | \section{Synopsis} 12 | 13 | \File{\#include $<$libunwind.h$>$}\\ 14 | 15 | \Type{void} \Func{\_U\_dyn\_cancel}(\Type{unw\_dyn\_info\_t~*}\Var{di});\\ 16 | 17 | \section{Description} 18 | 19 | The \Func{\_U\_dyn\_cancel}() routine cancels the registration of the 20 | unwind-info for a dynamically generated procedure. Argument \Var{di} 21 | is the pointer to the \Type{unw\_dyn\_info\_t} structure that 22 | describes the procedure's unwind-info. 23 | 24 | The \Func{\_U\_dyn\_cancel}() routine is guaranteed to execute in 25 | constant time (in the absence of contention from concurrent calls to 26 | \Func{\_U\_dyn\_register}() or \Func{\_U\_dyn\_cancel}()). 27 | 28 | 29 | \section{Thread and Signal Safety} 30 | 31 | \Func{\_U\_dyn\_cancel}() is thread-safe but \emph{not} safe to use 32 | from a signal handler. 33 | 34 | \section{See Also} 35 | 36 | \SeeAlso{libunwind-dynamic(3)}, \SeeAlso{\_U\_dyn\_register(3)} 37 | 38 | \section{Author} 39 | 40 | \noindent 41 | David Mosberger-Tang\\ 42 | Email: \Email{dmosberger@gmail.com}\\ 43 | WWW: \URL{http://www.nongnu.org/libunwind/}. 44 | \LatexManEnd 45 | 46 | \end{document} 47 | -------------------------------------------------------------------------------- /doc/_U_dyn_register.man: -------------------------------------------------------------------------------- 1 | '\" t 2 | .\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007 3 | .\" NOTE: This file is generated, DO NOT EDIT. 4 | .de Vb 5 | .ft CW 6 | .nf 7 | .. 8 | .de Ve 9 | .ft R 10 | 11 | .fi 12 | .. 13 | .TH "\\_U\\_DYN\\_REGISTER" "3" "16 August 2007" "Programming Library " "Programming Library " 14 | .SH NAME 15 | _U_dyn_register 16 | \-\- register unwind\-info for dynamically generated code 17 | .PP 18 | .SH SYNOPSIS 19 | 20 | .PP 21 | #include 22 | .br 23 | .PP 24 | void 25 | _U_dyn_register(unw_dyn_info_t *di); 26 | .br 27 | .PP 28 | .SH DESCRIPTION 29 | 30 | .PP 31 | The _U_dyn_register() 32 | routine registers unwind\-info for a 33 | dynamically generated procedure. The procedure\&'s unwind\-info is 34 | described by a structure of type unw_dyn_info_t 35 | (see 36 | libunwind\-dynamic(3)). 37 | A pointer to this structure is 38 | passed in argument di\&. 39 | .PP 40 | The _U_dyn_register() 41 | routine is guaranteed to execute in 42 | constant time (in the absence of contention from concurrent calls to 43 | _U_dyn_register() 44 | or _U_dyn_cancel()). 45 | .PP 46 | .SH THREAD AND SIGNAL SAFETY 47 | 48 | .PP 49 | _U_dyn_register() 50 | is thread\-safe but \fInot\fP 51 | safe to use 52 | from a signal handler. 53 | .PP 54 | .SH SEE ALSO 55 | 56 | .PP 57 | libunwind\-dynamic(3), 58 | _U_dyn_cancel(3) 59 | .PP 60 | .SH AUTHOR 61 | 62 | .PP 63 | David Mosberger\-Tang 64 | .br 65 | Email: \fBdmosberger@gmail.com\fP 66 | .br 67 | WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&. 68 | .\" NOTE: This file is generated, DO NOT EDIT. 69 | -------------------------------------------------------------------------------- /doc/_U_dyn_register.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage[fancyhdr,pdf]{latex2man} 3 | 4 | \input{common.tex} 5 | 6 | \begin{document} 7 | 8 | \begin{Name}{3}{\_U\_dyn\_register}{David Mosberger-Tang}{Programming Library}{\_U\_dyn\_register}\_U\_dyn\_register -- register unwind-info for dynamically generated code 9 | \end{Name} 10 | 11 | \section{Synopsis} 12 | 13 | \File{\#include $<$libunwind.h$>$}\\ 14 | 15 | \Type{void} \Func{\_U\_dyn\_register}(\Type{unw\_dyn\_info\_t~*}\Var{di});\\ 16 | 17 | \section{Description} 18 | 19 | The \Func{\_U\_dyn\_register}() routine registers unwind-info for a 20 | dynamically generated procedure. The procedure's unwind-info is 21 | described by a structure of type \Type{unw\_dyn\_info\_t} (see 22 | \SeeAlso{libunwind-dynamic(3)}). A pointer to this structure is 23 | passed in argument \Var{di}. 24 | 25 | The \Func{\_U\_dyn\_register}() routine is guaranteed to execute in 26 | constant time (in the absence of contention from concurrent calls to 27 | \Func{\_U\_dyn\_register}() or \Func{\_U\_dyn\_cancel}()). 28 | 29 | 30 | \section{Thread and Signal Safety} 31 | 32 | \Func{\_U\_dyn\_register}() is thread-safe but \emph{not} safe to use 33 | from a signal handler. 34 | 35 | \section{See Also} 36 | 37 | \SeeAlso{libunwind-dynamic(3)}, \SeeAlso{\_U\_dyn\_cancel(3)} 38 | 39 | \section{Author} 40 | 41 | \noindent 42 | David Mosberger-Tang\\ 43 | Email: \Email{dmosberger@gmail.com}\\ 44 | WWW: \URL{http://www.nongnu.org/libunwind/}. 45 | \LatexManEnd 46 | 47 | \end{document} 48 | -------------------------------------------------------------------------------- /doc/common.tex.in: -------------------------------------------------------------------------------- 1 | \setVersion{@VERSION@} 2 | 3 | \sloppy 4 | 5 | \newcommand{\Lt}{\symbol{"3C}} 6 | \newcommand{\Gt}{\symbol{"3E}} 7 | \newcommand{\Type}[1]{\File{#1}} % see libunwind.trans 8 | \newcommand{\Func}[1]{\Prog{#1}} % see libunwind.trans 9 | \newcommand{\Var}[1]{\Prog{#1}} % see libunwind.trans 10 | \newcommand{\Const}[1]{\File{#1}} % see libunwind.trans 11 | \newcommand{\SeeAlso}[2]{\File{#1}} % see libunwind.trans 12 | -------------------------------------------------------------------------------- /doc/libunwind.trans: -------------------------------------------------------------------------------- 1 | $manMacro1a{'Type'} = $manMacro1a{File}; 2 | $manMacro1b{'Type'} = $manMacro1b{File}; 3 | $htmlMacro1a{'Type'} = $htmlMacro1a{File}; 4 | $htmlMacro1b{'Type'} = $htmlMacro1b{File}; 5 | $texiMacro1a{'Type'} = $texiMacro1a{File}; 6 | $texiMacro1b{'Type'} = $texiMacro1b{File}; 7 | $manMacro1a{'Func'} = $manMacro1a{Prog}; 8 | $manMacro1b{'Func'} = $manMacro1b{Prog}; 9 | $htmlMacro1a{'Func'} = $htmlMacro1a{Arg}; 10 | $htmlMacro1b{'Func'} = $htmlMacro1b{Arg}; 11 | $texiMacro1a{'Func'} = $texiMacro1a{Prog}; 12 | $texiMacro1b{'Func'} = $texiMacro1b{Prog}; 13 | $manMacro1a{'Var'} = $manMacro1a{Prog}; 14 | $manMacro1b{'Var'} = $manMacro1b{Prog}; 15 | $htmlMacro1a{'Var'} = $htmlMacro1a{Prog}; 16 | $htmlMacro1b{'Var'} = $htmlMacro1b{Prog}; 17 | $texiMacro1a{'Var'} = $texiMacro1a{Prog}; 18 | $texiMacro1b{'Var'} = $texiMacro1b{Prog}; 19 | $manMacro1a{'Const'} = $manMacro1a{File}; 20 | $manMacro1b{'Const'} = $manMacro1b{File}; 21 | $htmlMacro1a{'Const'} = $htmlMacro1a{File}; 22 | $htmlMacro1b{'Const'} = $htmlMacro1b{File}; 23 | $texiMacro1a{'Const'} = $texiMacro1a{File}; 24 | $texiMacro1b{'Const'} = $texiMacro1b{File}; 25 | 26 | $manMacro1a{'SeeAlso'} = $manMacro1a{File}; 27 | $manMacro1b{'SeeAlso'} = $manMacro1b{File}; 28 | # special handling of SeeAlso in latex2man, so that argument gets doubled: 29 | $htmlMacro2a{'SeeAlso'} = "$htmlMacro1a{File}"; 31 | $htmlMacro2c{'SeeAlso'} = "$htmlMacro1b{File}"; 32 | $texiMacro1a{'SeeAlso'} = $texiMacro1a{File}; 33 | $texiMacro1b{'SeeAlso'} = $texiMacro1b{File}; 34 | 35 | -------------------------------------------------------------------------------- /doc/unw_backtrace2.man: -------------------------------------------------------------------------------- 1 | .so man3/unw_backtrace.3 2 | -------------------------------------------------------------------------------- /doc/unw_destroy_addr_space.man: -------------------------------------------------------------------------------- 1 | '\" t 2 | .\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007 3 | .\" NOTE: This file is generated, DO NOT EDIT. 4 | .de Vb 5 | .ft CW 6 | .nf 7 | .. 8 | .de Ve 9 | .ft R 10 | 11 | .fi 12 | .. 13 | .TH "UNW\\_DESTROY\\_ADDR\\_SPACE" "3" "16 August 2007" "Programming Library " "Programming Library " 14 | .SH NAME 15 | unw_destroy_addr_space 16 | \-\- destroy unwind address space 17 | .PP 18 | .SH SYNOPSIS 19 | 20 | .PP 21 | #include 22 | .br 23 | .PP 24 | void 25 | unw_destroy_addr_space(unw_addr_space_t 26 | as); 27 | .br 28 | .PP 29 | .SH DESCRIPTION 30 | 31 | .PP 32 | The unw_destroy_addr_space() 33 | routine destroys the 34 | address space specified by argument as 35 | and thereby releases 36 | all associated resources (such as memory). 37 | .PP 38 | Applications must not destroy the local address space 39 | unw_local_addr_space\&. 40 | Attempting to do so results in 41 | undefined behavior (e.g., the application may crash). 42 | .PP 43 | .SH SEE ALSO 44 | 45 | .PP 46 | libunwind(3), 47 | unw_create_addr_space(3) 48 | .PP 49 | .SH AUTHOR 50 | 51 | .PP 52 | David Mosberger\-Tang 53 | .br 54 | Email: \fBdmosberger@gmail.com\fP 55 | .br 56 | WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&. 57 | .\" NOTE: This file is generated, DO NOT EDIT. 58 | -------------------------------------------------------------------------------- /doc/unw_destroy_addr_space.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage[fancyhdr,pdf]{latex2man} 3 | 4 | \input{common.tex} 5 | 6 | \begin{document} 7 | 8 | \begin{Name}{3}{unw\_destroy\_addr\_space}{David Mosberger-Tang}{Programming Library}{unw\_destroy\_addr\_space}unw\_destroy\_addr\_space -- destroy unwind address space 9 | \end{Name} 10 | 11 | \section{Synopsis} 12 | 13 | \File{\#include $<$libunwind.h$>$}\\ 14 | 15 | \Type{void} \Func{unw\_destroy\_addr\_space}(\Type{unw\_addr\_space\_t} \Var{as});\\ 16 | 17 | \section{Description} 18 | 19 | The \Func{unw\_destroy\_addr\_space}() routine destroys the 20 | address space specified by argument \Var{as} and thereby releases 21 | all associated resources (such as memory). 22 | 23 | Applications must not destroy the local address space 24 | \Var{unw\_local\_addr\_space}. Attempting to do so results in 25 | undefined behavior (e.g., the application may crash). 26 | 27 | \section{See Also} 28 | 29 | \SeeAlso{libunwind(3)}, 30 | \SeeAlso{unw\_create\_addr\_space(3)} 31 | 32 | \section{Author} 33 | 34 | \noindent 35 | David Mosberger-Tang\\ 36 | Email: \Email{dmosberger@gmail.com}\\ 37 | WWW: \URL{http://www.nongnu.org/libunwind/}. 38 | \LatexManEnd 39 | 40 | \end{document} 41 | -------------------------------------------------------------------------------- /doc/unw_init_local2.man: -------------------------------------------------------------------------------- 1 | .so man3/unw_init_local.3 2 | -------------------------------------------------------------------------------- /doc/unw_is_fpreg.man: -------------------------------------------------------------------------------- 1 | '\" t 2 | .\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007 3 | .\" NOTE: This file is generated, DO NOT EDIT. 4 | .de Vb 5 | .ft CW 6 | .nf 7 | .. 8 | .de Ve 9 | .ft R 10 | 11 | .fi 12 | .. 13 | .TH "UNW\\_IS\\_FPREG" "3" "16 August 2007" "Programming Library " "Programming Library " 14 | .SH NAME 15 | unw_is_fpreg 16 | \-\- check if a register is a floating\-point register 17 | .PP 18 | .SH SYNOPSIS 19 | 20 | .PP 21 | #include 22 | .br 23 | .PP 24 | int 25 | unw_is_fpreg(unw_regnum_t 26 | reg); 27 | .br 28 | .PP 29 | .SH DESCRIPTION 30 | 31 | .PP 32 | The unw_is_fpreg() 33 | routine checks whether register number 34 | reg 35 | is a floating\-point register. 36 | .PP 37 | This routine is normally implemented as a macro and applications 38 | should not attempt to take its address. 39 | .PP 40 | .SH RETURN VALUE 41 | 42 | .PP 43 | The unw_is_fpreg() 44 | routine returns a non\-zero value if 45 | reg 46 | is a floating\-point register. Otherwise, it returns a value 47 | of 0. 48 | .PP 49 | .SH THREAD AND SIGNAL SAFETY 50 | 51 | .PP 52 | unw_is_fpreg() 53 | is thread\-safe as well as safe to use 54 | from a signal handler. 55 | .PP 56 | .SH SEE ALSO 57 | 58 | .PP 59 | libunwind(3), 60 | unw_get_reg(3), 61 | unw_set_reg(3), 62 | unw_get_fpreg(3), 63 | unw_set_fpreg(3) 64 | .PP 65 | .SH AUTHOR 66 | 67 | .PP 68 | David Mosberger\-Tang 69 | .br 70 | Email: \fBdmosberger@gmail.com\fP 71 | .br 72 | WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&. 73 | .\" NOTE: This file is generated, DO NOT EDIT. 74 | -------------------------------------------------------------------------------- /doc/unw_is_fpreg.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage[fancyhdr,pdf]{latex2man} 3 | 4 | \input{common.tex} 5 | 6 | \begin{document} 7 | 8 | \begin{Name}{3}{unw\_is\_fpreg}{David Mosberger-Tang}{Programming Library}{unw\_is\_fpreg}unw\_is\_fpreg -- check if a register is a floating-point register 9 | \end{Name} 10 | 11 | \section{Synopsis} 12 | 13 | \File{\#include $<$libunwind.h$>$}\\ 14 | 15 | \Type{int} \Func{unw\_is\_fpreg}(\Type{unw\_regnum\_t} \Var{reg});\\ 16 | 17 | \section{Description} 18 | 19 | The \Func{unw\_is\_fpreg}() routine checks whether register number 20 | \Var{reg} is a floating-point register. 21 | 22 | This routine is normally implemented as a macro and applications 23 | should not attempt to take its address. 24 | 25 | \section{Return Value} 26 | 27 | The \Func{unw\_is\_fpreg}() routine returns a non-zero value if 28 | \Var{reg} is a floating-point register. Otherwise, it returns a value 29 | of 0. 30 | 31 | \section{Thread and Signal Safety} 32 | 33 | \Func{unw\_is\_fpreg}() is thread-safe as well as safe to use 34 | from a signal handler. 35 | 36 | \section{See Also} 37 | 38 | \SeeAlso{libunwind(3)}, 39 | \SeeAlso{unw\_get\_reg(3)}, 40 | \SeeAlso{unw\_set\_reg(3)}, 41 | \SeeAlso{unw\_get\_fpreg(3)}, 42 | \SeeAlso{unw\_set\_fpreg(3)} 43 | 44 | \section{Author} 45 | 46 | \noindent 47 | David Mosberger-Tang\\ 48 | Email: \Email{dmosberger@gmail.com}\\ 49 | WWW: \URL{http://www.nongnu.org/libunwind/}. 50 | \LatexManEnd 51 | 52 | \end{document} 53 | -------------------------------------------------------------------------------- /doc/unw_regname.man: -------------------------------------------------------------------------------- 1 | '\" t 2 | .\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007 3 | .\" NOTE: This file is generated, DO NOT EDIT. 4 | .de Vb 5 | .ft CW 6 | .nf 7 | .. 8 | .de Ve 9 | .ft R 10 | 11 | .fi 12 | .. 13 | .TH "UNW\\_REGNAME" "3" "16 August 2007" "Programming Library " "Programming Library " 14 | .SH NAME 15 | unw_regname 16 | \-\- get register name 17 | .PP 18 | .SH SYNOPSIS 19 | 20 | .PP 21 | #include 22 | .br 23 | .PP 24 | const char *unw_regname(unw_regnum_t 25 | regnum); 26 | .br 27 | .PP 28 | .SH DESCRIPTION 29 | 30 | .PP 31 | The unw_regname() 32 | routine returns a printable name for 33 | register regnum\&. 34 | If regnum 35 | is an invalid or otherwise 36 | unrecognized register number, a string consisting of three question 37 | marks is returned. The returned string is statically allocated and 38 | therefore guaranteed to remain valid until the application terminates. 39 | .PP 40 | .SH RETURN VALUE 41 | 42 | .PP 43 | The unw_regname() 44 | routine cannot fail and always returns a 45 | valid (non\-NULL) 46 | string. 47 | .PP 48 | .SH THREAD AND SIGNAL SAFETY 49 | 50 | .PP 51 | The unw_regname() 52 | routine is thread\-safe as well as safe to 53 | use from a signal handler. 54 | .PP 55 | .SH SEE ALSO 56 | 57 | .PP 58 | libunwind(3) 59 | .PP 60 | .SH AUTHOR 61 | 62 | .PP 63 | David Mosberger\-Tang 64 | .br 65 | Email: \fBdmosberger@gmail.com\fP 66 | .br 67 | WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&. 68 | .\" NOTE: This file is generated, DO NOT EDIT. 69 | -------------------------------------------------------------------------------- /doc/unw_regname.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage[fancyhdr,pdf]{latex2man} 3 | 4 | \input{common.tex} 5 | 6 | \begin{document} 7 | 8 | \begin{Name}{3}{unw\_regname}{David Mosberger-Tang}{Programming Library}{unw\_regname}unw\_regname -- get register name 9 | \end{Name} 10 | 11 | \section{Synopsis} 12 | 13 | \File{\#include $<$libunwind.h$>$}\\ 14 | 15 | \Type{const char~*}\Func{unw\_regname}(\Type{unw\_regnum\_t} \Var{regnum});\\ 16 | 17 | \section{Description} 18 | 19 | The \Func{unw\_regname}() routine returns a printable name for 20 | register \Var{regnum}. If \Var{regnum} is an invalid or otherwise 21 | unrecognized register number, a string consisting of three question 22 | marks is returned. The returned string is statically allocated and 23 | therefore guaranteed to remain valid until the application terminates. 24 | 25 | \section{Return Value} 26 | 27 | The \Func{unw\_regname}() routine cannot fail and always returns a 28 | valid (non-\Const{NULL}) string. 29 | 30 | \section{Thread and Signal Safety} 31 | 32 | The \Func{unw\_regname}() routine is thread-safe as well as safe to 33 | use from a signal handler. 34 | 35 | \section{See Also} 36 | 37 | \SeeAlso{libunwind(3)} 38 | 39 | \section{Author} 40 | 41 | \noindent 42 | David Mosberger-Tang\\ 43 | Email: \Email{dmosberger@gmail.com}\\ 44 | WWW: \URL{http://www.nongnu.org/libunwind/}. 45 | \LatexManEnd 46 | 47 | \end{document} 48 | -------------------------------------------------------------------------------- /doc/unw_strerror.man: -------------------------------------------------------------------------------- 1 | '\" t 2 | .\" Manual page created with latex2man on Wed Aug 18 16:51:29 CEST 2004 3 | .\" NOTE: This file is generated, DO NOT EDIT. 4 | .de Vb 5 | .ft CW 6 | .nf 7 | .. 8 | .de Ve 9 | .ft R 10 | 11 | .fi 12 | .. 13 | .TH "UNW\\_STRERROR" "3" "18 August 2004" "Programming Library " "Programming Library " 14 | .SH NAME 15 | unw_strerror 16 | \-\- get text corresponding to error code 17 | .PP 18 | .SH SYNOPSIS 19 | 20 | .PP 21 | #include 22 | .br 23 | .PP 24 | const char * 25 | unw_strerror(int 26 | err_code); 27 | .br 28 | .PP 29 | .SH DESCRIPTION 30 | 31 | .PP 32 | The unw_strerror() 33 | routine maps the (negative) err_code 34 | to a corresponding text message and returns it. 35 | .PP 36 | .SH RETURN VALUE 37 | 38 | .PP 39 | The message that corresponds to err_code 40 | or, if the 41 | err_code 42 | has no corresponding message, the text "invalid error 43 | code". 44 | .PP 45 | .SH THREAD AND SIGNAL SAFETY 46 | 47 | .PP 48 | unw_strerror() 49 | is thread\-safe as well as safe to use 50 | from a signal handler. 51 | .PP 52 | .SH AUTHOR 53 | 54 | .PP 55 | Thomas Hallgren 56 | .br 57 | BEA Systems 58 | .br 59 | Stockholm, Sweden 60 | .br 61 | Email: \fBthallgre@bea.com\fP 62 | .br 63 | .\" NOTE: This file is generated, DO NOT EDIT. 64 | -------------------------------------------------------------------------------- /doc/unw_strerror.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage[fancyhdr,pdf]{latex2man} 3 | 4 | \input{common.tex} 5 | 6 | \begin{document} 7 | 8 | \begin{Name}{3}{unw\_strerror}{Thomas Hallgren}{Programming Library}{unw\_strerror}unw\_strerror -- get text corresponding to error code 9 | \end{Name} 10 | 11 | \section{Synopsis} 12 | 13 | \File{\#include $<$libunwind.h$>$}\\ 14 | 15 | \Type{const char *} \Func{unw\_strerror}(\Type{int} \Var{err\_code});\\ 16 | 17 | \section{Description} 18 | 19 | The \Func{unw\_strerror}() routine maps the (negative) \Var{err\_code} 20 | to a corresponding text message and returns it. 21 | 22 | \section{Return Value} 23 | 24 | The message that corresponds to \Var{err\_code} or, if the 25 | \Var{err\_code} has no corresponding message, the text "invalid error 26 | code". 27 | 28 | \section{Thread and Signal Safety} 29 | 30 | \Func{unw\_strerror}() is thread-safe as well as safe to use 31 | from a signal handler. 32 | 33 | \section{Author} 34 | 35 | \noindent 36 | Thomas Hallgren\\ 37 | BEA Systems\\ 38 | Stockholm, Sweden\\ 39 | Email: \Email{thallgre@bea.com}\\ 40 | \LatexManEnd 41 | 42 | \end{document} 43 | -------------------------------------------------------------------------------- /include/config.h.cmake.in: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_H 2 | #define CONFIG_H 3 | 4 | #cmakedefine01 HAVE_ELF_H 5 | #cmakedefine01 HAVE_ENDIAN_H 6 | 7 | #define PACKAGE_STRING "@PACKAGE_STRING@" 8 | #define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" 9 | 10 | #endif // CONFIG_H 11 | -------------------------------------------------------------------------------- /include/libunwind.h.in: -------------------------------------------------------------------------------- 1 | /* Provide a real file - not a symlink - as it would cause multiarch conflicts 2 | when multiple different arch releases are installed simultaneously. */ 3 | 4 | #ifndef UNW_REMOTE_ONLY 5 | 6 | #if defined __aarch64__ 7 | #include "libunwind-aarch64.h" 8 | #elif defined __arm__ 9 | # include "libunwind-arm.h" 10 | #elif defined __hppa__ 11 | # include "libunwind-hppa.h" 12 | #elif defined __ia64__ 13 | # include "libunwind-ia64.h" 14 | #elif defined __mips__ 15 | # include "libunwind-mips.h" 16 | #elif defined __powerpc__ && !defined __powerpc64__ 17 | # include "libunwind-ppc32.h" 18 | #elif defined __powerpc64__ 19 | # include "libunwind-ppc64.h" 20 | #elif defined __sh__ 21 | # include "libunwind-sh.h" 22 | #elif defined __i386__ 23 | # include "libunwind-x86.h" 24 | #elif defined __x86_64__ 25 | # include "libunwind-x86_64.h" 26 | #elif defined __tilegx__ 27 | # include "libunwind-tilegx.h" 28 | #elif defined __s390x__ 29 | # include "libunwind-s390x.h" 30 | #elif defined __riscv || defined __riscv__ 31 | # include "libunwind-riscv.h" 32 | #elif defined __loongarch64 33 | # include "libunwind-loongarch64.h" 34 | #else 35 | # error "Unsupported arch" 36 | #endif 37 | 38 | #else /* UNW_REMOTE_ONLY */ 39 | 40 | # include "libunwind-@arch@.h" 41 | 42 | #endif /* UNW_REMOTE_ONLY */ 43 | -------------------------------------------------------------------------------- /include/remote/elf.h: -------------------------------------------------------------------------------- 1 | // This is an incomplete & imprecice implementation 2 | // It defers to the open source freebsd-elf implementations. 3 | 4 | #ifndef ELF_H 5 | #define ELF_H 6 | 7 | #include 8 | 9 | #include "freebsd-elf_common.h" 10 | #include "freebsd-elf32.h" 11 | #include "freebsd-elf64.h" 12 | 13 | #endif // ELF_H 14 | -------------------------------------------------------------------------------- /include/remote/endian.h: -------------------------------------------------------------------------------- 1 | // This is an incomplete & imprecice implementation of the 2 | // standard file by the same name 3 | 4 | #ifndef ENDIAN_H 5 | #define ENDIAN_H 6 | 7 | #define __LITTLE_ENDIAN 1234 8 | #define __BIG_ENDIAN 4321 9 | 10 | #define __BYTE_ORDER __LITTLE_ENDIAN 11 | 12 | #endif // ENDIAN_H 13 | -------------------------------------------------------------------------------- /include/remote/win/fakestdalign.h.in: -------------------------------------------------------------------------------- 1 | // This is a fake implementation of stdalign.h for when 2 | // compiler C11 stdaliagn.h support is missing 3 | 4 | #ifndef FAKE_STD_ALIGN_H 5 | #define FAKE_STD_ALIGN_H 6 | 7 | #define alignas(x) 8 | 9 | #endif // FAKE_STD_ALIGN_H 10 | -------------------------------------------------------------------------------- /include/remote/win/fakestdatomic.h.in: -------------------------------------------------------------------------------- 1 | // This is a non-atomic fake implementation of stdatomic.h for when 2 | // compiler C11 stdatomic support is missing and only single threaded 3 | // operation is required 4 | 5 | #ifndef FAKE_STD_ATOMICS_H 6 | #define FAKE_STD_ATOMICS_H 7 | 8 | #include 9 | 10 | #define _Atomic volatile 11 | #define ATOMIC_FLAG_INIT 0 12 | 13 | typedef uint8_t atomic_bool; 14 | typedef uint8_t atomic_flag; 15 | 16 | #define atomic_compare_and_exchange_strong(x, y, z) return ((*(x) == *(y)) ? ((*(x) = z), true) : ((*(y) = *(x)),false)) 17 | 18 | #define atomic_fetch_add(x, y) *(x) += (y), (*(x) - (y)) 19 | 20 | static inline void atomic_flag_clear(volatile atomic_flag* flag) 21 | { 22 | *flag = ATOMIC_FLAG_INIT; 23 | } 24 | 25 | static inline atomic_bool atomic_flag_test_and_set( volatile atomic_flag* flag ) 26 | { 27 | atomic_bool result = *flag; 28 | *flag = 1; 29 | return result; 30 | } 31 | 32 | #define atomic_load(x) (*(x)) 33 | #define atomic_store(x, y) do { *(x) = (y); } while (0) 34 | 35 | 36 | #endif // FAKE_STD_ATOMICS_H 37 | -------------------------------------------------------------------------------- /include/remote/win/pthread.h: -------------------------------------------------------------------------------- 1 | // This is an incomplete & imprecice implementation of the Posix 2 | // standard file by the same name 3 | 4 | 5 | // Since this is only intended for VC++ compilers 6 | // use #pragma once instead of guard macros 7 | #pragma once 8 | 9 | #ifdef _MSC_VER // Only for cross compilation to windows 10 | 11 | // #include 12 | #include 13 | 14 | #define PTHREAD_DESTRUCTOR_ITERATIONS 0 15 | #define PTHREAD_MUTEX_INITIALIZER 0 16 | #define PTHREAD_ONCE_INIT 0 17 | 18 | typedef long pthread_key_t; 19 | typedef long pthread_mutex_t; 20 | typedef long pthread_mutexattr_t; 21 | typedef long pthread_once_t; 22 | 23 | int pthread_key_create(pthread_key_t *, void (*)(void*)); 24 | int pthread_mutex_init(pthread_mutex_t *, const pthread_mutexattr_t *); 25 | int pthread_mutex_lock(pthread_mutex_t *); 26 | int pthread_mutex_unlock(pthread_mutex_t *); 27 | int pthread_once(pthread_once_t *, void (*)(void)); 28 | int pthread_setspecific(pthread_key_t, const void *); 29 | 30 | #endif // _MSC_VER 31 | -------------------------------------------------------------------------------- /include/remote/win/signal.h: -------------------------------------------------------------------------------- 1 | // This is an incomplete & imprecice implementation of the Posix 2 | // standard file by the same name 3 | 4 | 5 | // Since this is only intended for VC++ compilers 6 | // use #pragma once instead of guard macros 7 | #pragma once 8 | 9 | #ifdef _MSC_VER // Only for cross compilation to windows 10 | 11 | // Posix is a superset of the ISO C signal.h 12 | // include ISO C version first 13 | #include <../ucrt/signal.h> 14 | #include 15 | #include 16 | 17 | #if defined(__linux__) && defined(__x86_64__) 18 | # define SIZEOF_SIGINFO 128 19 | #elif defined(__linux__) && defined(__aarch64__) 20 | # define SIZEOF_SIGINFO 128 21 | #elif defined(__linux__) && defined(__arm__) 22 | # define SIZEOF_SIGINFO 128 23 | #elif !defined(SIZEOF_SIGINFO) 24 | // It is not clear whether the sizeof(siginfo_t) is important 25 | // While compiling on Windows the members are not referenced... 26 | // However the size maybe important during a case or a memcpy 27 | // Barring a full audit it could be important so require the size to be defined 28 | # error SIZEOF_SIGINFO is unknown for this target 29 | #endif 30 | 31 | typedef struct siginfo 32 | { 33 | uint8_t content[SIZEOF_SIGINFO]; 34 | } siginfo_t; 35 | 36 | typedef long sigset_t; 37 | 38 | int sigfillset(sigset_t *set); 39 | 40 | #endif // _MSC_VER 41 | -------------------------------------------------------------------------------- /include/remote/win/sys/mman.h: -------------------------------------------------------------------------------- 1 | // This is an incomplete & imprecice implementation of the Posix 2 | // standard file by the same name 3 | 4 | 5 | // Since this is only intended for VC++ compilers 6 | // use #pragma once instead of guard macros 7 | #pragma once 8 | 9 | #ifdef _MSC_VER // Only for cross compilation to windows 10 | 11 | #include 12 | 13 | #define MAP_FAILED (void *) -1 14 | #define MAP_ANONYMOUS 1 15 | #define MAP_ANON MAP_ANONYMOUS 16 | #define MAP_PRIVATE 2 17 | #define PROT_READ 4 18 | #define PROT_WRITE 8 19 | #define PROT_EXEC 16 20 | 21 | void* mmap(void *, size_t, int, int, int, size_t); 22 | int munmap(void *, size_t); 23 | 24 | #endif // _MSC_VER 25 | -------------------------------------------------------------------------------- /include/remote/win/sys/stat.h: -------------------------------------------------------------------------------- 1 | // This is an incomplete & imprecice implementation of the Posix 2 | // standard file by the same name 3 | 4 | // Since this is only intended for VC++ compilers 5 | // use #pragma once instead of guard macros 6 | #pragma once 7 | 8 | #ifdef _MSC_VER // Only for cross compilation to windows 9 | 10 | #include 11 | 12 | #define S_IFMT 00170000 13 | #define S_IFDIR 0040000 14 | 15 | #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) 16 | 17 | struct stat 18 | { 19 | unsigned short st_dev; 20 | unsigned short st_ino; 21 | unsigned short st_mode; 22 | short st_nlink; 23 | short st_uid; 24 | short st_gid; 25 | unsigned short st_rdev; 26 | unsigned short st_size; 27 | time_t st_atime; 28 | time_t st_mtime; 29 | time_t st_ctime; 30 | }; 31 | 32 | int stat(const char *path, struct stat *buf); 33 | int fstat(int fd, struct stat *buf); 34 | 35 | #endif // _MSC_VER 36 | -------------------------------------------------------------------------------- /include/remote/win/sys/syscall.h: -------------------------------------------------------------------------------- 1 | // This is an incomplete & imprecice implementation of the Posix 2 | // standard file by the same name 3 | 4 | 5 | // Since this is only intended for VC++ compilers 6 | // use #pragma once instead of guard macros 7 | #pragma once 8 | 9 | #ifdef _MSC_VER // Only for cross compilation to windows 10 | 11 | #endif // _MSC_VER 12 | -------------------------------------------------------------------------------- /include/remote/win/sys/types.h: -------------------------------------------------------------------------------- 1 | // This is an incomplete & imprecice implementation of the Posix 2 | // standard file by the same name 3 | 4 | 5 | // Since this is only intended for VC++ compilers 6 | // use #pragma once instead of guard macros 7 | #pragma once 8 | 9 | #ifdef _MSC_VER // Only for cross compilation to windows 10 | 11 | // Posix is a superset of the ISO C sys/types 12 | // include ISO C version first 13 | #include <../ucrt/sys/types.h> 14 | #include 15 | 16 | typedef int pid_t; 17 | typedef ptrdiff_t ssize_t; 18 | 19 | #endif // _MSC_VER 20 | -------------------------------------------------------------------------------- /include/remote/win/sys/ucontext.h: -------------------------------------------------------------------------------- 1 | // This is an incomplete & imprecice implementation of the *nix file 2 | // by the same name 3 | 4 | 5 | // Since this is only intended for VC++ compilers 6 | // use #pragma once instead of guard macros 7 | #pragma once 8 | 9 | #ifdef _MSC_VER // Only for cross compilation to windows 10 | #include 11 | 12 | #if defined(__linux__) && defined(__x86_64__) 13 | # define SIZEOF_UCONTEXT 936 14 | #elif defined(__linux__) && defined(__aarch64__) 15 | # define SIZEOF_UCONTEXT 4560 16 | #elif defined(__linux__) && defined(__arm__) 17 | # define SIZEOF_UCONTEXT 744 18 | #elif !defined(SIZEOF_UCONTEXT) 19 | // It is not clear whether the sizeof(ucontext_t) is important 20 | // While compiling on Windows the members are not referenced... 21 | // However the size maybe important during a case or a memcpy 22 | // Barring a full audit it could be important so require the size to be defined 23 | # error SIZEOF_UCONTEXT is unknown for this target 24 | #endif 25 | 26 | typedef struct ucontext 27 | { 28 | uint8_t content[SIZEOF_UCONTEXT]; 29 | } ucontext_t; 30 | 31 | #ifdef __aarch64__ 32 | // These types are used in the definition of the aarch64 unw_tdep_context_t 33 | // They are not used in UNW_REMOTE_ONLY, so typedef them as something 34 | typedef long sigset_t; 35 | typedef long stack_t; 36 | 37 | // Windows SDK defines reserved. It conflicts with arm64 ucontext 38 | // Undefine it 39 | #undef __reserved 40 | #endif 41 | 42 | #endif // _MSC_VER 43 | -------------------------------------------------------------------------------- /include/remote/win/ucontext.h: -------------------------------------------------------------------------------- 1 | // This is an incomplete & imprecice implementation of the *nix file 2 | // by the same name 3 | 4 | 5 | // Since this is only intended for VC++ compilers 6 | // use #pragma once instead of guard macros 7 | #pragma once 8 | 9 | #ifdef _MSC_VER // Only for cross compilation to windows 10 | 11 | #include 12 | 13 | #endif // _MSC_VER 14 | -------------------------------------------------------------------------------- /include/remote/win/unistd.h: -------------------------------------------------------------------------------- 1 | // This is an incomplete & imprecice implementation of the Posix 2 | // standard file by the same name 3 | 4 | 5 | // Since this is only intended for VC++ compilers 6 | // use #pragma once instead of guard macros 7 | #pragma once 8 | 9 | #ifdef _MSC_VER // Only for cross compilation to windows 10 | 11 | #ifndef UNW_REMOTE_ONLY 12 | // This is solely intended to enable compilation of libunwind 13 | // for UNW_REMOTE_ONLY on windows 14 | #error Cross compilation of libunwind on Windows can only support UNW_REMOTE_ONLY 15 | #endif 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | int close(int); 23 | int getpagesize(void); 24 | int open(const char *, int, ...); 25 | ssize_t read(int fd, void *buf, size_t count); 26 | ssize_t write(int, const void *, size_t); 27 | long sysconf(int name); 28 | 29 | #define _SC_PAGESIZE 11 30 | 31 | #endif // _MSC_VER 32 | -------------------------------------------------------------------------------- /include/tdep-aarch64/jmpbuf.h: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2008 CodeSourcery 3 | Copyright (C) 2013 Linaro Limited 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | /* Use glibc's jump-buffer indices; NPTL peeks at SP: */ 27 | 28 | /* FIXME for AArch64 */ 29 | 30 | #define JB_SP 13 31 | #define JB_RP 14 32 | #define JB_MASK_SAVED 15 33 | #define JB_MASK 16 34 | -------------------------------------------------------------------------------- /include/tdep-arm/jmpbuf.h: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2008 CodeSourcery 3 | 4 | This file is part of libunwind. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 24 | 25 | /* Use glibc's jump-buffer indices; NPTL peeks at SP: */ 26 | 27 | /* FIXME for ARM! */ 28 | 29 | #define JB_SP 4 30 | #define JB_RP 5 31 | #define JB_MASK_SAVED 6 32 | #define JB_MASK 7 33 | -------------------------------------------------------------------------------- /include/tdep-hppa/jmpbuf.h: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2004 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | /* Use glibc's jump-buffer indices; NPTL peeks at SP: */ 27 | 28 | #ifndef JB_SP 29 | # define JB_SP 19 30 | #endif 31 | #define JB_RP 20 32 | #define JB_MASK_SAVED 21 33 | #define JB_MASK 22 34 | -------------------------------------------------------------------------------- /include/tdep-ia64/jmpbuf.h: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2004 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | /* Use glibc's jump-buffer indices; NPTL peeks at SP and BSP: */ 27 | 28 | #define JB_SP 0 29 | #define JB_RP 8 30 | #define JB_BSP 17 31 | #define JB_MASK_SAVED 70 32 | #define JB_MASK 71 33 | -------------------------------------------------------------------------------- /include/tdep-mips/jmpbuf.h: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2008 CodeSourcery 3 | 4 | This file is part of libunwind. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 24 | 25 | /* Use glibc's jump-buffer indices; NPTL peeks at SP: */ 26 | 27 | /* FIXME for MIPS! */ 28 | 29 | #define JB_SP 4 30 | #define JB_RP 5 31 | #define JB_MASK_SAVED 6 32 | #define JB_MASK 7 33 | -------------------------------------------------------------------------------- /include/tdep-s390x/jmpbuf.h: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2004 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #if defined __linux__ 27 | 28 | /* Use glibc's jump-buffer indices; NPTL peeks at SP: */ 29 | 30 | #define JB_SP 9 // __gregs[9] 31 | #define JB_RP 8 // __gregs[8] 32 | #define JB_MASK_SAVED 18 // __mask_was_saved 33 | #define JB_MASK 19 // __saved_mask 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /include/tdep-tilegx/jmpbuf.h: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2008 CodeSourcery 3 | Copyright (C) 2014 Tilera Corp. 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | /* Use glibc's jump-buffer indices; NPTL peeks at SP: */ 27 | 28 | /* FIXME for Tilegx! */ 29 | 30 | #define JB_SP 4 31 | #define JB_RP 5 32 | #define JB_MASK_SAVED 6 33 | #define JB_MASK 7 34 | -------------------------------------------------------------------------------- /include/tdep/dwarf-config.h: -------------------------------------------------------------------------------- 1 | /* Provide a real file - not a symlink - as it would cause multiarch conflicts 2 | when multiple different arch releases are installed simultaneously. */ 3 | 4 | #if defined __aarch64__ 5 | # include "tdep-aarch64/dwarf-config.h" 6 | #elif defined __arm__ 7 | # include "tdep-arm/dwarf-config.h" 8 | #elif defined __hppa__ 9 | # include "tdep-hppa/dwarf-config.h" 10 | #elif defined __ia64__ 11 | # include "tdep-ia64/dwarf-config.h" 12 | #elif defined __mips__ 13 | # include "tdep-mips/dwarf-config.h" 14 | #elif defined __powerpc__ && !defined __powerpc64__ 15 | # include "tdep-ppc32/dwarf-config.h" 16 | #elif defined __powerpc64__ 17 | # include "tdep-ppc64/dwarf-config.h" 18 | #elif defined __s390x__ 19 | # include "tdep-s390x/dwarf-config.h" 20 | #elif defined __sh__ 21 | # include "tdep-sh/dwarf-config.h" 22 | #elif defined __i386__ 23 | # include "tdep-x86/dwarf-config.h" 24 | #elif defined __x86_64__ || defined __amd64__ 25 | # include "tdep-x86_64/dwarf-config.h" 26 | #elif defined __tilegx__ 27 | # include "tdep-tilegx/dwarf-config.h" 28 | #elif defined __riscv || defined __riscv__ 29 | # include "tdep-riscv/dwarf-config.h" 30 | #elif defined __loongarch64 31 | # include "tdep-loongarch64/dwarf-config.h" 32 | #else 33 | # error "Unsupported arch" 34 | #endif 35 | -------------------------------------------------------------------------------- /include/tdep/jmpbuf.h: -------------------------------------------------------------------------------- 1 | /* Provide a real file - not a symlink - as it would cause multiarch conflicts 2 | when multiple different arch releases are installed simultaneously. */ 3 | 4 | #ifndef UNW_REMOTE_ONLY 5 | 6 | #if defined __aarch64__ 7 | # include "tdep-aarch64/jmpbuf.h" 8 | #elif defined __arm__ 9 | # include "tdep-arm/jmpbuf.h" 10 | #elif defined __hppa__ 11 | # include "tdep-hppa/jmpbuf.h" 12 | #elif defined __ia64__ 13 | # include "tdep-ia64/jmpbuf.h" 14 | #elif defined __mips__ 15 | # include "tdep-mips/jmpbuf.h" 16 | #elif defined __powerpc__ && !defined __powerpc64__ 17 | # include "tdep-ppc32/jmpbuf.h" 18 | #elif defined __powerpc64__ 19 | # include "tdep-ppc64/jmpbuf.h" 20 | #elif defined __i386__ 21 | # include "tdep-x86/jmpbuf.h" 22 | #elif defined __x86_64__ 23 | # include "tdep-x86_64/jmpbuf.h" 24 | #elif defined __tilegx__ 25 | # include "tdep-tilegx/jmpbuf.h" 26 | #elif defined __riscv || defined __riscv__ 27 | # include "tdep-riscv/jmpbuf.h" 28 | #elif defined __loongarch64 29 | # include "tdep-loongarch64/jmpbuf.h" 30 | #else 31 | # error "Unsupported arch" 32 | #endif 33 | 34 | #endif /* !UNW_REMOTE_ONLY */ 35 | -------------------------------------------------------------------------------- /include/tdep/libunwind_i.h.in: -------------------------------------------------------------------------------- 1 | /* Provide a real file - not a symlink - as it would cause multiarch conflicts 2 | when multiple different arch releases are installed simultaneously. */ 3 | 4 | #ifndef UNW_REMOTE_ONLY 5 | 6 | #if defined __aarch64__ 7 | # include "tdep-aarch64/libunwind_i.h" 8 | #elif defined __arm__ 9 | # include "tdep-arm/libunwind_i.h" 10 | #elif defined __hppa__ 11 | # include "tdep-hppa/libunwind_i.h" 12 | #elif defined __ia64__ 13 | # include "tdep-ia64/libunwind_i.h" 14 | #elif defined __mips__ 15 | # include "tdep-mips/libunwind_i.h" 16 | #elif defined __powerpc__ && !defined __powerpc64__ 17 | # include "tdep-ppc32/libunwind_i.h" 18 | #elif defined __powerpc64__ 19 | # include "tdep-ppc64/libunwind_i.h" 20 | #elif defined __sh__ 21 | # include "tdep-sh/libunwind_i.h" 22 | #elif defined __i386__ 23 | # include "tdep-x86/libunwind_i.h" 24 | #elif defined __x86_64__ 25 | # include "tdep-x86_64/libunwind_i.h" 26 | #elif defined __tilegx__ 27 | # include "tdep-tilegx/libunwind_i.h" 28 | #elif defined __s390x__ 29 | # include "tdep-s390x/libunwind_i.h" 30 | #elif defined __riscv || defined __riscv__ 31 | # include "tdep-riscv/libunwind_i.h" 32 | #elif defined __loongarch64 33 | # include "tdep-loongarch64/libunwind_i.h" 34 | #else 35 | # error "Unsupported arch" 36 | #endif 37 | 38 | 39 | #else /* UNW_REMOTE_ONLY */ 40 | 41 | # include "tdep-@arch@/libunwind_i.h" 42 | 43 | #endif /* UNW_REMOTE_ONLY */ 44 | -------------------------------------------------------------------------------- /include/x86/jmpbuf.h: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2004 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | /* Use glibc's jump-buffer indices; NPTL peeks at SP: */ 27 | 28 | #define JB_SP 4 29 | #define JB_RP 5 30 | #define JB_MASK_SAVED 6 31 | #define JB_MASK 7 32 | -------------------------------------------------------------------------------- /scripts/kernel-diff.sh: -------------------------------------------------------------------------------- 1 | kdir=${1:-../kernel} 2 | scriptdir=$(dirname $0) 3 | udir=$(dirname $scriptdir) 4 | cat $scriptdir/kernel-files.txt | \ 5 | (while read l r; do 6 | left=$(eval echo $l) 7 | right=$(eval echo $r) 8 | # echo $left $right 9 | diff -up $left $right 10 | done) 11 | -------------------------------------------------------------------------------- /scripts/kernel-files.txt: -------------------------------------------------------------------------------- 1 | $udir/include/tdep-ia64/rse.h $kdir/arch/ia64/unwind/rse.h 2 | $udir/src/ia64/Ginit_local.c $kdir/arch/ia64/unwind/init_local.c 3 | $udir/src/ia64/Gis_signal_frame.c $kdir/arch/ia64/unwind/is_signal_frame.c 4 | $udir/src/ia64/Gparser.c $kdir/arch/ia64/unwind/parser.c 5 | $udir/src/ia64/Grbs.c $kdir/arch/ia64/unwind/rbs.c 6 | $udir/src/ia64/Gregs.c $kdir/arch/ia64/unwind/regs.c 7 | $udir/src/ia64/Gscript.c $kdir/arch/ia64/unwind/script.c 8 | $udir/src/ia64/Gstep.c $kdir/arch/ia64/unwind/step.c 9 | $udir/src/ia64/init.h $kdir/arch/ia64/unwind/init.h 10 | $udir/src/ia64/offsets.h $kdir/arch/ia64/unwind/offsets.h 11 | $udir/src/ia64/regname.c $kdir/arch/ia64/unwind/regname.c 12 | $udir/src/ia64/regs.h $kdir/arch/ia64/unwind/regs.h 13 | $udir/src/ia64/unwind_decoder.h $kdir/arch/ia64/unwind/unwind_decoder.h 14 | $udir/src/mi/Gget_fpreg.c $kdir/unwind/get_fpreg.c 15 | $udir/src/mi/Gget_reg.c $kdir/unwind/get_reg.c 16 | $udir/src/mi/Gset_fpreg.c $kdir/unwind/set_fpreg.c 17 | $udir/src/mi/Gset_reg.c $kdir/unwind/set_reg.c 18 | $udir/src/mi/flush_cache.c $kdir/unwind/flush_cache.c 19 | $udir/src/mi/mempool.c $kdir/unwind/mempool.c 20 | -------------------------------------------------------------------------------- /scripts/make-L-files: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cwd=`pwd` 3 | dir=`basename ${cwd}` 4 | # 5 | # When compiling a file that goes into libunwind, we only 6 | # need to compile it when we really do support UNW_LOCAL_ONLY. 7 | # In contrast, libunwind-tests should always get compiled. 8 | # 9 | if test $dir = "tests"; then 10 | local_only_test="" 11 | else 12 | local_only_test="defined(UNW_LOCAL_ONLY) && " 13 | fi 14 | for gname in `ls G*.c G*.cxx G*.S 2>/dev/null`; do 15 | lname="L$(expr $gname : '.\(.*\)')" 16 | bk edit $lname >/dev/null 2>&1 17 | ext=$(expr $gname : '[^.]*[.]\(.*\)') 18 | if [ "$ext" = "S" ]; then 19 | include="" 20 | else 21 | include="#include " 22 | fi 23 | echo -e "\ 24 | #define UNW_LOCAL_ONLY\n\ 25 | $include\n\ 26 | #if ${local_only_test}!defined(UNW_REMOTE_ONLY)\n\ 27 | #include \"$gname\"\n\ 28 | #endif" > $lname 29 | echo created $lname 30 | done 31 | -------------------------------------------------------------------------------- /src/aarch64/Gget_proc_info.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2008 CodeSourcery 3 | 4 | This file is part of libunwind. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 24 | 25 | #include "unwind_i.h" 26 | 27 | int 28 | unw_get_proc_info (unw_cursor_t *cursor, unw_proc_info_t *pi) 29 | { 30 | struct cursor *c = (struct cursor *) cursor; 31 | int ret; 32 | 33 | ret = dwarf_make_proc_info (&c->dwarf); 34 | if (ret < 0) 35 | return ret; 36 | 37 | *pi = c->dwarf.pi; 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /src/aarch64/Lapply_reg_state.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gapply_reg_state.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/aarch64/Lcreate_addr_space.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gcreate_addr_space.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/aarch64/Lget_proc_info.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_proc_info.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/aarch64/Lget_save_loc.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_save_loc.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/aarch64/Lglobal.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gglobal.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/aarch64/Linit.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/aarch64/Linit_local.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_local.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/aarch64/Linit_remote.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_remote.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/aarch64/Lis_signal_frame.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gis_signal_frame.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/aarch64/Lreg_states_iterate.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Greg_states_iterate.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/aarch64/Lregs.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gregs.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/aarch64/Lresume.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gresume.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/aarch64/Lstash_frame.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstash_frame.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/aarch64/Lstep.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstep.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/aarch64/Ltrace.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gtrace.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/aarch64/is_fpreg.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2008 CodeSourcery 3 | Copyright (C) 2013 Linaro Limited 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "libunwind_i.h" 27 | 28 | int 29 | unw_is_fpreg (int regnum) 30 | { 31 | return (regnum >= UNW_AARCH64_V0 && regnum <= UNW_AARCH64_V31); 32 | } 33 | -------------------------------------------------------------------------------- /src/aarch64/siglongjmp.S: -------------------------------------------------------------------------------- 1 | /* Dummy implementation for now. */ 2 | 3 | .global _UI_siglongjmp_cont 4 | .global _UI_longjmp_cont 5 | 6 | _UI_siglongjmp_cont: 7 | _UI_longjmp_cont: 8 | ret 9 | #ifdef __linux__ 10 | /* We do not need executable stack. */ 11 | .section .note.GNU-stack,"",%progbits 12 | #endif 13 | -------------------------------------------------------------------------------- /src/arm/Lapply_reg_state.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gapply_reg_state.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Lcreate_addr_space.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gcreate_addr_space.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Lex_tables.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gex_tables.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Lget_proc_info.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_proc_info.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Lget_save_loc.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_save_loc.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Lglobal.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gglobal.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Linit.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Linit_local.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_local.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Linit_remote.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_remote.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Lis_signal_frame.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gis_signal_frame.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Los-freebsd.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gos-freebsd.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Los-linux.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gos-linux.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Los-other.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gos-freebsd.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Lreg_states_iterate.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Greg_states_iterate.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Lregs.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gregs.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Lresume.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gresume.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Lstash_frame.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstash_frame.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Lstep.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstep.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/arm/Ltrace.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gtrace.c" 5 | #endif 6 | 7 | -------------------------------------------------------------------------------- /src/arm/gen-offsets.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define UC(N,X) \ 7 | printf ("#define LINUX_UC_" N "_OFF\t0x%X\n", offsetof (ucontext_t, X)) 8 | 9 | #define SC(N,X) \ 10 | printf ("#define LINUX_SC_" N "_OFF\t0x%X\n", offsetof (struct sigcontext, X)) 11 | 12 | int 13 | main (void) 14 | { 15 | printf ( 16 | "/* Linux-specific definitions: */\n\n" 17 | 18 | "/* Define various structure offsets to simplify cross-compilation. */\n\n" 19 | 20 | "/* Offsets for ARM Linux \"ucontext_t\": */\n\n"); 21 | 22 | UC ("FLAGS", uc_flags); 23 | UC ("LINK", uc_link); 24 | UC ("STACK", uc_stack); 25 | UC ("MCONTEXT", uc_mcontext); 26 | UC ("SIGMASK", uc_sigmask); 27 | UC ("REGSPACE", uc_regspace); 28 | 29 | printf ("\n/* Offsets for ARM Linux \"struct sigcontext\": */\n\n"); 30 | 31 | SC ("TRAPNO", trap_no); 32 | SC ("ERRORCODE", error_code); 33 | SC ("OLDMASK", oldmask); 34 | SC ("R0", arm_r0); 35 | SC ("R1", arm_r1); 36 | SC ("R2", arm_r2); 37 | SC ("R3", arm_r3); 38 | SC ("R4", arm_r4); 39 | SC ("R5", arm_r5); 40 | SC ("R6", arm_r6); 41 | SC ("R7", arm_r7); 42 | SC ("R8", arm_r8); 43 | SC ("R9", arm_r9); 44 | SC ("R10", arm_r10); 45 | SC ("FP", arm_fp); 46 | SC ("IP", arm_ip); 47 | SC ("SP", arm_sp); 48 | SC ("LR", arm_lr); 49 | SC ("PC", arm_pc); 50 | SC ("CPSR", arm_cpsr); 51 | SC ("FAULTADDR", fault_address); 52 | 53 | return 0; 54 | } 55 | -------------------------------------------------------------------------------- /src/arm/offsets.h: -------------------------------------------------------------------------------- 1 | /* Linux-specific definitions: */ 2 | 3 | /* Define various structure offsets to simplify cross-compilation. */ 4 | 5 | /* Offsets for ARM Linux "ucontext_t": */ 6 | 7 | #define LINUX_UC_FLAGS_OFF 0x00 8 | #define LINUX_UC_LINK_OFF 0x04 9 | #define LINUX_UC_STACK_OFF 0x08 10 | #define LINUX_UC_MCONTEXT_OFF 0x14 11 | #define LINUX_UC_SIGMASK_OFF 0x68 12 | #define LINUX_UC_REGSPACE_OFF 0xE8 13 | 14 | /* Offsets for ARM Linux "struct sigcontext": */ 15 | 16 | #define LINUX_SC_TRAPNO_OFF 0x00 17 | #define LINUX_SC_ERRORCODE_OFF 0x04 18 | #define LINUX_SC_OLDMASK_OFF 0x08 19 | #define LINUX_SC_R0_OFF 0x0C 20 | #define LINUX_SC_R1_OFF 0x10 21 | #define LINUX_SC_R2_OFF 0x14 22 | #define LINUX_SC_R3_OFF 0x18 23 | #define LINUX_SC_R4_OFF 0x1C 24 | #define LINUX_SC_R5_OFF 0x20 25 | #define LINUX_SC_R6_OFF 0x24 26 | #define LINUX_SC_R7_OFF 0x28 27 | #define LINUX_SC_R8_OFF 0x2C 28 | #define LINUX_SC_R9_OFF 0x30 29 | #define LINUX_SC_R10_OFF 0x34 30 | #define LINUX_SC_FP_OFF 0x38 31 | #define LINUX_SC_IP_OFF 0x3C 32 | #define LINUX_SC_SP_OFF 0x40 33 | #define LINUX_SC_LR_OFF 0x44 34 | #define LINUX_SC_PC_OFF 0x48 35 | #define LINUX_SC_CPSR_OFF 0x4C 36 | #define LINUX_SC_FAULTADDR_OFF 0x50 37 | 38 | /* FreeBSD-specific definitions: */ 39 | 40 | #define FREEBSD_SC_UCONTEXT_OFF 0x40 41 | #define FREEBSD_UC_MCONTEXT_OFF 0x10 42 | #define FREEBSD_MC_R0_OFF 0 43 | -------------------------------------------------------------------------------- /src/arm/siglongjmp.S: -------------------------------------------------------------------------------- 1 | /* Dummy implementation for now. */ 2 | 3 | .globl _UI_siglongjmp_cont 4 | .globl _UI_longjmp_cont 5 | 6 | _UI_siglongjmp_cont: 7 | _UI_longjmp_cont: 8 | bx lr 9 | #ifdef __linux__ 10 | /* We do not need executable stack. */ 11 | .section .note.GNU-stack,"",%progbits 12 | #endif 13 | -------------------------------------------------------------------------------- /src/coredump/README: -------------------------------------------------------------------------------- 1 | This code is based on "unwinding via ptrace" code from ptrace/ 2 | directory. 3 | 4 | Files with names starting with _UCD_ are substantially changed 5 | from their ptrace/_UPT_... progenitors. 6 | 7 | Files which still have _UPT_... names are either verbiatim copies 8 | from ptrace/, or unimplemented stubs. 9 | -------------------------------------------------------------------------------- /src/coredump/_UCD_destroy.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | 3 | This file is part of libunwind. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 23 | 24 | #include "_UCD_internal.h" 25 | 26 | void 27 | _UCD_destroy (struct UCD_info *ui) 28 | { 29 | if (!ui) 30 | return; 31 | 32 | if (ui->coredump_fd >= 0) 33 | close(ui->coredump_fd); 34 | free(ui->coredump_filename); 35 | 36 | invalidate_edi (&ui->edi); 37 | 38 | ucd_file_table_dispose(&ui->ucd_file_table); 39 | 40 | free(ui->phdrs); 41 | free(ui->note_phdr); 42 | free(ui->threads); 43 | 44 | free(ui); 45 | } 46 | -------------------------------------------------------------------------------- /src/coredump/_UCD_get_mapinfo_generic.c: -------------------------------------------------------------------------------- 1 | /** 2 | * Extract filemap info from a coredump (generic) 3 | */ 4 | /* 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | this software and associated documentation files (the "Software"), to deal in 9 | the Software without restriction, including without limitation the rights to 10 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 11 | of the Software, and to permit persons to whom the Software is furnished to do 12 | so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #include "_UCD_internal.h" 26 | 27 | 28 | int 29 | _UCD_get_mapinfo(struct UCD_info *ui, coredump_phdr_t *phdrs, unsigned phdr_size) 30 | { 31 | int ret = UNW_ESUCCESS; /* it's OK if there are no file mappings */ 32 | 33 | return ret; 34 | } 35 | -------------------------------------------------------------------------------- /src/coredump/_UPT_elf.c: -------------------------------------------------------------------------------- 1 | /* We need to get a separate copy of the ELF-code into 2 | libunwind-coredump since it cannot (and must not) have any ELF 3 | dependencies on libunwind. */ 4 | #include "libunwind_i.h" /* get ELFCLASS defined */ 5 | #include "../elfxx.c" 6 | -------------------------------------------------------------------------------- /src/coredump/_UPT_put_unwind_info.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2003 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "_UCD_lib.h" 27 | #include "_UCD_internal.h" 28 | 29 | void 30 | _UCD_put_unwind_info (unw_addr_space_t as, unw_proc_info_t *pi, void *arg) 31 | { 32 | if (!pi->unwind_info) 33 | return; 34 | free (pi->unwind_info); 35 | pi->unwind_info = NULL; 36 | } 37 | -------------------------------------------------------------------------------- /src/coredump/_UPT_resume.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2003 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "_UCD_lib.h" 27 | #include "_UCD_internal.h" 28 | 29 | int 30 | _UCD_resume (unw_addr_space_t as, unw_cursor_t *c, void *arg) 31 | { 32 | print_error (__func__); 33 | print_error (" not implemented\n"); 34 | return -UNW_EINVAL; 35 | } 36 | -------------------------------------------------------------------------------- /src/coredump/libunwind-coredump.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libunwind-coredump 7 | Description: libunwind coredump library 8 | Version: @VERSION@ 9 | Requires: libunwind-generic libunwind 10 | Libs: -L${libdir} -lunwind-coredump 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /src/dwarf/Lexpr.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gexpr.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/dwarf/Lfde.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gfde.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/dwarf/Lfind_proc_info-lsb.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gfind_proc_info-lsb.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/dwarf/Lfind_unwind_table.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gfind_unwind_table.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/dwarf/Lparser.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gparser.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/dwarf/Lpe.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gpe.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/elf32.c: -------------------------------------------------------------------------------- 1 | #ifndef UNW_REMOTE_ONLY 2 | # include "elf32.h" 3 | # include "elfxx.c" 4 | #endif 5 | -------------------------------------------------------------------------------- /src/elf32.h: -------------------------------------------------------------------------------- 1 | #ifndef elf32_h 2 | #define elf32_h 3 | 4 | #ifndef UNW_ELF_CLASS 5 | # define UNW_ELF_CLASS UNW_ELFCLASS32 6 | #endif 7 | #include "elfxx.h" 8 | 9 | #endif /* elf32_h */ 10 | -------------------------------------------------------------------------------- /src/elf64.c: -------------------------------------------------------------------------------- 1 | #ifndef UNW_REMOTE_ONLY 2 | # include "elf64.h" 3 | # include "elfxx.c" 4 | #endif 5 | -------------------------------------------------------------------------------- /src/elf64.h: -------------------------------------------------------------------------------- 1 | #ifndef elf64_h 2 | #define elf64_h 3 | 4 | #ifndef UNW_ELF_CLASS 5 | # define UNW_ELF_CLASS UNW_ELFCLASS64 6 | #endif 7 | #include "elfxx.h" 8 | 9 | #endif /* elf64_h */ 10 | -------------------------------------------------------------------------------- /src/hppa/Lapply_reg_state.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gapply_reg_state.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/hppa/Lcreate_addr_space.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gcreate_addr_space.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/hppa/Lget_proc_info.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_proc_info.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/hppa/Lget_save_loc.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_save_loc.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/hppa/Lglobal.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gglobal.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/hppa/Linit.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/hppa/Linit_local.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_local.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/hppa/Linit_remote.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_remote.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/hppa/Lis_signal_frame.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gis_signal_frame.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/hppa/Lreg_states_iterate.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Greg_states_iterate.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/hppa/Lregs.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gregs.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/hppa/Lresume.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gresume.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/hppa/Lstep.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstep.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/hppa/get_accessors.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2003 Hewlett-Packard Co 3 | Contributed by ... 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "unwind_i.h" 27 | 28 | HIDDEN ALIAS(unw_get_accessors) unw_accessors_t * 29 | unw_get_accessors_int (unw_addr_space_t as); 30 | 31 | unw_accessors_t * 32 | unw_get_accessors (unw_addr_space_t as) 33 | { 34 | if (!atomic_load(&tdep_init_done)) 35 | tdep_init (); 36 | 37 | return &as->acc; 38 | } 39 | -------------------------------------------------------------------------------- /src/hppa/offsets.h: -------------------------------------------------------------------------------- 1 | #define LINUX_UC_FLAGS_OFF 0x000 2 | #define LINUX_UC_LINK_OFF 0x004 3 | #define LINUX_UC_STACK_OFF 0x008 4 | #define LINUX_UC_MCONTEXT_OFF 0x018 5 | #define LINUX_UC_SIGMASK_OFF 0x1b8 6 | 7 | #define LINUX_SC_FLAGS_OFF 0x000 8 | #define LINUX_SC_GR_OFF 0x004 9 | #define LINUX_SC_FR_OFF 0x088 10 | #define LINUX_SC_IASQ_OFF 0x188 11 | #define LINUX_SC_IAOQ_OFF 0x190 12 | #define LINUX_SC_SAR_OFF 0x198 13 | 14 | /* The signal frame contains 4 words of space for the sigreturn 15 | trampoline, the siginfo structure, and then the sigcontext 16 | structure. See include/asm-parisc/compat_rt_sigframe.h. */ 17 | #define LINUX_RT_SIGFRAME_UC_OFF 0xac 18 | -------------------------------------------------------------------------------- /src/hppa/siglongjmp.S: -------------------------------------------------------------------------------- 1 | /* Dummy implementation for now. */ 2 | 3 | .globl _UI_siglongjmp_cont 4 | .globl _UI_longjmp_cont 5 | 6 | _UI_siglongjmp_cont: 7 | _UI_longjmp_cont: 8 | .proc 9 | .callinfo 10 | #warning fix me 11 | bv %r0(%rp) 12 | .procend 13 | #ifdef __linux__ 14 | /* We do not need executable stack. */ 15 | .section .note.GNU-stack,"",@progbits 16 | #endif 17 | -------------------------------------------------------------------------------- /src/hppa/tables.c: -------------------------------------------------------------------------------- 1 | #include "unwind_i.h" 2 | 3 | static inline int 4 | is_local_addr_space (unw_addr_space_t as) 5 | { 6 | extern unw_addr_space_t _ULhppa_local_addr_space; 7 | 8 | return (as == _Uhppa_local_addr_space 9 | #ifndef UNW_REMOTE_ONLY 10 | || as == _ULhppa_local_addr_space 11 | #endif 12 | ); 13 | } 14 | 15 | HIDDEN int 16 | tdep_find_proc_info (unw_addr_space_t as, unw_word_t ip, 17 | unw_proc_info_t *pi, int need_unwind_info, void *arg) 18 | { 19 | printf ("%s: begging to get implemented...\n", __FUNCTION__); 20 | return 0; 21 | } 22 | 23 | HIDDEN int 24 | tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, 25 | unw_dyn_info_t *di, 26 | unw_proc_info_t *pi, int need_unwind_info, void *arg) 27 | { 28 | printf ("%s: the biggest beggar of them all...\n", __FUNCTION__); 29 | return 0; 30 | } 31 | 32 | HIDDEN void 33 | tdep_put_unwind_info (unw_addr_space_t as, unw_proc_info_t *pi, void *arg) 34 | { 35 | if (!pi->unwind_info) 36 | return; 37 | 38 | if (!is_local_addr_space (as)) 39 | { 40 | free (pi->unwind_info); 41 | pi->unwind_info = NULL; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/ia64/Gget_proc_info.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2002 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "unwind_i.h" 27 | 28 | int 29 | unw_get_proc_info (unw_cursor_t *cursor, unw_proc_info_t *pi) 30 | { 31 | struct cursor *c = (struct cursor *) cursor; 32 | int ret; 33 | 34 | if ((ret = ia64_make_proc_info (c)) < 0) 35 | return ret; 36 | *pi = c->pi; 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /src/ia64/Lapply_reg_state.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gapply_reg_state.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Lcreate_addr_space.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gcreate_addr_space.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Lfind_unwind_table.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gfind_unwind_table.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Lget_proc_info.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_proc_info.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Lget_save_loc.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_save_loc.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Lglobal.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gglobal.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Linit.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Linit_local.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_local.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Linit_remote.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_remote.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Linstall_cursor.S: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include "Ginstall_cursor.S" 3 | #ifdef __linux__ 4 | /* We do not need executable stack. */ 5 | .section .note.GNU-stack,"",@progbits 6 | #endif 7 | -------------------------------------------------------------------------------- /src/ia64/Lis_signal_frame.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gis_signal_frame.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Lparser.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gparser.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Lrbs.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Grbs.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Lreg_states_iterate.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Greg_states_iterate.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Lregs.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gregs.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Lresume.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gresume.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Lscript.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gscript.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Lstep.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstep.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/Ltables.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gtables.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ia64/dyn_info_list.S: -------------------------------------------------------------------------------- 1 | #ifndef UNW_REMOTE_ONLY 2 | 3 | /* 4 | * Create a special unwind-table entry which makes it easy for an 5 | * unwinder to locate the dynamic registration list. The special 6 | * entry covers address range [0-0) and is therefore guaranteed to be 7 | * the first in the unwind-table. 8 | */ 9 | .global _U_dyn_info_list 10 | .hidden _U_dyn_info_list 11 | 12 | .section .IA_64.unwind_info,"a","progbits" 13 | .info: data8 (1<<48) | 1 /* v1, length==1 (8-byte word) */ 14 | data8 0 /* 8 empty .prologue directives (nops) */ 15 | data8 0 /* personality routine (ignored) */ 16 | string "dyn-list" /* lsda */ 17 | data8 @gprel(_U_dyn_info_list) 18 | 19 | .section .IA_64.unwind, "ao", "unwind" 20 | data8 0, 0, @segrel(.info) 21 | 22 | #endif 23 | #ifdef __linux__ 24 | /* We do not need executable stack. */ 25 | .section .note.GNU-stack,"",@progbits 26 | #endif 27 | -------------------------------------------------------------------------------- /src/ia64/mk_Lcursor_i.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include "mk_Gcursor_i.c" 3 | -------------------------------------------------------------------------------- /src/ia64/mk_cursor_i: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | test -z "$1" && exit 1 3 | echo "/* GENERATED */" 4 | echo "#ifndef cursor_i_h" 5 | echo "#define cursor_i_h" 6 | sed -ne 's/^->"\(\S*\)" \(\d*\)/#define \1 \2/p' < $1 || exit $? 7 | echo "#endif" 8 | -------------------------------------------------------------------------------- /src/libunwind-generic.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libunwind-generic 7 | Description: libunwind generic library 8 | Version: @VERSION@ 9 | Requires: libunwind 10 | Libs: -L${libdir} -lunwind-generic 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /src/loongarch64/Lapply_reg_state.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gapply_reg_state.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/loongarch64/Lcreate_addr_space.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gcreate_addr_space.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/loongarch64/Lget_proc_info.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_proc_info.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/loongarch64/Lget_save_loc.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_save_loc.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/loongarch64/Lglobal.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gglobal.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/loongarch64/Linit.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/loongarch64/Linit_local.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_local.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/loongarch64/Linit_remote.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_remote.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/loongarch64/Lis_signal_frame.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gis_signal_frame.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/loongarch64/Lreg_states_iterate.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Greg_states_iterate.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/loongarch64/Lregs.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gregs.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/loongarch64/Lresume.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gresume.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/loongarch64/Lstep.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstep.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/loongarch64/is_fpreg.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2008 CodeSourcery 3 | 4 | This file is part of libunwind. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 24 | 25 | #include "libunwind_i.h" 26 | 27 | /* FIXME: I'm not sure if libunwind's FP register distinction is very useful 28 | on LoongArch64. */ 29 | 30 | int 31 | unw_is_fpreg (int regnum) 32 | { 33 | /* FIXME: Support FP. */ 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /src/loongarch64/siglongjmp.S: -------------------------------------------------------------------------------- 1 | /* Dummy implementation for now. */ 2 | 3 | .globl _UI_siglongjmp_cont 4 | .globl _UI_longjmp_cont 5 | 6 | _UI_siglongjmp_cont: 7 | _UI_longjmp_cont: 8 | jirl $r0, $r1, 0 9 | -------------------------------------------------------------------------------- /src/mi/Gdestroy_addr_space.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2002, 2005 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "libunwind_i.h" 27 | 28 | void 29 | unw_destroy_addr_space (unw_addr_space_t as) 30 | { 31 | #ifndef UNW_LOCAL_ONLY 32 | # if UNW_DEBUG 33 | memset (as, 0, sizeof (*as)); 34 | # endif 35 | free (as); 36 | #endif 37 | } 38 | -------------------------------------------------------------------------------- /src/mi/Gget_fpreg.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2004-2005 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "libunwind_i.h" 27 | 28 | int 29 | unw_get_fpreg (unw_cursor_t *cursor, int regnum, unw_fpreg_t *valp) 30 | { 31 | struct cursor *c = (struct cursor *) cursor; 32 | 33 | return tdep_access_fpreg (c, regnum, valp, 0); 34 | } 35 | -------------------------------------------------------------------------------- /src/mi/Gset_fpreg.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2004-2005 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "libunwind_i.h" 27 | 28 | int 29 | unw_set_fpreg (unw_cursor_t *cursor, int regnum, unw_fpreg_t val) 30 | { 31 | struct cursor *c = (struct cursor *) cursor; 32 | 33 | return tdep_access_fpreg (c, regnum, &val, 1); 34 | } 35 | -------------------------------------------------------------------------------- /src/mi/Gset_reg.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2002, 2005 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "libunwind_i.h" 27 | 28 | int 29 | unw_set_reg (unw_cursor_t *cursor, int regnum, unw_word_t valp) 30 | { 31 | struct cursor *c = (struct cursor *) cursor; 32 | 33 | return tdep_access_reg (c, regnum, &valp, 1); 34 | } 35 | -------------------------------------------------------------------------------- /src/mi/Ldestroy_addr_space.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gdestroy_addr_space.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mi/Ldyn-extract.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gdyn-extract.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mi/Ldyn-remote.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gdyn-remote.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mi/Lfind_dynamic_proc_info.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gfind_dynamic_proc_info.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mi/Lget_accessors.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_accessors.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mi/Lget_fpreg.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_fpreg.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mi/Lget_proc_info_by_ip.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_proc_info_by_ip.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mi/Lget_proc_info_in_range.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_proc_info_in_range.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mi/Lget_proc_name.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_proc_name.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mi/Lget_reg.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_reg.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mi/Lput_dynamic_unwind_info.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gput_dynamic_unwind_info.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mi/Lset_cache_size.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gset_cache_size.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mi/Lset_caching_policy.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gset_caching_policy.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mi/Lset_fpreg.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gset_fpreg.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mi/Lset_reg.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gset_reg.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mi/_ReadSLEB.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | unw_word_t 4 | _ReadSLEB (unsigned char **dpp) 5 | { 6 | unsigned shift = 0; 7 | unw_word_t byte, result = 0; 8 | unsigned char *bp = *dpp; 9 | 10 | while (1) 11 | { 12 | byte = *bp++; 13 | result |= (byte & 0x7f) << shift; 14 | shift += 7; 15 | if ((byte & 0x80) == 0) 16 | break; 17 | } 18 | 19 | if (shift < 8 * sizeof (unw_word_t) && (byte & 0x40) != 0) 20 | /* sign-extend negative value */ 21 | result |= ((unw_word_t) -1) << shift; 22 | 23 | *dpp = bp; 24 | return result; 25 | } 26 | -------------------------------------------------------------------------------- /src/mi/_ReadULEB.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | unw_word_t 4 | _ReadULEB (unsigned char **dpp) 5 | { 6 | unsigned shift = 0; 7 | unw_word_t byte, result = 0; 8 | unsigned char *bp = *dpp; 9 | 10 | while (1) 11 | { 12 | byte = *bp++; 13 | result |= (byte & 0x7f) << shift; 14 | if ((byte & 0x80) == 0) 15 | break; 16 | shift += 7; 17 | } 18 | *dpp = bp; 19 | return result; 20 | } 21 | -------------------------------------------------------------------------------- /src/mi/dyn-info-list.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2001-2002, 2005 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "libunwind_i.h" 27 | 28 | HIDDEN unw_dyn_info_list_t _U_dyn_info_list; 29 | 30 | unw_word_t 31 | _U_dyn_info_list_addr (void) 32 | { 33 | return (unw_word_t) (uintptr_t) &_U_dyn_info_list; 34 | } 35 | -------------------------------------------------------------------------------- /src/mips/Gresume.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2008 CodeSourcery 3 | 4 | This file is part of libunwind. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 24 | 25 | /* FIXME for MIPS. */ 26 | 27 | #include 28 | 29 | #include "unwind_i.h" 30 | 31 | #ifndef UNW_REMOTE_ONLY 32 | 33 | HIDDEN inline int 34 | mips_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg) 35 | { 36 | return -UNW_EINVAL; 37 | } 38 | 39 | #endif /* !UNW_REMOTE_ONLY */ 40 | 41 | int 42 | unw_resume (unw_cursor_t *cursor) 43 | { 44 | return -UNW_EINVAL; 45 | } 46 | -------------------------------------------------------------------------------- /src/mips/Lapply_reg_state.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gapply_reg_state.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mips/Lcreate_addr_space.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gcreate_addr_space.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mips/Lget_proc_info.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_proc_info.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mips/Lget_save_loc.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_save_loc.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mips/Lglobal.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gglobal.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mips/Linit.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mips/Linit_local.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_local.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mips/Linit_remote.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_remote.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mips/Lis_signal_frame.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gis_signal_frame.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mips/Lreg_states_iterate.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Greg_states_iterate.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mips/Lregs.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gregs.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mips/Lresume.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gresume.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mips/Lstep.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstep.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/mips/elfxx.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2008 CodeSourcery 3 | 4 | This file is part of libunwind. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 24 | 25 | #include "libunwind_i.h" 26 | 27 | #include "../src/elfxx.c" 28 | -------------------------------------------------------------------------------- /src/mips/gen-offsets.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define UC(N,X) \ 6 | printf ("#define LINUX_UC_" N "_OFF\t0x%X\n", offsetof (ucontext_t, X)) 7 | 8 | #define SC(N,X) \ 9 | printf ("#define LINUX_SC_" N "_OFF\t0x%X\n", offsetof (struct sigcontext, X)) 10 | 11 | int 12 | main (void) 13 | { 14 | printf ( 15 | "/* Linux-specific definitions: */\n\n" 16 | 17 | "/* Define various structure offsets to simplify cross-compilation. */\n\n" 18 | 19 | "/* Offsets for MIPS Linux \"ucontext_t\": */\n\n"); 20 | 21 | UC ("FLAGS", uc_flags); 22 | UC ("LINK", uc_link); 23 | UC ("STACK", uc_stack); 24 | UC ("MCONTEXT", uc_mcontext); 25 | UC ("SIGMASK", uc_sigmask); 26 | 27 | UC ("MCONTEXT_GREGS", uc_mcontext.gregs); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /src/mips/is_fpreg.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2008 CodeSourcery 3 | 4 | This file is part of libunwind. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 24 | 25 | #include "libunwind_i.h" 26 | 27 | /* FIXME: I'm not sure if libunwind's GP/FP register distinction is very useful 28 | on MIPS. */ 29 | 30 | int 31 | unw_is_fpreg (int regnum) 32 | { 33 | /* FIXME: Support FP. */ 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /src/mips/siglongjmp.S: -------------------------------------------------------------------------------- 1 | /* Dummy implementation for now. */ 2 | 3 | .globl _UI_siglongjmp_cont 4 | .globl _UI_longjmp_cont 5 | 6 | _UI_siglongjmp_cont: 7 | _UI_longjmp_cont: 8 | j $31 9 | -------------------------------------------------------------------------------- /src/ppc/Gget_save_loc.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | 3 | Copied from src/x86_64/, modified slightly (or made empty stubs) for 4 | building frysk successfully on ppc64, by Wu Zhou 5 | 6 | This file is part of libunwind. 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining 9 | a copy of this software and associated documentation files (the 10 | "Software"), to deal in the Software without restriction, including 11 | without limitation the rights to use, copy, modify, merge, publish, 12 | distribute, sublicense, and/or sell copies of the Software, and to 13 | permit persons to whom the Software is furnished to do so, subject to 14 | the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 26 | 27 | #include 28 | 29 | int 30 | unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc) 31 | { 32 | /* XXX: empty stub. */ 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /src/ppc/Lapply_reg_state.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gapply_reg_state.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc/Lget_proc_info.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_proc_info.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc/Lget_save_loc.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_save_loc.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc/Linit_local.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_local.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc/Linit_remote.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_remote.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc/Lis_signal_frame.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gis_signal_frame.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc/Lreg_states_iterate.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Greg_states_iterate.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc/longjmp.S: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | 3 | Copied from src/x86_64/, modified slightly (or made empty stubs) for 4 | building frysk successfully on ppc64, by Wu Zhou 5 | 6 | This file is part of libunwind. 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining 9 | a copy of this software and associated documentation files (the 10 | "Software"), to deal in the Software without restriction, including 11 | without limitation the rights to use, copy, modify, merge, publish, 12 | distribute, sublicense, and/or sell copies of the Software, and to 13 | permit persons to whom the Software is furnished to do so, subject to 14 | the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 26 | 27 | .globl _UI_longjmp_cont 28 | 29 | .type _UI_longjmp_cont, @function 30 | _UI_longjmp_cont: 31 | .size _UI_longjmp_cont, .-_UI_longjmp_cont 32 | 33 | #ifdef __linux__ 34 | /* We do not need executable stack. */ 35 | .section .note.GNU-stack,"",@progbits 36 | #endif 37 | -------------------------------------------------------------------------------- /src/ppc/siglongjmp.S: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | 3 | This file is part of libunwind. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 23 | 24 | .globl _UI_siglongjmp_cont 25 | 26 | _UI_siglongjmp_cont: 27 | 28 | #ifdef __linux__ 29 | /* We do not need executable stack. */ 30 | .section .note.GNU-stack,"",@progbits 31 | #endif 32 | -------------------------------------------------------------------------------- /src/ppc32/Lapply_reg_state.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gapply_reg_state.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc32/Lcreate_addr_space.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gcreate_addr_space.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc32/Lglobal.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gglobal.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc32/Linit.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc32/Lreg_states_iterate.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Greg_states_iterate.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc32/Lregs.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gregs.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc32/Lresume.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gresume.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc32/Lstep.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstep.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc32/Make-arch.in: -------------------------------------------------------------------------------- 1 | # Word size. 2 | ELFW = 64 3 | # Does use dwarf2 unwind info. 4 | dwarf_target = true 5 | 6 | libunwind_setjmp_OBJS += \ 7 | $(arch)/longjmp.o \ 8 | $(arch)/siglongjmp.o 9 | 10 | libunwind_OBJS_common += \ 11 | $(arch)/is_fpreg.o 12 | -------------------------------------------------------------------------------- /src/ppc32/get_func_addr.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2006-2007 IBM 3 | Contributed by 4 | Corey Ashford 5 | Jose Flavio Aguilar Paulino 6 | 7 | This file is part of libunwind. 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining 10 | a copy of this software and associated documentation files (the 11 | "Software"), to deal in the Software without restriction, including 12 | without limitation the rights to use, copy, modify, merge, publish, 13 | distribute, sublicense, and/or sell copies of the Software, and to 14 | permit persons to whom the Software is furnished to do so, subject to 15 | the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be 18 | included in all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 27 | 28 | #include "unwind_i.h" 29 | 30 | int 31 | tdep_get_func_addr (unw_addr_space_t as, unw_word_t symbol_val_addr, 32 | unw_word_t *real_func_addr) 33 | { 34 | *real_func_addr = symbol_val_addr; 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /src/ppc32/is_fpreg.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2006-2007 IBM 3 | Contributed by 4 | Corey Ashford 5 | Jose Flavio Aguilar Paulino 6 | 7 | This file is part of libunwind. 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining 10 | a copy of this software and associated documentation files (the 11 | "Software"), to deal in the Software without restriction, including 12 | without limitation the rights to use, copy, modify, merge, publish, 13 | distribute, sublicense, and/or sell copies of the Software, and to 14 | permit persons to whom the Software is furnished to do so, subject to 15 | the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be 18 | included in all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 27 | 28 | #include "libunwind_i.h" 29 | 30 | int 31 | unw_is_fpreg (int regnum) 32 | { 33 | return (regnum >= UNW_PPC32_F0 && regnum <= UNW_PPC32_F31); 34 | } 35 | -------------------------------------------------------------------------------- /src/ppc64/Lapply_reg_state.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gapply_reg_state.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc64/Lcreate_addr_space.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gcreate_addr_space.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc64/Lglobal.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gglobal.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc64/Linit.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc64/Lreg_states_iterate.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Greg_states_iterate.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc64/Lregs.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gregs.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc64/Lresume.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gresume.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc64/Lstep.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstep.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/ppc64/is_fpreg.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2006-2007 IBM 3 | Contributed by 4 | Corey Ashford 5 | Jose Flavio Aguilar Paulino 6 | 7 | This file is part of libunwind. 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining 10 | a copy of this software and associated documentation files (the 11 | "Software"), to deal in the Software without restriction, including 12 | without limitation the rights to use, copy, modify, merge, publish, 13 | distribute, sublicense, and/or sell copies of the Software, and to 14 | permit persons to whom the Software is furnished to do so, subject to 15 | the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be 18 | included in all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 27 | 28 | #include "libunwind_i.h" 29 | 30 | int 31 | unw_is_fpreg (int regnum) 32 | { 33 | return (regnum >= UNW_PPC64_F0 && regnum <= UNW_PPC64_F31); 34 | } 35 | -------------------------------------------------------------------------------- /src/ptrace/_UPT_destroy.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2003 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "_UPT_internal.h" 27 | 28 | void 29 | _UPT_destroy (void *ptr) 30 | { 31 | struct UPT_info *ui = (struct UPT_info *) ptr; 32 | invalidate_edi (&ui->edi); 33 | free (ptr); 34 | } 35 | -------------------------------------------------------------------------------- /src/ptrace/_UPT_elf.c: -------------------------------------------------------------------------------- 1 | /* We need to get a separate copy of the ELF-code into 2 | libunwind-ptrace since it cannot (and must not) have any ELF 3 | dependencies on libunwind. */ 4 | #include "libunwind_i.h" /* get ELFCLASS defined */ 5 | #include "../elfxx.c" 6 | -------------------------------------------------------------------------------- /src/ptrace/_UPT_put_unwind_info.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2003 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "_UPT_internal.h" 27 | 28 | void 29 | _UPT_put_unwind_info (unw_addr_space_t as, unw_proc_info_t *pi, void *arg) 30 | { 31 | if (!pi->unwind_info) 32 | return; 33 | free (pi->unwind_info); 34 | pi->unwind_info = NULL; 35 | } 36 | -------------------------------------------------------------------------------- /src/ptrace/libunwind-ptrace.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libunwind-ptrace 7 | Description: libunwind ptrace library 8 | Version: @VERSION@ 9 | Requires: libunwind-generic libunwind 10 | Libs: -L${libdir} -lunwind-ptrace 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /src/riscv/Lapply_reg_state.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gapply_reg_state.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/riscv/Lcreate_addr_space.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gcreate_addr_space.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/riscv/Lget_proc_info.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_proc_info.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/riscv/Lget_save_loc.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_save_loc.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/riscv/Lglobal.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gglobal.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/riscv/Linit.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/riscv/Linit_local.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_local.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/riscv/Linit_remote.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_remote.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/riscv/Lis_signal_frame.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gis_signal_frame.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/riscv/Lreg_states_iterate.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Greg_states_iterate.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/riscv/Lregs.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gregs.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/riscv/Lresume.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gresume.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/riscv/Lstep.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstep.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/riscv/is_fpreg.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2008 CodeSourcery 3 | 4 | This file is part of libunwind. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 24 | 25 | #include "libunwind_i.h" 26 | 27 | int 28 | unw_is_fpreg (int regnum) 29 | { 30 | return (regnum >= UNW_RISCV_F0 && regnum <= UNW_RISCV_F31); 31 | } 32 | -------------------------------------------------------------------------------- /src/riscv/offsets.h: -------------------------------------------------------------------------------- 1 | #ifdef __linux__ 2 | 3 | /* Linux-specific definitions: */ 4 | 5 | /* The RISC-V ucontext has the following structure: 6 | 7 | https://github.com/torvalds/linux/blob/44db63d1ad8d71c6932cbe007eb41f31c434d140/arch/riscv/include/uapi/asm/ucontext.h 8 | */ 9 | #define UC_MCONTEXT_REGS_OFF 176 10 | 11 | #else 12 | # error "Unsupported OS" 13 | #endif 14 | -------------------------------------------------------------------------------- /src/riscv/siglongjmp.S: -------------------------------------------------------------------------------- 1 | /* Dummy implementation for now. */ 2 | .globl _UI_siglongjmp_cont 3 | .globl _UI_longjmp_cont 4 | 5 | _UI_siglongjmp_cont: 6 | _UI_longjmp_cont: 7 | ret 8 | -------------------------------------------------------------------------------- /src/s390x/Lapply_reg_state.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gapply_reg_state.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/s390x/Lcreate_addr_space.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gcreate_addr_space.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/s390x/Lget_proc_info.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_proc_info.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/s390x/Lget_save_loc.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_save_loc.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/s390x/Lglobal.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include "config.h" 3 | #include 4 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 5 | #include "Gglobal.c" 6 | #endif 7 | -------------------------------------------------------------------------------- /src/s390x/Linit.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/s390x/Linit_local.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_local.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/s390x/Linit_remote.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_remote.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/s390x/Lis_signal_frame.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gis_signal_frame.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/s390x/Lreg_states_iterate.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Greg_states_iterate.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/s390x/Lregs.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gregs.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/s390x/Lresume.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gresume.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/s390x/Lstep.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstep.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/setjmp/libunwind-setjmp.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libunwind-setjmp 7 | Description: libunwind setjmp library 8 | Version: @VERSION@ 9 | Requires: libunwind 10 | Libs: -L${libdir} -lunwind-setjmp 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /src/sh/Gget_proc_info.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2008 CodeSourcery 3 | 4 | This file is part of libunwind. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 24 | 25 | #include "unwind_i.h" 26 | 27 | int 28 | unw_get_proc_info (unw_cursor_t *cursor, unw_proc_info_t *pi) 29 | { 30 | struct cursor *c = (struct cursor *) cursor; 31 | int ret; 32 | 33 | ret = dwarf_make_proc_info (&c->dwarf); 34 | if (ret < 0) 35 | return ret; 36 | 37 | *pi = c->dwarf.pi; 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /src/sh/Lapply_reg_state.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gapply_reg_state.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/sh/Lcreate_addr_space.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gcreate_addr_space.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/sh/Lget_proc_info.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_proc_info.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/sh/Lget_save_loc.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_save_loc.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/sh/Lglobal.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gglobal.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/sh/Linit.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/sh/Linit_local.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_local.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/sh/Linit_remote.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_remote.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/sh/Lis_signal_frame.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gis_signal_frame.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/sh/Lreg_states_iterate.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Greg_states_iterate.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/sh/Lregs.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gregs.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/sh/Lresume.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gresume.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/sh/Lstep.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstep.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/sh/gen-offsets.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define UC(N,X) \ 7 | printf ("#define LINUX_UC_" N "_OFF\t0x%X\n", offsetof (ucontext_t, X)) 8 | 9 | #define SC(N,X) \ 10 | printf ("#define LINUX_SC_" N "_OFF\t0x%X\n", offsetof (struct sigcontext, X)) 11 | 12 | int 13 | main (void) 14 | { 15 | printf ( 16 | "/* Linux-specific definitions: */\n\n" 17 | 18 | "/* Define various structure offsets to simplify cross-compilation. */\n\n" 19 | 20 | "/* Offsets for SH Linux \"ucontext_t\": */\n\n"); 21 | 22 | UC ("FLAGS", uc_flags); 23 | UC ("LINK", uc_link); 24 | UC ("STACK", uc_stack); 25 | UC ("MCONTEXT", uc_mcontext); 26 | UC ("SIGMASK", uc_sigmask); 27 | 28 | printf ("\n/* Offsets for SH Linux \"struct sigcontext\": */\n\n"); 29 | 30 | SC ("R0", sc_regs[0]); 31 | SC ("R1", sc_regs[1]); 32 | SC ("R2", sc_regs[2]); 33 | SC ("R3", sc_regs[3]); 34 | SC ("R4", sc_regs[4]); 35 | SC ("R5", sc_regs[5]); 36 | SC ("R6", sc_regs[6]); 37 | SC ("R7", sc_regs[7]); 38 | SC ("R8", sc_regs[8]); 39 | SC ("R9", sc_regs[9]); 40 | SC ("R10", sc_regs[10]); 41 | SC ("R11", sc_regs[11]); 42 | SC ("R12", sc_regs[12]); 43 | SC ("R13", sc_regs[13]); 44 | SC ("R14", sc_regs[14]); 45 | SC ("R15", sc_regs[15]); 46 | 47 | SC ("PC", sc_pc); 48 | SC ("PR", sc_pr); 49 | 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /src/sh/is_fpreg.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2008 CodeSourcery 3 | 4 | This file is part of libunwind. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 24 | 25 | #include "libunwind_i.h" 26 | 27 | int 28 | unw_is_fpreg (int regnum) 29 | { 30 | /* FIXME: Support FP. */ 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /src/sh/offsets.h: -------------------------------------------------------------------------------- 1 | /* Linux-specific definitions: */ 2 | 3 | /* Define various structure offsets to simplify cross-compilation. */ 4 | 5 | /* Offsets for SH Linux "ucontext_t": */ 6 | 7 | #define LINUX_UC_FLAGS_OFF 0x0 8 | #define LINUX_UC_LINK_OFF 0x4 9 | #define LINUX_UC_STACK_OFF 0x8 10 | #define LINUX_UC_MCONTEXT_OFF 0x14 11 | #define LINUX_UC_SIGMASK_OFF 0xFC 12 | 13 | /* Offsets for SH Linux "struct sigcontext": */ 14 | 15 | #define LINUX_SC_R0_OFF 0x4 16 | #define LINUX_SC_R1_OFF 0x8 17 | #define LINUX_SC_R2_OFF 0xC 18 | #define LINUX_SC_R3_OFF 0x10 19 | #define LINUX_SC_R4_OFF 0x14 20 | #define LINUX_SC_R5_OFF 0x18 21 | #define LINUX_SC_R6_OFF 0x1C 22 | #define LINUX_SC_R7_OFF 0x20 23 | #define LINUX_SC_R8_OFF 0x24 24 | #define LINUX_SC_R9_OFF 0x28 25 | #define LINUX_SC_R10_OFF 0x2C 26 | #define LINUX_SC_R11_OFF 0x30 27 | #define LINUX_SC_R12_OFF 0x34 28 | #define LINUX_SC_R13_OFF 0x38 29 | #define LINUX_SC_R14_OFF 0x3C 30 | #define LINUX_SC_R15_OFF 0x40 31 | #define LINUX_SC_PC_OFF 0x44 32 | #define LINUX_SC_PR_OFF 0x48 33 | -------------------------------------------------------------------------------- /src/sh/siglongjmp.S: -------------------------------------------------------------------------------- 1 | /* Dummy implementation for now. */ 2 | 3 | .globl _UI_siglongjmp_cont 4 | .globl _UI_longjmp_cont 5 | 6 | _UI_siglongjmp_cont: 7 | _UI_longjmp_cont: 8 | rts 9 | -------------------------------------------------------------------------------- /src/tilegx/Lapply_reg_state.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gapply_reg_state.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/tilegx/Lcreate_addr_space.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gcreate_addr_space.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/tilegx/Lget_proc_info.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_proc_info.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/tilegx/Lget_save_loc.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_save_loc.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/tilegx/Lglobal.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gglobal.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/tilegx/Linit.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/tilegx/Linit_local.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_local.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/tilegx/Linit_remote.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_remote.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/tilegx/Lis_signal_frame.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gis_signal_frame.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/tilegx/Lreg_states_iterate.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Greg_states_iterate.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/tilegx/Lregs.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gregs.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/tilegx/Lresume.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gresume.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/tilegx/Lstep.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstep.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/tilegx/elfxx.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2008 CodeSourcery 3 | 4 | This file is part of libunwind. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 24 | 25 | #include "libunwind_i.h" 26 | 27 | #include "../src/elfxx.c" 28 | -------------------------------------------------------------------------------- /src/tilegx/gen-offsets.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define UC(N,X) \ 6 | printf ("#define LINUX_UC_" N "_OFF\t0x%X\n", offsetof (ucontext_t, X)) 7 | 8 | #define SC(N,X) \ 9 | printf ("#define LINUX_SC_" N "_OFF\t0x%X\n", offsetof (struct sigcontext, X)) 10 | 11 | int 12 | main (void) 13 | { 14 | printf ( 15 | "/* Linux-specific definitions: */\n\n" 16 | 17 | "/* Define various structure offsets to simplify cross-compilation. */\n\n" 18 | 19 | "/* Offsets for TILEGX Linux \"ucontext_t\": */\n\n"); 20 | 21 | UC ("FLAGS", uc_flags); 22 | UC ("LINK", uc_link); 23 | UC ("STACK", uc_stack); 24 | UC ("MCONTEXT", uc_mcontext); 25 | UC ("SIGMASK", uc_sigmask); 26 | 27 | UC ("MCONTEXT_GREGS", uc_mcontext.gregs); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /src/tilegx/getcontext.S: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2008 CodeSourcery 3 | Copyright (C) 2014 Tilera Corp. 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "offsets.h" 27 | #include 28 | 29 | .text 30 | # define REG(X) LINUX_UC_MCONTEXT_GREGS + 8 * (X) 31 | .global _Utilegx_getcontext 32 | .type _Utilegx_getcontext, %function 33 | # This is a stub version of getcontext() for TILEGX. 34 | _Utilegx_getcontext: 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/tilegx/is_fpreg.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2008 CodeSourcery 3 | 4 | This file is part of libunwind. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 24 | 25 | #include "libunwind_i.h" 26 | 27 | /* TILEGX has no FP. */ 28 | 29 | int 30 | unw_is_fpreg (int regnum) 31 | { 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /src/tilegx/offsets.h: -------------------------------------------------------------------------------- 1 | /* Linux-specific definitions: */ 2 | 3 | /* Define various structure offsets to simplify cross-compilation. */ 4 | 5 | /* Offsets for TILEGX Linux "ucontext_t": */ 6 | 7 | #define LINUX_UC_FLAGS_OFF 0x0 8 | #define LINUX_UC_LINK_OFF 0x8 9 | #define LINUX_UC_STACK_OFF 0x10 10 | #define LINUX_UC_MCONTEXT_OFF 0x28 11 | #define LINUX_UC_SIGMASK_OFF 0x228 12 | #define LINUX_UC_MCONTEXT_GREGS 0x28 13 | -------------------------------------------------------------------------------- /src/tilegx/siglongjmp.S: -------------------------------------------------------------------------------- 1 | /* Dummy implementation for now. */ 2 | .globl _UI_siglongjmp_cont 3 | .globl _UI_longjmp_cont 4 | 5 | _UI_siglongjmp_cont: 6 | _UI_longjmp_cont: 7 | jrp lr 8 | -------------------------------------------------------------------------------- /src/unwind/GetIP.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2003-2004 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "unwind-internal.h" 27 | 28 | unsigned long 29 | _Unwind_GetIP (struct _Unwind_Context *context) 30 | { 31 | unw_word_t val; 32 | 33 | unw_get_reg (&context->cursor, UNW_REG_IP, &val); 34 | return val; 35 | } 36 | 37 | unsigned long __libunwind_Unwind_GetIP (struct _Unwind_Context *) 38 | ALIAS (_Unwind_GetIP); 39 | -------------------------------------------------------------------------------- /src/unwind/GetTextRelBase.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2003-2004 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "unwind-internal.h" 27 | 28 | unsigned long 29 | _Unwind_GetTextRelBase (struct _Unwind_Context *context) 30 | { 31 | return 0; 32 | } 33 | 34 | unsigned long __libunwind_Unwind_GetTextRelBase (struct _Unwind_Context *) 35 | ALIAS (_Unwind_GetTextRelBase); 36 | -------------------------------------------------------------------------------- /src/unwind/SetIP.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2003-2004 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "unwind-internal.h" 27 | 28 | void 29 | _Unwind_SetIP (struct _Unwind_Context *context, unsigned long new_value) 30 | { 31 | unw_set_reg (&context->cursor, UNW_REG_IP, new_value); 32 | } 33 | 34 | void __libunwind_Unwind_SetIP (struct _Unwind_Context *, unsigned long) 35 | ALIAS (_Unwind_SetIP); 36 | -------------------------------------------------------------------------------- /src/unwind/libunwind.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libunwind 7 | Description: libunwind base library 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lunwind 10 | Libs.private: @LIBLZMA@ @LIBZ@ 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /src/x86/Lapply_reg_state.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gapply_reg_state.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86/Lcreate_addr_space.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gcreate_addr_space.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86/Lget_proc_info.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_proc_info.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86/Lget_save_loc.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_save_loc.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86/Lglobal.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gglobal.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86/Linit.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86/Linit_local.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_local.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86/Linit_remote.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_remote.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86/Los-freebsd.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gos-freebsd.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86/Los-linux.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gos-linux.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86/Lreg_states_iterate.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Greg_states_iterate.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86/Lregs.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gregs.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86/Lresume.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gresume.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86/Lstep.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstep.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86/is_fpreg.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (c) 2004-2005 Hewlett-Packard Development Company, L.P. 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | #include "libunwind_i.h" 27 | 28 | int 29 | unw_is_fpreg (int regnum) 30 | { 31 | return ((regnum >= UNW_X86_ST0 && regnum <= UNW_X86_ST7) 32 | || (regnum >= UNW_X86_XMM0_lo && regnum <= UNW_X86_XMM7_hi) 33 | || (regnum >= UNW_X86_XMM0 && regnum <= UNW_X86_XMM7)); 34 | } 35 | -------------------------------------------------------------------------------- /src/x86/regname.c: -------------------------------------------------------------------------------- 1 | #include "unwind_i.h" 2 | 3 | static const char *regname[] = 4 | { 5 | "eax", "edx", "ecx", "ebx", "esi", "edi", "ebp", "esp", "eip", 6 | "eflags", "trapno", 7 | "st0", "st1", "st2", "st3", "st4", "st5", "st6", "st7", 8 | "fcw", "fsw", "ftw", "fop", "fcs", "fip", "fea", "fds", 9 | "xmm0_lo", "xmm0_hi", "xmm1_lo", "xmm1_hi", 10 | "xmm2_lo", "xmm2_hi", "xmm3_lo", "xmm3_hi", 11 | "xmm4_lo", "xmm4_hi", "xmm5_lo", "xmm5_hi", 12 | "xmm6_lo", "xmm6_hi", "xmm7_lo", "xmm7_hi", 13 | "mxcsr", 14 | "gs", "fs", "es", "ds", "ss", "cs", 15 | "tss", "ldt", 16 | "cfi", 17 | "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", 18 | }; 19 | 20 | const char * 21 | unw_regname (unw_regnum_t reg) 22 | { 23 | if (reg < (unw_regnum_t) ARRAY_SIZE (regname)) 24 | return regname[reg]; 25 | else 26 | return "???"; 27 | } 28 | -------------------------------------------------------------------------------- /src/x86_64/Lapply_reg_state.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gapply_reg_state.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86_64/Lcreate_addr_space.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gcreate_addr_space.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86_64/Lget_proc_info.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_proc_info.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86_64/Lget_save_loc.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gget_save_loc.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86_64/Lglobal.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include "config.h" 3 | #include 4 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 5 | #include "Gglobal.c" 6 | #endif 7 | -------------------------------------------------------------------------------- /src/x86_64/Linit.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86_64/Linit_local.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_local.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86_64/Linit_remote.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Ginit_remote.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86_64/Los-freebsd.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gos-freebsd.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86_64/Los-linux.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gos-linux.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86_64/Los-solaris.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gos-solaris.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86_64/Lreg_states_iterate.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Greg_states_iterate.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86_64/Lregs.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gregs.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86_64/Lresume.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gresume.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86_64/Lstash_frame.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstash_frame.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86_64/Lstep.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gstep.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86_64/Ltrace.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) 4 | #include "Gtrace.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/x86_64/longjmp.S: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2004-2005 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | .globl _UI_longjmp_cont 27 | .type _UI_longjmp_cont, @function 28 | _UI_longjmp_cont: 29 | push %rax /* push target IP as return address */ 30 | mov %rdx, %rax /* set up return-value */ 31 | retq 32 | .size _UI_longjmp_cont, .-_UI_longjmp_cont 33 | /* We do not need executable stack. */ 34 | .section .note.GNU-stack,"",@progbits 35 | -------------------------------------------------------------------------------- /src/x86_64/offsets.h: -------------------------------------------------------------------------------- 1 | /* FreeBSD specific definitions */ 2 | 3 | #define FREEBSD_UC_MCONTEXT_OFF 0x10 4 | -------------------------------------------------------------------------------- /src/x86_64/siglongjmp.S: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2004 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | 5 | This file is part of libunwind. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 | 26 | .globl _UI_siglongjmp_cont 27 | .type _UI_siglongjmp_cont, @function 28 | _UI_siglongjmp_cont: 29 | retq 30 | .size _UI_siglongjmp_cont, . - _UI_siglongjmp_cont 31 | /* We do not need executable stack. */ 32 | .section .note.GNU-stack,"",@progbits 33 | -------------------------------------------------------------------------------- /tests/Gtest-resume-sig-rt.c: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2003-2004 Hewlett-Packard Co 3 | Contributed by David Mosberger-Tang 4 | Copyright (C) 2012 Tommi Rantala 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 24 | 25 | /* The purpose of this test is to invoke different code paths in libunwind (on 26 | * some architectures), that are executed when the SA_SIGINFO sigaction() flag 27 | * is used. 28 | */ 29 | 30 | #define TEST_WITH_SIGINFO 1 31 | #include "Gtest-resume-sig.c" 32 | -------------------------------------------------------------------------------- /tests/Larm64-test-sve-signal.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Garm64-test-sve-signal.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/Lia64-test-nat.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Gia64-test-nat.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/Lia64-test-rbs.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Gia64-test-rbs.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/Lia64-test-readonly.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Gia64-test-readonly.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/Lia64-test-stack.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Gia64-test-stack.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/Lperf-simple.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Gperf-simple.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/Lperf-trace.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Gperf-trace.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/Ltest-bt.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Gtest-bt.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/Ltest-concurrent.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Gtest-concurrent.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/Ltest-dyn1.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Gtest-dyn1.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/Ltest-exc.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Gtest-exc.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/Ltest-init-local-signal-lib.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* To prevent inlining and optimizing away */ 4 | int foo(volatile int* f) { 5 | return *f; 6 | } 7 | -------------------------------------------------------------------------------- /tests/Ltest-init-local-signal.c: -------------------------------------------------------------------------------- 1 | #include "libunwind.h" 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | int stepper(unw_cursor_t* c) { 13 | int steps = 0; 14 | int ret = 1; 15 | while (ret) { 16 | 17 | ret = unw_step(c); 18 | if (!ret) { 19 | break; 20 | } 21 | steps++; 22 | } 23 | return steps; 24 | } 25 | 26 | /* Verify that we can step from both ucontext, and from getcontext() 27 | * roughly the same. This tests that the IP from ucontext is used 28 | * correctly (see impl of unw_init_local2) */ 29 | void handler(int num, siginfo_t* info, void* ucontext) { 30 | unw_cursor_t c; 31 | unw_context_t context; 32 | unw_getcontext(&context); 33 | int ret = unw_init_local2(&c, ucontext, UNW_INIT_SIGNAL_FRAME); 34 | assert(!ret); 35 | int ucontext_steps = stepper(&c); 36 | 37 | ret = unw_init_local(&c, &context); 38 | (void)ret; 39 | assert(!ret); 40 | int getcontext_steps = stepper(&c); 41 | if (ucontext_steps == getcontext_steps - 2) { 42 | exit(0); 43 | } 44 | printf("unw_getcontext steps was %i, ucontext steps was %i, should be %i\n", 45 | getcontext_steps, ucontext_steps, getcontext_steps - 2); 46 | exit(-1); 47 | } 48 | 49 | int foo(volatile int* f); 50 | 51 | int main(){ 52 | struct sigaction a; 53 | memset(&a, 0, sizeof(struct sigaction)); 54 | a.sa_sigaction = &handler; 55 | a.sa_flags = SA_SIGINFO; 56 | sigaction(SIGSEGV, &a, NULL); 57 | 58 | foo(NULL); 59 | return 0; 60 | } 61 | -------------------------------------------------------------------------------- /tests/Ltest-init.cxx: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Gtest-init.cxx" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/Ltest-nomalloc.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Gtest-nomalloc.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/Ltest-resume-sig-rt.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Gtest-resume-sig-rt.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/Ltest-resume-sig.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Gtest-resume-sig.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/Ltest-trace.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Gtest-trace.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/Lx64-test-dwarf-expressions.c: -------------------------------------------------------------------------------- 1 | #define UNW_LOCAL_ONLY 2 | #include 3 | #if !defined(UNW_REMOTE_ONLY) 4 | #include "Gx64-test-dwarf-expressions.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/flush-cache.h: -------------------------------------------------------------------------------- 1 | /* libunwind - a platform-independent unwind library 2 | Copyright (C) 2012 Tommi Rantala 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 22 | 23 | #ifndef FLUSH_CACHE_H 24 | #define FLUSH_CACHE_H 25 | 26 | #ifdef HAVE_CONFIG_H 27 | # include "config.h" 28 | #endif 29 | 30 | #ifdef HAVE__BUILTIN___CLEAR_CACHE 31 | #define flush_cache(ADDR, LEN) \ 32 | __builtin___clear_cache((ADDR), (ADDR) + (LEN)) 33 | #else 34 | #include 35 | extern void flush_cache (void *addr, size_t len); 36 | #endif 37 | 38 | #endif /* FLUSH_CACHE_H */ 39 | -------------------------------------------------------------------------------- /tests/ia64-test-rbs.h: -------------------------------------------------------------------------------- 1 | #define NSTACKS 128 2 | #define STACK_SIZE_SHIFT 17 3 | #define STACK_SIZE (1 << STACK_SIZE_SHIFT) 4 | -------------------------------------------------------------------------------- /tests/ia64-test-stack.h: -------------------------------------------------------------------------------- 1 | #define NSTACKS 1024 2 | #define STACK_SIZE_SHIFT 17 3 | #define STACK_SIZE (1 << STACK_SIZE_SHIFT) 4 | -------------------------------------------------------------------------------- /tests/ident.c: -------------------------------------------------------------------------------- 1 | long 2 | f (long val) 3 | { 4 | return val; 5 | } 6 | -------------------------------------------------------------------------------- /tests/perf-startup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | platform=$1 3 | LIBUNWIND=../src/.libs/libunwind.so 4 | LIBUNWIND_PLAT=../src/.libs/libunwind-$platform.so 5 | warmup=$(./forker 2000 /bin/true | cut -f1 -d' ') 6 | 7 | nsec1=$(./forker 2000 /bin/true | cut -f1 -d' ') 8 | printf "\"/bin/true\"\t\t\t\t\t\t: $nsec1 nsec/execution\n" 9 | 10 | nsec2=$(LD_PRELOAD=$LIBUNWIND ./forker 2000 /bin/true | cut -f1 -d' ') 11 | printf "\"LD_PRELOAD=$LIBUNWIND /bin/true\"\t: $nsec2 nsec/execution\n" 12 | 13 | nsec3=$(LD_PRELOAD=$LIBUNWIND_PLAT ./forker 2000 /bin/true | cut -f1 -d' ') 14 | printf "\"LD_PRELOAD=$LIBUNWIND_PLAT /bin/true\"\t: $nsec3 nsec/execution\n" 15 | 16 | echo 17 | 18 | printf "Overhead of preloading $LIBUNWIND\t: $(($nsec2 - $nsec1)) nsec\n" 19 | printf "Overhead of preloading $LIBUNWIND_PLAT\t: $(($nsec3 - $nsec1)) nsec\n" 20 | -------------------------------------------------------------------------------- /tests/ppc64-test-altivec-utils.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | union si_overlay 5 | { 6 | vector signed int v; 7 | int ints[4]; 8 | }; 9 | 10 | vector signed int 11 | vec_init () 12 | { 13 | vector signed int v; 14 | static int count = 1; 15 | 16 | ((union si_overlay *) &v)->ints[0] = count++; 17 | ((union si_overlay *) &v)->ints[1] = count++; 18 | ((union si_overlay *) &v)->ints[2] = count++; 19 | ((union si_overlay *) &v)->ints[3] = count++; 20 | return v; 21 | } 22 | 23 | void 24 | vec_print (vector signed int v) 25 | { 26 | printf ("%08x %08x %08x %08x", 27 | ((union si_overlay *) &v)->ints[0], 28 | ((union si_overlay *) &v)->ints[1], 29 | ((union si_overlay *) &v)->ints[2], 30 | ((union si_overlay *) &v)->ints[3]); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /tests/run-check-namespace: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | chmod +x ./check-namespace.sh 3 | ./check-namespace.sh $* 4 | -------------------------------------------------------------------------------- /tests/run-coredump-unwind-mdi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This test intends to test the unw_get_proc_name function on binaries without 4 | # the symbol table but with so called MiniDebuginfo available. In particular, 5 | # it is tested using the coredump accessors. For more info about MiniDebugInfo 6 | # see e.g. http://fedoraproject.org/wiki/Features/MiniDebugInfo 7 | 8 | ${0%/*}/run-coredump-unwind -minidebuginfo 9 | -------------------------------------------------------------------------------- /tests/run-ia64-test-dyn1: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ./test-ptrace -t ./ia64-test-dyn1 3 | -------------------------------------------------------------------------------- /tests/run-ptrace-mapper: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ./test-ptrace -c -n -t ./mapper $* 3 | -------------------------------------------------------------------------------- /tests/run-ptrace-misc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ./test-ptrace -c -t ./test-ptrace-misc 3 | -------------------------------------------------------------------------------- /tests/test-strerror.c: -------------------------------------------------------------------------------- 1 | #include "compiler.h" 2 | #include 3 | #include 4 | 5 | int 6 | main (int argc, char **argv UNUSED) 7 | { 8 | int i, verbose = argc > 1; 9 | const char *msg; 10 | 11 | for (i = 0; i < 16; ++i) 12 | { 13 | msg = unw_strerror (-i); 14 | if (verbose) 15 | printf ("%6d -> %s\n", -i, msg); 16 | } 17 | return 0; 18 | } 19 | --------------------------------------------------------------------------------