From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 7934D3854560; Thu, 1 Dec 2022 16:44:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7934D3854560 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669913093; bh=yfvOU6xHbr5idrJuKaDSe3gJ0lYgb5zbbWDd9sZa8RM=; h=From:To:Subject:Date:From; b=esT2QGR3iasNKUxq9EZqQUsH7bFqm4qOQ8uhkuAV9rlntckha96BhIATxauZOhqRm BvfqMFEN37Ib0mcVCPnyajKct/V54OSfmn0/rxbqQqthgAcwx9VEdcduhv2v/U0tND z9b47OPhfbwGrpoMtFsjfJmssMb4vDMTjm4nVwHw= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/dwarf: add some QUIT macros X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 616d7b31c8f468043bf6b858cbcb42fee6a86a9a X-Git-Newrev: 00a5867df72983c3f8a11c9955c5032d6f601b70 Message-Id: <20221201164453.7934D3854560@sourceware.org> Date: Thu, 1 Dec 2022 16:44:53 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D00a5867df729= 83c3f8a11c9955c5032d6f601b70 commit 00a5867df72983c3f8a11c9955c5032d6f601b70 Author: Simon Marchi Date: Thu Dec 1 11:44:41 2022 -0500 gdb/dwarf: add some QUIT macros =20 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. =20 Change-Id: Ie1d650381df7f944c16d841b3e592d2dce7306c3 Approved-By: Kevin Buettner Diff: --- gdb/dwarf2/read.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 87c0914d839..dd7fea40027 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 !=3D nullptr) continue; =20 @@ -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;