From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63398 invoked by alias); 5 Jul 2016 13:41:19 -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 63309 invoked by uid 89); 5 Jul 2016 13:41:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=U*simon.marchi, sk:simonm, sk:simon.m 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; Tue, 05 Jul 2016 13:41:09 +0000 Received: from EUSAAHC008.ericsson.se (Unknown_Domain [147.117.188.96]) by usplmg21.ericsson.net (Symantec Mail Security) with SMTP id 19.66.03614.EA8BB775; Tue, 5 Jul 2016 15:39:58 +0200 (CEST) Received: from elxa4wqvvz1.dyn.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.96) with Microsoft SMTP Server (TLS) id 14.3.294.0; Tue, 5 Jul 2016 09:40:50 -0400 From: Antoine Tremblay To: CC: Simon Marchi Subject: [PATCH v3 03/18] arm-tdep.c: Move debug printout from decode to copy function Date: Tue, 05 Jul 2016 13:41:00 -0000 Message-ID: <1467726030-13020-4-git-send-email-antoine.tremblay@ericsson.com> In-Reply-To: <1467726030-13020-1-git-send-email-antoine.tremblay@ericsson.com> References: <1467726030-13020-1-git-send-email-antoine.tremblay@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2016-07/txt/msg00047.txt.bz2 From: Simon Marchi To be consistent with the rest of the code, the debug printout should be in thumb_copy_pc_relative_16bit. Also, thumb_decode_pc_relative_16bit will be move out of arm-tdep.c to common code, so it can't contain anything gdb-specific. * arm-tdep.c (thumb_decode_pc_relative_16bit): Move debug print from here... (thumb_copy_pc_relative_16bit): ... to here. --- gdb/arm-tdep.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 5a0e247..0c05aae 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -6972,9 +6972,13 @@ install_pc_relative (struct arm_insn_reloc_data *data, int rd) } static int -thumb_copy_pc_relative_16bit (struct arm_insn_reloc_data *data, int rd, - unsigned int imm) +thumb_copy_pc_relative_16bit (uint16_t insn, struct arm_insn_reloc_data *data, + int rd, unsigned int imm) { + if (debug_displaced) + fprintf_unfiltered (gdb_stdlog, + "displaced: copying thumb adr r%d, #%d insn %.4x\n", + rd, imm, insn); /* Encoding T2: ADDS Rd, #imm */ data->dsc->modinsn[0] = (0x3000 | (rd << 8) | imm); @@ -6990,12 +6994,7 @@ thumb_decode_pc_relative_16bit (uint16_t insn, struct arm_insn_reloc_data *data) unsigned int rd = bits (insn, 8, 10); unsigned int imm8 = bits (insn, 0, 7); - if (debug_displaced) - fprintf_unfiltered (gdb_stdlog, - "displaced: copying thumb adr r%d, #%d insn %.4x\n", - rd, imm8, insn); - - return thumb_copy_pc_relative_16bit (data, rd, imm8); + return thumb_copy_pc_relative_16bit (insn, data, rd, imm8); } static int -- 2.8.1