1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-14 04:18:11 +01:00

use target dependent names for stack registers

When adjusting the stack for a DW_CFA_arg_size adjustment, ensure that
we use the target dependent register name as the generic name does not
necessarily map to the same register.  For example, on x86, ESP maps to
the eip register, which results in the wrong stack adjustment being
applied.
This commit is contained in:
Saleem Abdulrasool 2017-01-18 10:07:50 -08:00 committed by Dave Watson
parent 09a598a3da
commit 11a053f5ca
2 changed files with 4 additions and 4 deletions

View file

@ -66,10 +66,10 @@ establish_machine_state (struct cursor *c)
if (c->dwarf.args_size)
{
if (tdep_access_reg (c, ESP, &val, 0) >= 0)
if (tdep_access_reg (c, UNW_X86_ESP, &val, 0) >= 0)
{
val += c->dwarf.args_size;
(*access_reg) (as, ESP, &val, 1, arg);
(*access_reg) (as, UNW_X86_ESP, &val, 1, arg);
}
}
return 0;

View file

@ -98,10 +98,10 @@ establish_machine_state (struct cursor *c)
if (c->dwarf.args_size)
{
if (tdep_access_reg (c, RSP, &val, 0) >= 0)
if (tdep_access_reg (c, UNW_X86_64_RSP, &val, 0) >= 0)
{
val += c->dwarf.args_size;
(*access_reg) (as, RSP, &val, 1, arg);
(*access_reg) (as, UNW_X86_64_RSP, &val, 1, arg);
}
}
return 0;