1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-12-23 20:03:43 +01:00

(uc_addr): Add "nat_bitnr"-pointer argument. Handle preserved

NaT-bit registers.
(tdep_uc_addr): Add "nat_bitnr"-pointer argument.
(access_reg): Pass NULL as third argument to uc_addr().
(access_fpreg): Likewise.

(Logical change 1.181)
This commit is contained in:
mostang.com!davidm 2004-02-27 08:54:25 +00:00
parent 7356cf80a5
commit ebe6b21c93

View file

@ -85,8 +85,9 @@ PROTECTED unw_addr_space_t unw_local_addr_space = &local_addr_space;
#else /* !HAVE_SYS_UC_ACCESS_H */ #else /* !HAVE_SYS_UC_ACCESS_H */
static inline void * static inline void *
uc_addr (ucontext_t *uc, int reg) uc_addr (ucontext_t *uc, int reg, uint8_t *nat_bitnr)
{ {
unw_word_t reg_addr;
void *addr; void *addr;
switch (reg) switch (reg)
@ -114,6 +115,13 @@ uc_addr (ucontext_t *uc, int reg)
addr = &uc->uc_mcontext.sc_gr[reg - UNW_IA64_GR]; addr = &uc->uc_mcontext.sc_gr[reg - UNW_IA64_GR];
break; break;
case UNW_IA64_NAT + 4 ... UNW_IA64_NAT + 7:
case UNW_IA64_NAT + 12:
addr = &uc->uc_mcontext.sc_nat;
reg_addr = (unw_word_t) &uc->uc_mcontext.sc_gr[reg - UNW_IA64_NAT];
*nat_bitnr = reg - UNW_IA64_NAT;
break;
case UNW_IA64_BR + 1 ... UNW_IA64_BR + 5: case UNW_IA64_BR + 1 ... UNW_IA64_BR + 5:
addr = &uc->uc_mcontext.sc_br[reg - UNW_IA64_BR]; addr = &uc->uc_mcontext.sc_br[reg - UNW_IA64_BR];
break; break;
@ -130,9 +138,9 @@ uc_addr (ucontext_t *uc, int reg)
} }
HIDDEN void * HIDDEN void *
tdep_uc_addr (ucontext_t *uc, int reg) tdep_uc_addr (ucontext_t *uc, int reg, uint8_t *nat_bitnr)
{ {
return uc_addr (uc, reg); return uc_addr (uc, reg, nat_bitnr);
} }
#endif /* !HAVE_SYS_UC_ACCESS_H */ #endif /* !HAVE_SYS_UC_ACCESS_H */
@ -358,7 +366,7 @@ access_reg (unw_addr_space_t as, unw_regnum_t reg, unw_word_t *val, int write,
return 0; return 0;
} }
addr = uc_addr (uc, reg); addr = uc_addr (uc, reg, NULL);
if (!addr) if (!addr)
goto badreg; goto badreg;
@ -389,7 +397,7 @@ access_fpreg (unw_addr_space_t as, unw_regnum_t reg, unw_fpreg_t *val,
if (reg < UNW_IA64_FR || reg >= UNW_IA64_FR + 128) if (reg < UNW_IA64_FR || reg >= UNW_IA64_FR + 128)
goto badreg; goto badreg;
addr = uc_addr (uc, reg); addr = uc_addr (uc, reg, NULL);
if (!addr) if (!addr)
goto badreg; goto badreg;