On Tue, Oct 6, 2015 at 8:30 AM, Steve Ellcey <sell...@imgtec.com> wrote: > On Mon, 2015-10-05 at 09:57 -0700, H.J. Lu wrote: > >> You need to update dwarf2cfi.c to generate proper unwind info for >> whatever frame instructions MIPS generates, like what we did for >> x86 dynamic stack realignment. > > 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. > > 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. > > 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.
You can start by writing dynamic stack alignment in assembly with CFI directives and verify you can unwind it under gdb. You will know what CFI directives you should generate for GDB. BTW, you should first fix readelf to dump MIPS DWARF unwind info. -- H.J.