[PATCH] [libcxxabi] Make _Unwind_Backtrace() work on ARM.

Jonathan Roelofs jonathan at codesourcery.com
Mon Sep 8 10:36:38 PDT 2014



On 9/7/14, 3:57 PM, Jonathan Roelofs wrote:
>
>
> On 9/7/14, 2:23 PM, Nico Weber wrote:
>> On Wed, Sep 3, 2014 at 6:25 AM, Jonathan Roelofs <jonathan at codesourcery.com
>> <mailto:jonathan at codesourcery.com>> wrote:
>>
>>
>>
>>     On 9/3/14, 5:09 AM, Renato Golin wrote:
>>
>>         On 3 September 2014 01:02, Antoine Labour <piman at google.com
>>         <mailto:piman at google.com>> wrote:
>>
>>             Where in the EHABI spec is that defined? AFAICT all it says in
>>             section 6.2
>>             is that there's data for the PR, but it doesn't say anything about
>> the
>>             contents of that data.
>>
>>
>>         I concur. The EHABI doesn't define what's in the personality data
>>         block, let alone that the length must be the first byte. I think these
>>         are premature assumptions.
>>
>>     Hmm, re-reading those sections, I see that it doesn't. I suppose all that
>>     can be done is to check that the prel31 points at __gxx_personality_v0, and
>>     fail to unwind otherwise.
>>
>>
>> Did this happen? If not, should we back out the change until someone has time to
>> implement this correctly?
>
> Not yet. I'll implement it at some point tomorrow, and send it here for review.
> This was already broken before this patch, so I'm not so worried about backing
> it out.
Anddd, here's the patch.

Jon
>
>
> Jon
>
>>
>>
>>
>>
>>     Jon
>>
>>
>>         cheers,
>>         --renato
>>         _________________________________________________
>>         cfe-commits mailing list
>>         cfe-commits at cs.uiuc.edu <mailto:cfe-commits at cs.uiuc.edu>
>>         http://lists.cs.uiuc.edu/__mailman/listinfo/cfe-commits
>>         <http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits>
>>
>>     _________________________________________________
>>     cfe-commits mailing list
>>     cfe-commits at cs.uiuc.edu <mailto:cfe-commits at cs.uiuc.edu>
>>     http://lists.cs.uiuc.edu/__mailman/listinfo/cfe-commits
>>     <http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits>
>>
>>
>

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded
-------------- next part --------------
Index: src/Unwind/Unwind-EHABI.cpp
===================================================================
--- src/Unwind/Unwind-EHABI.cpp	(revision 217387)
+++ src/Unwind/Unwind-EHABI.cpp	(working copy)
@@ -218,8 +218,17 @@
 decode_eht_entry(const uint32_t* data, size_t* off, size_t* len) {
   if ((*data & 0x80000000) == 0) {
     // 6.2: Generic Model
-    *off = 1; // First byte is size data.
-    *len = (((data[1] >> 24) & 0xff) + 1) * 4;
+
+    _Unwind_Reason_Code __gxx_personality_v0(int version, _Unwind_Action actions,
+                                             uint64_t exceptionClass,
+                                             _Unwind_Exception* unwind_exception,
+                                             _Unwind_Context* context);
+    void *PR = (void*)signExtendPrel31(*data);
+    if (PR == &__gxx_personality_v0) {
+      *off = 1; // First byte is size data.
+      *len = (((data[1] >> 24) & 0xff) + 1) * 4;
+    } else
+      return nullptr;
     data++; // Skip the first word, which is the prel31 offset.
   } else {
     // 6.3: ARM Compact Model


More information about the cfe-commits mailing list