From 7377d07464f95745a7233f66bd01e4bac7e7d720 Mon Sep 17 00:00:00 2001 From: "mostang.com!davidm" Date: Sat, 8 Feb 2003 10:10:59 +0000 Subject: [PATCH] (ia64_access_reg): When writing UNW_REG_IP, invalidate the proc_info if the new IP is outside the range of the old procedure. When writing one of the exception argument registers, track the update in c->eh_valid_mask. (Logical change 1.45) --- src/ia64/Gregs-ia64.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/ia64/Gregs-ia64.c b/src/ia64/Gregs-ia64.c index 336f25c4..9adc3019 100644 --- a/src/ia64/Gregs-ia64.c +++ b/src/ia64/Gregs-ia64.c @@ -247,7 +247,11 @@ ia64_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, case UNW_REG_IP: if (write) - c->ip = *valp; /* also update the IP cache */ + { + c->ip = *valp; /* also update the IP cache */ + if (c->pi_valid && (*valp < c->pi.start_ip || *valp >= c->pi.end_ip)) + c->pi_valid = 0; /* new IP outside of current proc */ + } loc = c->ip_loc; break; @@ -319,7 +323,8 @@ ia64_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, case UNW_IA64_AR_EC: if (write) { - c->cfm = (c->cfm & ~((unw_word_t) 0x3f << 52)) | ((*valp & 0x3f) << 52); + c->cfm = ((c->cfm & ~((unw_word_t) 0x3f << 52)) + | ((*valp & 0x3f) << 52)); return ia64_put (c, c->cfm_loc, c->cfm); } else @@ -379,16 +384,20 @@ ia64_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, break; case UNW_IA64_GR + 15 ... UNW_IA64_GR + 18: - if (c->is_signal_frame) - loc = ia64_scratch_loc (c, reg); - else + mask = 1 << (reg - (UNW_IA64_GR + 15)); + if (write) { - if (write) - c->eh_args[reg - (UNW_IA64_GR + 15)] = *valp; - else - *valp = c->eh_args[reg - (UNW_IA64_GR + 15)] = *valp; + c->eh_args[reg - (UNW_IA64_GR + 15)] = *valp; + c->eh_valid_mask |= mask; return 0; } + else if ((c->eh_valid_mask & mask) != 0) + { + *valp = c->eh_args[reg - (UNW_IA64_GR + 15)] = *valp; + return 0; + } + else + loc = ia64_scratch_loc (c, reg); break; case UNW_IA64_GR + 2 ... UNW_IA64_GR + 3: