mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-25 16:47:38 +01:00
(unw_init_remote): Rename from ia64_init_remote(). Initialize
cfm_loc with UNW_IA64_CFM. Initialize bspstore_loc with UNW_IA64_AR_BSPSTORE. Renamem rp_loc to ip_loc and initialize with UNW_IA64_IP. Initialized the cached values of PR and IP. Initialize sp and psp to value in UNW_IA64_SP. Initialize exception handling args by reading the corresponding scratch registers (r15-r18). If the read fails, initialize with 0. Finish by calling ia64_get_proc_info() instead of ia64_get_frame_state(). (Logical change 1.5)
This commit is contained in:
parent
dffc24cb9f
commit
5cdb197f44
1 changed files with 34 additions and 16 deletions
|
@ -25,10 +25,10 @@ License. */
|
||||||
#include "unwind_i.h"
|
#include "unwind_i.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
ia64_init_remote (unw_cursor_t *cursor, unw_accessors_t *a)
|
unw_init_remote (unw_cursor_t *cursor, unw_accessors_t *a)
|
||||||
{
|
{
|
||||||
struct ia64_cursor *c = (struct ia64_cursor *) cursor;
|
struct ia64_cursor *c = (struct ia64_cursor *) cursor;
|
||||||
int i;
|
int i, ret;
|
||||||
|
|
||||||
if (unw.first_time)
|
if (unw.first_time)
|
||||||
{
|
{
|
||||||
|
@ -38,13 +38,13 @@ ia64_init_remote (unw_cursor_t *cursor, unw_accessors_t *a)
|
||||||
|
|
||||||
c->acc = *a;
|
c->acc = *a;
|
||||||
|
|
||||||
c->cfm_loc = IA64_REG_LOC (UNW_IA64_AR_PFS);
|
c->cfm_loc = IA64_REG_LOC (UNW_IA64_CFM);
|
||||||
c->top_rnat_loc = IA64_REG_LOC (UNW_IA64_AR_RNAT);
|
c->top_rnat_loc = IA64_REG_LOC (UNW_IA64_AR_RNAT);
|
||||||
c->bsp_loc = IA64_REG_LOC (UNW_IA64_AR_BSP);
|
c->bsp_loc = IA64_REG_LOC (UNW_IA64_AR_BSP);
|
||||||
c->bspstore_loc = IA64_REG_LOC (UNW_IA64_AR_BSP);
|
c->bspstore_loc = IA64_REG_LOC (UNW_IA64_AR_BSPSTORE);
|
||||||
c->pfs_loc = IA64_REG_LOC (UNW_IA64_AR_PFS);
|
c->pfs_loc = IA64_REG_LOC (UNW_IA64_AR_PFS);
|
||||||
c->rnat_loc = IA64_REG_LOC (UNW_IA64_AR_RNAT);
|
c->rnat_loc = IA64_REG_LOC (UNW_IA64_AR_RNAT);
|
||||||
c->rp_loc = IA64_REG_LOC (UNW_IA64_BR + 0);
|
c->ip_loc = IA64_REG_LOC (UNW_IA64_IP);
|
||||||
c->pri_unat_loc = 0; /* no primary UNaT location */
|
c->pri_unat_loc = 0; /* no primary UNaT location */
|
||||||
c->unat_loc = IA64_REG_LOC (UNW_IA64_AR_UNAT);
|
c->unat_loc = IA64_REG_LOC (UNW_IA64_AR_UNAT);
|
||||||
c->pr_loc = IA64_REG_LOC (UNW_IA64_PR);
|
c->pr_loc = IA64_REG_LOC (UNW_IA64_PR);
|
||||||
|
@ -74,25 +74,43 @@ ia64_init_remote (unw_cursor_t *cursor, unw_accessors_t *a)
|
||||||
for (i = 16; i <= 31; ++i)
|
for (i = 16; i <= 31; ++i)
|
||||||
c->fr_loc[i - 16] = IA64_FPREG_LOC (UNW_IA64_FR + i);
|
c->fr_loc[i - 16] = IA64_FPREG_LOC (UNW_IA64_FR + i);
|
||||||
|
|
||||||
if (ia64_get (c, IA64_REG_LOC (UNW_IA64_SP), &c->psp) < 0)
|
ret = ia64_get (c, c->pr_loc, &c->pr);
|
||||||
return -1;
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
if (ia64_get (c, c->bsp_loc, &c->bsp) < 0)
|
ret = ia64_get (c, c->ip_loc, &c->ip);
|
||||||
return -1;
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
ret = ia64_get (c, IA64_REG_LOC (UNW_IA64_SP), &c->sp);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
c->psp = c->sp;
|
||||||
|
|
||||||
|
ret = ia64_get (c, c->bsp_loc, &c->bsp);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
c->rbs_top = c->bsp;
|
c->rbs_top = c->bsp;
|
||||||
c->pi.flags = 0;
|
c->pi.flags = 0;
|
||||||
c->eh_args[0] = 0;
|
|
||||||
c->eh_args[1] = 0;
|
for (i = 0; i < 4; ++i)
|
||||||
c->eh_args[2] = 0;
|
{
|
||||||
c->eh_args[3] = 0;
|
ret = ia64_get (c, IA64_REG_LOC (UNW_IA64_GR + 15 + i), &c->eh_args[i]);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
if (ret == -UNW_EBADREG)
|
||||||
|
c->eh_args[i] = 0;
|
||||||
|
else
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef IA64_UNW_SCRIPT_CACHE
|
#ifdef IA64_UNW_SCRIPT_CACHE
|
||||||
c->hint = 0;
|
c->hint = 0;
|
||||||
c->prev_script = 0;
|
c->prev_script = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return ia64_get_frame_state (c);
|
return ia64_get_proc_info (c);
|
||||||
}
|
}
|
||||||
|
|
||||||
alias (ia64_init_remote, UNW_OBJ(init_remote))
|
|
||||||
|
|
Loading…
Reference in a new issue