From patchwork Thu Jan 9 23:26:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Machado X-Patchwork-Id: 37279 Received: (qmail 59388 invoked by alias); 9 Jan 2020 23:26:36 -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 59379 invoked by uid 89); 9 Jan 2020 23:26:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-qk1-f174.google.com Received: from mail-qk1-f174.google.com (HELO mail-qk1-f174.google.com) (209.85.222.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Jan 2020 23:26:34 +0000 Received: by mail-qk1-f174.google.com with SMTP id d71so295537qkc.0 for ; Thu, 09 Jan 2020 15:26:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=Mt9rruZW0EkSiAV9YMq17IyDxlOCK+gWcxEA+7rL1Gs=; b=cPdIDRpMpg5u1NesfppZhL8nAp+1SR1xyqOl0G/4jClVAq36VqzSZGwOhLIqNrEHYT euCWgvShEeW2nBUbja76eBh5sM5PXKxdlqekodtJZX8I4xtq5wQGq8W9FVhCPgD02tyn rX4Olw04qjNkNNiuGCqEx2bkU7E7xZjjP0WQlIpQ7ohuId348rDg9JouXX5tlZQlMbyq Aeu9UHOx6ovZniMz7B9hSeQkhyTeWMAXb36FRNd8WEgzVeUOmhhSzfJRHST3PtRuGNhT o9T5MT5LLVlPld8QclluLpHa9r4ejVPvlKTdiI0mF2IvWDFnjLPGJALuCc6idHt+VWb8 E1fg== Return-Path: Received: from localhost.localdomain ([177.158.86.92]) by smtp.gmail.com with ESMTPSA id v5sm84952qtc.64.2020.01.09.15.26.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2020 15:26:31 -0800 (PST) From: Luis Machado To: gdb-patches@sourceware.org Subject: [PATCH, v2] Fix/Update misc comments Date: Thu, 9 Jan 2020 20:26:26 -0300 Message-Id: <20200109232626.13846-1-luis.machado@linaro.org> In-Reply-To: <20200106143620.2881-1-luis.machado@linaro.org> References: <20200106143620.2881-1-luis.machado@linaro.org> X-IsSubscribed: yes v2: Updated comments based on review. While doing some investigation of mine, i noticed a few typos, inaccuracies and missing information. I went ahead and updated/improved those. How does it look? Regards, Luis gdb/ChangeLog: 2020-01-09 Luis Machado * inf-ptrace.c (inf_ptrace_target::resume): Update comments * infrun.c (resume_1): Likewise. (handle_inferior_event): Remove stale comment. * linux-nat.c (linux_nat_target::resume): Update comments. (save_stop_reason): Likewise. (linux_nat_filter_event): Likewise. * linux-nat.h (struct lwp_info) , : Likewise. --- gdb/inf-ptrace.c | 8 ++++---- gdb/infrun.c | 8 +++----- gdb/linux-nat.c | 9 +++++---- gdb/linux-nat.h | 4 ++-- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c index fd18146efe..421c7ea779 100644 --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -354,10 +354,10 @@ inf_ptrace_target::resume (ptid_t ptid, int step, enum gdb_signal signal) if (step) { /* If this system does not support PT_STEP, a higher level - function will have called single_step() to transmute the step - request into a continue request (by setting breakpoints on - all possible successor instructions), so we don't have to - worry about that here. */ + function will have called the appropriate functions to transmute the + step request into a continue request (by setting breakpoints on + all possible successor instructions), so we don't have to + worry about that here. */ request = PT_STEP; } diff --git a/gdb/infrun.c b/gdb/infrun.c index 7ddd21dd09..ecedd0248f 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2388,8 +2388,8 @@ resume_1 (enum gdb_signal sig) if (tp->control.trap_expected || bpstat_should_step ()) tp->control.may_range_step = 0; - /* If enabled, step over breakpoints by executing a copy of the - instruction at a different address. + /* If displaced stepping is enabled, step over breakpoints by executing a + copy of the instruction at a different address. We can't use displaced stepping when we have a signal to deliver; the comments for displaced_step_prepare explain why. The @@ -2477,7 +2477,7 @@ resume_1 (enum gdb_signal sig) && step_over_info_valid_p ()) { /* If we have nested signals or a pending signal is delivered - immediately after a handler returns, might might already have + immediately after a handler returns, might already have a step-resume breakpoint set on the earlier handler. We cannot set another step-resume breakpoint; just continue on until the original breakpoint is hit. */ @@ -4928,8 +4928,6 @@ Cannot fill $_exitsignal with the correct signal number.\n")); stop_waiting (ecs); return; - /* The following are the only cases in which we keep going; - the above cases end in a continue or goto. */ case TARGET_WAITKIND_FORKED: case TARGET_WAITKIND_VFORKED: /* Check whether the inferior is displaced stepping. */ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 465b2acd94..bc150c317c 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -1696,7 +1696,8 @@ linux_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo) resume_many = (minus_one_ptid == ptid || ptid.is_pid ()); - /* Mark the lwps we're resuming as resumed. */ + /* Mark the lwps we're resuming as resumed and update their + last_resume_kind to resume_continue. */ iterate_over_lwps (ptid, resume_set_callback); /* See if it's the current inferior that should be handled @@ -2721,7 +2722,7 @@ save_stop_reason (struct lwp_info *lp) { /* If we determine the LWP stopped for a SW breakpoint, trust it. Particularly don't check watchpoint - registers, because at least on s390, we'd find + registers, because, at least on s390, we'd find stopped-by-watchpoint as long as there's a watchpoint set. */ lp->stop_reason = TARGET_STOPPED_BY_SW_BREAKPOINT; @@ -2925,7 +2926,7 @@ resumed_callback (struct lwp_info *lp) } /* Check if we should go on and pass this event to common code. - Return the affected lwp if we are, or NULL otherwise. */ + Return the affected lwp if we should, or NULL otherwise. */ static struct lwp_info * linux_nat_filter_event (int lwpid, int status) @@ -3118,7 +3119,7 @@ linux_nat_filter_event (int lwpid, int status) /* Don't report signals that GDB isn't interested in, such as signals that are neither printed nor stopped upon. Stopping all - threads can be a bit time-consuming so if we want decent + threads can be a bit time-consuming, so if we want decent performance with heavily multi-threaded programs, especially when they're using a high frequency timer, we'd better avoid it if we can. */ diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h index 0c1695ad10..da99368505 100644 --- a/gdb/linux-nat.h +++ b/gdb/linux-nat.h @@ -228,7 +228,7 @@ struct lwp_info /* When 'stopped' is set, this is where the lwp last stopped, with decr_pc_after_break already accounted for. If the LWP is - running, and stepping, this is the address at which the lwp was + running and stepping, this is the address at which the lwp was resumed (that is, it's the previous stop PC). If the LWP is running and not stepping, this is 0. */ CORE_ADDR stop_pc; @@ -237,7 +237,7 @@ struct lwp_info int step; /* The reason the LWP last stopped, if we need to track it - (breakpoint, watchpoint, etc.) */ + (breakpoint, watchpoint, etc.). */ enum target_stop_reason stop_reason; /* On architectures where it is possible to know the data address of