From patchwork Mon Nov 14 17:42:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 17466 Received: (qmail 46487 invoked by alias); 14 Nov 2016 17:43:11 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 46334 invoked by uid 89); 14 Nov 2016 17:43:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, SPF_PASS autolearn=ham version=3.3.2 spammy=H*RU:74.125.83.65, Hx-spam-relays-external:74.125.83.65, 1.9.1, Hx-languages-length:2260 X-HELO: mail-pg0-f65.google.com Received: from mail-pg0-f65.google.com (HELO mail-pg0-f65.google.com) (74.125.83.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Nov 2016 17:43:03 +0000 Received: by mail-pg0-f65.google.com with SMTP id p66so9488191pga.2 for ; Mon, 14 Nov 2016 09:43:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=KM0H07dTpx2SEbrx9aMlrgnSJKFFpYPVJzeURlv/MIw=; b=P3JzMzRkmFmsDJ6UBgYzzIeR8pH8O2XoZNL5noH/DZFrAX9xQMQbun5jGmfeCZLu6y OT29R2aNJipqxK0ekHZF+qc2Ef2mKSCPLdJfRilF5xi1XoQ1ZDjrQeO/ehfN6x9dy89p +01va5hbLfpFw5v/XyIUitl0hf+zLABZbiAwWUZ8zlkPVSNnfAWeBrklORv9PlR4Xedc 0sAT9VdtasoTSkHOfM3iwfqsUs12yJGHZSqiDNxdAzG2TS35nLPPTBPz1gPr4v7QJkeh s4M4rBD33NIXPUeMOrE/CGoWyfNufUoQECMI7IJBFs2MjBIgPS5SsR3xbY0VJk3ckRb0 OoMg== X-Gm-Message-State: ABUngvcpa2+I6DL5+ukSQj4Whei99M0ChBqx/6dpnMmrkINBzM2+zzviCYVHOQbUN15n9Q== X-Received: by 10.99.219.21 with SMTP id e21mr30212793pgg.136.1479145381513; Mon, 14 Nov 2016 09:43:01 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id y29sm36696024pfd.63.2016.11.14.09.43.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Nov 2016 09:43:01 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 04/13] gdbarch software_single_step frame_info to regcache: cris Date: Mon, 14 Nov 2016 17:42:41 +0000 Message-Id: <1479145370-11432-5-git-send-email-yao.qi@linaro.org> In-Reply-To: <1479145370-11432-1-git-send-email-yao.qi@linaro.org> References: <1479145370-11432-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes gdb: 2016-11-10 Yao Qi * cris-tdep.c (find_step_target): Replace parameter frame with regcache. Call get_regcache_arch instead of get_frame_arch. Call regcache_raw_get_unsigned instead of get_frame_register_unsigned. (cris_software_single_step): Call get_regcache_arch instead of get_frame_arch. --- gdb/cris-tdep.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 460e7eb..6b060ea 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -1989,25 +1989,25 @@ find_cris_op (unsigned short insn, inst_env_type *inst_env) actually an internal error. */ static int -find_step_target (struct frame_info *frame, inst_env_type *inst_env) +find_step_target (struct regcache *regcache, inst_env_type *inst_env) { int i; int offset; unsigned short insn; - struct gdbarch *gdbarch = get_frame_arch (frame); + struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); /* Create a local register image and set the initial state. */ for (i = 0; i < NUM_GENREGS; i++) { inst_env->reg[i] = - (unsigned long) get_frame_register_unsigned (frame, i); + (unsigned long) regcache_raw_get_unsigned (regcache, i); } offset = NUM_GENREGS; for (i = 0; i < NUM_SPECREGS; i++) { inst_env->preg[i] = - (unsigned long) get_frame_register_unsigned (frame, offset + i); + (unsigned long) regcache_raw_get_unsigned (regcache, offset + i); } inst_env->branch_found = 0; inst_env->slot_needed = 0; @@ -2063,13 +2063,14 @@ find_step_target (struct frame_info *frame, inst_env_type *inst_env) static VEC (CORE_ADDR) * cris_software_single_step (struct frame_info *frame) { - struct gdbarch *gdbarch = get_frame_arch (frame); + struct regcache *regcache = get_current_regcache (); + struct gdbarch *gdbarch = get_regcache_arch (regcache); inst_env_type inst_env; VEC (CORE_ADDR) *next_pcs = NULL; /* Analyse the present instruction environment and insert breakpoints. */ - int status = find_step_target (frame, &inst_env); + int status = find_step_target (regcache, &inst_env); if (status == -1) { /* Could not find a target. Things are likely to go downhill