+2014-07-30 Tom Tromey <tromey@redhat.com>
+
+ * bsd-kvm.c (bsd_kvm_open): Constify.
+ * corelow.c (core_open): Constify.
+ * ctf.c (ctf_open): Constify.
+ * dbug-rom.c (dbug_open): Constify.
+ * exec.c (exec_open): Constify.
+ * m32r-rom.c (m32r_open, mon2000_open): Constify.
+ * microblaze-rom.c (picobug_open): Constify.
+ * nto-procfs.c (procfs_open_1, procfs_open, procfs_native_open):
+ Constify.
+ * ppcbug-rom.c (ppcbug_open0, ppcbug_open1): Constify.
+ * record-btrace.c (record_btrace_open): Constify.
+ * record-full.c (record_full_core_open_1, record_full_open_1)
+ (record_full_open): Constify.
+ * remote-m32r-sdi.c (m32r_open): Constify.
+ * remote-mips.c (common_open, mips_open, pmon_open, ddb_open)
+ (rockhopper_open, lsi_open): Constify.
+ * remote-sim.c (gdbsim_open): Constify.
+ * remote.c (remote_open, extended_remote_open, remote_open_1):
+ Constify.
+ * target.h (struct target_ops) <to_open>: Make "arg" const.
+ * tracefile-tfile.c (tfile_open): Constify.
+
2014-07-30 Tom Tromey <tromey@redhat.com>
* breakpoint.c (map_breakpoint_numbers): Update.
static ptid_t bsd_kvm_ptid;
static void
-bsd_kvm_open (char *filename, int from_tty)
+bsd_kvm_open (const char *arg, int from_tty)
{
char errbuf[_POSIX2_LINE_MAX];
char *execfile = NULL;
kvm_t *temp_kd;
+ char *filename = NULL;
target_preopen (from_tty);
- if (filename)
+ if (arg)
{
char *temp;
- filename = tilde_expand (filename);
+ filename = tilde_expand (arg);
if (filename[0] != '/')
{
temp = concat (current_directory, "/", filename, (char *)NULL);
static int gdb_check_format (bfd *);
-static void core_open (char *, int);
-
static void core_close (struct target_ops *self);
static void core_close_cleanup (void *ignore);
/* This routine opens and sets up the core file bfd. */
static void
-core_open (char *filename, int from_tty)
+core_open (const char *arg, int from_tty)
{
const char *p;
int siggy;
int scratch_chan;
int flags;
volatile struct gdb_exception except;
+ char *filename;
target_preopen (from_tty);
- if (!filename)
+ if (!arg)
{
if (core_bfd)
error (_("No core file specified. (Use `detach' "
error (_("No core file specified."));
}
- filename = tilde_expand (filename);
+ filename = tilde_expand (arg);
if (!IS_ABSOLUTE_PATH (filename))
{
temp = concat (current_directory, "/",
/* Open CTF trace data in DIRNAME. */
static void
-ctf_open_dir (char *dirname)
+ctf_open_dir (const char *dirname)
{
struct bt_iter_pos begin_pos;
struct bt_iter_pos *pos;
second packet which contains events on trace blocks. */
static void
-ctf_open (char *dirname, int from_tty)
+ctf_open (const char *dirname, int from_tty)
{
struct bt_ctf_event *event;
uint32_t event_id;
#include "m68k-tdep.h"
-static void dbug_open (char *args, int from_tty);
-
static void
dbug_supply_register (struct regcache *regcache, char *regname,
int regnamelen, char *val, int vallen)
} /* init_debug_ops */
static void
-dbug_open (char *args, int from_tty)
+dbug_open (const char *args, int from_tty)
{
monitor_open (args, &dbug_cmds, from_tty);
}
#include "inferior.h"
#include "regcache.h"
-static void dink32_open (char *args, int from_tty);
-
static void
dink32_supply_register (struct regcache *regcache, char *regname,
int regnamelen, char *val, int vallen)
static struct monitor_ops dink32_cmds;
static void
-dink32_open (char *args, int from_tty)
+dink32_open (const char *args, int from_tty)
{
monitor_open (args, &dink32_cmds, from_tty);
}
static void
-exec_open (char *args, int from_tty)
+exec_open (const char *args, int from_tty)
{
target_preopen (from_tty);
exec_file_attach (args, from_tty);
}
static void
-inf_child_open (char *arg, int from_tty)
+inf_child_open (const char *arg, int from_tty)
{
inf_child_open_target (inf_child_ops, arg, from_tty);
}
generic_load (filename, from_tty);
}
-static void m32r_open (char *args, int from_tty);
-static void mon2000_open (char *args, int from_tty);
-
/* This array of registers needs to match the indexes used by GDB. The
whole reason this exists is because the various ROM monitors use
different names than GDB does, and don't support all the registers
} /* init_m32r_cmds */
static void
-m32r_open (char *args, int from_tty)
+m32r_open (const char *args, int from_tty)
{
monitor_open (args, &m32r_cmds, from_tty);
}
} /* init_mon2000_cmds */
static void
-mon2000_open (char *args, int from_tty)
+mon2000_open (const char *args, int from_tty)
{
monitor_open (args, &mon2000_cmds, from_tty);
}
static void
-picobug_open (char *args, int from_tty)
+picobug_open (const char *args, int from_tty)
{
monitor_open (args, &picobug_cmds, from_tty);
}
will be a QNX node string, eg: "/net/some_node". If arg is not a
valid QNX node, we will default to local. */
static void
-procfs_open_1 (struct target_ops *ops, char *arg, int from_tty)
+procfs_open_1 (struct target_ops *ops, const char *arg, int from_tty)
{
char *nodestr;
char *endstr;
/* to_open implementation for "target procfs". */
static void
-procfs_open (char *arg, int from_tty)
+procfs_open (const char *arg, int from_tty)
{
procfs_open_1 (&nto_procfs_ops, arg, from_tty);
}
/* to_open implementation for "target native". */
static void
-procfs_native_open (char *arg, int from_tty)
+procfs_native_open (const char *arg, int from_tty)
{
procfs_open_1 (nto_native_ops, arg, from_tty);
}
static struct monitor_ops ppcbug_cmds1;
static void
-ppcbug_open0 (char *args, int from_tty)
+ppcbug_open0 (const char *args, int from_tty)
{
monitor_open (args, &ppcbug_cmds0, from_tty);
}
static void
-ppcbug_open1 (char *args, int from_tty)
+ppcbug_open1 (const char *args, int from_tty)
{
monitor_open (args, &ppcbug_cmds1, from_tty);
}
/* The to_open method of target record-btrace. */
static void
-record_btrace_open (char *args, int from_tty)
+record_btrace_open (const char *args, int from_tty)
{
struct cleanup *disable_chain;
struct thread_info *tp;
/* Open the process record target. */
static void
-record_full_core_open_1 (char *name, int from_tty)
+record_full_core_open_1 (const char *name, int from_tty)
{
struct regcache *regcache = get_current_regcache ();
int regnum = gdbarch_num_regs (get_regcache_arch (regcache));
/* "to_open" target method for 'live' processes. */
static void
-record_full_open_1 (char *name, int from_tty)
+record_full_open_1 (const char *name, int from_tty)
{
if (record_debug)
fprintf_unfiltered (gdb_stdlog, "Process record: record_full_open\n");
/* "to_open" target method. Open the process record target. */
static void
-record_full_open (char *name, int from_tty)
+record_full_open (const char *name, int from_tty)
{
struct target_ops *t;
NAME is the filename used for communication. */
static void
-m32r_open (char *args, int from_tty)
+m32r_open (const char *args, int from_tty)
{
struct hostent *host_ent;
struct sockaddr_in server_addr;
static void mips_initialize (void);
-static void mips_open (char *name, int from_tty);
-
-static void pmon_open (char *name, int from_tty);
-
-static void ddb_open (char *name, int from_tty);
-
-static void lsi_open (char *name, int from_tty);
-
static void mips_close (struct target_ops *self);
static int mips_map_regno (struct gdbarch *, int);
/* Open a connection to the remote board. */
static void
-common_open (struct target_ops *ops, char *name, int from_tty,
+common_open (struct target_ops *ops, const char *name, int from_tty,
enum mips_monitor_type new_monitor,
const char *new_monitor_prompt)
{
/* Open a connection to an IDT board. */
static void
-mips_open (char *name, int from_tty)
+mips_open (const char *name, int from_tty)
{
const char *monitor_prompt = NULL;
if (gdbarch_bfd_arch_info (target_gdbarch ()) != NULL
/* Open a connection to a PMON board. */
static void
-pmon_open (char *name, int from_tty)
+pmon_open (const char *name, int from_tty)
{
common_open (&pmon_ops, name, from_tty, MON_PMON, "PMON> ");
}
/* Open a connection to a DDB board. */
static void
-ddb_open (char *name, int from_tty)
+ddb_open (const char *name, int from_tty)
{
common_open (&ddb_ops, name, from_tty, MON_DDB, "NEC010>");
}
/* Open a connection to a rockhopper board. */
static void
-rockhopper_open (char *name, int from_tty)
+rockhopper_open (const char *name, int from_tty)
{
common_open (&rockhopper_ops, name, from_tty, MON_ROCKHOPPER, "NEC01>");
}
/* Open a connection to an LSI board. */
static void
-lsi_open (char *name, int from_tty)
+lsi_open (const char *name, int from_tty)
{
int i;
/* Called when selecting the simulator. E.g. (gdb) target sim name. */
static void
-gdbsim_open (char *args, int from_tty)
+gdbsim_open (const char *args, int from_tty)
{
int len;
char *arg_buf;
static void remote_prepare_to_store (struct target_ops *self,
struct regcache *regcache);
-static void remote_open (char *name, int from_tty);
-
-static void extended_remote_open (char *name, int from_tty);
-
-static void remote_open_1 (char *, int, struct target_ops *, int extended_p);
+static void remote_open_1 (const char *, int, struct target_ops *,
+ int extended_p);
static void remote_close (struct target_ops *self);
NAME is the filename used for communication. */
static void
-remote_open (char *name, int from_tty)
+remote_open (const char *name, int from_tty)
{
remote_open_1 (name, from_tty, &remote_ops, 0);
}
remote gdb protocol. NAME is the filename used for communication. */
static void
-extended_remote_open (char *name, int from_tty)
+extended_remote_open (const char *name, int from_tty)
{
remote_open_1 (name, from_tty, &extended_remote_ops, 1 /*extended_p */);
}
}
static void
-remote_open_1 (char *name, int from_tty,
+remote_open_1 (const char *name, int from_tty,
struct target_ops *target, int extended_p)
{
struct remote_state *rs = get_remote_state ();
command, and (if successful) pushes a new target onto the
stack. Targets should supply this routine, if only to provide
an error message. */
- void (*to_open) (char *, int);
+ void (*to_open) (const char *, int);
/* Old targets with a static target vector provide "to_close".
New re-entrant targets provide "to_xclose" and that is expected
to xfree everything (including the "struct target_ops"). */
}
static void
-tfile_open (char *filename, int from_tty)
+tfile_open (const char *arg, int from_tty)
{
volatile struct gdb_exception ex;
char *temp;
struct trace_status *ts;
struct uploaded_tp *uploaded_tps = NULL;
struct uploaded_tsv *uploaded_tsvs = NULL;
+ char *filename;
target_preopen (from_tty);
- if (!filename)
+ if (!arg)
error (_("No trace file specified."));
- filename = tilde_expand (filename);
+ filename = tilde_expand (arg);
if (!IS_ABSOLUTE_PATH(filename))
{
temp = concat (current_directory, "/", filename, (char *) NULL);