diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2012-01-20 09:59:14 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2012-01-20 09:59:14 +0000 |
commit | 8deba5c6ed4af7b2e1d209bd85a061dece34198a (patch) | |
tree | 8a5b84465d42c04a4f189fb3dfee19947268a25a /gdb/gcore.c | |
parent | f076ba40346bb343e0f99cdf3217d10c01a7efc7 (diff) | |
download | gdb-8deba5c6ed4af7b2e1d209bd85a061dece34198a.tar.gz |
* 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 2a769d3b49c..aedda412eb6 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); |