summaryrefslogtreecommitdiff
path: root/include/tdep-arm
diff options
context:
space:
mode:
authorFilip Nyback <filip.nyback@fillexen.fi>2014-06-27 15:11:41 +0300
committerFilip Nyback <filip.nyback@fillexen.fi>2014-07-30 14:25:14 +0300
commite1804829cabb9bb1514d9537ed94f2c353a1a70d (patch)
tree16ea07919892e7158a212348bb03dd80e91a4b2d /include/tdep-arm
parent65ac86741606e1d87aef75755c699e4fa6884230 (diff)
downloadlibunwind-e1804829cabb9bb1514d9537ed94f2c353a1a70d.tar.gz
Add fast stack trace on ARM.
Port of the fast stack trace feature to ARM.
Diffstat (limited to 'include/tdep-arm')
-rw-r--r--include/tdep-arm/libunwind_i.h29
1 files changed, 26 insertions, 3 deletions
diff --git a/include/tdep-arm/libunwind_i.h b/include/tdep-arm/libunwind_i.h
index 291b1018..e5ec9553 100644
--- a/include/tdep-arm/libunwind_i.h
+++ b/include/tdep-arm/libunwind_i.h
@@ -36,9 +36,25 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include "dwarf.h"
#include "ex_tables.h"
+typedef enum
+ {
+ UNW_ARM_FRAME_STANDARD = -2, /* regular r7, sp +/- offset */
+ UNW_ARM_FRAME_SIGRETURN = -1, /* special sigreturn frame */
+ UNW_ARM_FRAME_OTHER = 0, /* not cacheable (special or unrecognised) */
+ UNW_ARM_FRAME_GUESSED = 1 /* guessed it was regular, but not known */
+ }
+unw_tdep_frame_type_t;
+
typedef struct
{
- /* no arm-specific fast trace */
+ uint32_t virtual_address;
+ int32_t frame_type : 2; /* unw_tdep_frame_type_t classification */
+ int32_t last_frame : 1; /* non-zero if last frame in chain */
+ int32_t cfa_reg_sp : 1; /* cfa dwarf base register is sp vs. r7 */
+ int32_t cfa_reg_offset : 30; /* cfa is at this offset from base register value */
+ int32_t r7_cfa_offset : 30; /* r7 saved at this offset from cfa (-1 = not saved) */
+ int32_t lr_cfa_offset : 30; /* lr saved at this offset from cfa (-1 = not saved) */
+ int32_t sp_cfa_offset : 30; /* sp saved at this offset from cfa (-1 = not saved) */
}
unw_tdep_frame_t;
@@ -61,6 +77,9 @@ struct unw_addr_space
struct cursor
{
struct dwarf_cursor dwarf; /* must be first */
+
+ unw_tdep_frame_t frame_info; /* quick tracing assist info */
+
enum
{
ARM_SCF_NONE, /* no signal frame */
@@ -73,6 +92,7 @@ struct cursor
unw_word_t sigcontext_addr;
unw_word_t sigcontext_sp;
unw_word_t sigcontext_pc;
+ int validate;
};
#define DWARF_GET_LOC(l) ((l).val)
@@ -242,8 +262,8 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val)
#define tdep_fetch_frame(c,ip,n) do {} while(0)
#define tdep_cache_frame(c,rs) do {} while(0)
#define tdep_reuse_frame(c,rs) do {} while(0)
-#define tdep_stash_frame(c,rs) do {} while(0)
-#define tdep_trace(cur,addr,n) (-UNW_ENOINFO)
+#define tdep_stash_frame UNW_OBJ(tdep_stash_frame)
+#define tdep_trace UNW_OBJ(tdep_trace)
#ifdef UNW_LOCAL_ONLY
# define tdep_find_proc_info(c,ip,n) \
@@ -283,6 +303,9 @@ extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg,
unw_word_t *valp, int write);
extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg,
unw_fpreg_t *valp, int write);
+extern int tdep_trace (unw_cursor_t *cursor, void **addresses, int *n);
+extern void tdep_stash_frame (struct dwarf_cursor *c,
+ struct dwarf_reg_state *rs);
/* unwinding method selection support */
#define UNW_ARM_METHOD_ALL 0xFF