From patchwork Fri Oct 13 12:19:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 56228 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AC8B63857C41 for ; Fri, 13 Oct 2023 12:20:02 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id DFD4E3858C53 for ; Fri, 13 Oct 2023 12:19:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DFD4E3858C53 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A3C1E1FD9A for ; Fri, 13 Oct 2023 12:19:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1697199579; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=RZ+6aMHTfD2oxyuFJUJzJgbQyLx5jCdHPIS703eCvwY=; b=MyjrOIee9x7DRGFfNRAJ1M92Vu5MIhvagT4k2HrA9GSjFQ+w7mQ1sdpAJB/Qfz6adHQxn1 vWyI2ml69rWPV91wkfYD/UbIFzlDFZiMiSCoykI9+yXUalE9dq6qbKBRZNoSLCJ6NRTfEu NfoQ5dZ/tYCMF47e6oesgjWOVasdsRo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1697199579; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=RZ+6aMHTfD2oxyuFJUJzJgbQyLx5jCdHPIS703eCvwY=; b=Dti+D6qFdc6dTf3shI3+l33w0UAJYzbJbcihpEMrwmrSZ8FzOx8+J+EOkNKqHCfVabP78w HzbtdGIJTf+xMqBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 91ED91358F for ; Fri, 13 Oct 2023 12:19:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id W9CNIts1KWU0bQAAMHmgww (envelope-from ) for ; Fri, 13 Oct 2023 12:19:39 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH v2 0/4] [gdb/cli] Allow source highlighting to be interrupted Date: Fri, 13 Oct 2023 14:19:49 +0200 Message-Id: <20231013121953.25917-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: 0.89 X-Spamd-Result: default: False [0.89 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-3.00)[-1.000]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.01)[46.56%] X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org I wrote this patch series to fix PR cli/30934. The 1st patch is an unrelated optimization, which I added to this series because it touches the same code. The 2nd patch factors out a function. The 3rd patch adds a means to keep track of styling failures in the source cache, as suggested here ( https://sourceware.org/pipermail/gdb-patches/2023-October/203164.html ). The 4th patch fixes the PR cli/30934. This is v2. Changes since v1: - fixed a build problem with --disable-source-highlight, reported by the linaro CI. - temporarily installs the default_quit_handler to be able to use QUIT - added a question whether to interrupt highlighting or not (in the RFC, I had a warning, in v1 I dropped it) - added "gdb_assert (target_terminal::is_ours ())" Adding the question was inspired by the v3 patch "gdb/debuginfod: Ctrl-C ask to cancel further downloads" ( https://sourceware.org/pipermail/gdb-patches/2023-March/197679.html ). Submission history: - RFC: https://sourceware.org/pipermail/gdb-patches/2023-October/203157.html - v1: https://sourceware.org/pipermail/gdb-patches/2023-October/203179.html Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30934 Tom de Vries (4): [gdb/cli] Skip string copy in source_cache::ensure [gdb/cli] Factor out try_source_highlight [gdb/cli] Keep track of styling failures in source_cache [gdb/cli] Allow source highlighting to be interrupted gdb/source-cache.c | 173 +++++++++++++++++++++++++++++++++++---------- gdb/source-cache.h | 4 ++ 2 files changed, 141 insertions(+), 36 deletions(-) base-commit: 9326300e4d3dbe943380b30766ed474d98df07ba