From 8cdd8bfed8f21bb632faf69cca023c9762d78ab1 Mon Sep 17 00:00:00 2001 From: Arun Sharma Date: Wed, 26 Jul 2006 21:39:46 -0600 Subject: [PATCH] [x86-64] Make even UNW_LOCAL_ONLY accessors go through validation. Signed-off-by: Arun Sharma --- include/tdep-x86_64/libunwind_i.h | 52 ++----------------------------- 1 file changed, 3 insertions(+), 49 deletions(-) diff --git a/include/tdep-x86_64/libunwind_i.h b/include/tdep-x86_64/libunwind_i.h index 59ac2c05..9984febb 100644 --- a/include/tdep-x86_64/libunwind_i.h +++ b/include/tdep-x86_64/libunwind_i.h @@ -78,44 +78,8 @@ struct cursor # define DWARF_MEM_LOC(c,m) DWARF_LOC ((m), 0) # define DWARF_FPREG_LOC(c,r) (DWARF_LOC((unw_word_t) \ tdep_uc_addr((c)->as_arg, (r)), 0)) - -static inline int -dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val) -{ - if (!DWARF_GET_LOC (loc)) - return -1; - *val = *(unw_fpreg_t *) DWARF_GET_LOC (loc); - return 0; -} - -static inline int -dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) -{ - if (!DWARF_GET_LOC (loc)) - return -1; - *(unw_fpreg_t *) DWARF_GET_LOC (loc) = val; - return 0; -} - -static inline int -dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) -{ - if (!DWARF_GET_LOC (loc)) - return -1; - *val = *(unw_word_t *) DWARF_GET_LOC (loc); - return 0; -} - -static inline int -dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) -{ - if (!DWARF_GET_LOC (loc)) - return -1; - *(unw_word_t *) DWARF_GET_LOC (loc) = val; - return 0; -} - #else /* !UNW_LOCAL_ONLY */ + # define DWARF_LOC_TYPE_FP (1 << 0) # define DWARF_LOC_TYPE_REG (1 << 1) # define DWARF_NULL_LOC DWARF_LOC (0, 0) @@ -129,13 +93,14 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) # define DWARF_FPREG_LOC(c,r) DWARF_LOC((r), (DWARF_LOC_TYPE_REG \ | DWARF_LOC_TYPE_FP)) +#endif /* !UNW_LOCAL_ONLY */ + static inline int dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val) { if (DWARF_IS_NULL_LOC (loc)) return -UNW_EBADREG; -//# warning fix me abort (); } @@ -145,7 +110,6 @@ dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) if (DWARF_IS_NULL_LOC (loc)) return -UNW_EBADREG; -//# warning fix me abort (); } @@ -155,10 +119,6 @@ dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) if (DWARF_IS_NULL_LOC (loc)) return -UNW_EBADREG; - if (DWARF_IS_FP_LOC (loc)) -//# warning fix me - abort (); - if (DWARF_IS_REG_LOC (loc)) return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), val, 0, c->as_arg); @@ -173,10 +133,6 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) if (DWARF_IS_NULL_LOC (loc)) return -UNW_EBADREG; - if (DWARF_IS_FP_LOC (loc)) -//# warning fix me - abort (); - if (DWARF_IS_REG_LOC (loc)) return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), &val, 1, c->as_arg); @@ -185,8 +141,6 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) 1, c->as_arg); } -#endif /* !UNW_LOCAL_ONLY */ - #define tdep_needs_initialization UNW_OBJ(needs_initialization) #define tdep_init UNW_OBJ(init) /* Platforms that support UNW_INFO_FORMAT_TABLE need to define