From patchwork Thu Dec 1 16:01:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 61322 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 05A4D385840E for ; Thu, 1 Dec 2022 16:02:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05A4D385840E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669910550; bh=1D2vdKlRfIzrzh56eoif8MKtZ2+APHorg491V1Qqc5E=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=ot/bqfOqauhOuBC0kSFRd19Pp/pZjZnXom1ystvgJlogab6HWhsSc6S7om6bRyqg+ eecYO4G8jWbdMOk9FiL4s4y7CFl0lLQespnM6MS2QIYIAYoC2nrJYZc8V0gPNyfmvZ jz3jLaE8XQPyDaimb2m1G9OiXjvONU2cnpJ8rFpU= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 4509A3858D32 for ; Thu, 1 Dec 2022 16:01:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4509A3858D32 X-ASG-Debug-ID: 1669910505-0c856e6c056f9f0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id RN77IXDBine0YddV (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Thu, 01 Dec 2022 11:01:45 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from smarchi-efficios.internal.efficios.com (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtp.ebox.ca (Postfix) with ESMTP id EDAA1441D64; Thu, 1 Dec 2022 11:01:44 -0500 (EST) X-Barracuda-RBL-IP: 192.222.180.24 X-Barracuda-Effective-Source-IP: 192-222-180-24.qc.cable.ebox.net[192.222.180.24] X-Barracuda-Apparent-Source-IP: 192.222.180.24 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] gdb/dwarf: add some QUIT macros Date: Thu, 1 Dec 2022 11:01:44 -0500 X-ASG-Orig-Subj: [PATCH] gdb/dwarf: add some QUIT macros Message-Id: <20221201160144.1045410-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1669910505 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 1320 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=5.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.102531 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-3498.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Simon Marchi via Gdb-patches From: Simon Marchi Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" While testing the fix for PR 29105, I noticed I couldn't ctrl-C my way out of GDB expanding many symtabs. GDB was busy in a loop in cooked_index_functions::expand_symtabs_matching. Add a QUIT there. I also happened to see a spot in cooked_index_functions::expand_matching_symbols where a QUIT would be useful too, since we iterate over a potentially big number of index entries and expand CUs in the loop. Add one there too. Change-Id: Ie1d650381df7f944c16d841b3e592d2dce7306c3 --- gdb/dwarf2/read.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 87c0914d8395..dd7fea400275 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -18653,6 +18653,8 @@ cooked_index_functions::expand_matching_symbols (per_objfile->per_bfd->index_table.get ())); for (const cooked_index_entry *entry : table->all_entries ()) { + QUIT; + if (entry->parent_entry != nullptr) continue; @@ -18728,6 +18730,8 @@ cooked_index_functions::expand_symtabs_matching for (const cooked_index_entry *entry : table->find (name_vec.back (), completing)) { + QUIT; + /* No need to consider symbols from expanded CUs. */ if (per_objfile->symtab_set_p (entry->per_cu)) continue;