From 2e73927ca515996146d2b20d8e6f0b39c0a51b29 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 17 Dec 2013 21:35:39 -0700 Subject: Add target_ops argument to to_find_memory_regions 2014-02-19 Tom Tromey * target.h (struct target_ops) : Add argument. (target_find_memory_regions): Add argument. * target.c (dummy_find_memory_regions): Add 'self' argument. * procfs.c (proc_find_memory_regions): Add 'self' argument. * gnu-nat.c (gnu_find_memory_regions): Add 'self' argument. * fbsd-nat.h (fbsd_find_memory_regions): Add 'self' argument. * fbsd-nat.c (fbsd_find_memory_regions): Add 'self' argument. * exec. (exec_do_find_memory_regions): New global. (exec_set_find_memory_regions): Rewrite. (exec_find_memory_regions): New function. (init_exec_ops): Use exec_find_memory_regions. --- gdb/exec.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'gdb/exec.c') diff --git a/gdb/exec.c b/gdb/exec.c index 1885afd..f3df4b1 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -62,6 +62,10 @@ void _initialize_exec (void); struct target_ops exec_ops; +/* Function used to implement to_find_memory_regions. */ + +static int (*exec_do_find_memory_regions) (find_memory_region_ftype, void *); + /* True if the exec target is pushed on the stack. */ static int using_exec_ops; @@ -835,7 +839,14 @@ exec_has_memory (struct target_ops *ops) extern void exec_set_find_memory_regions (int (*func) (find_memory_region_ftype, void *)) { - exec_ops.to_find_memory_regions = func; + exec_do_find_memory_regions = func; +} + +static int +exec_find_memory_regions (struct target_ops *self, + find_memory_region_ftype func, void *data) +{ + return exec_do_find_memory_regions (func, data); } static char *exec_make_note_section (bfd *, int *); @@ -862,6 +873,7 @@ Specify the filename of the executable file."; exec_ops.to_stratum = file_stratum; exec_ops.to_has_memory = exec_has_memory; exec_ops.to_make_corefile_notes = exec_make_note_section; + exec_ops.to_find_memory_regions = exec_find_memory_regions; exec_ops.to_magic = OPS_MAGIC; } -- cgit v1.1