From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by sourceware.org (Postfix) with ESMTPS id 8AA1238493D0 for ; Fri, 27 Jan 2023 19:22:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8AA1238493D0 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-il1-x133.google.com with SMTP id f8so2703707ilj.5 for ; Fri, 27 Jan 2023 11:22:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=N8C5E2Vv8BgIKnGI3dcoDmbU+X2NiosihWYyL4j9m5o=; b=YIfk4DSg2Le9yr12fC0XxxkOMWLskvSPl1abIXEKOum6zqLT4fIi6k+7GYd3F2X6Od ehj2csBGl52aTBE8wodVDnSBDEJWt03iR0CBoO2drpjVXQZQ9QMAkWoUuIRrbL196Uij d8jBB3N97PVZw3xYa086f3sG07+8ExwUl3D6uDurEYZOvVU90Ds0TlQ10CpWMeupxiTH QPRKh8hmnRfIO6GE5+ykJgLXbCA0QbBzWGJyl8S0bxT4C0qiyPXXDsvY1xOeCCxdQXJd i7ST0WY2hRQWAkSxvzzZb5A676LlKDxgxODH7cH3m1sJBj9UvOf8yLgFdBtMEJJaQvbP 5gWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=N8C5E2Vv8BgIKnGI3dcoDmbU+X2NiosihWYyL4j9m5o=; b=zhmtYQO7hiTrHVdujr0Urhp/W23+ajYUQuv7DEH3ZafgrduBv1iGzEDQtVoUuS9gP/ W6W0JFmQ9VO9MtQonG89E8s0+XULyfnsG2NgX8PIRNqmNHYTTTLz87gBV/M6NJ562qnJ 6A/HMSSSSAPFMFzL+7fWEM7xepw1JNHqwK8lDGWV2/94tb9PJYt9+HaOsrCF+MkwQTEa tj+7F1yXrobsV1hAK2Y9SioYS2b7j9cM97GoDbViVKL1FyUxzppZeRT97GIpnkZJjVHS a0WFWdBaA+2lK8y53suFW+iWAKs/RQOv71OLeEdFLebCNnrP7skgBvL/azMl8n6jYdx6 IaEQ== X-Gm-Message-State: AO0yUKVThmwQpDxrdCZXoiY8GtQo2Zp+bf/Uy6a/3Dr5k7cQK6UhTAJS N4qKjQDtOBVdIc6Kwh1hw3rwNItMCMebYo0a X-Google-Smtp-Source: AK7set+9hH5tg6O9/SjiJOg9z3zv1ZY9yqxvKe95VT6t97bplX5IL06XkacihjM6d2KvI2tqJnPQ2g== X-Received: by 2002:a92:c246:0:b0:310:a78f:2677 with SMTP id k6-20020a92c246000000b00310a78f2677mr7779547ilo.29.1674847327874; Fri, 27 Jan 2023 11:22:07 -0800 (PST) Received: from murgatroyd (75-166-146-144.hlrn.qwest.net. [75.166.146.144]) by smtp.gmail.com with ESMTPSA id q14-20020a056e02106e00b0030c27c9eea4sm1504823ilj.33.2023.01.27.11.22.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 11:22:07 -0800 (PST) From: Tom Tromey To: Tom Tromey via Gdb-patches Cc: Tom Tromey Subject: Re: [PATCH] Let user C-c when waiting for DWARF index finalization References: <20221206192743.2827834-1-tromey@adacore.com> X-Attribution: Tom Date: Fri, 27 Jan 2023 12:22:06 -0700 In-Reply-To: <20221206192743.2827834-1-tromey@adacore.com> (Tom Tromey via Gdb-patches's message of "Tue, 6 Dec 2022 12:27:43 -0700") Message-ID: <87zga3pyu9.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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: >>>>> "Tom" == Tom Tromey via Gdb-patches writes: Tom> In PR gdb/29854, Simon pointed out that it would be good to be able to Tom> use C-c when the DWARF cooked index is waiting for finalization. The Tom> idea here is to be able to interrupt a command like "break" -- not to Tom> stop the finalization process itself, which runs in a worker thread. Tom> This patch implements this idea, by changing the index wait functions Tom> to, by default, allow a quit. Polling is done, because there doesn't Tom> seem to be a better way to interrupt a wait on a std::future. I'm not totally sure what to do with this patch. Should it go in GDB 13? Tom> +void Tom> +cooked_index::wait (bool allow_quit) Tom> +{ Tom> + if (allow_quit) Tom> + { Tom> + using namespace std::chrono_literals; Tom> + auto duration = 15ms; Tom> + while (m_future.wait_for (duration) == std::future_status::timeout) I did belatedly realize this will need an update to the gdb::future compatibility wrapper. I'll do a --disable-threading build before patching this. Tom