From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70208 invoked by alias); 26 Feb 2016 16:12:44 -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 70190 invoked by uid 89); 26 Feb 2016 16:12:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Allocate, prepares, carry X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 26 Feb 2016 16:12:43 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1aZL0S-0005Eu-8U from Luis_Gustavo@mentor.com ; Fri, 26 Feb 2016 08:12:40 -0800 Received: from [172.30.3.146] (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.224.2; Fri, 26 Feb 2016 08:12:39 -0800 Subject: Re: [PATCH 1/2] arm-tdep.c: Replace arguments to relocation functions by a structure References: <1456415245-24005-1-git-send-email-simon.marchi@ericsson.com> <1456415245-24005-2-git-send-email-simon.marchi@ericsson.com> To: Simon Marchi , From: Luis Machado Reply-To: Luis Machado Message-ID: <56D07976.6020204@codesourcery.com> Date: Fri, 26 Feb 2016 16:12: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: <1456415245-24005-2-git-send-email-simon.marchi@ericsson.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00869.txt.bz2 Hi, I like this idea. If it ends up being accepted, we should eventually extend it for other architectures so we can decouple this type of code from GDB and shared it more. On 02/25/2016 12:47 PM, Simon Marchi wrote: > This patch prepares the functions that do the instruction > decoding/relocating so they can be moved out of arm-tdep.c and shared > with gdbserver. Some arguments passed around are necessary for > relocating the instructions, but specific to GDB and the displaced > stepping use case. Instead of passing those values by parameters > directly, we now carry a pointer to a data structure containing them. > This allows decoupling the decoding phase (analyzing the opcode), which > will be shared with gdbserver, from the relocation phase (generating a > modified instruction). When gdbserver uses those functions, it will be > able to specify its own data structure, with different fields. > > gdb/ChangeLog: > > * arm-tdep.c (struct arm_insn_reloc_data): New structure. > (arm_copy_unmodified): Replace args with pointer to struct > arm_insn_reloc_data. > (thumb_copy_unmodified_32bit): Likewise. > (thumb_copy_unmodified_16bit): > (install_preload): Likewise. > (arm_copy_preload): Likewise. > (thumb2_copy_preload): Likewise. > (install_preload_reg): Likewise. > (arm_copy_preload_reg): Likewise. > (install_copro_load_store): Likewise. > (arm_copy_copro_load_store): Likewise. > (thumb2_copy_copro_load_store): Likewise. > (install_b_bl_blx): Likewise. > (arm_copy_b_bl_blx): Likewise. > (thumb2_copy_b_bl_blx): Likewise. > (thumb_copy_b): Likewise. > (install_bx_blx_reg): Likewise. > (arm_copy_bx_blx_reg): Likewise. > (thumb_copy_bx_blx_reg): Likewise. > (arm_copy_alu_imm): Likewise. > (thumb2_copy_alu_imm): Likewise. > (install_alu_reg): Likewise. > (arm_copy_alu_reg): Likewise. > (thumb_copy_alu_reg): Likewise. > (install_alu_shifted_reg): Likewise. > (arm_copy_alu_shifted_reg): Likewise. > (arm_copy_extra_ld_st): Likewise. > (install_load_store): Likewise. > (thumb2_copy_load_literal): Likewise. > (thumb2_copy_load_reg_imm): Likewise. > (arm_copy_ldr_str_ldrb_strb): Likewise. > (arm_copy_block_xfer): Likewise. > (thumb2_copy_block_xfer): Likewise. > (install_svc): Likewise. > (arm_copy_svc): Likewise. > (arm_copy_unpred): Likewise. > (arm_decode_misc_memhint_neon): Likewise. > (arm_decode_ld_st_word_ubyte): Likewise. > (arm_decode_b_bl_ldmstm): Likewise. > (thumb2_decode_dp_shift_reg): Likewise. > (thumb2_decode_ext_reg_ld_st): Likewise. > (arm_decode_svc_copro): Likewise. > (thumb_copy_pc_relative_16bit): Likewise. > (thumb_decode_pc_relative_16bit): Likewise. > (thumb_copy_pc_relative_32bit): Likewise. > (thumb_copy_16bit_ldr_literal): Likewise. > (thumb_copy_cbnz_cbz): Likewise. > (thumb2_copy_table_branch): Likewise. > (thumb_copy_pop_pc_16bit): Likewise. > (thumb_process_displaced_16bit_insn): Likewise. > (decode_thumb_32bit_ld_mem_hints): Likewise. > (thumb_process_displaced_32bit_insn): Likewise. > (thumb_process_displaced_insn): Likewise. > (arm_process_displaced_insn): Allocate a strict Allocate a struct. The rest looks mostly like mechanical changes, so OK to my eyes.