diff options
Diffstat (limited to 'gdb/solib.c')
-rw-r--r-- | gdb/solib.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/gdb/solib.c b/gdb/solib.c index 0bbcb02..4876f1a 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1,6 +1,6 @@ /* Handle shared libraries for GDB, the GNU Debugger. - Copyright (C) 1990-2024 Free Software Foundation, Inc. + Copyright (C) 1990-2025 Free Software Foundation, Inc. This file is part of GDB. @@ -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 @@ -1051,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"); @@ -1083,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)) { |