diff options
author | Tom Tromey <tromey@redhat.com> | 2013-12-18 14:11:53 -0700 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2014-02-19 07:47:55 -0700 |
commit | 9249843f19916f0ba5d02749b0811765babf527a (patch) | |
tree | cde5c92d0d534e7e0525d8c5b194663fe17bf6b8 | |
parent | ace92e7d1435c46e3085f1183f957ab372b1f4a8 (diff) | |
download | gdb-9249843f19916f0ba5d02749b0811765babf527a.zip gdb-9249843f19916f0ba5d02749b0811765babf527a.tar.gz gdb-9249843f19916f0ba5d02749b0811765babf527a.tar.bz2 |
convert to_get_min_fast_tracepoint_insn_len
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_get_min_fast_tracepoint_insn_len.
(return_minus_one): Remove.
* target.h (struct target_ops)
<to_get_min_fast_tracepoint_insn_len>: Use TARGET_DEFAULT_RETURN.
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/target-delegates.c | 16 | ||||
-rw-r--r-- | gdb/target.c | 13 | ||||
-rw-r--r-- | gdb/target.h | 3 |
4 files changed, 28 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d560ad6..57dfaf2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -2,6 +2,15 @@ * target-delegates.c: Rebuild. * target.c (update_current_target): Don't inherit or default + to_get_min_fast_tracepoint_insn_len. + (return_minus_one): Remove. + * target.h (struct target_ops) + <to_get_min_fast_tracepoint_insn_len>: Use TARGET_DEFAULT_RETURN. + +2014-02-19 Tom Tromey <tromey@redhat.com> + + * target-delegates.c: Rebuild. + * target.c (update_current_target): Don't inherit or default to_get_raw_trace_data. * target.h (struct target_ops) <to_get_raw_trace_data>: Use TARGET_DEFAULT_NORETURN. diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c index cdf2905..ae9e567 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -859,6 +859,19 @@ tdefault_get_raw_trace_data (struct target_ops *self, gdb_byte *arg1, ULONGEST a } static int +delegate_get_min_fast_tracepoint_insn_len (struct target_ops *self) +{ + self = self->beneath; + return self->to_get_min_fast_tracepoint_insn_len (self); +} + +static int +tdefault_get_min_fast_tracepoint_insn_len (struct target_ops *self) +{ + return -1; +} + +static int delegate_supports_btrace (struct target_ops *self) { self = self->beneath; @@ -1020,6 +1033,8 @@ install_delegators (struct target_ops *ops) ops->to_upload_trace_state_variables = delegate_upload_trace_state_variables; if (ops->to_get_raw_trace_data == NULL) ops->to_get_raw_trace_data = delegate_get_raw_trace_data; + if (ops->to_get_min_fast_tracepoint_insn_len == NULL) + ops->to_get_min_fast_tracepoint_insn_len = delegate_get_min_fast_tracepoint_insn_len; if (ops->to_supports_btrace == NULL) ops->to_supports_btrace = delegate_supports_btrace; } @@ -1100,5 +1115,6 @@ install_dummy_methods (struct target_ops *ops) ops->to_upload_tracepoints = tdefault_upload_tracepoints; ops->to_upload_trace_state_variables = tdefault_upload_trace_state_variables; ops->to_get_raw_trace_data = tdefault_get_raw_trace_data; + ops->to_get_min_fast_tracepoint_insn_len = tdefault_get_min_fast_tracepoint_insn_len; ops->to_supports_btrace = tdefault_supports_btrace; } diff --git a/gdb/target.c b/gdb/target.c index 8caa720..bfbf5fd 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -66,8 +66,6 @@ static int nomemory (CORE_ADDR, char *, int, int, struct target_ops *); static int return_zero (void); -static int return_minus_one (void); - static void *return_null (void); void target_ignore (void); @@ -705,7 +703,7 @@ update_current_target (void) /* Do not inherit to_upload_tracepoints. */ /* Do not inherit to_upload_trace_state_variables. */ /* Do not inherit to_get_raw_trace_data. */ - INHERIT (to_get_min_fast_tracepoint_insn_len, t); + /* Do not inherit to_get_min_fast_tracepoint_insn_len. */ INHERIT (to_set_disconnected_tracing, t); INHERIT (to_set_circular_trace_buffer, t); INHERIT (to_set_trace_buffer_size, t); @@ -752,9 +750,6 @@ update_current_target (void) (void (*) (struct target_ops *, ptid_t)) target_ignore); current_target.to_read_description = NULL; - de_fault (to_get_min_fast_tracepoint_insn_len, - (int (*) (struct target_ops *)) - return_minus_one); de_fault (to_set_disconnected_tracing, (void (*) (struct target_ops *, int)) target_ignore); @@ -3510,12 +3505,6 @@ return_zero (void) return 0; } -static int -return_minus_one (void) -{ - return -1; -} - static void * return_null (void) { diff --git a/gdb/target.h b/gdb/target.h index 9fe5991..3cdb028 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -888,7 +888,8 @@ struct target_ops may be set on the target. If this operation is unsupported, return -1. If for some reason the minimum length cannot be determined, return 0. */ - int (*to_get_min_fast_tracepoint_insn_len) (struct target_ops *); + int (*to_get_min_fast_tracepoint_insn_len) (struct target_ops *) + TARGET_DEFAULT_RETURN (-1); /* Set the target's tracing behavior in response to unexpected disconnection - set VAL to 1 to keep tracing, 0 to stop. */ |