btrace: add format argument to supports_btrace

Add a format argument to the various supports_btrace functions to check
for support of a specific btrace format.  This is to prepare for a new
format.

Removed two redundant calls.  The check will be made in the subsequent
btrace_enable call.

2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>

	* btrace.c (btrace_enable): Pass BTRACE_FORMAT_BTS.
	* record-btrace.c (record_btrace_open): Remove call to
	target_supports_btrace.
	* remote.c (remote_supports_btrace): Update parameters.
	* target.c (target_supports_btrace): Update parameters.
	* target.h (to_supports_btrace, target_supports_btrace): Update
	parameters.
	* target-delegates.c: Regenerate.
	* target-debug.h (target_debug_print_enum_btrace_format): New.
	* nat/linux-btrace.c
	(kernel_supports_btrace): Rename into ...
	(kernel_supports_bts): ... this.  Update users.  Update warning text.
	(intel_supports_btrace): Rename into ...
	(intel_supports_bts): ... this.  Update users.
	(cpu_supports_btrace): Rename into ...
	(cpu_supports_bts): ... this.  Update users.
	(linux_supports_btrace): Update parameters.  Split into this and ...
	(linux_supports_bts): ... this.
	* nat/linux-btrace.h (linux_supports_btrace): Update parameters.

gdbserver/
	* server.c (handle_btrace_general_set): Remove call to
	target_supports_btrace.
	(supported_btrace_packets): New.
	(handle_query): Call supported_btrace_packets.
	* target.h: include btrace-common.h.
	(btrace_target_info): Removed.
	(supports_btrace, target_supports_btrace): Update parameters.
This commit is contained in:
Markus Metzger 2014-01-17 13:29:19 +01:00
parent 734b0e4bda
commit 043c357797
13 changed files with 120 additions and 53 deletions

View file

@ -3085,26 +3085,28 @@ debug_can_use_agent (struct target_ops *self)
}
static int
delegate_supports_btrace (struct target_ops *self)
delegate_supports_btrace (struct target_ops *self, enum btrace_format arg1)
{
self = self->beneath;
return self->to_supports_btrace (self);
return self->to_supports_btrace (self, arg1);
}
static int
tdefault_supports_btrace (struct target_ops *self)
tdefault_supports_btrace (struct target_ops *self, enum btrace_format arg1)
{
return 0;
}
static int
debug_supports_btrace (struct target_ops *self)
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);
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);