diff options
Diffstat (limited to 'gdb/solib.c')
-rw-r--r-- | gdb/solib.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gdb/solib.c b/gdb/solib.c index 6d0fded..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); |