From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23086 invoked by alias); 10 Oct 2011 12:23:25 -0000 Received: (qmail 23051 invoked by uid 22791); 10 Oct 2011 12:23:23 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,TW_IB X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 Oct 2011 12:23:04 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RDEsp-0001Z8-4h from Paul_Brook@mentor.com ; Mon, 10 Oct 2011 05:23:03 -0700 Received: from nowt.org ([172.30.64.129]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 10 Oct 2011 13:23:01 +0100 Received: from wren.localnet (wren.home [192.168.93.7]) by nowt.org (Postfix) with ESMTP id 2A9556EF70; Mon, 10 Oct 2011 13:23:01 +0100 (BST) From: Paul Brook To: Matthias Klose Subject: Re: [patch] C6X unwinding/exception handling Date: Mon, 10 Oct 2011 12:23:00 -0000 User-Agent: KMail/1.13.7 (Linux/3.0.0-1-amd64; KDE/4.6.5; x86_64; ; ) Cc: Andrew Haley , gcc-patches@gcc.gnu.org, GCC Java , Nicola Pero References: <201108041531.58790.paul@codesourcery.com> <4E92C9D0.10106@redhat.com> <4E92D68A.6080308@ubuntu.com> In-Reply-To: <4E92D68A.6080308@ubuntu.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201110101323.00966.paul@codesourcery.com> Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00004.txt.bz2 > Index: libjava/exception.cc > =================================================================== > --- libjava/exception.cc (revision 179739) > +++ libjava/exception.cc (working copy) > @@ -135,6 +135,7 @@ > { > _Unwind_Ptr Start; > _Unwind_Ptr LPStart; > + _Unwind_Ptr ttype_base; > const unsigned char *TType; > const unsigned char *action_table; > unsigned char ttype_encoding; > @@ -184,7 +185,7 @@ > _Unwind_Ptr ptr; > > ptr = (_Unwind_Ptr) (info->TType - (i * 4)); > - ptr = _Unwind_decode_target2(ptr); > + ptr = _Unwind_decode_typeinfo_ptr (info->ttype_base, (_Unwind_Word) > ptr); > > return reinterpret_cast(ptr); > } > @@ -325,6 +326,7 @@ > > // Parse the LSDA header. > p = parse_lsda_header (context, language_specific_data, &info); > + info.ttype_base = base_of_encoded_value (info.ttype_encoding, context); > #ifdef HAVE_GETIPINFO > ip = _Unwind_GetIPInfo (context, &ip_before_insn); > #else No. The purpose of my patch was to remove the arm specific code. The only difference I can see in this bit of code is that libstdc++ uses base_of_encoded_value/read_encoded_value_with_base whereas libjava uses context/read_encoded_value. I expect you want something like the patch below (completely untested). Paul Index: exception.cc =================================================================== --- exception.cc (revision 178906) +++ exception.cc (working copy) @@ -161,6 +161,11 @@ parse_lsda_header (_Unwind_Context *cont info->ttype_encoding = *p++; if (info->ttype_encoding != DW_EH_PE_omit) { +#if _GLIBCXX_OVERRIDE_TTYPE_ENCODING + /* Older ARM EABI toolchains set this value incorrectly, so use a + hardcoded OS-specific format. */ + info->ttype_encoding = _GLIBCXX_OVERRIDE_TTYPE_ENCODING; +#endif p = read_uleb128 (p, &tmp); info->TType = p + tmp; } @@ -176,21 +181,6 @@ parse_lsda_header (_Unwind_Context *cont return p; } -#ifdef __ARM_EABI_UNWINDER__ - -static void ** -get_ttype_entry(_Unwind_Context *, lsda_header_info* info, _uleb128_t i) -{ - _Unwind_Ptr ptr; - - ptr = (_Unwind_Ptr) (info->TType - (i * 4)); - ptr = _Unwind_decode_target2(ptr); - - return reinterpret_cast(ptr); -} - -#else - static void ** get_ttype_entry (_Unwind_Context *context, lsda_header_info *info, long i) { @@ -202,8 +192,6 @@ get_ttype_entry (_Unwind_Context *contex return reinterpret_cast(ptr); } -#endif - // Using a different personality function name causes link failures // when trying to mix code using different exception handling models. #ifdef SJLJ_EXCEPTIONS