aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.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/target.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/target.c')
-rw-r--r--gdb/target.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 575415b..e469905 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -3133,6 +3133,35 @@ maintenance_print_target_stack (char *cmd, int from_tty)
}
}
+/* Controls if async mode is permitted. */
+int target_async_permitted = 0;
+
+/* The set command writes to this variable. If the inferior is
+ executing, linux_nat_async_permitted is *not* updated. */
+static int target_async_permitted_1 = 0;
+
+static void
+set_maintenance_target_async_permitted (char *args, int from_tty,
+ struct cmd_list_element *c)
+{
+ if (target_has_execution)
+ {
+ target_async_permitted_1 = target_async_permitted;
+ error (_("Cannot change this setting while the inferior is running."));
+ }
+
+ target_async_permitted = target_async_permitted_1;
+}
+
+static void
+show_maintenance_target_async_permitted (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c,
+ const char *value)
+{
+ fprintf_filtered (file, _("\
+Controlling the inferior in asynchronous mode is %s.\n"), value);
+}
+
void
initialize_targets (void)
{
@@ -3170,5 +3199,15 @@ result in significant performance improvement for remote targets."),
_("Print the name of each layer of the internal target stack."),
&maintenanceprintlist);
+ add_setshow_boolean_cmd ("target-async", no_class,
+ &target_async_permitted_1, _("\
+Set whether gdb controls the inferior in asynchronous mode."), _("\
+Show whether gdb controls the inferior in asynchronous mode."), _("\
+Tells gdb whether to control the inferior in asynchronous mode."),
+ set_maintenance_target_async_permitted,
+ show_maintenance_target_async_permitted,
+ &setlist,
+ &showlist);
+
target_dcache = dcache_init ();
}