]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
patch ../102438207.patch
authorDoug Evans <dje@google.com>
Thu, 10 Dec 2015 20:00:32 +0000 (12:00 -0800)
committerDoug Evans <dje@google.com>
Thu, 10 Dec 2015 20:00:32 +0000 (12:00 -0800)
README.google
gdb/completer.c
gdb/dwarf2read.c
gdb/psymtab.c
gdb/symtab.c

index 1dbf2d345e82f53d8bcf5d307ef9496cdd632e0d..86cec17289e6cd5eb19d04c57a88e15a7f45f8db 100644 (file)
@@ -364,3 +364,12 @@ they are an ongoing maintenance burden.
 +      * nat/linux-ptrace.h (linux_ptrace_attach_fail_reason): Delete.
 +      * utils.c (perror_string): New arg errno_value.  All callers updated.
 +      (throw_perror_with_name): Call throw_error_with_suberror.
+--- README.google      2015-09-06 00:17:17.000000000 -0700
++++ README.google      2015-09-06 00:28:23.000000000 -0700
++
++2015-09-05  Doug Evans  <dje@google.com>
++
++      * completer.c (location_completer): Protect file_to_match with cleanup.
++      * dwarf2read.c (dw2_map_symtabs_matching_filename): Add QUIT calls.
++      * psymtab.c (psym_map_symtabs_matching_filename): Add QUIT call.
++      * symtab.c (iterate_over_symtabs): Add QUIT calls.
index fd52a0400b1eefce77bd509467fb6efdc66b8362..d55853cedb5ad0cc4a979d75a48874e48b04487a 100644 (file)
@@ -196,7 +196,6 @@ location_completer (struct cmd_list_element *ignore,
   int quoted = *text == '\'' || *text == '"';
   int quote_char = '\0';
   const char *colon = NULL;
-  char *file_to_match = NULL;
   const char *symbol_start = text;
   const char *orig_text = text;
   size_t text_len;
@@ -242,12 +241,17 @@ location_completer (struct cmd_list_element *ignore,
     text++;
   text_len = strlen (text);
 
-  /* Where is the file name?  */
-  if (colon)
+  /* Where is the file name?
+     If the text includes a colon, they want completion only on a
+     symbol name after the colon.  Otherwise, we need to complete on
+     symbols as well as on files.  */
+  if (colon != NULL)
     {
-      char *s;
+      char *s, *file_to_match;
+      struct cleanup *cleanup;
 
-      file_to_match = (char *) xmalloc (colon - text + 1);
+      file_to_match = xmalloc (colon - text + 1);
+      cleanup = make_cleanup (xfree, file_to_match);
       strncpy (file_to_match, text, colon - text + 1);
       /* Remove trailing colons and quotes from the file name.  */
       for (s = file_to_match + (colon - text);
@@ -255,15 +259,9 @@ location_completer (struct cmd_list_element *ignore,
           s--)
        if (*s == ':' || *s == quote_char)
          *s = '\0';
-    }
-  /* If the text includes a colon, they want completion only on a
-     symbol name after the colon.  Otherwise, we need to complete on
-     symbols as well as on files.  */
-  if (colon)
-    {
       list = make_file_symbol_completion_list (symbol_start, word,
                                               file_to_match);
-      xfree (file_to_match);
+      do_cleanups (cleanup);
     }
   else
     {
index 28196471b6e545a5f77fd1358ae564701e6b525b..68c4b87bf2251c04ac0456a815c8b3d79e0566c4 100644 (file)
@@ -3559,6 +3559,8 @@ dw2_map_symtabs_matching_filename (struct objfile *objfile, const char *name,
       struct dwarf2_per_cu_data *per_cu = dw2_get_cu (i);
       struct quick_file_names *file_data;
 
+      QUIT;
+
       /* We only need to look at symtabs not already expanded.  */
       if (per_cu->v.quick->compunit_symtab)
        continue;
@@ -3572,6 +3574,8 @@ dw2_map_symtabs_matching_filename (struct objfile *objfile, const char *name,
          const char *this_name = file_data->file_names[j];
          const char *this_real_name;
 
+         QUIT;
+
          if (compare_filenames_for_search (this_name, name))
            {
              if (dw2_map_expand_apply (objfile, per_cu, name, real_path,
index cfc642ab237f20745d4585ba0c5d45f1344b5993..fc3d192406d924e0c062e5a77338925e6102d433 100644 (file)
@@ -169,6 +169,8 @@ psym_map_symtabs_matching_filename (struct objfile *objfile,
 
   ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, pst)
   {
+    QUIT;
+
     /* We can skip shared psymtabs here, because any file name will be
        attached to the unshared psymtab.  */
     if (pst->user != NULL)
index b5cd1980a266b781b13f421c673f4d1a76d05623..c4678ea12f74d93fd578a98843c7613f97d72f6e 100644 (file)
@@ -444,6 +444,8 @@ iterate_over_symtabs (const char *name,
 
   ALL_OBJFILES (objfile)
   {
+    QUIT;
+
     if (iterate_over_some_symtabs (name, real_path, callback, data,
                                   objfile->compunit_symtabs, NULL))
       {
@@ -457,6 +459,8 @@ iterate_over_symtabs (const char *name,
 
   ALL_OBJFILES (objfile)
   {
+    QUIT;
+
     if (objfile->sf
        && objfile->sf->qf->map_symtabs_matching_filename (objfile,
                                                           name,