From 9908b56683c3fce81b58ff5ee888741790f516d0 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 19 Aug 2008 13:22:14 +0000 Subject: Make sure target supports non-stop. * infcmd.c (run_command_1, attach_command): If non-stop mode is requested, verify the target supports it. * linux-nat.c (linux_nat_supports_non_stop): New. (linux_nat_add_target): Register the above. * target.c (find_default_supports_non_stop) (target_supports_non_stop): New. (init_dummy_target): Register find_default_supports_non_stop. * target.h (struct target_ops): New field to_supports_non_stop. (target_supports_non_stop): New. --- gdb/target.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'gdb/target.c') diff --git a/gdb/target.c b/gdb/target.c index e469905..1f65819 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -2126,6 +2126,29 @@ find_default_is_async_p (void) return 0; } +int +find_default_supports_non_stop (void) +{ + struct target_ops *t; + + t = find_default_run_target (NULL); + if (t && t->to_supports_non_stop) + return (t->to_supports_non_stop) (); + return 0; +} + +int +target_supports_non_stop () +{ + struct target_ops *t; + for (t = ¤t_target; t != NULL; t = t->beneath) + if (t->to_supports_non_stop) + return t->to_supports_non_stop (); + + return 0; +} + + static int default_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) { @@ -2400,6 +2423,7 @@ init_dummy_target (void) 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; + dummy_target.to_supports_non_stop = find_default_supports_non_stop; dummy_target.to_pid_to_str = normal_pid_to_str; dummy_target.to_stratum = dummy_stratum; dummy_target.to_find_memory_regions = dummy_find_memory_regions; -- cgit v1.1