aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog32
-rw-r--r--gdb/aix-thread.c2
-rw-r--r--gdb/corelow.c4
-rw-r--r--gdb/darwin-nat.c2
-rw-r--r--gdb/dec-thread.c2
-rw-r--r--gdb/gnu-nat.c2
-rw-r--r--gdb/go32-nat.c2
-rw-r--r--gdb/inf-ptrace.c2
-rw-r--r--gdb/inf-ttrace.c2
-rw-r--r--gdb/linux-fork.c2
-rw-r--r--gdb/linux-fork.h2
-rw-r--r--gdb/linux-nat.c9
-rw-r--r--gdb/linux-thread-db.c2
-rw-r--r--gdb/monitor.c2
-rw-r--r--gdb/nto-procfs.c2
-rw-r--r--gdb/procfs.c4
-rw-r--r--gdb/record.c2
-rw-r--r--gdb/record.h2
-rw-r--r--gdb/remote-m32r-sdi.c2
-rw-r--r--gdb/remote-mips.c4
-rw-r--r--gdb/remote-sim.c2
-rw-r--r--gdb/remote.c8
-rw-r--r--gdb/sol-thread.c2
-rw-r--r--gdb/target.c4
-rw-r--r--gdb/target.h4
-rw-r--r--gdb/windows-nat.c2
26 files changed, 67 insertions, 38 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1c23f96..4d1c26d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,35 @@
+2013-11-08 Tom Tromey <tromey@redhat.com>
+
+ * aix-thread.c (aix_thread_detach): Update.
+ * corelow.c (core_detach): Update.
+ * darwin-nat.c (darwin_detach): Update.
+ * dec-thread.c (dec_thread_detach): Update.
+ * gnu-nat.c (gnu_detach): Update.
+ * go32-nat.c (go32_detach): Update.
+ * inf-ptrace.c (inf_ptrace_detach): Update.
+ * inf-ttrace.c (inf_ttrace_detach): Update.
+ * linux-fork.c (linux_fork_detach): Update.
+ * linux-fork.h (linux_fork_detach): Update.
+ * linux-nat.c (linux_nat_detach): Update. Introduce "tem"
+ local for const-correctness.
+ * linux-thread-db.c (thread_db_detach): Update.
+ * monitor.c (monitor_detach): Update.
+ * nto-procfs.c (procfs_detach): Update.
+ * procfs.c (procfs_detach): Update.
+ * record.c (record_detach): Update.
+ * record.h (record_detach): Update.
+ * remote-m32r-sdi.c (m32r_detach): Update.
+ * remote-mips.c (mips_detach): Update.
+ * remote-sim.c (gdbsim_detach): Update.
+ * remote.c (remote_detach_1, remote_detach)
+ (extended_remote_detach): Update.
+ * sol-thread.c (sol_thread_detach): Update.
+ * target.c (target_detach): Make "args" const.
+ (init_dummy_target): Update.
+ * target.h (struct target_ops) <to_detach>: Make argument const.
+ (target_detach): Likewise.
+ * windows-nat.c (windows_detach): Update.
+
2013-11-07 Doug Evans <dje@google.com>
PR 11786
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 3175835..373a09a 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -967,7 +967,7 @@ aix_thread_attach (struct target_ops *ops, char *args, int from_tty)
/* Detach from the process attached to by aix_thread_attach(). */
static void
-aix_thread_detach (struct target_ops *ops, char *args, int from_tty)
+aix_thread_detach (struct target_ops *ops, const char *args, int from_tty)
{
struct target_ops *beneath = find_target_beneath (ops);
diff --git a/gdb/corelow.c b/gdb/corelow.c
index d1e7f6a..78f8120 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -85,8 +85,6 @@ static int gdb_check_format (bfd *);
static void core_open (char *, int);
-static void core_detach (struct target_ops *ops, char *, int);
-
static void core_close (void);
static void core_close_cleanup (void *ignore);
@@ -465,7 +463,7 @@ core_open (char *filename, int from_tty)
}
static void
-core_detach (struct target_ops *ops, char *args, int from_tty)
+core_detach (struct target_ops *ops, const char *args, int from_tty)
{
if (args)
error (_("Too many arguments"));
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index 6995c25..a9157db 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -1681,7 +1681,7 @@ darwin_attach (struct target_ops *ops, char *args, int from_tty)
previously attached. It *might* work if the program was
started via fork. */
static void
-darwin_detach (struct target_ops *ops, char *args, int from_tty)
+darwin_detach (struct target_ops *ops, const char *args, int from_tty)
{
pid_t pid = ptid_get_pid (inferior_ptid);
struct inferior *inf = current_inferior ();
diff --git a/gdb/dec-thread.c b/gdb/dec-thread.c
index f07721d..0376828 100644
--- a/gdb/dec-thread.c
+++ b/gdb/dec-thread.c
@@ -444,7 +444,7 @@ resync_thread_list (struct target_ops *ops)
/* The "to_detach" method of the dec_thread_ops. */
static void
-dec_thread_detach (struct target_ops *ops, char *args, int from_tty)
+dec_thread_detach (struct target_ops *ops, const char *args, int from_tty)
{
struct target_ops *beneath = find_target_beneath (ops);
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 4a25759..659aa67 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -2218,7 +2218,7 @@ gnu_attach (struct target_ops *ops, char *args, int from_tty)
previously attached. It *might* work if the program was
started via fork. */
static void
-gnu_detach (struct target_ops *ops, char *args, int from_tty)
+gnu_detach (struct target_ops *ops, const char *args, int from_tty)
{
int pid;
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index 4dac617..a92a34f 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -384,7 +384,7 @@ Use the `run' command to run DJGPP programs."));
}
static void
-go32_detach (struct target_ops *ops, char *args, int from_tty)
+go32_detach (struct target_ops *ops, const char *args, int from_tty)
{
}
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index bdebe65..5e5e248 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -264,7 +264,7 @@ inf_ptrace_post_attach (int pid)
specified by ARGS. If FROM_TTY is non-zero, be chatty about it. */
static void
-inf_ptrace_detach (struct target_ops *ops, char *args, int from_tty)
+inf_ptrace_detach (struct target_ops *ops, const char *args, int from_tty)
{
pid_t pid = ptid_get_pid (inferior_ptid);
int sig = 0;
diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c
index 36bf4cb..c715c71 100644
--- a/gdb/inf-ttrace.c
+++ b/gdb/inf-ttrace.c
@@ -798,7 +798,7 @@ inf_ttrace_attach (struct target_ops *ops, char *args, int from_tty)
}
static void
-inf_ttrace_detach (struct target_ops *ops, char *args, int from_tty)
+inf_ttrace_detach (struct target_ops *ops, const char *args, int from_tty)
{
pid_t pid = ptid_get_pid (inferior_ptid);
int sig = 0;
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index bff807e..754500f 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -387,7 +387,7 @@ linux_fork_mourn_inferior (void)
the first available. */
void
-linux_fork_detach (char *args, int from_tty)
+linux_fork_detach (const char *args, int from_tty)
{
/* OK, inferior_ptid is the one we are detaching from. We need to
delete it from the fork_list, and switch to the next available
diff --git a/gdb/linux-fork.h b/gdb/linux-fork.h
index 5d924de..51b5112 100644
--- a/gdb/linux-fork.h
+++ b/gdb/linux-fork.h
@@ -22,6 +22,6 @@ extern struct fork_info *add_fork (pid_t);
extern struct fork_info *find_fork_pid (pid_t);
extern void linux_fork_killall (void);
extern void linux_fork_mourn_inferior (void);
-extern void linux_fork_detach (char *, int);
+extern void linux_fork_detach (const char *, int);
extern int forks_exist_p (void);
extern int linux_fork_checkpointing_p (int);
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 4784a5e..95064f7 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -1557,7 +1557,7 @@ detach_callback (struct lwp_info *lp, void *data)
}
static void
-linux_nat_detach (struct target_ops *ops, char *args, int from_tty)
+linux_nat_detach (struct target_ops *ops, const char *args, int from_tty)
{
int pid;
int status;
@@ -1587,10 +1587,13 @@ linux_nat_detach (struct target_ops *ops, char *args, int from_tty)
&& get_pending_status (main_lwp, &status) != -1
&& WIFSTOPPED (status))
{
+ char *tem;
+
/* Put the signal number in ARGS so that inf_ptrace_detach will
pass it along with PTRACE_DETACH. */
- args = alloca (8);
- sprintf (args, "%d", (int) WSTOPSIG (status));
+ tem = alloca (8);
+ sprintf (tem, "%d", (int) WSTOPSIG (status));
+ args = tem;
if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog,
"LND: Sending signal %s to %s\n",
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index 593fc29..4cc3a4c 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -1340,7 +1340,7 @@ detach_thread (ptid_t ptid)
}
static void
-thread_db_detach (struct target_ops *ops, char *args, int from_tty)
+thread_db_detach (struct target_ops *ops, const char *args, int from_tty)
{
struct target_ops *target_beneath = find_target_beneath (ops);
struct thread_db_info *info;
diff --git a/gdb/monitor.c b/gdb/monitor.c
index 08153dd..0f5d8ca 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -875,7 +875,7 @@ monitor_close (void)
when you want to detach and do something else with your gdb. */
static void
-monitor_detach (struct target_ops *ops, char *args, int from_tty)
+monitor_detach (struct target_ops *ops, const char *args, int from_tty)
{
unpush_target (ops); /* calls monitor_close to do the real work. */
if (from_tty)
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index 1e6ec74..a9b4276 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -877,7 +877,7 @@ procfs_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int dowrite,
on signals, etc. We'd better not have left any breakpoints
in the program or it'll die when it hits one. */
static void
-procfs_detach (struct target_ops *ops, char *args, int from_tty)
+procfs_detach (struct target_ops *ops, const char *args, int from_tty)
{
int siggnal = 0;
int pid;
diff --git a/gdb/procfs.c b/gdb/procfs.c
index e013096..018a0d8 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -110,7 +110,7 @@
/* This module defines the GDB target vector and its methods. */
static void procfs_attach (struct target_ops *, char *, int);
-static void procfs_detach (struct target_ops *, char *, int);
+static void procfs_detach (struct target_ops *, const char *, int);
static void procfs_resume (struct target_ops *,
ptid_t, int, enum gdb_signal);
static void procfs_stop (ptid_t);
@@ -3071,7 +3071,7 @@ procfs_attach (struct target_ops *ops, char *args, int from_tty)
}
static void
-procfs_detach (struct target_ops *ops, char *args, int from_tty)
+procfs_detach (struct target_ops *ops, const char *args, int from_tty)
{
int sig = 0;
int pid = ptid_get_pid (inferior_ptid);
diff --git a/gdb/record.c b/gdb/record.c
index 4078def..ec2a042 100644
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -141,7 +141,7 @@ record_disconnect (struct target_ops *t, char *args, int from_tty)
/* See record.h. */
void
-record_detach (struct target_ops *t, char *args, int from_tty)
+record_detach (struct target_ops *t, const char *args, int from_tty)
{
gdb_assert (t->to_stratum == record_stratum);
diff --git a/gdb/record.h b/gdb/record.h
index 65d508f..124c32b 100644
--- a/gdb/record.h
+++ b/gdb/record.h
@@ -55,7 +55,7 @@ extern void cmd_record_goto (char *arg, int from_tty);
extern void record_disconnect (struct target_ops *, char *, int);
/* The default "to_detach" target method for record targets. */
-extern void record_detach (struct target_ops *, char *, int);
+extern void record_detach (struct target_ops *, const char *, int);
/* The default "to_mourn_inferior" target method for record targets. */
extern void record_mourn_inferior (struct target_ops *);
diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c
index 81fea53..4ffb72d 100644
--- a/gdb/remote-m32r-sdi.c
+++ b/gdb/remote-m32r-sdi.c
@@ -878,7 +878,7 @@ m32r_wait (struct target_ops *ops,
Use this when you want to detach and do something else
with your gdb. */
static void
-m32r_detach (struct target_ops *ops, char *args, int from_tty)
+m32r_detach (struct target_ops *ops, const char *args, int from_tty)
{
if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "m32r_detach(%d)\n", from_tty);
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index bf6cce5..f8e6cac 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -86,8 +86,6 @@ static void lsi_open (char *name, int from_tty);
static void mips_close (void);
-static void mips_detach (struct target_ops *ops, char *args, int from_tty);
-
static int mips_map_regno (struct gdbarch *, int);
static void mips_set_register (int regno, ULONGEST value);
@@ -1749,7 +1747,7 @@ mips_close (void)
/* Detach from the remote board. */
static void
-mips_detach (struct target_ops *ops, char *args, int from_tty)
+mips_detach (struct target_ops *ops, const char *args, int from_tty)
{
if (args)
error (_("Argument given to \"detach\" when remotely debugging."));
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 3753c00..e095035 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -817,7 +817,7 @@ gdbsim_close (void)
Use this when you want to detach and do something else with your gdb. */
static void
-gdbsim_detach (struct target_ops *ops, char *args, int from_tty)
+gdbsim_detach (struct target_ops *ops, const char *args, int from_tty)
{
if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "gdbsim_detach: args \"%s\"\n", args);
diff --git a/gdb/remote.c b/gdb/remote.c
index 7bd9b2a..f4667e3 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -133,8 +133,6 @@ static int remote_is_async_p (void);
static void remote_async (void (*callback) (enum inferior_event_type event_type,
void *context), void *context);
-static void remote_detach (struct target_ops *ops, char *args, int from_tty);
-
static void sync_remote_interrupt_twice (int signo);
static void interrupt_query (void);
@@ -4425,7 +4423,7 @@ remote_open_1 (char *name, int from_tty,
die when it hits one. */
static void
-remote_detach_1 (char *args, int from_tty, int extended)
+remote_detach_1 (const char *args, int from_tty, int extended)
{
int pid = ptid_get_pid (inferior_ptid);
struct remote_state *rs = get_remote_state ();
@@ -4469,13 +4467,13 @@ remote_detach_1 (char *args, int from_tty, int extended)
}
static void
-remote_detach (struct target_ops *ops, char *args, int from_tty)
+remote_detach (struct target_ops *ops, const char *args, int from_tty)
{
remote_detach_1 (args, from_tty, 0);
}
static void
-extended_remote_detach (struct target_ops *ops, char *args, int from_tty)
+extended_remote_detach (struct target_ops *ops, const char *args, int from_tty)
{
remote_detach_1 (args, from_tty, 1);
}
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 4a0de1f..b20134c 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -320,7 +320,7 @@ lwp_to_thread (ptid_t lwp)
program was started via the normal ptrace (PTRACE_TRACEME). */
static void
-sol_thread_detach (struct target_ops *ops, char *args, int from_tty)
+sol_thread_detach (struct target_ops *ops, const char *args, int from_tty)
{
struct target_ops *beneath = find_target_beneath (ops);
diff --git a/gdb/target.c b/gdb/target.c
index 7aeab79..86a5572 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -2612,7 +2612,7 @@ target_preopen (int from_tty)
/* Detach a target after doing deferred register stores. */
void
-target_detach (char *args, int from_tty)
+target_detach (const char *args, int from_tty)
{
struct target_ops* t;
@@ -3748,7 +3748,7 @@ init_dummy_target (void)
dummy_target.to_doc = "";
dummy_target.to_attach = find_default_attach;
dummy_target.to_detach =
- (void (*)(struct target_ops *, char *, int))target_ignore;
+ (void (*)(struct target_ops *, const char *, int))target_ignore;
dummy_target.to_create_inferior = find_default_create_inferior;
dummy_target.to_can_async_p = find_default_can_async_p;
dummy_target.to_is_async_p = find_default_is_async_p;
diff --git a/gdb/target.h b/gdb/target.h
index 56ca40c..df17be5 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -359,7 +359,7 @@ struct target_ops
void (*to_close) (void);
void (*to_attach) (struct target_ops *ops, char *, int);
void (*to_post_attach) (int);
- void (*to_detach) (struct target_ops *ops, char *, int);
+ void (*to_detach) (struct target_ops *ops, const char *, int);
void (*to_disconnect) (struct target_ops *, char *, int);
void (*to_resume) (struct target_ops *, ptid_t, int, enum gdb_signal);
ptid_t (*to_wait) (struct target_ops *,
@@ -949,7 +949,7 @@ void target_attach (char *, int);
typed by the user (e.g. a signal to send the process). FROM_TTY
says whether to be verbose or not. */
-extern void target_detach (char *, int);
+extern void target_detach (const char *, int);
/* Disconnect from the current target without resuming it (leaving it
waiting for a debugger). */
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 24b97ab..193a6d7 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -1866,7 +1866,7 @@ windows_attach (struct target_ops *ops, char *args, int from_tty)
}
static void
-windows_detach (struct target_ops *ops, char *args, int from_tty)
+windows_detach (struct target_ops *ops, const char *args, int from_tty)
{
int detached = 1;