From 0b5a271985687f3cfaf22a301e5ad4600df1302b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 18 Dec 2013 10:55:34 -0700 Subject: [PATCH] convert to_find_memory_regions 2014-02-19 Tom Tromey * target-delegates.c: Rebuild. * target.c (update_current_target): Don't inherit or default to_find_memory_regions. (init_dummy_target): Don't initialize to_find_memory_regions. * target.h (struct target_ops) : Use TARGET_DEFAULT_FUNC. --- gdb/ChangeLog | 9 +++++++++ gdb/target-delegates.c | 10 ++++++++++ gdb/target.c | 7 +++++-- gdb/target.h | 3 ++- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e3ec9ac34d..f91a1bac7c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2014-02-19 Tom Tromey + + * target-delegates.c: Rebuild. + * target.c (update_current_target): Don't inherit or default + to_find_memory_regions. + (init_dummy_target): Don't initialize to_find_memory_regions. + * target.h (struct target_ops) : Use + TARGET_DEFAULT_FUNC. + 2014-02-19 Tom Tromey * target-delegates.c: Rebuild. diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c index 600e64ecb0..301b07aa3c 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -511,6 +511,13 @@ tdefault_async (struct target_ops *self, async_callback_ftype *arg1, void *arg2) tcomplain (); } +static int +delegate_find_memory_regions (struct target_ops *self, find_memory_region_ftype arg1, void *arg2) +{ + self = self->beneath; + return self->to_find_memory_regions (self, arg1, arg2); +} + static enum target_xfer_status delegate_xfer_partial (struct target_ops *self, enum target_object arg1, const char *arg2, gdb_byte *arg3, const gdb_byte *arg4, ULONGEST arg5, ULONGEST arg6, ULONGEST *arg7) { @@ -628,6 +635,8 @@ install_delegators (struct target_ops *ops) ops->to_is_async_p = delegate_is_async_p; if (ops->to_async == NULL) ops->to_async = delegate_async; + if (ops->to_find_memory_regions == NULL) + ops->to_find_memory_regions = delegate_find_memory_regions; if (ops->to_xfer_partial == NULL) ops->to_xfer_partial = delegate_xfer_partial; if (ops->to_supports_btrace == NULL) @@ -681,6 +690,7 @@ install_dummy_methods (struct target_ops *ops) ops->to_can_async_p = find_default_can_async_p; ops->to_is_async_p = find_default_is_async_p; ops->to_async = tdefault_async; + ops->to_find_memory_regions = dummy_find_memory_regions; ops->to_xfer_partial = tdefault_xfer_partial; ops->to_supports_btrace = tdefault_supports_btrace; } diff --git a/gdb/target.c b/gdb/target.c index db6771ec93..767bcad2a4 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -78,6 +78,10 @@ static target_xfer_partial_ftype default_xfer_partial; static struct gdbarch *default_thread_architecture (struct target_ops *ops, ptid_t ptid); +static int dummy_find_memory_regions (struct target_ops *self, + find_memory_region_ftype ignore1, + void *ignore2); + static int find_default_can_async_p (struct target_ops *ignore); static int find_default_is_async_p (struct target_ops *ignore); @@ -661,7 +665,7 @@ update_current_target (void) /* Do not inherit to_can_async_p. */ /* Do not inherit to_is_async_p. */ /* Do not inherit to_async. */ - INHERIT (to_find_memory_regions, t); + /* Do not inherit to_find_memory_regions. */ INHERIT (to_make_corefile_notes, t); INHERIT (to_get_bookmark, t); INHERIT (to_goto_bookmark, t); @@ -3703,7 +3707,6 @@ init_dummy_target (void) = find_default_supports_disable_randomization; dummy_target.to_pid_to_str = dummy_pid_to_str; dummy_target.to_stratum = dummy_stratum; - dummy_target.to_find_memory_regions = dummy_find_memory_regions; dummy_target.to_make_corefile_notes = dummy_make_corefile_notes; dummy_target.to_get_bookmark = dummy_get_bookmark; dummy_target.to_goto_bookmark = dummy_goto_bookmark; diff --git a/gdb/target.h b/gdb/target.h index a1259c8a82..35b95c6aa0 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -582,7 +582,8 @@ struct target_ops int (*to_supports_non_stop) (struct target_ops *); /* find_memory_regions support method for gcore */ int (*to_find_memory_regions) (struct target_ops *, - find_memory_region_ftype func, void *data); + find_memory_region_ftype func, void *data) + TARGET_DEFAULT_FUNC (dummy_find_memory_regions); /* make_corefile_notes support method for gcore */ char * (*to_make_corefile_notes) (struct target_ops *, bfd *, int *); /* get_bookmark support method for bookmarks */ -- 2.34.1