diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2008-08-19 13:22:14 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2008-08-19 13:22:14 +0000 |
commit | 9908b56683c3fce81b58ff5ee888741790f516d0 (patch) | |
tree | 05b062f89b7a634c46c5830d54824e00df366c40 /gdb/target.c | |
parent | c6ebd6cf9956565b8b2c3e14a54dea6c467f48d4 (diff) | |
download | gdb-9908b56683c3fce81b58ff5ee888741790f516d0.zip gdb-9908b56683c3fce81b58ff5ee888741790f516d0.tar.gz gdb-9908b56683c3fce81b58ff5ee888741790f516d0.tar.bz2 |
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.
Diffstat (limited to 'gdb/target.c')
-rw-r--r-- | gdb/target.c | 24 |
1 files changed, 24 insertions, 0 deletions
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; |