X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fsymfile.c;h=8e3cf7f23e57b8740edbd54dc6e22eb9d23c5abf;hb=f65fe5704af56aca58fd5547d0841a9512e540af;hp=b914b05a1754547b3376d1de2613e821f3b7cd41;hpb=fd3619828e94a24a92cddec42cbc0ab33352eeb4;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/symfile.c b/gdb/symfile.c index b914b05a17..8e3cf7f23e 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -44,7 +44,7 @@ #include "completer.h" #include "bcache.h" #include "hashtab.h" -#include "readline/readline.h" +#include "readline/tilde.h" #include "block.h" #include "observable.h" #include "exec.h" @@ -499,7 +499,7 @@ addr_info_make_relative (section_addr_info *addrs, bfd *abfd) int i; /* Find lowest loadable section to be used as starting point for - continguous sections. */ + contiguous sections. */ lower_sect = NULL; bfd_map_over_sections (abfd, find_lowest_section, &lower_sect); if (lower_sect == NULL) @@ -809,7 +809,7 @@ read_symbols (struct objfile *objfile, symfile_add_flags add_flags) } } if ((add_flags & SYMFILE_NO_READ) == 0) - require_partial_symbols (objfile, 0); + require_partial_symbols (objfile, false); } /* Initialize entry point information for this objfile. */ @@ -905,10 +905,10 @@ init_entry_point_info (struct objfile *objfile) into a format-specific offset table --- a `struct section_offsets'. The sectindex field is used to control the ordering of sections with the same name. Upon return, it is updated to contain the - correspondig BFD section index, or -1 if the section was not found. + corresponding BFD section index, or -1 if the section was not found. ADD_FLAGS encodes verbosity level, whether this is main symbol or - an extra symbol file such as dynamically loaded code, and wether + an extra symbol file such as dynamically loaded code, and whether breakpoint reset should be deferred. */ static void @@ -1044,7 +1044,7 @@ finish_new_objfile (struct objfile *objfile, symfile_add_flags add_flags) For NAME description see the objfile constructor. ADD_FLAGS encodes verbosity, whether this is main symbol file or - extra, such as dynamically loaded code, and what to do with breakpoins. + extra, such as dynamically loaded code, and what to do with breakpoints. ADDRS is as described for syms_from_objfile_1, above. ADDRS is ignored when SYMFILE_MAINLINE bit is set in ADD_FLAGS. @@ -1093,10 +1093,7 @@ symbol_file_add_with_addrs (bfd *abfd, const char *name, if (mainline) flags |= OBJF_MAINLINE; - objfile = new struct objfile (abfd, name, flags); - - if (parent) - add_separate_debug_objfile (objfile, parent); + objfile = objfile::make (abfd, name, flags, parent); /* We either created a new mapped symbol table, mapped an existing symbol table file which has not had initial symbol reading @@ -1106,11 +1103,8 @@ symbol_file_add_with_addrs (bfd *abfd, const char *name, if (deprecated_pre_add_symbol_hook) deprecated_pre_add_symbol_hook (name); else - { - puts_filtered (_("Reading symbols from ")); - fputs_styled (name, file_name_style.style (), gdb_stdout); - puts_filtered ("...\n"); - } + printf_filtered (_("Reading symbols from %ps...\n"), + styled_string (file_name_style.style (), name)); } syms_from_objfile (objfile, addrs, add_flags); @@ -1122,7 +1116,8 @@ symbol_file_add_with_addrs (bfd *abfd, const char *name, if ((flags & OBJF_READNOW)) { if (should_print) - printf_filtered (_("Expanding full symbols from %s...\n"), name); + printf_filtered (_("Expanding full symbols from %ps...\n"), + styled_string (file_name_style.style (), name)); if (objfile->sf) objfile->sf->qf->expand_all_symtabs (objfile); @@ -1134,7 +1129,8 @@ symbol_file_add_with_addrs (bfd *abfd, const char *name, file, and so printing it twice is just redundant. */ if (should_print && !objfile_has_symbols (objfile) && objfile->separate_debug_objfile == nullptr) - printf_filtered (_("(No debugging symbols found in %s)\n"), name); + printf_filtered (_("(No debugging symbols found in %ps)\n"), + styled_string (file_name_style.style (), name)); if (should_print) { @@ -1445,7 +1441,7 @@ find_separate_debug_file (const char *dir, https://sourceware.org/ml/gdb-patches/2019-04/msg00605.html - If some of those scenarions need to be supported, we will need to + If some of those scenarios need to be supported, we will need to use a different condition for HAS_DRIVE_SPEC and a different macro instead of STRIP_DRIVE_SPEC, which work on Posix systems as well. */ std::string drive; @@ -2519,6 +2515,9 @@ reread_symbols (void) automatically recreated by sym_read. */ free_objfile_separate_debug (objfile); + /* Clear the stale source cache. */ + forget_cached_source_info (); + /* Remove any references to this objfile in the global value lists. */ preserve_values (objfile);