+2014-06-16 Tom Tromey <tromey@redhat.com>
+
+ * target.h (struct target_ops) <to_info_proc>: Make parameter
+ const.
+ (target_info_proc): Update.
+ * target.c (target_info_proc): Make "args" const.
+ * procfs.c (procfs_info_proc): Update.
+ * linux-tdep.c (linux_info_proc): Update.
+ (linux_core_info_proc_mappings): Make "args" const.
+ (linux_core_info_proc): Update.
+ * gdbarch.sh (info_proc, core_info_proc): Make "args" const.
+ * gdbarch.c: Rebuild.
+ * gdbarch.h: Rebuild.
+ * corelow.c (core_info_proc): Update.
+
2014-06-16 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_disconnect>: Make parameter
/* Implement the to_info_proc method. */
static void
-core_info_proc (struct target_ops *ops, char *args, enum info_proc_what request)
+core_info_proc (struct target_ops *ops, const char *args,
+ enum info_proc_what request)
{
struct gdbarch *gdbarch = get_current_arch ();
}
void
-gdbarch_info_proc (struct gdbarch *gdbarch, char *args, enum info_proc_what what)
+gdbarch_info_proc (struct gdbarch *gdbarch, const char *args, enum info_proc_what what)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->info_proc != NULL);
}
void
-gdbarch_core_info_proc (struct gdbarch *gdbarch, char *args, enum info_proc_what what)
+gdbarch_core_info_proc (struct gdbarch *gdbarch, const char *args, enum info_proc_what what)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->core_info_proc != NULL);
extern int gdbarch_info_proc_p (struct gdbarch *gdbarch);
-typedef void (gdbarch_info_proc_ftype) (struct gdbarch *gdbarch, char *args, enum info_proc_what what);
-extern void gdbarch_info_proc (struct gdbarch *gdbarch, char *args, enum info_proc_what what);
+typedef void (gdbarch_info_proc_ftype) (struct gdbarch *gdbarch, const char *args, enum info_proc_what what);
+extern void gdbarch_info_proc (struct gdbarch *gdbarch, const char *args, enum info_proc_what what);
extern void set_gdbarch_info_proc (struct gdbarch *gdbarch, gdbarch_info_proc_ftype *info_proc);
/* Implement the "info proc" command for core files. Noe that there
extern int gdbarch_core_info_proc_p (struct gdbarch *gdbarch);
-typedef void (gdbarch_core_info_proc_ftype) (struct gdbarch *gdbarch, char *args, enum info_proc_what what);
-extern void gdbarch_core_info_proc (struct gdbarch *gdbarch, char *args, enum info_proc_what what);
+typedef void (gdbarch_core_info_proc_ftype) (struct gdbarch *gdbarch, const char *args, enum info_proc_what what);
+extern void gdbarch_core_info_proc (struct gdbarch *gdbarch, const char *args, enum info_proc_what what);
extern void set_gdbarch_core_info_proc (struct gdbarch *gdbarch, gdbarch_core_info_proc_ftype *core_info_proc);
/* Iterate over all objfiles in the order that makes the most sense
m:void:gen_return_address:struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope:ax, value, scope::default_gen_return_address::0
# Implement the "info proc" command.
-M:void:info_proc:char *args, enum info_proc_what what:args, what
+M:void:info_proc:const char *args, enum info_proc_what what:args, what
# Implement the "info proc" command for core files. Noe that there
# are two "info_proc"-like methods on gdbarch -- one for core files,
# one for live targets.
-M:void:core_info_proc:char *args, enum info_proc_what what:args, what
+M:void:core_info_proc:const char *args, enum info_proc_what what:args, what
# Iterate over all objfiles in the order that makes the most sense
# for the architecture to make global symbol searches.
/* Implement the "info proc" command. */
static void
-linux_info_proc (struct gdbarch *gdbarch, char *args,
+linux_info_proc (struct gdbarch *gdbarch, const char *args,
enum info_proc_what what)
{
/* A long is used for pid instead of an int to avoid a loss of precision
int target_errno;
if (args && isdigit (args[0]))
- pid = strtoul (args, &args, 10);
+ {
+ char *tem;
+
+ pid = strtoul (args, &tem, 10);
+ args = tem;
+ }
else
{
if (!target_has_execution)
pid = current_inferior ()->pid;
}
- args = skip_spaces (args);
+ args = skip_spaces_const (args);
if (args && args[0])
error (_("Too many parameters: %s"), args);
/* Implement "info proc mappings" for a corefile. */
static void
-linux_core_info_proc_mappings (struct gdbarch *gdbarch, char *args)
+linux_core_info_proc_mappings (struct gdbarch *gdbarch, const char *args)
{
asection *section;
ULONGEST count, page_size;
/* Implement "info proc" for a corefile. */
static void
-linux_core_info_proc (struct gdbarch *gdbarch, char *args,
+linux_core_info_proc (struct gdbarch *gdbarch, const char *args,
enum info_proc_what what)
{
int exe_f = (what == IP_MINIMAL || what == IP_EXE || what == IP_ALL);
static int procfs_can_use_hw_breakpoint (struct target_ops *self,
int, int, int);
-static void procfs_info_proc (struct target_ops *, char *,
+static void procfs_info_proc (struct target_ops *, const char *,
enum info_proc_what);
#if defined (PR_MODEL_NATIVE) && (PR_MODEL_NATIVE == PR_MODEL_LP64)
/* Implement the "info proc" command. */
static void
-procfs_info_proc (struct target_ops *ops, char *args,
+procfs_info_proc (struct target_ops *ops, const char *args,
enum info_proc_what what)
{
struct cleanup *old_chain;
/* Implement the "info proc" command. */
int
-target_info_proc (char *args, enum info_proc_what what)
+target_info_proc (const char *args, enum info_proc_what what)
{
struct target_ops *t;
/* Implement the "info proc" command. */
- void (*to_info_proc) (struct target_ops *, char *, enum info_proc_what);
+ void (*to_info_proc) (struct target_ops *, const char *,
+ enum info_proc_what);
/* Tracepoint-related operations. */
an error was encountered while attempting to handle the
request. */
-int target_info_proc (char *, enum info_proc_what);
+int target_info_proc (const char *, enum info_proc_what);
/* Returns true if this target can debug multiple processes
simultaneously. */