From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by sourceware.org (Postfix) with ESMTPS id B8774385E00A for ; Fri, 7 Jul 2023 15:24:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B8774385E00A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-3144098df56so2193950f8f.2 for ; Fri, 07 Jul 2023 08:24:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688743481; x=1691335481; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=J3oV9bB2yvvWN0l4YjFjK0Yrsj187mTQYWv/r69U/nY=; b=U3gQrH7siqD0xTWvs/wXH6DEOnEP75a4EdPDLEYgzQkNdtGBup6wu6PHVZ1VlvGSyT aamEM10SIbMlj6MoZpCeZZa5jvhKQxnyS0qFbVAKNFf9+cGiqrFgm9JzKFqDIYqEsMRJ dxZk0o8lu6ps7QFBmtNb8KxNXiGCbCn/vIws93mYuQN/bF/Se98djOJPzG63vZlg2qtE 5/foWmslLQRmH8ii00TSFRExKVoD4b1KCeMlSpp5S6t4rpPo0UCihDxDhAdrINTAv6// 2k9AU3lvRQfGXApXVi9MgIVfX+G+8VYpPh77VQQ+REPpVhVkbGEohm+Cmy6SN4agf04R bVdg== X-Gm-Message-State: ABy/qLYvuEB/ab8Ge5AC3xO0mfS9KF3NLTv7D2JqSo+o8JOGRW8M0hqc BUANnZrue+s/Cio/gNu53Z9pTxPr7v4= X-Google-Smtp-Source: APBJJlH5EsFbP/suo6ZjQotBLRSoWYIFgvKtsBZgWoeLgRiDktZf6FuHjP31hZEniomkPjyyvmYILQ== X-Received: by 2002:adf:dc45:0:b0:314:10d6:8910 with SMTP id m5-20020adfdc45000000b0031410d68910mr4521259wrj.63.1688743481397; Fri, 07 Jul 2023 08:24:41 -0700 (PDT) Received: from ?IPV6:2001:8a0:f91d:bc00:1b6e:208c:60cc:dcc? ([2001:8a0:f91d:bc00:1b6e:208c:60cc:dcc]) by smtp.gmail.com with ESMTPSA id f5-20020a5d6645000000b0030e56a9ff25sm4726462wrw.31.2023.07.07.08.24.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Jul 2023 08:24:40 -0700 (PDT) Message-ID: <796e9bc1-6272-3528-93b9-f1463e6b8156@palves.net> Date: Fri, 7 Jul 2023 16:24:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCHv5 05/11] gdb: don't always print breakpoint location after failed condition check Content-Language: en-US From: Pedro Alves To: Andrew Burgess , gdb-patches@sourceware.org References: <6fd4aa13-6003-2563-5841-e80d5a55d59e@palves.net> In-Reply-To: <6fd4aa13-6003-2563-5841-e80d5a55d59e@palves.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-07-07 16:20, Pedro Alves wrote: > I'd think the second *stopped shouldn't even be there at all, following the > logic used to remove the stop from the CLI. > > Maybe we should try moving or copying this "don't report this stop" logic to > fetch_inferior_event, to avoid calling the second normal_stop at all. > I gave it a quick try, but what I tried without thinking much about it > just hung GDB. I didn't dig too much as I want to move on to review the rest > of your series. Here's the totally broken naive patch I tried. >From e1fde974fa58351de9f6dc0661162d77fc8be078 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 7 Jul 2023 16:10:29 +0100 Subject: [PATCH] mi Change-Id: Ie49a36dc67b9584c40daabfffae1f87f6dd98c5c --- gdb/infrun.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index 3dd24fccf6e..ab1fd13abe0 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4395,6 +4395,8 @@ fetch_inferior_event () auto defer_delete_threads = make_scope_exit (delete_just_stopped_threads_infrun_breakpoints); + stop_context saved_context; + /* Now figure out what to do with the result of the result. */ handle_inferior_event (&ecs); @@ -4415,16 +4417,17 @@ fetch_inferior_event () } else { - bool should_notify_stop = true; bool proceeded = false; stop_all_threads_if_all_stop_mode (); clean_up_just_stopped_threads_fsms (&ecs); - if (thr != nullptr && thr->thread_fsm () != nullptr) - should_notify_stop - = thr->thread_fsm ()->should_notify_stop (); + bool should_notify_stop + = (!saved_context.changed () + && thr != nullptr + && thr->thread_fsm () != nullptr + && thr->thread_fsm ()->should_notify_stop ()); if (should_notify_stop) { base-commit: c0c3bb70f2f13e07295041cdf24a4d2997fe99a4 prerequisite-patch-id: c39ea2983f5abc3fac4664e7ea78420409d3df86 -- 2.34.1