From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46436 invoked by alias); 14 Nov 2016 17:43:10 -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 46332 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,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=1.9.1, longest X-HELO: mail-pf0-f194.google.com Received: from mail-pf0-f194.google.com (HELO mail-pf0-f194.google.com) (209.85.192.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Nov 2016 17:43:01 +0000 Received: by mail-pf0-f194.google.com with SMTP id y68so6508260pfb.1 for ; Mon, 14 Nov 2016 09:43:01 -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=2/MdSZFkTbxNwMW7SdPrhTC6GUuI+TvwGXjx28MvfTY=; b=evBrAOuAijFay9h96VXzCZ3yYqu7P8gyFEB4r59+X2OzK9sPXURAkAN9C/Ddp79t5v X6XjTqW2YJjJHrSqB6QoORB2dIsxeUQYd+xiPRdxO63+hf/zGrkLUDIXCbidB5Ca2Mgf K/upaWcuaOrEcfeqLkppBH9BDzMafsM+XiNeIxmwT0QXcyg9iSNJ7ylH9VU11pJhaKuT 4jOzT008wHW1MXxgXU3eKYK5VF4sGj+9V9fOzwGRIq3Y5S7mSBu38pjRqZs6fKcFQUKN ob21gYbYaHO6g2l6ZT6K5ARGLsNY4ijohRX9+h50In9st06V5M2hjAwiJaqn7sKTOcyM GmfQ== X-Gm-Message-State: ABUngvdIyI7Y8P+uqU5bUSYPFNIB7rga9OnRg5fyZDUP/ZLG7huXHnnL84gsH5n0QmFwww== X-Received: by 10.99.159.26 with SMTP id g26mr30824252pge.62.1479145380297; Mon, 14 Nov 2016 09:43:00 -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.42.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Nov 2016 09:42:59 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 03/13] gdbarch software_single_step frame_info to regcache: alpha Date: Mon, 14 Nov 2016 17:43:00 -0000 Message-Id: <1479145370-11432-4-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 X-SW-Source: 2016-11/txt/msg00346.txt.bz2 gdb: 2016-11-10 Yao Qi * alpha-tdep.c (alpha_deal_with_atomic_sequence): Call get_regcache_arch instead of get_frame_arch. Call regcache_read_pc instead of get_frame_pc. (alpha_next_pc): Replace parameter frame with regcache. Call regcache_raw_get_unsigned instead of get_frame_register_unsigned. --- gdb/alpha-tdep.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index a0485ef..9753c1b 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -768,8 +768,9 @@ static const int stq_c_opcode = 0x2f; static VEC (CORE_ADDR) * alpha_deal_with_atomic_sequence (struct frame_info *frame) { - struct gdbarch *gdbarch = get_frame_arch (frame); - CORE_ADDR pc = get_frame_pc (frame); + struct regcache *regcache = get_current_regcache (); + struct gdbarch *gdbarch = get_regcache_arch (regcache); + CORE_ADDR pc = regcache_read_pc (regcache); CORE_ADDR breaks[2] = {-1, -1}; CORE_ADDR loc = pc; CORE_ADDR closing_insn; /* Instruction that closes the atomic sequence. */ @@ -1597,9 +1598,9 @@ fp_register_sign_bit (LONGEST reg) the target of the coming instruction and breakpoint it. */ static CORE_ADDR -alpha_next_pc (struct frame_info *frame, CORE_ADDR pc) +alpha_next_pc (struct regcache *regcache, CORE_ADDR pc) { - struct gdbarch *gdbarch = get_frame_arch (frame); + struct gdbarch *gdbarch = get_regcache_arch (regcache); unsigned int insn; unsigned int op; int regno; @@ -1615,7 +1616,7 @@ alpha_next_pc (struct frame_info *frame, CORE_ADDR pc) { /* Jump format: target PC is: RB & ~3 */ - return (get_frame_register_unsigned (frame, (insn >> 16) & 0x1f) & ~3); + return (regcache_raw_get_unsigned (regcache, (insn >> 16) & 0x1f) & ~3); } if ((op & 0x30) == 0x30) @@ -1646,7 +1647,7 @@ alpha_next_pc (struct frame_info *frame, CORE_ADDR pc) regno += gdbarch_fp0_regnum (gdbarch); } - rav = get_frame_register_signed (frame, regno); + rav = regcache_raw_get_signed (regcache, regno); switch (op) { @@ -1720,13 +1721,14 @@ alpha_next_pc (struct frame_info *frame, CORE_ADDR pc) VEC (CORE_ADDR) * alpha_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); CORE_ADDR pc; VEC (CORE_ADDR) *next_pcs = NULL; - pc = get_frame_pc (frame); + pc = regcache_read_pc (regcache); - VEC_safe_push (CORE_ADDR, next_pcs, alpha_next_pc (frame, pc)); + VEC_safe_push (CORE_ADDR, next_pcs, alpha_next_pc (regcache, pc)); return next_pcs; } -- 1.9.1