aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2008-08-19 13:05:02 +0000
committerVladimir Prus <vladimir@codesourcery.com>2008-08-19 13:05:02 +0000
commitc6ebd6cf9956565b8b2c3e14a54dea6c467f48d4 (patch)
treee35cffef73d4cdeba52ea413769fc16c33979a5f /gdb/remote.c
parent073120b913e2614f309c5b6d0c313308ed2b4c82 (diff)
downloadgdb-c6ebd6cf9956565b8b2c3e14a54dea6c467f48d4.zip
gdb-c6ebd6cf9956565b8b2c3e14a54dea6c467f48d4.tar.gz
gdb-c6ebd6cf9956565b8b2c3e14a54dea6c467f48d4.tar.bz2
* target.c (target_async_permitted, target_async_permitted_1)
(set_maintenance_target_async_permitted) (show_maintenance_target_async_permitted): New. (initialize_targets): Register 'set target-async'. * target.h (target_async_permitted): Declare. * linux-nat.c (linux_nat_async_enabled) (linux_nat_async_permitted, set_maintenance_linux_async_permitted) (show_maintenance_linux_async_permitted): Remove. (sigchld_handler, linux_nat_is_async_p, linux_nat_can_async_p) (get_pending_events, linux_nat_async): Use target_async_permitted. (linux_nat_set_async_mode): Remove, moving the only used bits into... (linux_nat_setup_async): This. (_initialize_linux_nat): Do not register 'maint set linux-async'. Use linux_nat_setup_async. * remote.c (remote_async_permitted, remote_async_permitted_set) (set_maintenance_remote_async_permitted) (show_maintenance_remote_async_permitted): Remove. (remote_open_1, remote_terminal_inferior, remote_can_async_p) (remote_is_async_p): Use target_async_permitted. (_initialize_remote): Don't register 'main set remote-async'. * mi/mi-cmds.c (mi_cmds): Register -list-target-features. * mi/mi-cmds.h (mi_cmd_list_target_features): New. * mi/mi-main.c (mi_cmd_list_target_features): New.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c54
1 files changed, 8 insertions, 46 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 2782d05..af3b0b8 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -209,33 +209,6 @@ static void show_remote_protocol_packet_cmd (struct ui_file *file,
void _initialize_remote (void);
-/* Controls if async mode is permitted. */
-static int remote_async_permitted = 0;
-
-static int remote_async_permitted_set = 0;
-
-static void
-set_maintenance_remote_async_permitted (char *args, int from_tty,
- struct cmd_list_element *c)
-{
- if (target_has_execution)
- {
- remote_async_permitted_set = remote_async_permitted; /* revert */
- error (_("Cannot change this setting while the inferior is running."));
- }
-
- remote_async_permitted = remote_async_permitted_set;
-}
-
-static void
-show_maintenance_remote_async_permitted (struct ui_file *file, int from_tty,
- struct cmd_list_element *c, const char *value)
-{
- fprintf_filtered (file, _("\
-Controlling the remote inferior in asynchronous mode is %s.\n"),
- value);
-}
-
/* For "remote". */
static struct cmd_list_element *remote_cmdlist;
@@ -2703,7 +2676,7 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target, int extended
"(e.g. /dev/ttyS0, /dev/ttya, COM1, etc.)."));
/* See FIXME above. */
- if (!remote_async_permitted)
+ if (!target_async_permitted)
wait_forever_enabled_p = 1;
/* If we're connected to a running target, target_preopen will kill it.
@@ -2824,7 +2797,7 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target, int extended
this before anything involving memory or registers. */
target_find_description ();
- if (remote_async_permitted)
+ if (target_async_permitted)
{
/* With this target we start out by owning the terminal. */
remote_async_terminal_ours_p = 1;
@@ -2869,13 +2842,13 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target, int extended
if (ex.reason < 0)
{
pop_target ();
- if (remote_async_permitted)
+ if (target_async_permitted)
wait_forever_enabled_p = 1;
throw_exception (ex);
}
}
- if (remote_async_permitted)
+ if (target_async_permitted)
wait_forever_enabled_p = 1;
if (extended_p)
@@ -3403,7 +3376,7 @@ Give up (and stop debugging it)? "))
static void
remote_terminal_inferior (void)
{
- if (!remote_async_permitted)
+ if (!target_async_permitted)
/* Nothing to do. */
return;
@@ -3433,7 +3406,7 @@ remote_terminal_inferior (void)
static void
remote_terminal_ours (void)
{
- if (!remote_async_permitted)
+ if (!target_async_permitted)
/* Nothing to do. */
return;
@@ -7265,7 +7238,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
static int
remote_can_async_p (void)
{
- if (!remote_async_permitted)
+ if (!target_async_permitted)
/* We only enable async when the user specifically asks for it. */
return 0;
@@ -7276,7 +7249,7 @@ remote_can_async_p (void)
static int
remote_is_async_p (void)
{
- if (!remote_async_permitted)
+ if (!target_async_permitted)
/* We only enable async when the user specifically asks for it. */
return 0;
@@ -7630,17 +7603,6 @@ Set the remote pathname for \"run\""), _("\
Show the remote pathname for \"run\""), NULL, NULL, NULL,
&remote_set_cmdlist, &remote_show_cmdlist);
- add_setshow_boolean_cmd ("remote-async", class_maintenance,
- &remote_async_permitted_set, _("\
-Set whether gdb controls the remote inferior in asynchronous mode."), _("\
-Show whether gdb controls the remote inferior in asynchronous mode."), _("\
-Tells gdb whether to control the remote inferior in asynchronous mode."),
- set_maintenance_remote_async_permitted,
- show_maintenance_remote_async_permitted,
- &maintenance_set_cmdlist,
- &maintenance_show_cmdlist);
-
-
/* Eventually initialize fileio. See fileio.c */
initialize_remote_fileio (remote_set_cmdlist, remote_show_cmdlist);