This is an archive of the discontinued LLVM Phabricator instance.

libunwind: Fix unw_step() for ARM EHABI.
ClosedPublic

Authored by logan on May 24 2015, 10:34 AM.

Details

Summary

This commit fixes the unw_step() for ARM EHABI. However, this commit
also changes the implementation details for ARM EHABI.

The first change is that the personality function should call
gnu_unwind_frame() for default (or de facto) frame unwinding based on
the ARM-defined unwind opcode. The function
gnu_unwind_frame() will
in turn calls unw_step() which actually unwinds the frame.

The second change is that the implementation _Unwind_Backtrace() should
no longer calls unw_step() to unwind the frame; since according to ARM
EHABI, the personality function should unwind the frame for us.

Special thanks to Anton for helpful suggestion on the initial version of
this patch.

Diff Detail

Event Timeline

logan updated this revision to Diff 26384.May 24 2015, 10:34 AM
logan retitled this revision from to libunwind: Fix unw_step() for ARM EHABI..
logan updated this object.
logan edited the test plan for this revision. (Show Details)
logan added reviewers: asl, rengolin, danalbert, compnerd.
logan added a subscriber: Unknown Object (MLST).
rengolin edited edge metadata.May 24 2015, 11:35 AM

Hi Logan,

I imagine this is the result of our discussion on how to merge the two exception handling mechanisms. It's been a long while since the last time I checked the unwinder code, so I'm not going to opine on it, but if both you and Anton are happy with it, so am I.

cheers,
--renato

asl edited edge metadata.May 25 2015, 9:55 PM

This looks ok to me. Note that we need to enable -funwind-frame to UnwindLevel1-gcc-ext.c

logan accepted this revision.May 29 2015, 8:28 AM
logan added a reviewer: logan.
This revision is now accepted and ready to land.May 29 2015, 8:28 AM
logan added a comment.May 29 2015, 8:31 AM

Note that we need to enable -funwind-frame to UnwindLevel1-gcc-ext.c

I guess you mean -funwind-tables?

Yes, -funwind-tables will be added to CFLAGS if we build the library with cmake.

logan closed this revision.May 29 2015, 8:39 AM

Hi Anton and Renato,

Thanks for reviewing. Committed as rL238560.