diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2012-01-20 09:59:15 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2012-01-20 09:59:15 +0000 |
commit | 35c2fab7c6364453c5847ba5fccd68dded16d7a6 (patch) | |
tree | a82f332e4f055eeb052fc5d61a153522a406737f /gdb/gcore.c | |
parent | 6432734d1ddb783a4f7ed377dfe5920013ee9872 (diff) | |
download | gdb-35c2fab7c6364453c5847ba5fccd68dded16d7a6.zip gdb-35c2fab7c6364453c5847ba5fccd68dded16d7a6.tar.gz gdb-35c2fab7c6364453c5847ba5fccd68dded16d7a6.tar.bz2 |
* gdbarch.sh (find_memory_regions): New callback.
* gdbarch.c, gdbarch.h: Regenerate.
* gcore.c (gcore_memory_sections): Try gdbarch find_memory_regions
callback before falling back to target method.
* linux-nat.c (read_mapping, linux_nat_find_memory_regions): Remove.
(linux_target_install_ops): No longer install it.
* linux-tdep.c (linux_find_memory_regions): New function.
(linux_init_abi): Install it.
Diffstat (limited to 'gdb/gcore.c')
-rw-r--r-- | gdb/gcore.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gdb/gcore.c b/gdb/gcore.c index 2a769d3..aedda41 100644 --- a/gdb/gcore.c +++ b/gdb/gcore.c @@ -561,8 +561,14 @@ gcore_copy_callback (bfd *obfd, asection *osec, void *ignored) static int gcore_memory_sections (bfd *obfd) { - if (target_find_memory_regions (gcore_create_callback, obfd) != 0) - return 0; /* FIXME: error return/msg? */ + /* Try gdbarch method first, then fall back to target method. */ + if (!gdbarch_find_memory_regions_p (target_gdbarch) + || gdbarch_find_memory_regions (target_gdbarch, + gcore_create_callback, obfd) != 0) + { + if (target_find_memory_regions (gcore_create_callback, obfd) != 0) + return 0; /* FIXME: error return/msg? */ + } /* Record phdrs for section-to-segment mapping. */ bfd_map_over_sections (obfd, make_output_phdrs, NULL); |