123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- #define UNW_VERSION_MAJOR @PKG_MAJOR@
- #define UNW_VERSION_MINOR @PKG_MINOR@
- #define UNW_VERSION_EXTRA @PKG_EXTRA@
- #define UNW_VERSION_CODE(maj,min) (((maj) << 16) | (min))
- #define UNW_VERSION UNW_VERSION_CODE(UNW_VERSION_MAJOR, UNW_VERSION_MINOR)
- #define UNW_PASTE2(x,y) x##y
- #define UNW_PASTE(x,y) UNW_PASTE2(x,y)
- #define UNW_OBJ(fn) UNW_PASTE(UNW_PREFIX, fn)
- #define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
- #ifdef UNW_LOCAL_ONLY
- # define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UL,UNW_TARGET),_)
- #else
- # define UNW_PREFIX UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_)
- #endif
- typedef enum
- {
- UNW_ESUCCESS = 0,
- UNW_EUNSPEC,
- UNW_ENOMEM,
- UNW_EBADREG,
- UNW_EREADONLYREG,
- UNW_ESTOPUNWIND,
- UNW_EINVALIDIP,
- UNW_EBADFRAME,
- UNW_EINVAL,
- UNW_EBADVERSION,
- UNW_ENOINFO
- }
- unw_error_t;
- typedef enum
- {
- UNW_REG_IP = UNW_TDEP_IP,
- UNW_REG_SP = UNW_TDEP_SP,
- UNW_REG_EH = UNW_TDEP_EH,
- UNW_REG_LAST = UNW_TDEP_LAST_REG
- }
- unw_frame_regnum_t;
- #define UNW_NUM_EH_REGS UNW_TDEP_NUM_EH_REGS
- typedef enum
- {
- UNW_CACHE_NONE,
- UNW_CACHE_GLOBAL,
- UNW_CACHE_PER_THREAD
- }
- unw_caching_policy_t;
- typedef int unw_regnum_t;
- typedef struct unw_cursor
- {
- unw_word_t opaque[UNW_TDEP_CURSOR_LEN];
- }
- unw_cursor_t;
- typedef unw_tdep_context_t unw_context_t;
- #define unw_getcontext(uc) unw_tdep_getcontext(uc)
- #define unw_is_fpreg(r) unw_tdep_is_fpreg(r)
- typedef unw_tdep_fpreg_t unw_fpreg_t;
- typedef struct unw_addr_space *unw_addr_space_t;
- #define UNW_PI_FLAG_FIRST_TDEP_BIT 16
- #define UNW_PI_FLAG_DEBUG_FRAME 32
- typedef struct unw_proc_info
- {
- unw_word_t start_ip;
- unw_word_t end_ip;
- unw_word_t lsda;
- unw_word_t handler;
- unw_word_t gp;
- unw_word_t flags;
- int format;
- int unwind_info_size;
- void *unwind_info;
- unw_tdep_proc_info_t extra;
- }
- unw_proc_info_t;
- typedef struct unw_accessors
- {
-
- int (*find_proc_info) (unw_addr_space_t, unw_word_t, unw_proc_info_t *,
- int, void *);
-
- void (*put_unwind_info) (unw_addr_space_t, unw_proc_info_t *, void *);
-
- int (*get_dyn_info_list_addr) (unw_addr_space_t, unw_word_t *, void *);
-
- int (*access_mem) (unw_addr_space_t, unw_word_t, unw_word_t *, int,
- void *);
-
- int (*access_reg) (unw_addr_space_t, unw_regnum_t, unw_word_t *, int,
- void *);
-
- int (*access_fpreg) (unw_addr_space_t, unw_regnum_t,
- unw_fpreg_t *, int, void *);
- int (*resume) (unw_addr_space_t, unw_cursor_t *, void *);
-
- int (*get_proc_name) (unw_addr_space_t, unw_word_t, char *, size_t,
- unw_word_t *, void *);
- }
- unw_accessors_t;
- typedef enum unw_save_loc_type
- {
- UNW_SLT_NONE,
- UNW_SLT_MEMORY,
- UNW_SLT_REG
- }
- unw_save_loc_type_t;
- typedef struct unw_save_loc
- {
- unw_save_loc_type_t type;
- union
- {
- unw_word_t addr;
- unw_regnum_t regnum;
- }
- u;
- unw_tdep_save_loc_t extra;
- }
- unw_save_loc_t;
- #define unw_local_addr_space UNW_OBJ(local_addr_space)
- #define unw_create_addr_space UNW_OBJ(create_addr_space)
- #define unw_destroy_addr_space UNW_OBJ(destroy_addr_space)
- #define unw_get_accessors UNW_ARCH_OBJ(get_accessors)
- #define unw_init_local UNW_OBJ(init_local)
- #define unw_init_remote UNW_OBJ(init_remote)
- #define unw_step UNW_OBJ(step)
- #define unw_resume UNW_OBJ(resume)
- #define unw_get_proc_info UNW_OBJ(get_proc_info)
- #define unw_get_proc_info_by_ip UNW_OBJ(get_proc_info_by_ip)
- #define unw_get_reg UNW_OBJ(get_reg)
- #define unw_set_reg UNW_OBJ(set_reg)
- #define unw_get_fpreg UNW_OBJ(get_fpreg)
- #define unw_set_fpreg UNW_OBJ(set_fpreg)
- #define unw_get_save_loc UNW_OBJ(get_save_loc)
- #define unw_is_signal_frame UNW_OBJ(is_signal_frame)
- #define unw_handle_signal_frame UNW_OBJ(handle_signal_frame)
- #define unw_get_proc_name UNW_OBJ(get_proc_name)
- #define unw_set_caching_policy UNW_OBJ(set_caching_policy)
- #define unw_regname UNW_ARCH_OBJ(regname)
- #define unw_flush_cache UNW_ARCH_OBJ(flush_cache)
- #define unw_strerror UNW_ARCH_OBJ(strerror)
- extern unw_addr_space_t unw_create_addr_space (unw_accessors_t *, int);
- extern void unw_destroy_addr_space (unw_addr_space_t);
- extern unw_accessors_t *unw_get_accessors (unw_addr_space_t);
- extern void unw_flush_cache (unw_addr_space_t, unw_word_t, unw_word_t);
- extern int unw_set_caching_policy (unw_addr_space_t, unw_caching_policy_t);
- extern const char *unw_regname (unw_regnum_t);
- extern int unw_init_local (unw_cursor_t *, unw_context_t *);
- extern int unw_init_remote (unw_cursor_t *, unw_addr_space_t, void *);
- extern int unw_step (unw_cursor_t *);
- extern int unw_resume (unw_cursor_t *);
- extern int unw_get_proc_info (unw_cursor_t *, unw_proc_info_t *);
- extern int unw_get_proc_info_by_ip (unw_addr_space_t, unw_word_t,
- unw_proc_info_t *, void *);
- extern int unw_get_reg (unw_cursor_t *, int, unw_word_t *);
- extern int unw_set_reg (unw_cursor_t *, int, unw_word_t);
- extern int unw_get_fpreg (unw_cursor_t *, int, unw_fpreg_t *);
- extern int unw_set_fpreg (unw_cursor_t *, int, unw_fpreg_t);
- extern int unw_get_save_loc (unw_cursor_t *, int, unw_save_loc_t *);
- extern int unw_is_signal_frame (unw_cursor_t *);
- extern int unw_handle_signal_frame (unw_cursor_t *);
- extern int unw_get_proc_name (unw_cursor_t *, char *, size_t, unw_word_t *);
- extern const char *unw_strerror (int);
- extern int unw_backtrace (void **, int);
- extern unw_addr_space_t unw_local_addr_space;
|