From patchwork Tue Nov 8 13:01:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 17285 Received: (qmail 27917 invoked by alias); 8 Nov 2016 13:01:54 -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 27901 invoked by uid 89); 8 Nov 2016 13:01:53 -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=Hx-languages-length:2248, 20161108 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; Tue, 08 Nov 2016 13:01:43 +0000 Received: by mail-pf0-f194.google.com with SMTP id n85so19437588pfi.3 for ; Tue, 08 Nov 2016 05:01:43 -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; bh=sIAB+QYUZZef9ysrd7HZ5heFu5lvfJYeN4qRbSQFBnc=; b=kko02BwbWVUe/lf2yqIGBNZAkKIEwoHrIZ2fRJymfyzYtzBEsT1SsXnJEnUTFgyERa MReDC8Owa1jmyMOzzKCwcVcDd+Y0TxymdRlPWfHhTIkbLuHX3ekfCzY4AXn2NV6VIusz 8O6BtHhaq2r/w+fHaasrCKI4Qg1R86zjU/QusEs13JjN7WFQpVA3ySphTkWxJ5oCGv+L yn7JHNYUHh5b3h3HOMv/C+s0SydU0r/qvwofcx6Uu8EaqoeN7FVyIc+C+u76wplKWVir Yu3jaWmytvooglBOFXsCQdGz73zlQs7egnBvlnPoi3hhLBQtYsda2nAcyAgY8TZo2jHM +V3A== X-Gm-Message-State: ABUngvfmhZI3+b2ukSmGdjzUh9kpcHsaM4IFQpKo+6ugovnoaHDJFlbCDrZQ3OcEOxc7bA== X-Received: by 10.99.174.5 with SMTP id q5mr6631020pgf.128.1478610101735; Tue, 08 Nov 2016 05:01:41 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id 123sm48189511pfe.41.2016.11.08.05.01.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Nov 2016 05:01:41 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH PUSHED] Clear addr bit in next_pcs vector Date: Tue, 8 Nov 2016 13:01:37 +0000 Message-Id: <1478610097-3354-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-11-08 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/ChangeLog | 7 +++++++ gdb/arm-linux-tdep.c | 5 ++++- gdb/arm-tdep.c | 5 ++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 163e1a9..3e6bd4c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2016-11-08 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. + +2016-11-08 Yao Qi + * arm-linux-tdep.c (arm_linux_software_single_step): Don't call arm_insert_single_step_breakpoint, call insert_single_step_breakpoint instead. diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index bc92177..4a734b0 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -952,9 +952,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 a3bea97..9340b3b 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -6310,9 +6310,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;