[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libunwind] problems parsing dwarf frame info on amd64 optimized cod
From: |
Max Asbock |
Subject: |
Re: [libunwind] problems parsing dwarf frame info on amd64 optimized code |
Date: |
Fri, 12 Mar 2004 11:20:56 -0800 |
User-agent: |
KMail/1.5.4 |
On Friday 12 March 2004 11:40, David Mosberger wrote:
> >>>>> On Fri, 12 Mar 2004 10:37:02 -0800, Max Asbock <address@hidden> said:
>
> Max> In apply_reg_state() this could translate to:
>
> Max> for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i)
> Max> {
> Max> switch ((dwarf_where_t) rs->reg[i].where)
> Max> {
> Max> ......
> Max> case DWARF_WHERE_SAME:
> Max> if (i == <REGNUM_SP>)
> Max> if (ret = dwarf_put(c, c->loc[i], cfa))
> Max> return ret;
> Max> .......
>
>
> That may work for this particular case, but it's almost certainly
> wrong: it will modify the initial machine-state, which is not what you
> want. Instead, I think you'll need to use c->cfa "in the right
> places" (I'm not sure yet what the right places are...).
>
Then how about:
if (rs->reg[DWARF_CFA_REG_COLUMN].where == DWARF_WHERE_REG)
{
if ((rs->reg[DWARF_CFA_REG_COLUMN].val == <REGNUM_SP>)
&& (rs->reg[<REGNUM_SP>].where == DWARF_WHERE_SAME))
cfa = c->cfa;
else
read the value for the cfa from the register
}
This works as well.
max