From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53206 invoked by alias); 25 Feb 2016 15:47:33 -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 53185 invoked by uid 89); 25 Feb 2016 15:47:33 -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=relocating, decoding, Hx-languages-length:1476, 491 X-HELO: usplmg20.ericsson.net Received: from usplmg20.ericsson.net (HELO usplmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 25 Feb 2016 15:47:31 +0000 Received: from EUSAAHC001.ericsson.se (Unknown_Domain [147.117.188.75]) by usplmg20.ericsson.net (Symantec Mail Security) with SMTP id E5.41.12433.9DD1FC65; Thu, 25 Feb 2016 16:29:29 +0100 (CET) Received: from elxcz23q12-y4.dyn.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.75) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 25 Feb 2016 10:47:29 -0500 From: Simon Marchi To: CC: Simon Marchi Subject: [PATCH 0/2] Decouple ARM instruction decoding/relocating from GDB Date: Thu, 25 Feb 2016 15:47:00 -0000 Message-ID: <1456415245-24005-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00800.txt.bz2 As part of the upcoming ARM fast tracepoint support, we need to have some code in gdbserver that decodes the relocated instructions, to check whether they need to be modified or not (whether the result of their execution depends on their particular PC). Instead of writing new code from scratch, we should take advantage of the code already written for the displaced stepping feature in GDB, as AArch64 does. To make this possible, we first need to decouple the instruction decoding part from GDB, so that the code can eventually be moved to a shared location. Patch 1 replaces the GDB-specific arguments of the instruction decoding functions by a pointer to a structure/closure, so that different contexts can provide different parameters. Patch 2 refactors the functions in arm-tdep.c to isolate the instruction decoding bits specific to displaced stepping in a single function. It renames the other functions to show that they are not specific to displaced stepping anymore. Future patches will complete this work by implementing a visitor pattern similar to AArch64 and moving the code to the arch/ directory. Simon Marchi (2): arm-tdep.c: Replace arguments to relocation functions by a structure arm-tdep.c: Refactor displaced stepping relocation functions gdb/arm-tdep.c | 947 +++++++++++++++++++++++++++------------------------------ 1 file changed, 456 insertions(+), 491 deletions(-) -- 2.5.1