From 99a8e537841025daa212aa33e08cfdebc82c27ee Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Thu, 10 Dec 2015 12:00:31 -0800 Subject: [PATCH] patch ../102429642.patch --- README.google | 12 ++++++++++++ gdb/symfile.c | 17 +++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/README.google b/README.google index a593939bb1e..4a92ff13f05 100644 --- a/README.google +++ b/README.google @@ -230,3 +230,15 @@ they are an ongoing maintenance burden. + Ref: 15188412 + * breakpoint.c (create_solib_event_breakpoint): Apply + gdbarch_skip_entrypoint if it's defined. +--- README.google 2015-09-05 18:23:16.000000000 -0700 ++++ README.google 2015-09-05 18:26:36.000000000 -0700 ++ ++2015-09-05 Doug Evans ++ ++ PR python/17936 ++ * symfile.c (symbol_file_add_with_addrs): Call ++ observer_notify_new_objfile (NULL) early, before loading symbols. ++ (symbol_file_add_separate): Turn off SYMFILE_MAINLINE when loading ++ separate debug files. ++ (clear_symtab_users): Don't call observer_notify_new_objfile (NULL) ++ here if SYMFILE_MAINLINE. diff --git a/gdb/symfile.c b/gdb/symfile.c index 7cc475eafa9..7a5554f9e4a 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1191,6 +1191,15 @@ symbol_file_add_with_addrs (bfd *abfd, const char *name, int add_flags, && !query (_("Load new symbol table from \"%s\"? "), name)) error (_("Not confirmed.")); + /* If mainline, send the new_objfile (NULL) notification now. + This is done here so that clients will see one event instead of one for + the main objfile and a second one for a possible separate debug file, and + will see the event before any objfiles are loaded including possible + separate debug files. Note that if there is a separate debug file, we + will end up back here from calling syms_from_objfile below. PR 17936. */ + if (mainline) + observer_notify_new_objfile (NULL); + objfile = allocate_objfile (abfd, name, flags | (mainline ? OBJF_MAINLINE : 0)); @@ -1284,7 +1293,7 @@ symbol_file_add_separate (bfd *bfd, const char *name, int symfile_flags, my_cleanup = make_cleanup_free_section_addr_info (sap); new_objfile = symbol_file_add_with_addrs - (bfd, name, symfile_flags, sap, + (bfd, name, symfile_flags & ~SYMFILE_MAINLINE, sap, objfile->flags & (OBJF_REORDERED | OBJF_SHARED | OBJF_READNOW | OBJF_USERLOADED), objfile); @@ -3030,7 +3039,11 @@ clear_symtab_users (int add_flags) clear_displays (); clear_last_displayed_sal (); clear_pc_function_cache (); - observer_notify_new_objfile (NULL); + + /* If this is the main objfile, the notification is sent out sooner, + by symbol_file_add_with_addrs. PR 17936. */ + if ((add_flags & SYMFILE_MAINLINE) == 0) + observer_notify_new_objfile (NULL); /* Clear globals which might have pointed into a removed objfile. FIXME: It's not clear which of these are supposed to persist -- 2.47.2