aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/dwarf.h1
-rw-r--r--include/libunwind-arm.h10
-rw-r--r--include/libunwind-hppa.h10
-rw-r--r--include/libunwind-ia64.h10
-rw-r--r--include/libunwind-mips.h10
-rw-r--r--include/libunwind-ppc32.h10
-rw-r--r--include/libunwind-ppc64.h10
-rw-r--r--include/libunwind-x86.h10
-rw-r--r--include/libunwind-x86_64.h33
-rw-r--r--include/tdep-arm/libunwind_i.h1
-rw-r--r--include/tdep-hppa/libunwind_i.h1
-rw-r--r--include/tdep-ia64/libunwind_i.h1
-rw-r--r--include/tdep-mips/libunwind_i.h1
-rw-r--r--include/tdep-ppc32/libunwind_i.h3
-rw-r--r--include/tdep-ppc64/libunwind_i.h3
-rw-r--r--include/tdep-x86/libunwind_i.h1
-rw-r--r--include/tdep-x86_64/libunwind_i.h6
17 files changed, 114 insertions, 7 deletions
diff --git a/include/dwarf.h b/include/dwarf.h
index 82d1f9f8..334aaadc 100644
--- a/include/dwarf.h
+++ b/include/dwarf.h
@@ -296,6 +296,7 @@ typedef struct dwarf_cursor
dwarf_loc_t loc[DWARF_NUM_PRESERVED_REGS];
+ unsigned int stash_frames :1; /* stash frames for fast lookup */
unsigned int use_prev_instr :1; /* use previous (= call) or current (= signal) instruction? */
unsigned int pi_valid :1; /* is proc_info valid? */
unsigned int pi_is_dynamic :1; /* proc_info found via dynamic proc info? */
diff --git a/include/libunwind-arm.h b/include/libunwind-arm.h
index 492331e4..5cbfe860 100644
--- a/include/libunwind-arm.h
+++ b/include/libunwind-arm.h
@@ -286,11 +286,21 @@ typedef struct
}
unw_tdep_proc_info_t;
+typedef struct
+ {
+ /* no arm-specific fast trace */
+ }
+unw_tdep_frame_t;
+
#include "libunwind-common.h"
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
+#define unw_tdep_make_frame_cache(n) (0)
+#define unw_tdep_free_frame_cache(p) do {} while(0)
+#define unw_tdep_trace(cur,addr,n,c) (-UNW_ENOINFO)
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
diff --git a/include/libunwind-hppa.h b/include/libunwind-hppa.h
index 74ea70da..e28fcaaf 100644
--- a/include/libunwind-hppa.h
+++ b/include/libunwind-hppa.h
@@ -103,6 +103,12 @@ unw_tdep_save_loc_t;
/* On PA-RISC, we can directly use ucontext_t as the unwind context. */
typedef ucontext_t unw_tdep_context_t;
+typedef struct
+ {
+ /* no hppa-specific fast trace */
+ }
+unw_tdep_frame_t;
+
#define unw_tdep_is_fpreg(r) ((unsigned) ((r) - UNW_HPPA_FR) < 32)
#include "libunwind-dynamic.h"
@@ -118,6 +124,10 @@ unw_tdep_proc_info_t;
#define unw_tdep_getcontext UNW_ARCH_OBJ (getcontext)
extern int unw_tdep_getcontext (unw_tdep_context_t *);
+#define unw_tdep_make_frame_cache(n) (0)
+#define unw_tdep_free_frame_cache(p) do {} while(0)
+#define unw_tdep_trace(cur,addr,n,c) (-UNW_ENOINFO)
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
diff --git a/include/libunwind-ia64.h b/include/libunwind-ia64.h
index fb2fbfe5..e4ac85c2 100644
--- a/include/libunwind-ia64.h
+++ b/include/libunwind-ia64.h
@@ -150,6 +150,12 @@ unw_tdep_save_loc_t;
/* On IA-64, we can directly use ucontext_t as the unwind context. */
typedef ucontext_t unw_tdep_context_t;
+typedef struct
+ {
+ /* no ia64-specific fast trace */
+ }
+unw_tdep_frame_t;
+
#define unw_tdep_is_fpreg(r) ((unsigned) ((r) - UNW_IA64_FR) < 128)
#include "libunwind-dynamic.h"
@@ -187,6 +193,10 @@ extern unw_word_t _Uia64_find_dyn_list (unw_addr_space_t, unw_dyn_info_t *,
signal-safe. */
extern int _Uia64_get_kernel_table (unw_dyn_info_t *);
+#define unw_tdep_make_frame_cache(n) (0)
+#define unw_tdep_free_frame_cache(p) do {} while(0)
+#define unw_tdep_trace(cur,addr,n,c) (-UNW_ENOINFO)
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
diff --git a/include/libunwind-mips.h b/include/libunwind-mips.h
index 91f70015..cbaa5dd1 100644
--- a/include/libunwind-mips.h
+++ b/include/libunwind-mips.h
@@ -137,6 +137,12 @@ typedef struct
}
unw_tdep_proc_info_t;
+typedef struct
+ {
+ /* no mips-specific fast trace */
+ }
+unw_tdep_frame_t;
+
#include "libunwind-common.h"
/* There is no getcontext() on MIPS. Use a stub version which only saves GP
@@ -148,6 +154,10 @@ extern int unw_tdep_getcontext (ucontext_t *uc);
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
+#define unw_tdep_make_frame_cache(n) (0)
+#define unw_tdep_free_frame_cache(p) do {} while(0)
+#define unw_tdep_trace(cur,addr,n,c) (-UNW_ENOINFO)
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
diff --git a/include/libunwind-ppc32.h b/include/libunwind-ppc32.h
index b40a84ef..b22c2793 100644
--- a/include/libunwind-ppc32.h
+++ b/include/libunwind-ppc32.h
@@ -195,11 +195,21 @@ typedef struct
}
unw_tdep_proc_info_t;
+typedef struct
+ {
+ /* no ppc32-specific fast trace */
+ }
+unw_tdep_frame_t;
+
#include "libunwind-common.h"
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
+#define unw_tdep_make_frame_cache(n) (0)
+#define unw_tdep_free_frame_cache(p) do {} while(0)
+#define unw_tdep_trace(cur,addr,n,c) (-UNW_ENOINFO)
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
diff --git a/include/libunwind-ppc64.h b/include/libunwind-ppc64.h
index 66420b33..b1c2b072 100644
--- a/include/libunwind-ppc64.h
+++ b/include/libunwind-ppc64.h
@@ -252,11 +252,21 @@ typedef struct
}
unw_tdep_proc_info_t;
+typedef struct
+ {
+ /* no ppc64-specific fast trace */
+ }
+unw_tdep_frame_t;
+
#include "libunwind-common.h"
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
+#define unw_tdep_make_frame_cache(n) (0)
+#define unw_tdep_free_frame_cache(p) do {} while(0)
+#define unw_tdep_trace(cur,addr,n,c) (-UNW_ENOINFO)
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
diff --git a/include/libunwind-x86.h b/include/libunwind-x86.h
index 32533df9..e1f2ba4d 100644
--- a/include/libunwind-x86.h
+++ b/include/libunwind-x86.h
@@ -172,6 +172,12 @@ typedef struct
}
unw_tdep_proc_info_t;
+typedef struct
+ {
+ /* no x86-specific fast trace */
+ }
+unw_tdep_frame_t;
+
#include "libunwind-common.h"
#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext)
@@ -180,6 +186,10 @@ extern int unw_tdep_getcontext (unw_tdep_context_t *);
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
+#define unw_tdep_make_frame_cache(n) (0)
+#define unw_tdep_free_frame_cache(p) do {} while(0)
+#define unw_tdep_trace(cur,addr,n,c) (-UNW_ENOINFO)
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
diff --git a/include/libunwind-x86_64.h b/include/libunwind-x86_64.h
index 53789cc3..cdde5579 100644
--- a/include/libunwind-x86_64.h
+++ b/include/libunwind-x86_64.h
@@ -104,15 +104,44 @@ typedef struct
}
unw_tdep_proc_info_t;
+typedef enum
+ {
+ UNW_X86_64_FRAME_STANDARD = -2, /* regular rbp, rsp +/- offset */
+ UNW_X86_64_FRAME_SIGRETURN = -1, /* special sigreturn frame */
+ UNW_X86_64_FRAME_OTHER = 0, /* not cacheable (special or unrecognised) */
+ UNW_X86_64_FRAME_GUESSED = 1 /* guessed it was regular, but not known */
+ }
+unw_tdep_frame_type_t;
+
+typedef struct
+ {
+ uint64_t virtual_address;
+ int64_t frame_type : 2; /* unw_tdep_frame_type_t classification */
+ int64_t last_frame : 1; /* non-zero if last frame in chain */
+ int64_t cfa_reg_rsp : 1; /* cfa dwarf base register is rsp vs. rbp */
+ int64_t cfa_reg_offset : 30; /* cfa is at this offset from base register value */
+ int64_t rbp_cfa_offset : 15; /* rbp saved at this offset from cfa (-1 = not saved) */
+ int64_t rsp_cfa_offset : 15; /* rsp saved at this offset from cfa (-1 = not saved) */
+ }
+unw_tdep_frame_t;
+
#include "libunwind-dynamic.h"
#include "libunwind-common.h"
#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext)
-extern int unw_tdep_getcontext (unw_tdep_context_t *);
-
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
+#define unw_tdep_make_frame_cache UNW_OBJ(make_frame_cache)
+#define unw_tdep_free_frame_cache UNW_OBJ(free_frame_cache)
+#define unw_tdep_trace UNW_OBJ(trace)
+
+extern int unw_tdep_getcontext (unw_tdep_context_t *);
extern int unw_tdep_is_fpreg (int);
+extern unw_tdep_frame_t *unw_tdep_make_frame_cache (size_t n);
+extern int unw_tdep_free_frame_cache (unw_tdep_frame_t *p);
+extern int unw_tdep_trace (unw_cursor_t *cursor, void **addresses,
+ int *n, unw_tdep_frame_t *cache);
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
diff --git a/include/tdep-arm/libunwind_i.h b/include/tdep-arm/libunwind_i.h
index acaf6d71..0cb4a719 100644
--- a/include/tdep-arm/libunwind_i.h
+++ b/include/tdep-arm/libunwind_i.h
@@ -221,6 +221,7 @@ 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)
#ifdef UNW_LOCAL_ONLY
# define tdep_find_proc_info(c,ip,n) \
diff --git a/include/tdep-hppa/libunwind_i.h b/include/tdep-hppa/libunwind_i.h
index 50d1aabd..4e6c1c3a 100644
--- a/include/tdep-hppa/libunwind_i.h
+++ b/include/tdep-hppa/libunwind_i.h
@@ -227,6 +227,7 @@ 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)
#ifdef UNW_LOCAL_ONLY
# define tdep_find_proc_info(c,ip,n) \
diff --git a/include/tdep-ia64/libunwind_i.h b/include/tdep-ia64/libunwind_i.h
index 75cc220d..3193a646 100644
--- a/include/tdep-ia64/libunwind_i.h
+++ b/include/tdep-ia64/libunwind_i.h
@@ -223,6 +223,7 @@ struct ia64_global_unwind_state
#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_get_as(c) ((c)->as)
#define tdep_get_as_arg(c) ((c)->as_arg)
#define tdep_get_ip(c) ((c)->ip)
diff --git a/include/tdep-mips/libunwind_i.h b/include/tdep-mips/libunwind_i.h
index 160a6372..2e6fc4fd 100644
--- a/include/tdep-mips/libunwind_i.h
+++ b/include/tdep-mips/libunwind_i.h
@@ -282,6 +282,7 @@ 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)
#ifdef UNW_LOCAL_ONLY
# define tdep_find_proc_info(c,ip,n) \
diff --git a/include/tdep-ppc32/libunwind_i.h b/include/tdep-ppc32/libunwind_i.h
index e775dd64..7db2b393 100644
--- a/include/tdep-ppc32/libunwind_i.h
+++ b/include/tdep-ppc32/libunwind_i.h
@@ -245,8 +245,6 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val)
1, c->as_arg);
}
-
-
#define tdep_needs_initialization UNW_OBJ(needs_initialization)
#define tdep_init UNW_OBJ(init)
/* Platforms that support UNW_INFO_FORMAT_TABLE need to define
@@ -259,6 +257,7 @@ 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_get_func_addr UNW_OBJ(get_func_addr)
#ifdef UNW_LOCAL_ONLY
diff --git a/include/tdep-ppc64/libunwind_i.h b/include/tdep-ppc64/libunwind_i.h
index bb6c977b..6c46e1a7 100644
--- a/include/tdep-ppc64/libunwind_i.h
+++ b/include/tdep-ppc64/libunwind_i.h
@@ -245,8 +245,6 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val)
1, c->as_arg);
}
-
-
#define tdep_needs_initialization UNW_OBJ(needs_initialization)
#define tdep_init UNW_OBJ(init)
/* Platforms that support UNW_INFO_FORMAT_TABLE need to define
@@ -259,6 +257,7 @@ 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_get_func_addr UNW_OBJ(get_func_addr)
#ifdef UNW_LOCAL_ONLY
diff --git a/include/tdep-x86/libunwind_i.h b/include/tdep-x86/libunwind_i.h
index bc381e91..88ab2467 100644
--- a/include/tdep-x86/libunwind_i.h
+++ b/include/tdep-x86/libunwind_i.h
@@ -243,6 +243,7 @@ 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)
#ifdef UNW_LOCAL_ONLY
# define tdep_find_proc_info(c,ip,n) \
diff --git a/include/tdep-x86_64/libunwind_i.h b/include/tdep-x86_64/libunwind_i.h
index fa5ebe97..b076bd18 100644
--- a/include/tdep-x86_64/libunwind_i.h
+++ b/include/tdep-x86_64/libunwind_i.h
@@ -57,6 +57,8 @@ struct cursor
{
struct dwarf_cursor dwarf; /* must be first */
+ unw_tdep_frame_t frame_info; /* quick tracing assist info */
+
/* Format of sigcontext structure and address at which it is
stored: */
enum
@@ -173,6 +175,7 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val)
# define tdep_cache_frame(c,rs) do {} while(0)
# define tdep_reuse_frame(c,rs) do {} while(0)
#endif
+#define tdep_stash_frame UNW_OBJ(stash_frame)
#ifdef UNW_LOCAL_ONLY
# define tdep_find_proc_info(c,ip,n) \
@@ -215,7 +218,8 @@ extern void tdep_cache_frame (struct dwarf_cursor *c,
struct dwarf_reg_state *rs);
extern void tdep_reuse_frame (struct dwarf_cursor *c,
struct dwarf_reg_state *rs);
+extern void tdep_stash_frame (struct dwarf_cursor *c,
+ struct dwarf_reg_state *rs);
#endif
-
#endif /* X86_64_LIBUNWIND_I_H */