From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by sourceware.org (Postfix) with ESMTPS id C24D13858012 for ; Thu, 1 Apr 2021 12:18:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C24D13858012 Received: by mail-qk1-x731.google.com with SMTP id o5so1994369qkb.0 for ; Thu, 01 Apr 2021 05:18:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=E8OA6JEHKlS6IlEmNvlIGO59yiOG5D4uF7jArfBqm1s=; b=Z1vx1IsnfkdOLgJwQ5Z13eWk0Gu3ei9bandAfkukpSpd9TGno27A5Szwbjz9AhkYz8 gVyoyIyvlc43BaLxn77aRSHWbzJZMb7evfSgohrnkMr1qdNe7IrlTwULquWE6Y1Surbs xZbvJZbF+B3Z1gtxw0zhKTgWh9edgG5q7O9kQRdcGs0NVmd0gO8qQtXSu+fMr/4p62JG 8uU/ys0dUx3MhR7pDnQPfd9573iL/tnD6hAIhk9sbx5fej56jSvPLNBGu4nHMsmu8mem m0/9YKdT+Xja5y0UXm/y5eg7Q5lnNHYI9/dUxzm5++p4qqZ8J/r/5lLq1kwIAZpdd9XD LY3g== X-Gm-Message-State: AOAM530tGvFwEF54l/yZh7qqJvx4eKL4I03RfPe1LBm32vQ4MqvwcC40 nWTUJ8fPPM+Kxq7tMBo6FYIapO0wXNtuoA== X-Google-Smtp-Source: ABdhPJxDQuLeJe8AI4vDch1A9B2WQ5c2aEaCwKmkF6Ve/vAdpAw8qD2jROuqlQYYE3fqAtkBxD5/7g== X-Received: by 2002:a37:a647:: with SMTP id p68mr7896784qke.189.1617279494316; Thu, 01 Apr 2021 05:18:14 -0700 (PDT) Received: from ?IPv6:2804:7f0:4841:2841:a9:4096:7e03:e64d? ([2804:7f0:4841:2841:a9:4096:7e03:e64d]) by smtp.gmail.com with ESMTPSA id p8sm3448862qtu.8.2021.04.01.05.18.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Apr 2021 05:18:13 -0700 (PDT) Subject: Re: [PATCH v3 5/7] fix issue: gdb hangs in the command following a commad returning with TARGET_WAITKIND_NO_HISTORY To: Zied Guermazi , gdb-patches@sourceware.org References: <20210331025234.518688-1-zied.guermazi@trande.de> <20210331025234.518688-6-zied.guermazi@trande.de> From: Luis Machado Message-ID: <8ff312ae-48db-e27c-3400-0f1c6ec78781@linaro.org> Date: Thu, 1 Apr 2021 09:18:11 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210331025234.518688-6-zied.guermazi@trande.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2021 12:18:17 -0000 On 3/30/21 11:52 PM, Zied Guermazi wrote: > > This patch fixes an issue observed with btrace when replaying the execution. > The issue was observed on ARMv7 processors. > To reproduce the issue, the user needs to replay in forward direction > until he reaches the end of history, then replay backwards > (e.g a reverse-next) and then replay forwards. gdb hangs and the user > can not issue new commands. > This fix keeps the same behaviour of gdb as when TARGET_WAITKIND_NO_HISTORY > is hit on other architectures. > > gdb/ChangeLog > > * infrun.c (set_step_over_info): add debug print. > (handle_inferior_event): clear step over info > in case TARGET_WAITKIND_NO_HISTORY > > --- > gdb/ChangeLog | 6 ++++++ > gdb/infrun.c | 3 ++- > 2 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/gdb/ChangeLog b/gdb/ChangeLog > index d22ec8b5976..d4ed6fe0255 100644 > --- a/gdb/ChangeLog > +++ b/gdb/ChangeLog > @@ -1,3 +1,9 @@ > +2021-02-25 Zied Guermazi > + > + * infrun.c (set_step_over_info): add debug print. > + (handle_inferior_event): clear step over info > + in case TARGET_WAITKIND_NO_HISTORY > + > 2021-02-25 Zied Guermazi > > * nat/linux-btrace.h (btrace_tinfo_etm): New. > diff --git a/gdb/infrun.c b/gdb/infrun.c > index a271220b261..9c2522376f2 100644 > --- a/gdb/infrun.c > +++ b/gdb/infrun.c > @@ -1308,6 +1308,7 @@ set_step_over_info (const address_space *aspace, CORE_ADDR address, > int nonsteppable_watchpoint_p, > int thread) > { > + infrun_debug_printf ("setting step over info"); > step_over_info.aspace = aspace; > step_over_info.address = address; > step_over_info.nonsteppable_watchpoint_p = nonsteppable_watchpoint_p; > @@ -5536,7 +5537,7 @@ handle_inferior_event (struct execution_control_state *ecs) > delete_just_stopped_threads_single_step_breakpoints (); > ecs->event_thread->suspend.stop_pc > = regcache_read_pc (get_thread_regcache (inferior_thread ())); > - > + clear_step_over_info (); > if (handle_stop_requested (ecs)) > return; > > I'll defer this to folks more familiar with the infrun code, but this is one area that needs to be exercised carefully, as it is really complex with many execution paths.