aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2003-06-17 20:28:14 +0000
committerDaniel Jacobowitz <drow@false.org>2003-06-17 20:28:14 +0000
commit6ad8ae5c579e2e6198870b21d10459edba9457ca (patch)
tree9d71b7266e55d4d44bf3a28736465e9f2d7132bc /gdb/target.c
parent687595f963bb32dd89d85bdf91e7ca6aa3187502 (diff)
downloadgdb-6ad8ae5c579e2e6198870b21d10459edba9457ca.zip
gdb-6ad8ae5c579e2e6198870b21d10459edba9457ca.tar.gz
gdb-6ad8ae5c579e2e6198870b21d10459edba9457ca.tar.bz2
gdb/
* NEWS: Mention gdbserver detach change and "disconnect" command. * infcmd.c (disconnect_command): New function. (_initialize_infcmd): Add ``disconnect'' command. * remote.c (remote_async_detach): Delete. (remote_detach): Merge remote_async_detach. (remote_disconnect): New. (init_remote_ops): Set to_disconnect. (init_remote_cisco_ops): Likewise. (init_remote_async_ops): Likewise. Use remote_detach. * target.c (cleanup_target): Default to_disconnect. (update_current_target): Inherit to_disconnect. (target_disconnect, debug_to_disconnect): New functions. (setup_target_debug): Set to_disconnect. * target.h (struct target_ops): Add to_disconnect. (target_disconnect): Add prototype. gdbserver/ * linux-low.c: Move comment to linux_thread_alive where it belonged. (linux_detach_one_process, linux_detach): New functions. (linux_target_ops): Add linux_detach. * server.c (main): Handle 'D' packet. * target.h (struct target_ops): Add "detach" member. (detach_inferior): Define. mi/ * mi-cmds.c (mi_cmds): Add "-target-disconnect".
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c
index fd0165a..e738208 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -95,6 +95,8 @@ static void debug_to_attach (char *, int);
static void debug_to_detach (char *, int);
+static void debug_to_disconnect (char *, int);
+
static void debug_to_resume (ptid_t, int, enum target_signal);
static ptid_t debug_to_wait (ptid_t, struct target_waitstatus *);
@@ -371,6 +373,9 @@ cleanup_target (struct target_ops *t)
de_fault (to_detach,
(void (*) (char *, int))
target_ignore);
+ de_fault (to_disconnect,
+ (void (*) (char *, int))
+ tcomplain);
de_fault (to_resume,
(void (*) (ptid_t, int, enum target_signal))
noprocess);
@@ -556,6 +561,7 @@ update_current_target (void)
INHERIT (to_attach, t);
INHERIT (to_post_attach, t);
INHERIT (to_detach, t);
+ INHERIT (to_disconnect, t);
INHERIT (to_resume, t);
INHERIT (to_wait, t);
INHERIT (to_post_wait, t);
@@ -1141,6 +1147,16 @@ target_detach (char *args, int from_tty)
}
void
+target_disconnect (char *args, int from_tty)
+{
+ /* Handle any optimized stores to the inferior. */
+#ifdef DO_DEFERRED_STORES
+ DO_DEFERRED_STORES;
+#endif
+ (current_target.to_disconnect) (args, from_tty);
+}
+
+void
target_link (char *modname, CORE_ADDR *t_reloc)
{
if (STREQ (current_target.to_shortname, "rombug"))
@@ -1562,6 +1578,15 @@ debug_to_detach (char *args, int from_tty)
}
static void
+debug_to_disconnect (char *args, int from_tty)
+{
+ debug_target.to_disconnect (args, from_tty);
+
+ fprintf_unfiltered (gdb_stdlog, "target_disconnect (%s, %d)\n",
+ args, from_tty);
+}
+
+static void
debug_to_resume (ptid_t ptid, int step, enum target_signal siggnal)
{
debug_target.to_resume (ptid, step, siggnal);
@@ -2202,6 +2227,7 @@ setup_target_debug (void)
current_target.to_attach = debug_to_attach;
current_target.to_post_attach = debug_to_post_attach;
current_target.to_detach = debug_to_detach;
+ current_target.to_disconnect = debug_to_disconnect;
current_target.to_resume = debug_to_resume;
current_target.to_wait = debug_to_wait;
current_target.to_post_wait = debug_to_post_wait;