On 10/06/2015 05:30 PM, Steve Ellcey wrote:
On Mon, 2015-10-05 at 09:57 -0700, H.J. Lu wrote:
The problem is understanding what the 'proper' unwind info is and
figuring out what is wrong about it when it doesn't work.

I used Bernd's comment about Rule #6 to handle the sp = sp AND reg
issue, but I have a couple of more dwarf/cfi questions.

Feel free to ask. I can't guarantee I'll have all the answers - you'll have to do some digging yourself.

One, can you explicitly make a copy of the stack pointer to another
register and not make that register the new stack pointer?  I want to
save the old stack pointer before aligning it but when I do that I think
that dwarfcfi.c automatically assumes that the new register is now the
stack pointer and that is not what I want.  I want the stack pointer to
remain as the original register.

Did your tag that copy as RTX_FRAME_RELATED? I'd expect dwarf2cfi would ignore instructions with that bit unset. There's even a comment indicating arm does something like this:

         /* Update the CFA rule wrt SP or FP.  Make sure src is
            relative to the current CFA register.
            We used to require that dest be either SP or FP, but the
            ARM copies SP to a temporary register, and from there to
            FP.  So we just rely on the backends to only set
            RTX_FRAME_RELATED_P on appropriate insns.  */

However, the right answer may be "don't do that". Is this something the i386 port does, and if not, why does MIPS need it?

My other question is about 'set_unexpected' and how that affects
the generated unwind info.  I noticed that a lot of my failing tests use
'set_unexpected' and I don't know what this function does or how it
affects the generated code that would cause these tests in particular to
fail.

Seems to be a standard C++ thing:
  http://www.cplusplus.com/reference/exception/set_unexpected/
I don't know more about it.


Bernd

Reply via email to