#include "cli/cli-utils.h"
#include "cli/cli-setshow.h"
-static void maintenance_internal_error (char *args, int from_tty);
-
-static void maintenance_space_display (char *, int);
-
static void maintenance_do_deprecate (const char *, int);
/* Set this to the maximum number of seconds to wait instead of waiting forever
GDB. */
static void
-maintenance_internal_error (char *args, int from_tty)
+maintenance_internal_error (const char *args, int from_tty)
{
internal_error (__FILE__, __LINE__, "%s", (args == NULL ? "" : args));
}
GDB. */
static void
-maintenance_internal_warning (char *args, int from_tty)
+maintenance_internal_warning (const char *args, int from_tty)
{
internal_warning (__FILE__, __LINE__, "%s", (args == NULL ? "" : args));
}
demangler problem is detected. Allows testing of the mechanism. */
static void
-maintenance_demangler_warning (char *args, int from_tty)
+maintenance_demangler_warning (const char *args, int from_tty)
{
demangler_warning (__FILE__, __LINE__, "%s", (args == NULL ? "" : args));
}
}
static void
-maintenance_space_display (char *args, int from_tty)
+maintenance_space_display (const char *args, int from_tty)
{
if (args == NULL || *args == '\0')
printf_unfiltered ("\"maintenance space\" takes a numeric argument.\n");
}
static void
-maintenance_print_architecture (char *args, int from_tty)
+maintenance_print_architecture (const char *args, int from_tty)
{
struct gdbarch *gdbarch = get_current_arch ();
or maintenance translate-address <addr>. */
static void
-maintenance_translate_address (char *arg, int from_tty)
+maintenance_translate_address (const char *arg, int from_tty)
{
CORE_ADDR address;
struct obj_section *sect;
- char *p;
+ const char *p;
struct bound_minimal_symbol sym;
struct objfile *objfile;
p++;
if (*p == '\000') /* End of command? */
error (_("Need to specify <section-name> and <address>"));
- *p++ = '\000';
- p = skip_spaces (p);
+
+ int arg_len = p - arg;
+ p = skip_spaces (p + 1);
ALL_OBJSECTIONS (objfile, sect)
{
- if (strcmp (sect->the_bfd_section->name, arg) == 0)
+ if (strncmp (sect->the_bfd_section->name, arg, arg_len) == 0)
break;
}
}
static void
-maintenance_info_selftests (char *arg, int from_tty)
+maintenance_info_selftests (const char *arg, int from_tty)
{
printf_filtered ("Registered selftests:\n");
selftests::for_each_selftest ([] (const std::string &name) {