Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libunwind/include/libunwind.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL;
extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL;
extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL;
//extern int unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*);
extern const char *unw_strerror(int) LIBUNWIND_AVAIL;

extern unw_addr_space_t unw_local_addr_space;

Expand Down
35 changes: 35 additions & 0 deletions libunwind/src/libunwind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,41 @@ void __unw_remove_dynamic_eh_frame_section(unw_word_t eh_frame_start) {
}

#endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)

/// Maps the UNW_* error code to a textual representation
_LIBUNWIND_HIDDEN const char *__unw_strerror(int error_code) {
switch (error_code) {
case UNW_ESUCCESS:
return "no error";
case UNW_EUNSPEC:
return "unspecified (general) error";
case UNW_ENOMEM:
return "out of memory";
case UNW_EBADREG:
return "bad register number";
case UNW_EREADONLYREG:
return "attempt to write read-only register";
case UNW_ESTOPUNWIND:
return "stop unwinding";
case UNW_EINVALIDIP:
return "invalid IP";
case UNW_EBADFRAME:
return "bad frame";
case UNW_EINVAL:
return "unsupported operation or bad value";
case UNW_EBADVERSION:
return "unwind info has unsupported version";
case UNW_ENOINFO:
return "no unwind info found";
#if defined(_LIBUNWIND_TARGET_AARCH64) && !defined(_LIBUNWIND_IS_NATIVE_ONLY)
case UNW_ECROSSRASIGNING:
return "return address require authentication";
#endif
}
return "invalid error code";
}
_LIBUNWIND_WEAK_ALIAS(__unw_strerror, unw_strerror)

#endif // !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__wasm__)

#ifdef __APPLE__
Expand Down
1 change: 1 addition & 0 deletions libunwind/src/libunwind_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ extern int __unw_get_proc_info(unw_cursor_t *, unw_proc_info_t *);
extern int __unw_is_fpreg(unw_cursor_t *, unw_regnum_t);
extern int __unw_is_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);

#if defined(_AIX)
extern uintptr_t __unw_get_data_rel_base(unw_cursor_t *);
Expand Down
Loading