diff options
-rw-r--r-- | gdb/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/minidebug.c | 5 | ||||
-rw-r--r-- | gdb/symfile-add-flags.h | 7 | ||||
-rw-r--r-- | gdb/symfile.c | 7 |
4 files changed, 25 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3e0c53d..65b9098 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2018-05-16 Tom Tromey <tom@tromey.com> + + PR cli/19551: + * symfile-add-flags.h (enum symfile_add_flags) + <SYMFILE_NOT_FILENAME>: New constant. + * symfile.c (read_symbols): Use SYMFILE_NOT_FILENAME. Get + objfile name from BFD. + (symbol_file_add_with_addrs): Check SYMFILE_NOT_FILENAME. + * minidebug.c (find_separate_debug_file_in_section): Put + ".gnu_debugdata" into BFD's file name. + 2018-05-16 Simon Marchi <simon.marchi@ericsson.com> * regcache.c (regcache_read_ftype, regcache_write_ftype): diff --git a/gdb/minidebug.c b/gdb/minidebug.c index 693c715..e21353d 100644 --- a/gdb/minidebug.c +++ b/gdb/minidebug.c @@ -269,7 +269,10 @@ find_separate_debug_file_in_section (struct objfile *objfile) return NULL; #ifdef HAVE_LIBLZMA - abfd = gdb_bfd_openr_iovec (objfile_name (objfile), gnutarget, lzma_open, + std::string filename = string_printf (_(".gnu_debugdata for %s"), + objfile_name (objfile)); + + abfd = gdb_bfd_openr_iovec (filename.c_str (), gnutarget, lzma_open, section, lzma_pread, lzma_close, lzma_stat); if (abfd == NULL) return NULL; diff --git a/gdb/symfile-add-flags.h b/gdb/symfile-add-flags.h index f07ba79..3c07513 100644 --- a/gdb/symfile-add-flags.h +++ b/gdb/symfile-add-flags.h @@ -40,8 +40,11 @@ enum symfile_add_flag /* Do not immediately read symbols for this file. By default, symbols are read when the objfile is created. */ - SYMFILE_NO_READ = 1 << 4 - }; + SYMFILE_NO_READ = 1 << 4, + + /* The new objfile should be marked OBJF_NOT_FILENAME. */ + SYMFILE_NOT_FILENAME = 1 << 5, + }; DEF_ENUM_FLAGS_TYPE (enum symfile_add_flag, symfile_add_flags); diff --git a/gdb/symfile.c b/gdb/symfile.c index b0a5f11..1f5d761 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -808,8 +808,9 @@ read_symbols (struct objfile *objfile, symfile_add_flags add_flags) virtual section-as-bfd like the bfd filename containing the section. Therefore use also non-canonical name form for the same file containing the section. */ - symbol_file_add_separate (abfd.get (), objfile->original_name, - add_flags, objfile); + symbol_file_add_separate (abfd.get (), + bfd_get_filename (abfd.get ()), + add_flags | SYMFILE_NOT_FILENAME, objfile); } } if ((add_flags & SYMFILE_NO_READ) == 0) @@ -1079,6 +1080,8 @@ symbol_file_add_with_addrs (bfd *abfd, const char *name, flags |= OBJF_READNEVER; add_flags |= SYMFILE_NO_READ; } + if ((add_flags & SYMFILE_NOT_FILENAME) != 0) + flags |= OBJF_NOT_FILENAME; /* Give user a chance to burp if we'd be interactively wiping out any existing symbols. */ |