diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2018-01-19 14:32:09 +0100 |
---|---|---|
committer | Markus Metzger <markus.t.metzger@intel.com> | 2018-02-09 14:03:20 +0100 |
commit | de6242d3075700ec4b73bdee583dc216f3a0b046 (patch) | |
tree | 1ec1bfd7c1cc4fc218cc6c3efcb66db3b6164c73 /gdb/target-delegates.c | |
parent | 9ee23a853c18da3c83530c7957464bc6b6e9fb16 (diff) | |
download | binutils-de6242d3075700ec4b73bdee583dc216f3a0b046.zip binutils-de6242d3075700ec4b73bdee583dc216f3a0b046.tar.gz binutils-de6242d3075700ec4b73bdee583dc216f3a0b046.tar.bz2 |
btrace, gdbserver: remove the to_supports_btrace target method
Remove the to_supports_btrace target method and instead rely on detecting errors
when trying to enable recording. This will also provide a suitable error
message explaining why recording is not possible.
For remote debugging, gdbserver will now always advertise branch tracing related
packets. When talking to an older GDB, this will cause GDB to try to enable
branch tracing and gdbserver to report a suitable error message every time.
An older gdbserver will not advertise branch tracing related packets if the
one-time check failed, so a newer GDB with this patch will fail to enable branch
tracing at remote_enable_btrace() rather than at btrace_enable(). The error
message is the same in both cases so there should be no user-visible change.
gdb/
* btrace.c (btrace_enable): Remove target_supports_btrace call.
* nat/linux-btrace.c (perf_event_pt_event_type): Move.
(kernel_supports_bts, kernel_supports_pt, linux_supports_bts)
(linux_supports_pt, linux_supports_btrace): Remove.
(linux_enable_bts): Call cpu_supports_bts.
* nat/linux-btrace.h (linux_supports_btrace): Remove.
* remote.c (remote_supports_btrace): Remove.
(init_remote_ops): Remove remote_supports_btrace.
* target-delegates.c: Regenerated.
* target.c (target_supports_btrace): Remove.
* target.h (target_ops) <to_supports_btrace>: Remove
(target_supports_btrace): Remove.
* x86-linux-nat.c (x86_linux_create_target): Remove
linux_supports_btrace.
gdbserver/
* linux-low.c (linux_target_ops): Remove linux_supports_btrace.
* nto-low.c (nto_target_ops): Remove NULL for supports_btrace.
* spu-low.c (spu_target_ops): Likewise.
* win32-low.c (win32_target_ops): Likewise.
* server.c (supported_btrace_packets): Report packets unconditionally.
* target.h (target_ops) <supports_btrace>: Remove.
(target_supports_btrace): Remove.
Diffstat (limited to 'gdb/target-delegates.c')
-rw-r--r-- | gdb/target-delegates.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c index 95ccef4..c7ebdbf 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -3458,35 +3458,6 @@ debug_can_use_agent (struct target_ops *self) return result; } -static int -delegate_supports_btrace (struct target_ops *self, enum btrace_format arg1) -{ - self = self->beneath; - return self->to_supports_btrace (self, arg1); -} - -static int -tdefault_supports_btrace (struct target_ops *self, enum btrace_format arg1) -{ - return 0; -} - -static int -debug_supports_btrace (struct target_ops *self, enum btrace_format arg1) -{ - int result; - fprintf_unfiltered (gdb_stdlog, "-> %s->to_supports_btrace (...)\n", debug_target.to_shortname); - result = debug_target.to_supports_btrace (&debug_target, arg1); - fprintf_unfiltered (gdb_stdlog, "<- %s->to_supports_btrace (", debug_target.to_shortname); - target_debug_print_struct_target_ops_p (&debug_target); - fputs_unfiltered (", ", gdb_stdlog); - target_debug_print_enum_btrace_format (arg1); - fputs_unfiltered (") = ", gdb_stdlog); - target_debug_print_int (result); - fputs_unfiltered ("\n", gdb_stdlog); - return result; -} - static struct btrace_target_info * delegate_enable_btrace (struct target_ops *self, ptid_t arg1, const struct btrace_config *arg2) { @@ -4458,8 +4429,6 @@ install_delegators (struct target_ops *ops) ops->to_use_agent = delegate_use_agent; if (ops->to_can_use_agent == NULL) ops->to_can_use_agent = delegate_can_use_agent; - if (ops->to_supports_btrace == NULL) - ops->to_supports_btrace = delegate_supports_btrace; if (ops->to_enable_btrace == NULL) ops->to_enable_btrace = delegate_enable_btrace; if (ops->to_disable_btrace == NULL) @@ -4647,7 +4616,6 @@ install_dummy_methods (struct target_ops *ops) ops->to_traceframe_info = tdefault_traceframe_info; ops->to_use_agent = tdefault_use_agent; ops->to_can_use_agent = tdefault_can_use_agent; - ops->to_supports_btrace = tdefault_supports_btrace; ops->to_enable_btrace = tdefault_enable_btrace; ops->to_disable_btrace = tdefault_disable_btrace; ops->to_teardown_btrace = tdefault_teardown_btrace; @@ -4808,7 +4776,6 @@ init_debug_target (struct target_ops *ops) ops->to_traceframe_info = debug_traceframe_info; ops->to_use_agent = debug_use_agent; ops->to_can_use_agent = debug_can_use_agent; - ops->to_supports_btrace = debug_supports_btrace; ops->to_enable_btrace = debug_enable_btrace; ops->to_disable_btrace = debug_disable_btrace; ops->to_teardown_btrace = debug_teardown_btrace; |