[PATCH][cxxabi] ARM EHABI zero-cost exception handling for libc++abi

Logan Chien tzuhsiang.chien at gmail.com
Sun Apr 13 09:37:00 PDT 2014


Hi Jonathan,

Thanks for your reply.

>  *  One thing that immediately jumps out at me as missing from this
>     implementation are the __aeabi_unwind_pr{0,1,2} functions, which
>     are necessary to unwind more kinds of frames that the backend spits
out.

Yes.  I have only implemented the personality function in this patch.
Thus, we still have to link with libgcc at the moment.  AFAICT, following
important functions are missing:

- __aeabi_unwind_pr{0,1,2}()
- _Unwind_RaiseException(), _Unwind_GetLanguageSpecificData(),
_Unwind_GetRegionStart()
- _Unwind_VRS_{Get,Set}()
- __gnu_unwind_frame()

>  *  Also, I believe there might be a catch clause indexing bug as fixed
in [2]
>     (though maybe that change should be under #if LIBCXXABI_ARM_EHABI ?).

It seems that I am using different way to handle the filter type index,
thus it won't be a problem.

>  *  A bunch of the _Unwind_* functions are done up as static inline...
would be
>     nicer to use the unwind cursor abstraction to help keep down #ifdef
>     proliferation.

I don't quite understand what do you mean by "unwind cursor abstraction".
May you give further explanation?

I wrote those static inline function simply because I wish to reuse the
code with _Unwind_GetGR()/_Unwind_SetGR().  It seems that the header from
clang did the same thing.

> I'm being pedantic here: you say they compile & run, but what's the pass
rate?

I have tried every test cases in libcxxabi/test, and all of them are
passing except one case in test_demangle.cpp.  That case assumes that long
double has 80-bit, which is not true for ARM.  Thus, I have changed it in
the patch.

I haven't tried the test case from libc++ yet, though I am planning to do
so.

Cheers,
Logan


On Sun, Apr 13, 2014 at 10:52 PM, Jonathan Roelofs <
jonathan at codesourcery.com> wrote:

> Logan,
>
> I wish I had been faster in helping Nico to upstream their implementation
> of
> this [1] as I had promised a few weeks ago (see "[cfe-dev] [libcxxabi]
> Contributing ARM EHABI support for libcxxabi"). :/
>
> A couple of comments after a quick skim:
>   *  One thing that immediately jumps out at me as missing from this
>      implementation are the __aeabi_unwind_pr{0,1,2} functions, which
>      are necessary to unwind more kinds of frames that the backend spits
> out.
>   *  Also, I believe there might be a catch clause indexing bug as fixed
> in [2]
>      (though maybe that change should be under #if LIBCXXABI_ARM_EHABI ?).
>   *  A bunch of the _Unwind_* functions are done up as static inline...
> would be
>      nicer to use the unwind cursor abstraction to help keep down #ifdef
>      proliferation.
>
> Maybe we ought to merge these two implementations (yours and [1]) or apply
> things learned from one to the other, and then review/commit it?
>
> Cheers,
> Jon
>
> [1]: https://github.com/awong-dev/ndk/tree/use-libc%2B%2Babi/
> sources/cxx-stl/llvm-libc%2B%2Babi/libcxxabi
> [2]: https://github.com/awong-dev/ndk/commit/
> 9d617501b7862adbd9dcfd62ca0b7347af38f01e#diff-
> f48fdacc036821bdabe7e46660900794R613
>
>
> On 4/13/14, 3:16 AM, Logan Chien wrote:
>
>> Hi,
>>
>> I have worked on ARM EHABI zero-cost exception handling for libc++abi.
>>
>> With the attached patch, I can compile and run all libc++abi unittests on
>> ARM Linux.
>>
> I'm being pedantic here: you say they compile & run, but what's the pass
> rate?
>
>>
>> Is it OK to commit?  Thanks.
>>
>>
>> Sincerely,
>> Logan
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>>
> --
> Jon Roelofs
> jonathan at codesourcery.com
> CodeSourcery / Mentor Embedded
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140414/7e44f1e9/attachment.html>


More information about the cfe-commits mailing list