Code cleanup.
* defs.h (find_memory_region_ftype): New typedef.
(exec_set_find_memory_regions): Use it.
* exec.c (exec_set_find_memory_regions): Use find_memory_region_ftype.
* fbsd-nat.c (fbsd_find_memory_regions): Likewise.
* gcore.c (objfile_find_memory_regions): Likewise.
* gnu-nat.c (gnu_find_memory_regions): Likewise.
* linux-nat.c (linux_nat_find_memory_regions): Likewise.
* procfs.c (iterate_over_mappings_cb_ftype): Remove.
(iterate_over_mappings): Rename iterate_over_mappings_cb_ftype to
find_memory_region_ftype.
(insert_dbx_link_bpt_in_region): Likewise.
(iterate_over_mappings): Likewise. Drop the comment part about the
function prototype.
(find_memory_regions_callback): Use find_memory_region_ftype.
(proc_find_memory_regions): Likewise.
(info_mappings_callback): Rename iterate_over_mappings_cb_ftype to
find_memory_region_ftype.
* target.c (dummy_find_memory_regions): Use find_memory_region_ftype.
* target.h (struct target_ops) <to_find_memory_regions>: Likewise.
+2010-08-31 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Code cleanup.
+ * defs.h (find_memory_region_ftype): New typedef.
+ (exec_set_find_memory_regions): Use it.
+ * exec.c (exec_set_find_memory_regions): Use find_memory_region_ftype.
+ * fbsd-nat.c (fbsd_find_memory_regions): Likewise.
+ * gcore.c (objfile_find_memory_regions): Likewise.
+ * gnu-nat.c (gnu_find_memory_regions): Likewise.
+ * linux-nat.c (linux_nat_find_memory_regions): Likewise.
+ * procfs.c (iterate_over_mappings_cb_ftype): Remove.
+ (iterate_over_mappings): Rename iterate_over_mappings_cb_ftype to
+ find_memory_region_ftype.
+ (insert_dbx_link_bpt_in_region): Likewise.
+ (iterate_over_mappings): Likewise. Drop the comment part about the
+ function prototype.
+ (find_memory_regions_callback): Use find_memory_region_ftype.
+ (proc_find_memory_regions): Likewise.
+ (info_mappings_callback): Rename iterate_over_mappings_cb_ftype to
+ find_memory_region_ftype.
+ * target.c (dummy_find_memory_regions): Use find_memory_region_ftype.
+ * target.h (struct target_ops) <to_find_memory_regions>: Likewise.
+
2010-08-31 Sami Wagiaalla <swagiaal@redhat.com>
* psymtab.c (add_psymbol_to_bcache): Remove 'static' from
/* From exec.c */
+typedef int (*find_memory_region_ftype) (CORE_ADDR addr, unsigned long size,
+ int read, int write, int exec,
+ void *data);
+
/* Take over the 'find_mapped_memory' vector from exec.c. */
-extern void exec_set_find_memory_regions (int (*) (int (*) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
- void *));
+extern void exec_set_find_memory_regions
+ (int (*func) (find_memory_region_ftype func, void *data));
/* Possible lvalue types. Like enum language, this should be in
value.h, but needs to be here for the same reason. */
/* Find mapped memory. */
extern void
-exec_set_find_memory_regions (int (*func) (int (*) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
- void *))
+exec_set_find_memory_regions (int (*func) (find_memory_region_ftype, void *))
{
exec_ops.to_find_memory_regions = func;
}
argument to FUNC. */
int
-fbsd_find_memory_regions (int (*func) (CORE_ADDR, unsigned long,
- int, int, int, void *),
- void *obfd)
+fbsd_find_memory_regions (find_memory_region_ftype func, void *obfd)
{
pid_t pid = ptid_get_pid (inferior_ptid);
char *mapfilename;
}
static int
-objfile_find_memory_regions (int (*func) (CORE_ADDR, unsigned long,
- int, int, int, void *),
- void *obfd)
+objfile_find_memory_regions (find_memory_region_ftype func, void *obfd)
{
/* Use objfile data to create memory sections. */
struct objfile *objfile;
/* Call FUNC on each memory region in the task. */
static int
-gnu_find_memory_regions (int (*func) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
- void *data)
+gnu_find_memory_regions (find_memory_region_ftype func, void *data)
{
error_t err;
task_t task;
regions in the inferior for a corefile. */
static int
-linux_nat_find_memory_regions (int (*func) (CORE_ADDR,
- unsigned long,
- int, int, int, void *), void *obfd)
+linux_nat_find_memory_regions (find_memory_region_ftype func, void *obfd)
{
int pid = PIDGET (inferior_ptid);
char mapsfilename[MAXPATHLEN];
static int find_syscall (procinfo *pi, char *name);
#endif /* DYNAMIC_SYSCALLS */
-/* A function type used as a callback back iterate_over_mappings. */
-typedef int (iterate_over_mappings_cb_ftype)
- (CORE_ADDR vaddr, unsigned long size, int read, int write, int execute,
- void *data);
-
static int iterate_over_mappings
- (procinfo *pi,
- iterate_over_mappings_cb_ftype *child_func,
- void *data,
- int (*func) (struct prmap *map,
- iterate_over_mappings_cb_ftype *child_func,
+ (procinfo *pi, find_memory_region_ftype child_func, void *data,
+ int (*func) (struct prmap *map, find_memory_region_ftype child_func,
void *data));
/* The head of the procinfo list: */
static int
insert_dbx_link_bpt_in_region (struct prmap *map,
- iterate_over_mappings_cb_ftype *child_func,
+ find_memory_region_ftype child_func,
void *data)
{
procinfo *pi = (procinfo *) data;
from the callback function, or zero. */
static int
-iterate_over_mappings (procinfo *pi,
- iterate_over_mappings_cb_ftype *child_func,
+iterate_over_mappings (procinfo *pi, find_memory_region_ftype child_func,
void *data,
int (*func) (struct prmap *map,
- iterate_over_mappings_cb_ftype *child_func,
+ find_memory_region_ftype child_func,
void *data))
{
char pathname[MAX_PROC_NAME_SIZE];
}
/* Implements the to_find_memory_regions method. Calls an external
- function for each memory region. The external function will have
- the signature:
-
- int callback (CORE_ADDR vaddr,
- unsigned long size,
- int read, int write, int execute,
- void *data);
-
+ function for each memory region.
Returns the integer value returned by the callback. */
static int
find_memory_regions_callback (struct prmap *map,
- int (*func) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
- void *data)
+ find_memory_region_ftype func, void *data)
{
return (*func) ((CORE_ADDR) map->pr_vaddr,
map->pr_size,
the callback. */
static int
-proc_find_memory_regions (int (*func) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
- void *data)
+proc_find_memory_regions (find_memory_region_ftype func, void *data)
{
procinfo *pi = find_procinfo_or_die (PIDGET (inferior_ptid), 0);
mappings'. */
static int
-info_mappings_callback (struct prmap *map,
- iterate_over_mappings_cb_ftype *ignore,
+info_mappings_callback (struct prmap *map, find_memory_region_ftype ignore,
void *unused)
{
unsigned int pr_off;
/* Error-catcher for target_find_memory_regions. */
static int
-dummy_find_memory_regions (int (*ignore1) (), void *ignore2)
+dummy_find_memory_regions (find_memory_region_ftype ignore1, void *ignore2)
{
error (_("Command not implemented for this target."));
return 0;
int (*to_async_mask) (int);
int (*to_supports_non_stop) (void);
/* find_memory_regions support method for gcore */
- int (*to_find_memory_regions) (int (*) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
- void *);
+ int (*to_find_memory_regions) (find_memory_region_ftype func, void *data);
/* make_corefile_notes support method for gcore */
char * (*to_make_corefile_notes) (bfd *, int *);
/* get_bookmark support method for bookmarks */