From patchwork Tue Apr 26 07:58:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 11880 Received: (qmail 73749 invoked by alias); 26 Apr 2016 07:58: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 72580 invoked by uid 89); 26 Apr 2016 07:58:53 -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=*entry, cancelled, sk:status_, 2016-04-26 X-HELO: mail-pa0-f52.google.com Received: from mail-pa0-f52.google.com (HELO mail-pa0-f52.google.com) (209.85.220.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 26 Apr 2016 07:58:43 +0000 Received: by mail-pa0-f52.google.com with SMTP id zm5so4042744pac.0 for ; Tue, 26 Apr 2016 00:58:43 -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; bh=h2MKOr+nzQGmXNBnPPNCCDnXM0xryxRt2KKJdxY86jY=; b=gH0kRpCmLcaM2m5kALFizYdvCyiPzN5u25MlhRQCjUSfjOZ64EDJ/4Dwng73nRYQzp 7a7Zh83CTOINQrt5h+Xb2C9SqJ+URa+scjpghQFFXOCwrCuLBBppynylA+vWBsGyskOA CgFa3QsoOO9jH+TmbDDXWTg/OI1n1MmmdJcNV0UCojmHKWICpBiB5bSefTtVnUszZ15s PzQm3xfcH87B9cVoYHdcHaKYt97UR+NxtKqb3kawsx1zbJ6/VsYtrwKU4MA4Bi9pp7m1 AcD10b2UtHWefZbwJ7zKYfBrtbWmx7k3bO7d1FqDHxBh4NITAea306vxncEeMYzUyd/P juyg== X-Gm-Message-State: AOPr4FXbE8tJZKcEUbmcqTD+MmALyhLTZHZsRu8s9d2L54LylD/j+cZ7u2FvFhonPNcY1w== X-Received: by 10.66.164.39 with SMTP id yn7mr1557741pab.107.1461657521808; Tue, 26 Apr 2016 00:58:41 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id z17sm32299876pfi.61.2016.04.26.00.58.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Apr 2016 00:58:41 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [RFC] Remove need_step_over from struct lwp_info Date: Tue, 26 Apr 2016 08:58:17 +0100 Message-Id: <1461657497-12076-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes Hi, I happen to see that field need_step_over in struct lwp_info is only used to print a debug info. need_step_over is set in linux_wait_1 when breakpoint_here is true, however, we check breakpoint_here too in need_step_over_p and do the step over. I think we don't need field need_step_over, and check breakpoint_here directly in need_step_over_p. This field was added in this patch https://sourceware.org/ml/gdb-patches/2010-03/msg00605.html and the code wasn't changed much since then. This patch is to remove it. gdb/gdbserver: 2016-04-26 Yao Qi * linux-low.h (struct lwp_info) : Remove. * linux-low.c (linux_wait_1): Update. (need_step_over_p): Likewise. --- gdb/gdbserver/linux-low.c | 13 ------------- gdb/gdbserver/linux-low.h | 4 ---- 2 files changed, 17 deletions(-) diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index ca6c4f6..559dea2 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -3276,9 +3276,6 @@ linux_wait_1 (ptid_t ptid, PC), we should step over it. */ if (debug_threads) debug_printf ("Hit a gdbserver breakpoint.\n"); - - if (breakpoint_here (event_child->stop_pc)) - event_child->need_step_over = 1; } } else @@ -4544,12 +4541,6 @@ need_step_over_p (struct inferior_list_entry *entry, void *dummy) return 0; } - if (!lwp->need_step_over) - { - if (debug_threads) - debug_printf ("Need step over [LWP %ld]? No\n", lwpid_of (thread)); - } - if (lwp->status_pending_p) { if (debug_threads) @@ -4575,8 +4566,6 @@ need_step_over_p (struct inferior_list_entry *entry, void *dummy) "Old stop_pc was 0x%s, PC is now 0x%s\n", lwpid_of (thread), paddress (lwp->stop_pc), paddress (pc)); - - lwp->need_step_over = 0; return 0; } @@ -4626,8 +4615,6 @@ need_step_over_p (struct inferior_list_entry *entry, void *dummy) that find_inferior stops looking. */ current_thread = saved_thread; - /* If the step over is cancelled, this is set again. */ - lwp->need_step_over = 0; return 1; } } diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h index d4946c1..6e7ddbd 100644 --- a/gdb/gdbserver/linux-low.h +++ b/gdb/gdbserver/linux-low.h @@ -365,10 +365,6 @@ struct lwp_info a exit-jump-pad-quickly breakpoint. This is it. */ struct breakpoint *exit_jump_pad_bkpt; - /* True if the LWP was seen stop at an internal breakpoint and needs - stepping over later when it is resumed. */ - int need_step_over; - #ifdef USE_THREAD_DB int thread_known; /* The thread handle, used for e.g. TLS access. Only valid if