diff mbox

Improve interruptability of symbol lookup

Message ID 20cf301cc49e5db73f05162769e9@google.com
State New
Headers show

Commit Message

Doug Evans May 15, 2015, 11:43 p.m. UTC
Hi.

This patch improves the interruptability of commands that do
symbol lookup when many objfiles are involved (think 1000s).

2015-05-15  Doug Evans  <dje@google.com>

	* 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 mbox

Patch

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);