From patchwork Fri May 15 23:43:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 6760 Received: (qmail 35849 invoked by alias); 15 May 2015 23:43:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 35839 invoked by uid 89); 15 May 2015 23:43:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-ig0-f201.google.com Received: from mail-ig0-f201.google.com (HELO mail-ig0-f201.google.com) (209.85.213.201) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 15 May 2015 23:43:32 +0000 Received: by igdh15 with SMTP id h15so452819igd.0 for ; Fri, 15 May 2015 16:43:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:message-id:date:subject:from:to :content-type; bh=hb/V1R+GPuCG8aC1NuuHYzO9oIQm77iqg2QjigbDvy4=; b=FjG5Cy1ycqp87+TJnJ0a0ITo+zG7BfgV55tFR0/ZRqREtGnLsazbDhLx87mV9KhbU8 nxg8K7GCRZaPNeXub+Lay0/zGiVUEMsArkZ5BZKb5PifP2N1cEfQ3uF11SSajg9BDvkN ZzBw/ju83UoYJUQNfOpIe6MNKGdEZdfX9m4clj2vDCXllYn084By1yL/cdIng6H+TrUq GGJ5ooNuPFITI2zGX1SXAVvHhpGQ0maXaixkkYqAwB88mjmFRbvHwOJiS1o0z4s9WW5f zCzRKTEYGtqzwRnJUHXijRBEkhHbJwiIve8D1V4D3r6i3v9plPMhOye57ZMxE0LIYwqN bS7Q== X-Gm-Message-State: ALoCoQkxsNl9knRVRt6EyZ6jY9EZumaigS8Fw4EUYZnA+2AbUy6Eqng8fxdiSvDhKrKly+dK8sQOFE27V5NeIZJTEr9jC/M44TA2s7p4HgRfQJc56A619W9CXKT7qQ1IxDZNA/gRHm18cjUusGwbM1CrVRy0HQ6xeE5+e1IylF0rqAytHL7ddEc= MIME-Version: 1.0 X-Received: by 10.42.118.79 with SMTP id w15mr30022770icq.2.1431733410824; Fri, 15 May 2015 16:43:30 -0700 (PDT) Message-ID: <20cf301cc49e5db73f05162769e9@google.com> Date: Fri, 15 May 2015 23:43:30 +0000 Subject: [PATCH] Improve interruptability of symbol lookup From: Doug Evans To: gdb-patches@sourceware.org X-IsSubscribed: yes Hi. This patch improves the interruptability of commands that do symbol lookup when many objfiles are involved (think 1000s). 2015-05-15 Doug Evans * objfiles.c (default_iterate_over_objfiles_in_search_order): Add QUIT call. * symtab.c (lookup_static_symbol): Ditto. (basic_lookup_transparent_type): Ditto. * windows-tdep.c (windows_iterate_over_objfiles_in_search_order): Ditto. diff --git a/gdb/objfiles.c b/gdb/objfiles.c index c6f9f00..f6023ad 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -1487,9 +1487,11 @@ default_iterate_over_objfiles_in_search_order ALL_OBJFILES (objfile) { - stop = cb (objfile, cb_data); - if (stop) - return; + QUIT; + + stop = cb (objfile, cb_data); + if (stop) + return; } } diff --git a/gdb/symtab.c b/gdb/symtab.c index 72df872..dbb7221 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2652,6 +2656,8 @@ lookup_static_symbol (const char *name, const domain_enum domain) ALL_OBJFILES (objfile) { + QUIT; + result = lookup_symbol_in_objfile (objfile, STATIC_BLOCK, name, domain); if (result != NULL) { @@ -2837,6 +2843,8 @@ basic_lookup_transparent_type (const char *name) ALL_OBJFILES (objfile) { + QUIT; + ALL_OBJFILE_COMPUNITS (objfile, cust) { bv = COMPUNIT_BLOCKVECTOR (cust); @@ -2851,6 +2859,8 @@ basic_lookup_transparent_type (const char *name) ALL_OBJFILES (objfile) { + QUIT; + t = basic_lookup_transparent_type_quick (objfile, GLOBAL_BLOCK, name); if (t) return t; @@ -2865,6 +2875,8 @@ basic_lookup_transparent_type (const char *name) ALL_OBJFILES (objfile) { + QUIT; + ALL_OBJFILE_COMPUNITS (objfile, cust) { bv = COMPUNIT_BLOCKVECTOR (cust); @@ -2879,6 +2891,8 @@ basic_lookup_transparent_type (const char *name) ALL_OBJFILES (objfile) { + QUIT; + t = basic_lookup_transparent_type_quick (objfile, STATIC_BLOCK, name); if (t) return t; diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c index dc4e2e4..49460f2 100644 --- a/gdb/windows-tdep.c +++ b/gdb/windows-tdep.c @@ -448,6 +448,8 @@ windows_iterate_over_objfiles_in_search_order ALL_OBJFILES (objfile) { + QUIT; + if (objfile != current_objfile) { stop = cb (objfile, cb_data);