diff options
Diffstat (limited to 'gdb/solib.c')
-rw-r--r-- | gdb/solib.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/gdb/solib.c b/gdb/solib.c index 676688b..3ec2032 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1167,9 +1167,7 @@ info_linker_namespace_command (const char *pattern, int from_tty) struct ui_out *uiout = current_uiout; std::vector<std::pair<int, std::vector<const solib *>>> all_solibs_to_print; - if (pattern != nullptr) - while (*pattern == ' ') - pattern++; + pattern = skip_spaces (pattern); if (pattern == nullptr || pattern[0] == '\0') { @@ -1197,10 +1195,10 @@ info_linker_namespace_command (const char *pattern, int from_tty) escape sequence must be doubled to survive the compiler pass. */ re_comp ("^\\[\\[[0-9]\\+\\]\\]$"); if (re_exec (pattern)) - ns = strtol (pattern+2, nullptr, 10); + ns = strtol (pattern + 2, nullptr, 10); else { - char * end = nullptr; + char *end = nullptr; ns = strtol (pattern, &end, 10); if (end[0] != '\0') error (_("Invalid linker namespace identifier: %s"), pattern); @@ -1212,14 +1210,13 @@ info_linker_namespace_command (const char *pattern, int from_tty) bool ns_separator = false; - for (auto &solibs_pair : all_solibs_to_print) + for (const auto &[ns, solibs_to_print] : all_solibs_to_print) { if (ns_separator) uiout->message ("\n\n"); else ns_separator = true; - int ns = solibs_pair.first; - std::vector<const solib *> solibs_to_print = solibs_pair.second; + if (solibs_to_print.size () == 0) { uiout->message (_("Linker namespace [[%d]] is not active.\n"), ns); @@ -1743,8 +1740,8 @@ gdb_bfd_read_elf_soname (const char *filename) if symbol is not found. */ static CORE_ADDR -bfd_lookup_symbol_from_dyn_symtab ( - bfd *abfd, gdb::function_view<bool (const asymbol *)> match_sym) +bfd_lookup_symbol_from_dyn_symtab + (bfd *abfd, gdb::function_view<bool (const asymbol *)> match_sym) { long storage_needed = bfd_get_dynamic_symtab_upper_bound (abfd); CORE_ADDR symaddr = 0; |