From patchwork Mon Nov 14 17:42:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 17473 Received: (qmail 48023 invoked by alias); 14 Nov 2016 17:43:21 -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 47882 invoked by uid 89); 14 Nov 2016 17:43:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1889 X-HELO: mail-pf0-f196.google.com Received: from mail-pf0-f196.google.com (HELO mail-pf0-f196.google.com) (209.85.192.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Nov 2016 17:43:12 +0000 Received: by mail-pf0-f196.google.com with SMTP id 144so6507289pfv.0 for ; Mon, 14 Nov 2016 09:43:11 -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=qfBSYgGpzC4xywWfB/9DjvhFERKSQ44/A0cOsXv/2Vo=; b=bB/Bk3b5+A1SggXN5EqmAWiuDu7ubWYoSErp5MYtv5wCqQahDpaZR4SOY/BMvubK2V sU3c97QztKqly6a10Wyt9AAA4Z70CCaluHm9mXTvN5q3JGNURaH3JIQX56F6w4UGoI3q zeM3QdXOMVwmNDmdOKiSimWWK3ToI7AQTdSaLGOnp6wmQfUthb4khkt783XgaxQyRnKx U1kjNl0hpA9Y24t5ykxXo6REE250EYbbuP3Wc97A5hqRjNZB4AD/umKHT2LSsKdflUpG iQ6KAeLPgWGntAgwKqt/UCXJPASOFTzMhuL0o3UUQNCd9dxt9Vrn8PP+EE/+mqInB0cf EYGA== X-Gm-Message-State: ABUngvdJ0gssuyPbkddlFuRJLAhNkdGnVhJcXnz8Up57g7ObF//vqO0r+pCN5az5kMg6pA== X-Received: by 10.99.97.15 with SMTP id v15mr30944972pgb.10.1479145390401; Mon, 14 Nov 2016 09:43:10 -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.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Nov 2016 09:43:10 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 12/13] gdbarch software_single_step frame_info to regcache: spu Date: Mon, 14 Nov 2016 17:42:49 +0000 Message-Id: <1479145370-11432-13-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 * spu-tdep.c (spu_software_single_step): Call get_regcache_arch instead of get_frame_arch. Call regcache_read_pc instead of get_frame_pc. Call regcache_raw_get_unsigned instead of get_frame_register_unsigned. --- gdb/spu-tdep.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c index 073be2d..d16b68f 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c @@ -1613,7 +1613,8 @@ spu_memory_remove_breakpoint (struct gdbarch *gdbarch, static VEC (CORE_ADDR) * spu_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); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR pc, next_pc; unsigned int insn; @@ -1622,7 +1623,7 @@ spu_software_single_step (struct frame_info *frame) ULONGEST lslr; VEC (CORE_ADDR) *next_pcs = NULL; - pc = get_frame_pc (frame); + pc = regcache_read_pc (regcache); if (target_read_memory (pc, buf, 4)) throw_error (MEMORY_ERROR, _("Could not read instruction at %s."), @@ -1631,7 +1632,7 @@ spu_software_single_step (struct frame_info *frame) insn = extract_unsigned_integer (buf, 4, byte_order); /* Get local store limit. */ - lslr = get_frame_register_unsigned (frame, SPU_LSLR_REGNUM); + lslr = regcache_raw_get_unsigned (regcache, SPU_LSLR_REGNUM); if (!lslr) lslr = (ULONGEST) -1; @@ -1652,7 +1653,7 @@ spu_software_single_step (struct frame_info *frame) if (reg == SPU_PC_REGNUM) target += SPUADDR_ADDR (pc); else if (reg != -1) - target += get_frame_register_unsigned (frame, reg) & -4; + target += regcache_raw_get_unsigned (regcache, reg) & -4; target = target & lslr; if (target != next_pc)