diff options
Diffstat (limited to 'gdb/solib.c')
-rw-r--r-- | gdb/solib.c | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/gdb/solib.c b/gdb/solib.c index b1fdea9..3ddd4f9 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -68,7 +68,7 @@ show_solib_search_path (struct ui_file *file, int from_tty, value); } -/* Same as HAVE_DOS_BASED_FILE_SYSTEM, but useable as an rvalue. */ +/* Same as HAVE_DOS_BASED_FILE_SYSTEM, but usable as an rvalue. */ #if (HAVE_DOS_BASED_FILE_SYSTEM) #define DOS_BASED_FILE_SYSTEM 1 #else @@ -694,14 +694,17 @@ notify_solib_loaded (solib &so) /* Notify interpreters and observers that solib SO has been unloaded. When STILL_IN_USE is true, the objfile backing SO is still in use, this indicates that SO was loaded multiple times, but only mapped - in once (the mapping was reused). */ + in once (the mapping was reused). + + When SILENT is true, don't announce to the user if any breakpoints are + disabled as a result of unloading SO. */ static void notify_solib_unloaded (program_space *pspace, const solib &so, - bool still_in_use) + bool still_in_use, bool silent) { interps_notify_solib_unloaded (so, still_in_use); - gdb::observers::solib_unloaded.notify (pspace, so, still_in_use); + gdb::observers::solib_unloaded.notify (pspace, so, still_in_use, silent); } /* See solib.h. */ @@ -803,7 +806,7 @@ update_solib_list (int from_tty) /* Notify any observer that the shared object has been unloaded before we remove it from GDB's tables. */ notify_solib_unloaded (current_program_space, *gdb_iter, - still_in_use); + still_in_use, false); /* Unless the user loaded it explicitly, free SO's objfile. */ if (gdb_iter->objfile != nullptr @@ -1048,12 +1051,24 @@ info_sharedlibrary_command (const char *pattern, int from_tty) } } + /* How many columns the table should have. If the inferior has + more than one namespace active, we need a column to show that. */ + int num_cols = 4; + const solib_ops *ops = gdbarch_so_ops (gdbarch); + if (ops->num_active_namespaces != nullptr + && ops->num_active_namespaces () > 1) + num_cols++; + { - ui_out_emit_table table_emitter (uiout, 4, nr_libs, "SharedLibraryTable"); + ui_out_emit_table table_emitter (uiout, num_cols, nr_libs, + "SharedLibraryTable"); /* The "- 1" is because ui_out adds one space between columns. */ uiout->table_header (addr_width - 1, ui_left, "from", "From"); uiout->table_header (addr_width - 1, ui_left, "to", "To"); + if (ops->num_active_namespaces != nullptr + && ops->num_active_namespaces () > 1) + uiout->table_header (5, ui_left, "namespace", "NS"); uiout->table_header (12 - 1, ui_left, "syms-read", "Syms Read"); uiout->table_header (0, ui_noalign, "name", "Shared Object Library"); @@ -1080,6 +1095,19 @@ info_sharedlibrary_command (const char *pattern, int from_tty) uiout->field_skip ("to"); } + if (ops->num_active_namespaces != nullptr + && ops->num_active_namespaces ()> 1) + { + try + { + uiout->field_fmt ("namespace", "[[%d]]", ops->find_solib_ns (so)); + } + catch (const gdb_exception_error &er) + { + uiout->field_skip ("namespace"); + } + } + if (!top_level_interpreter ()->interp_ui_out ()->is_mi_like_p () && so.symbols_loaded && !objfile_has_symbols (so.objfile)) { @@ -1163,14 +1191,12 @@ clear_solib (program_space *pspace) { const solib_ops *ops = gdbarch_so_ops (current_inferior ()->arch ()); - disable_breakpoints_in_shlibs (pspace); - for (solib &so : pspace->so_list) { bool still_in_use = (so.objfile != nullptr && solib_used (pspace, so)); - notify_solib_unloaded (pspace, so, still_in_use); + notify_solib_unloaded (pspace, so, still_in_use, true); pspace->remove_target_sections (&so); }; |