1*0faf1914Srobert //===----------------------------------------------------------------------===// 2f6c50668Spatrick // 3f6c50668Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4f6c50668Spatrick // See https://llvm.org/LICENSE.txt for license information. 5f6c50668Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6f6c50668Spatrick // 7f6c50668Spatrick // 8f6c50668Spatrick // Extensions to libunwind API. 9f6c50668Spatrick // 10f6c50668Spatrick //===----------------------------------------------------------------------===// 11f6c50668Spatrick 12f6c50668Spatrick #ifndef __LIBUNWIND_EXT__ 13f6c50668Spatrick #define __LIBUNWIND_EXT__ 14f6c50668Spatrick 15f6c50668Spatrick #include "config.h" 16f6c50668Spatrick #include <libunwind.h> 17f6c50668Spatrick #include <unwind.h> 18f6c50668Spatrick 19f6c50668Spatrick #define UNW_STEP_SUCCESS 1 20f6c50668Spatrick #define UNW_STEP_END 0 21f6c50668Spatrick 22f6c50668Spatrick #ifdef __cplusplus 23f6c50668Spatrick extern "C" { 24f6c50668Spatrick #endif 25f6c50668Spatrick 26f6c50668Spatrick extern int __unw_getcontext(unw_context_t *); 27f6c50668Spatrick extern int __unw_init_local(unw_cursor_t *, unw_context_t *); 28f6c50668Spatrick extern int __unw_step(unw_cursor_t *); 29f6c50668Spatrick extern int __unw_get_reg(unw_cursor_t *, unw_regnum_t, unw_word_t *); 30f6c50668Spatrick extern int __unw_get_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t *); 31f6c50668Spatrick extern int __unw_set_reg(unw_cursor_t *, unw_regnum_t, unw_word_t); 32f6c50668Spatrick extern int __unw_set_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t); 33f6c50668Spatrick extern int __unw_resume(unw_cursor_t *); 34f6c50668Spatrick 35f6c50668Spatrick #ifdef __arm__ 36f6c50668Spatrick /* Save VFP registers in FSTMX format (instead of FSTMD). */ 37f6c50668Spatrick extern void __unw_save_vfp_as_X(unw_cursor_t *); 38f6c50668Spatrick #endif 39f6c50668Spatrick 40f6c50668Spatrick extern const char *__unw_regname(unw_cursor_t *, unw_regnum_t); 41f6c50668Spatrick extern int __unw_get_proc_info(unw_cursor_t *, unw_proc_info_t *); 42f6c50668Spatrick extern int __unw_is_fpreg(unw_cursor_t *, unw_regnum_t); 43f6c50668Spatrick extern int __unw_is_signal_frame(unw_cursor_t *); 44f6c50668Spatrick extern int __unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *); 45f6c50668Spatrick 46*0faf1914Srobert #if defined(_AIX) 47*0faf1914Srobert extern uintptr_t __unw_get_data_rel_base(unw_cursor_t *); 48*0faf1914Srobert #endif 49*0faf1914Srobert 50f6c50668Spatrick // SPI 51f6c50668Spatrick extern void __unw_iterate_dwarf_unwind_cache(void (*func)( 52f6c50668Spatrick unw_word_t ip_start, unw_word_t ip_end, unw_word_t fde, unw_word_t mh)); 53f6c50668Spatrick 54f6c50668Spatrick // IPI 55f6c50668Spatrick extern void __unw_add_dynamic_fde(unw_word_t fde); 56f6c50668Spatrick extern void __unw_remove_dynamic_fde(unw_word_t fde); 57f6c50668Spatrick 58*0faf1914Srobert extern void __unw_add_dynamic_eh_frame_section(unw_word_t eh_frame_start); 59*0faf1914Srobert extern void __unw_remove_dynamic_eh_frame_section(unw_word_t eh_frame_start); 60*0faf1914Srobert 61f6c50668Spatrick #if defined(_LIBUNWIND_ARM_EHABI) 62f6c50668Spatrick extern const uint32_t* decode_eht_entry(const uint32_t*, size_t*, size_t*); 63f6c50668Spatrick extern _Unwind_Reason_Code _Unwind_VRS_Interpret(_Unwind_Context *context, 64f6c50668Spatrick const uint32_t *data, 65f6c50668Spatrick size_t offset, size_t len); 66f6c50668Spatrick #endif 67f6c50668Spatrick 68f6c50668Spatrick #ifdef __cplusplus 69f6c50668Spatrick } 70f6c50668Spatrick #endif 71f6c50668Spatrick 72f6c50668Spatrick #endif // __LIBUNWIND_EXT__ 73