mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2025-01-11 11:33:43 +01:00
(access_reg): Do not reject accesses to floating-point registers. On
little-endian machines, this automagically does the right thing and on HP-UX (big-endian) we never use this routine. Reject write-accesses to read-only save-locations (such as unw.read_only.r0). (access_fpreg): Reject write-accesses to read-only save-locations. (Logical change 1.229)
This commit is contained in:
parent
ec634b320c
commit
b8d777bc65
1 changed files with 12 additions and 5 deletions
|
@ -290,9 +290,6 @@ access_reg (unw_addr_space_t as, unw_regnum_t reg, unw_word_t *val, int write,
|
||||||
unw_word_t *addr, mask;
|
unw_word_t *addr, mask;
|
||||||
ucontext_t *uc = arg;
|
ucontext_t *uc = arg;
|
||||||
|
|
||||||
if (reg >= UNW_IA64_FR && reg < UNW_IA64_FR + 128)
|
|
||||||
goto badreg;
|
|
||||||
|
|
||||||
if (reg >= UNW_IA64_NAT + 4 && reg <= UNW_IA64_NAT + 7)
|
if (reg >= UNW_IA64_NAT + 4 && reg <= UNW_IA64_NAT + 7)
|
||||||
{
|
{
|
||||||
mask = ((unw_word_t) 1) << (reg - UNW_IA64_NAT);
|
mask = ((unw_word_t) 1) << (reg - UNW_IA64_NAT);
|
||||||
|
@ -319,7 +316,12 @@ access_reg (unw_addr_space_t as, unw_regnum_t reg, unw_word_t *val, int write,
|
||||||
|
|
||||||
if (write)
|
if (write)
|
||||||
{
|
{
|
||||||
*(unw_word_t *) addr = *val;
|
if (ia64_read_only_reg (addr))
|
||||||
|
{
|
||||||
|
Debug (16, "attempt to write read-only register\n");
|
||||||
|
return -UNW_EREADONLYREG;
|
||||||
|
}
|
||||||
|
*addr = *val;
|
||||||
Debug (12, "%s <- %lx\n", unw_regname (reg), *val);
|
Debug (12, "%s <- %lx\n", unw_regname (reg), *val);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -350,9 +352,14 @@ access_fpreg (unw_addr_space_t as, unw_regnum_t reg, unw_fpreg_t *val,
|
||||||
|
|
||||||
if (write)
|
if (write)
|
||||||
{
|
{
|
||||||
|
if (ia64_read_only_reg (addr))
|
||||||
|
{
|
||||||
|
Debug (16, "attempt to write read-only register\n");
|
||||||
|
return -UNW_EREADONLYREG;
|
||||||
|
}
|
||||||
|
*addr = *val;
|
||||||
Debug (12, "%s <- %016lx.%016lx\n",
|
Debug (12, "%s <- %016lx.%016lx\n",
|
||||||
unw_regname (reg), val->raw.bits[1], val->raw.bits[0]);
|
unw_regname (reg), val->raw.bits[1], val->raw.bits[0]);
|
||||||
*(unw_fpreg_t *) addr = *val;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue