From 8c0db0bffe1ff6b7644d3f6a90fce0a110311a7e Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Thu, 10 Dec 2015 12:00:32 -0800 Subject: [PATCH] patch ../102438207.patch --- README.google | 9 +++++++++ gdb/completer.c | 22 ++++++++++------------ gdb/dwarf2read.c | 4 ++++ gdb/psymtab.c | 2 ++ gdb/symtab.c | 4 ++++ 5 files changed, 29 insertions(+), 12 deletions(-) diff --git a/README.google b/README.google index 1dbf2d345e8..86cec17289e 100644 --- a/README.google +++ b/README.google @@ -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 ++ ++ * 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. diff --git a/gdb/completer.c b/gdb/completer.c index fd52a0400b1..d55853cedb5 100644 --- a/gdb/completer.c +++ b/gdb/completer.c @@ -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 { diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 28196471b6e..68c4b87bf22 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -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, diff --git a/gdb/psymtab.c b/gdb/psymtab.c index cfc642ab237..fc3d192406d 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -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) diff --git a/gdb/symtab.c b/gdb/symtab.c index b5cd1980a26..c4678ea12f7 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -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, -- 2.47.2