diff options
-rw-r--r-- | gdb/ChangeLog | 24 | ||||
-rw-r--r-- | gdb/defs.h | 2 | ||||
-rw-r--r-- | gdb/exec.c | 2 | ||||
-rw-r--r-- | gdb/fbsd-proc.c | 4 | ||||
-rw-r--r-- | gdb/gcore.c | 8 | ||||
-rw-r--r-- | gdb/gnu-nat.c | 3 | ||||
-rw-r--r-- | gdb/inftarg.c | 2 | ||||
-rw-r--r-- | gdb/linux-proc.c | 15 | ||||
-rw-r--r-- | gdb/procfs.c | 12 | ||||
-rw-r--r-- | gdb/sol-thread.c | 2 | ||||
-rw-r--r-- | gdb/target.h | 2 |
11 files changed, 58 insertions, 18 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index aedcf454dbc..1f99b6ce13f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,29 @@ 2003-09-29 Elena Zannoni <ezannoni@redhat.com> + * exec.c (exec_set_find_memory_regions): Update parameter list. + * defs.h (exec_set_find_memory_regions): Update parameter list. + * fbsd-proc.c (fbsd_find_memory_regions): Likewise. Update call to + function parameter. + * gcore.c (gcore_create_callback): Update paramter list. + (objfile_find_memory_regions): Update parameter list. Update calls + to function parameter. + * gnu-nat.c (gnu_find_memory_regions): Update parameter + list. Update calls to function parameter. + * inftarg.c (inftarg_set_find_memory_regions): Update parameter + list. + * linux-proc.c (read_mapping): Prune the leading whitespaces in + the filename. + (linux_find_memory_regions): Update parameter list. Update call to + function parameter. + * procfs.c (find_memory_regions_callback): Update paremeters and + calls. + (proc_find_memory_regions): Update parameters. + * sol-thread.c (sol_find_memory_regions): Update parameter list. + * target.h (struct target_ops): Update definition of + to_find_memory_regions field. + +2003-09-29 Elena Zannoni <ezannoni@redhat.com> + * solib-svr4.c: Include gdbcmd.h. (debug_solib): New variable. (elf_locate_base): Add some debugging statements. diff --git a/gdb/defs.h b/gdb/defs.h index 842f4d8b430..24758b8bb37 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -607,7 +607,7 @@ extern void exec_set_section_offsets (bfd_signed_vma text_off, extern void exec_set_find_memory_regions (int (*) (int (*) (CORE_ADDR, unsigned long, int, int, int, - void *), + char *, void *), void *)); /* Possible lvalue types. Like enum language, this should be in diff --git a/gdb/exec.c b/gdb/exec.c index 468b0ea299b..6df806e7564 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -700,7 +700,7 @@ extern void exec_set_find_memory_regions (int (*func) (int (*) (CORE_ADDR, unsigned long, int, int, int, - void *), + char *, void *), void *)) { exec_ops.to_find_memory_regions = func; diff --git a/gdb/fbsd-proc.c b/gdb/fbsd-proc.c index 6c47979650a..2201a453fe3 100644 --- a/gdb/fbsd-proc.c +++ b/gdb/fbsd-proc.c @@ -75,7 +75,7 @@ static int fbsd_find_memory_regions (int (*func) (CORE_ADDR, unsigned long, int, int, int, - void *), + char *, void *), void *obfd) { pid_t pid = ptid_get_pid (inferior_ptid); @@ -114,7 +114,7 @@ fbsd_find_memory_regions (int (*func) (CORE_ADDR, } /* Invoke the callback function to create the corefile segment. */ - func (start, size, read, write, exec, obfd); + func (start, size, read, write, exec, NULL, obfd); } fclose (mapfile); diff --git a/gdb/gcore.c b/gdb/gcore.c index 5bf09fdbe60..d1237a98f84 100644 --- a/gdb/gcore.c +++ b/gdb/gcore.c @@ -338,7 +338,8 @@ make_mem_sec (bfd *obfd, bfd_vma addr, bfd_size_type size, static int gcore_create_callback (CORE_ADDR vaddr, unsigned long size, - int read, int write, int exec, void *data) + int read, int write, int exec, char *filename, + void *data) { flagword flags = 0; @@ -360,7 +361,7 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size, static int objfile_find_memory_regions (int (*func) (CORE_ADDR, unsigned long, - int, int, int, void *), + int, int, int, char *, void *), void *obfd) { /* Use objfile data to create memory sections. */ @@ -385,6 +386,7 @@ objfile_find_memory_regions (int (*func) (CORE_ADDR, unsigned long, 1, /* All sections will be readable. */ (flags & SEC_READONLY) == 0, /* Writable. */ (flags & SEC_CODE) != 0, /* Executable. */ + NULL, obfd); if (ret != 0) return ret; @@ -397,6 +399,7 @@ objfile_find_memory_regions (int (*func) (CORE_ADDR, unsigned long, 1, /* Stack section will be readable. */ 1, /* Stack section will be writable. */ 0, /* Stack section will not be executable. */ + NULL, obfd); /* Make a heap segment. */ @@ -405,6 +408,7 @@ objfile_find_memory_regions (int (*func) (CORE_ADDR, unsigned long, 1, /* Heap section will be readable. */ 1, /* Heap section will be writable. */ 0, /* Heap section will not be executable. */ + NULL, obfd); return 0; diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index a75b16921da..f49250f1c12 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -2473,7 +2473,7 @@ static int gnu_find_memory_regions (int (*func) (CORE_ADDR, unsigned long, int, int, int, - void *), + char *, void *), void *data) { error_t err; @@ -2531,6 +2531,7 @@ gnu_find_memory_regions (int (*func) (CORE_ADDR, last_protection & VM_PROT_READ, last_protection & VM_PROT_WRITE, last_protection & VM_PROT_EXECUTE, + NULL, data); last_region_address = region_address; last_region_end = region_address += region_length; diff --git a/gdb/inftarg.c b/gdb/inftarg.c index 7786579d406..189218190e8 100644 --- a/gdb/inftarg.c +++ b/gdb/inftarg.c @@ -623,7 +623,7 @@ extern void inftarg_set_find_memory_regions (int (*func) (int (*) (CORE_ADDR, unsigned long, int, int, int, - void *), + char *, void *), void *)) { child_ops.to_find_memory_regions = func; diff --git a/gdb/linux-proc.c b/gdb/linux-proc.c index 2f290c49acb..73457a43d7c 100644 --- a/gdb/linux-proc.c +++ b/gdb/linux-proc.c @@ -81,6 +81,8 @@ read_mapping (FILE *mapfile, long long *offset, char *device, long long *inode, char *filename) { + char tmp_filename[MAXPATHLEN]; + char *p; int ret = fscanf (mapfile, "%llx-%llx %s %llx %s %llx", addr, endaddr, permissions, offset, device, inode); @@ -93,7 +95,13 @@ read_mapping (FILE *mapfile, filename. Note the filename is used for informational purposes only. */ - ret += fscanf (mapfile, "%[^\n]\n", filename); + ret += fscanf (mapfile, "%[^\n]\n", tmp_filename); + + /* Skip the spaces at the beginning of the filename. */ + p = tmp_filename; + while (*p == ' ') + p++; + strcpy (filename, p); } else { @@ -112,7 +120,8 @@ read_mapping (FILE *mapfile, static int linux_find_memory_regions (int (*func) (CORE_ADDR, unsigned long, - int, int, int, void *), void *obfd) + int, int, int, char *, void *), + void *obfd) { long long pid = PIDGET (inferior_ptid); char mapsfilename[MAXPATHLEN]; @@ -155,7 +164,7 @@ linux_find_memory_regions (int (*func) (CORE_ADDR, } /* Invoke the callback function to create the corefile segment. */ - func (addr, size, read, write, exec, obfd); + func (addr, size, read, write, exec, filename, obfd); } fclose (mapsfile); return 0; diff --git a/gdb/procfs.c b/gdb/procfs.c index 96cdaa9a37d..2b4a3c67967 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -136,7 +136,7 @@ char *procfs_pid_to_str (ptid_t); static int proc_find_memory_regions (int (*) (CORE_ADDR, unsigned long, int, int, int, - void *), + char *, void *), void *); static char * procfs_make_note_section (bfd *, int *); @@ -5433,7 +5433,7 @@ proc_iterate_over_mappings (int (*func) (int, CORE_ADDR)) * int callback (CORE_ADDR vaddr, * unsigned long size, * int read, int write, int execute, - * void *data); + * char *filename, void *data); * * Returns the integer value returned by the callback. */ @@ -5443,7 +5443,7 @@ find_memory_regions_callback (struct prmap *map, int (*func) (CORE_ADDR, unsigned long, int, int, int, - void *), + char *, void *), void *data) { return (*func) ((CORE_ADDR) map->pr_vaddr, @@ -5451,6 +5451,7 @@ find_memory_regions_callback (struct prmap *map, (map->pr_mflags & MA_READ) != 0, (map->pr_mflags & MA_WRITE) != 0, (map->pr_mflags & MA_EXEC) != 0, + NULL, data); } @@ -5463,7 +5464,8 @@ find_memory_regions_callback (struct prmap *map, * unsigned long size, * int read, TRUE if region is readable by the child * int write, TRUE if region is writable by the child - * int execute TRUE if region is executable by the child. + * int execute TRUE if region is executable by the child + * char *filename. * * Stops iterating and returns the first non-zero value * returned by the callback. @@ -5473,7 +5475,7 @@ static int proc_find_memory_regions (int (*func) (CORE_ADDR, unsigned long, int, int, int, - void *), + char *, void *), void *data) { procinfo *pi = find_procinfo_or_die (PIDGET (inferior_ptid), 0); diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index 3a11c31f285..c9b900d8303 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -1517,7 +1517,7 @@ static int sol_find_memory_regions (int (*func) (CORE_ADDR, unsigned long, int, int, int, - void *), + char *, void *), void *data) { return procfs_ops.to_find_memory_regions (func, data); diff --git a/gdb/target.h b/gdb/target.h index a3e10e8ddd0..bff9cc3af52 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -320,7 +320,7 @@ struct target_ops int (*to_find_memory_regions) (int (*) (CORE_ADDR, unsigned long, int, int, int, - void *), + char *, void *), void *); char * (*to_make_corefile_notes) (bfd *, int *); |