From patchwork Thu May 12 16:18:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 12224 Received: (qmail 111288 invoked by alias); 12 May 2016 16:18:57 -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 111149 invoked by uid 89); 12 May 2016 16:18:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:armlin, sk:arm-lin 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 (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 12 May 2016 16:18:44 +0000 Received: by mail-pf0-f196.google.com with SMTP id 145so6970273pfz.1 for ; Thu, 12 May 2016 09:18:44 -0700 (PDT) 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=b6NoSzakVyKP7PoxP7xZ7uftBGCTmhbiTm9AISsR7KU=; b=jPmEALuZFI76fa9+3U7o2Nm6r/TYNryI8FvaWzuiKr6kP5zv6Rksertpmq9zgmpW4v VW16z/ZPcMIbEd16qff+KNmcKAgKTl9Tn4q0QIivgcYWPcsuI3tHCMRqWJQ9BIn1LdvD mdMjj+Ba7WNymMtYefVmEatL8f3bzkAdu/cjyRt56Auri/DYROX53HG46i7jGvhMxq74 BBjapNI/GJpbVJ+MvQbywSJt0QTzm6uxfAKkJ6xL5rc7Wp3OA2zTq/sWo4UMLOknzAn1 MIkk+hlSnhL5L6Puxkpv0CpDmn+sCJDhfqN0nNt7y86Lzn89Kb/cNqUWJHi4KqkRk9GV Pqqw== X-Gm-Message-State: AOPr4FUso0OsHB7xWX1EfGCzhMYGIov/Ba8gw0y8SSFja/W08s+Qwk55hCEcSfZCZazBLQ== X-Received: by 10.98.31.65 with SMTP id f62mr15270502pff.83.1463069922636; Thu, 12 May 2016 09:18:42 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc113.osuosl.org. [140.211.9.71]) by smtp.gmail.com with ESMTPSA id m86sm13238672pfj.77.2016.05.12.09.18.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 May 2016 09:18:42 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 3/4] Clear addr bit in next_pcs vector Date: Thu, 12 May 2016 17:18:31 +0100 Message-Id: <1463069912-23472-4-git-send-email-yao.qi@linaro.org> In-Reply-To: <1463069912-23472-1-git-send-email-yao.qi@linaro.org> References: <1463069912-23472-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes This patch is to split the loop of calling gdbarch_addr_bits_remove and insert_single_step_breakpoint into two loops. gdb: 2016-05-12 Yao Qi * arm-linux-tdep.c (arm_linux_software_single_step): Write adjusted address back to vector. Call insert_single_step_breakpoint in a new loop. * arm-tdep.c (arm_software_single_step): Likewise. --- gdb/arm-linux-tdep.c | 5 ++++- gdb/arm-tdep.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index 0e7cad5..4820c7d 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -954,9 +954,12 @@ arm_linux_software_single_step (struct frame_info *frame) for (i = 0; VEC_iterate (CORE_ADDR, next_pcs, i, pc); i++) { pc = gdbarch_addr_bits_remove (gdbarch, pc); - insert_single_step_breakpoint (gdbarch, aspace, pc); + VEC_replace (CORE_ADDR, next_pcs, i, pc); } + for (i = 0; VEC_iterate (CORE_ADDR, next_pcs, i, pc); i++) + insert_single_step_breakpoint (gdbarch, aspace, pc); + do_cleanups (old_chain); return 1; diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index c027ad5..fca9f52 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -6302,9 +6302,12 @@ arm_software_single_step (struct frame_info *frame) for (i = 0; VEC_iterate (CORE_ADDR, next_pcs, i, pc); i++) { pc = gdbarch_addr_bits_remove (gdbarch, pc); - insert_single_step_breakpoint (gdbarch, aspace, pc); + VEC_replace (CORE_ADDR, next_pcs, i, pc); } + for (i = 0; VEC_iterate (CORE_ADDR, next_pcs, i, pc); i++) + insert_single_step_breakpoint (gdbarch, aspace, pc); + do_cleanups (old_chain); return 1;