From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42009 invoked by alias); 26 Feb 2016 16:23:37 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 41990 invoked by uid 89); 26 Feb 2016 16:23:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1527 X-HELO: usplmg21.ericsson.net Received: from usplmg21.ericsson.net (HELO usplmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 26 Feb 2016 16:23:35 +0000 Received: from EUSAAHC003.ericsson.se (Unknown_Domain [147.117.188.81]) by usplmg21.ericsson.net (Symantec Mail Security) with SMTP id 3D.62.32102.AEB70D65; Fri, 26 Feb 2016 17:23:07 +0100 (CET) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.83) with Microsoft SMTP Server id 14.3.248.2; Fri, 26 Feb 2016 11:23:33 -0500 Subject: Re: [PATCH 2/2] arm-tdep.c: Refactor displaced stepping relocation functions To: Luis Machado , References: <1456415245-24005-1-git-send-email-simon.marchi@ericsson.com> <1456415245-24005-3-git-send-email-simon.marchi@ericsson.com> <56D07946.2060104@codesourcery.com> From: Simon Marchi Message-ID: <56D07C04.9060000@ericsson.com> Date: Fri, 26 Feb 2016 16:23:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56D07946.2060104@codesourcery.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00870.txt.bz2 >> diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c >> index 43b61c2..ef48a90 100644 >> --- a/gdb/arm-tdep.c >> +++ b/gdb/arm-tdep.c >> @@ -7111,9 +7111,8 @@ thumb_copy_pop_pc_16bit (uint16_t insn1, struct arm_insn_reloc_data *data) >> return 0; >> } >> >> -static void >> -thumb_process_displaced_16bit_insn (uint16_t insn1, >> - struct arm_insn_reloc_data *data) >> +static int >> +arm_relocate_insn_thumb_16bit (uint16_t insn1, struct arm_insn_reloc_data *data) >> { >> unsigned short op_bit_12_15 = bits (insn1, 12, 15); >> unsigned short op_bit_10_11 = bits (insn1, 10, 11); >> @@ -7202,9 +7201,7 @@ thumb_process_displaced_16bit_insn (uint16_t insn1, >> err = 1; >> } >> >> - if (err) >> - internal_error (__FILE__, __LINE__, >> - _("thumb_process_displaced_16bit_insn: Instruction decode error")); >> + return err; > > Should we keep this internal error message under a different context > instead of exporting just an error code? Maybe the error code should > trigger this internal error for GDB? I am not sure I understand your comment. Given this call tree: - arm_process_displaced_insn - arm_relocate_insn_arm ... - arm_relocate_insn_thumb_32bit ... - arm_relocate_insn_thumb_16bit ... my patch makes it so that the arm_relocate_insn* functions return an error code, and arm_process_displaced_insn calls internal_error if an error is returned. Do you suggest putting the internal_error calls in the arm_relocate_insn_* functions directly?