public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Simon Marchi <simark@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] gdb/dwarf: add some QUIT macros
Date: Thu,  1 Dec 2022 16:44:53 +0000 (GMT)	[thread overview]
Message-ID: <20221201164453.7934D3854560@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=00a5867df72983c3f8a11c9955c5032d6f601b70

commit 00a5867df72983c3f8a11c9955c5032d6f601b70
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Thu Dec 1 11:44:41 2022 -0500

    gdb/dwarf: add some QUIT macros
    
    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
    Approved-By: Kevin Buettner <kevinb@redhat.com>

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 != 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;

                 reply	other threads:[~2022-12-01 16:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221201164453.7934D3854560@sourceware.org \
    --to=simark@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).