1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-06-26 03:11:44 +02:00

[dwarf] Allow return address column to differ from function to function.

Signed-off-by: Andrey Veskov <Andrey.Veskov@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@google.com>
This commit is contained in:
Arun Sharma 2006-07-26 21:29:50 -06:00 committed by David Mosberger-Tang
parent 60b7af702a
commit c5dc3c150a
2 changed files with 10 additions and 5 deletions

View file

@ -232,6 +232,7 @@ typedef struct dwarf_reg_state
struct dwarf_reg_state *next; /* for rs_stack */
dwarf_save_loc_t reg[DWARF_NUM_PRESERVED_REGS + 2];
unw_word_t ip; /* ip this rs is for */
unw_word_t ret_addr_column; /* indicates which column in the rule table represents return address */
unsigned short lru_chain; /* used for least-recently-used chain */
unsigned short coll_chain; /* used for hash collisions */
unsigned short hint; /* hint for next rs to try (or -1) */

View file

@ -535,7 +535,7 @@ rs_lookup (struct dwarf_rs_cache *cache, struct dwarf_cursor *c)
}
static inline dwarf_reg_state_t *
rs_new (struct dwarf_rs_cache *cache, unw_word_t ip)
rs_new (struct dwarf_rs_cache *cache, struct dwarf_cursor * c)
{
dwarf_reg_state_t *rs, *prev, *tmp;
unw_hash_index_t index;
@ -575,12 +575,13 @@ rs_new (struct dwarf_rs_cache *cache, unw_word_t ip)
}
/* enter new rs in the hash table */
index = hash (ip);
index = hash (c->ip);
rs->coll_chain = cache->hash[index];
cache->hash[index] = rs - cache->buckets;
rs->hint = 0;
rs->ip = ip;
rs->ip = c->ip;
rs->ret_addr_column = c->ret_addr_column;
return rs;
}
@ -771,7 +772,10 @@ dwarf_find_save_locs (struct dwarf_cursor *c)
rs = rs_lookup(cache, c);
if (rs)
goto apply;
{
c->ret_addr_column = rs->ret_addr_column;
goto apply;
}
if ((ret = fetch_proc_info (c, c->ip, 1)) < 0)
return ret;
@ -782,7 +786,7 @@ dwarf_find_save_locs (struct dwarf_cursor *c)
rs1 = &sr.rs_current;
if (rs1)
{
rs = rs_new (cache, c->ip);
rs = rs_new (cache, c);
memcpy(rs, rs1, offsetof(struct dwarf_reg_state, ip));
if (!rs)
{