summaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2012-01-20 09:59:14 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2012-01-20 09:59:14 +0000
commit8deba5c6ed4af7b2e1d209bd85a061dece34198a (patch)
tree8a5b84465d42c04a4f189fb3dfee19947268a25a /gdb/gdbarch.c
parentf076ba40346bb343e0f99cdf3217d10c01a7efc7 (diff)
downloadgdb-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/gdbarch.c')
-rw-r--r--gdb/gdbarch.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 7a1db102234..1bd2341ac4d 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -240,6 +240,7 @@ struct gdbarch
gdbarch_regset_from_core_section_ftype *regset_from_core_section;
struct core_regset_section * core_regset_sections;
gdbarch_make_corefile_notes_ftype *make_corefile_notes;
+ gdbarch_find_memory_regions_ftype *find_memory_regions;
gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries;
gdbarch_core_pid_to_str_ftype *core_pid_to_str;
const char * gcore_bfd_target;
@@ -397,6 +398,7 @@ struct gdbarch startup_gdbarch =
0, /* regset_from_core_section */
0, /* core_regset_sections */
0, /* make_corefile_notes */
+ 0, /* find_memory_regions */
0, /* core_xfer_shared_libraries */
0, /* core_pid_to_str */
0, /* gcore_bfd_target */
@@ -686,6 +688,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of fetch_pointer_argument, has predicate. */
/* Skip verify of regset_from_core_section, has predicate. */
/* Skip verify of make_corefile_notes, has predicate. */
+ /* Skip verify of find_memory_regions, has predicate. */
/* Skip verify of core_xfer_shared_libraries, has predicate. */
/* Skip verify of core_pid_to_str, has predicate. */
/* Skip verify of gcore_bfd_target, has predicate. */
@@ -928,6 +931,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: fetch_tls_load_module_address = <%s>\n",
host_address_to_string (gdbarch->fetch_tls_load_module_address));
fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_find_memory_regions_p() = %d\n",
+ gdbarch_find_memory_regions_p (gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: find_memory_regions = <%s>\n",
+ host_address_to_string (gdbarch->find_memory_regions));
+ fprintf_unfiltered (file,
"gdbarch_dump: float_bit = %s\n",
plongest (gdbarch->float_bit));
fprintf_unfiltered (file,
@@ -3278,6 +3287,30 @@ set_gdbarch_make_corefile_notes (struct gdbarch *gdbarch,
}
int
+gdbarch_find_memory_regions_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->find_memory_regions != NULL;
+}
+
+int
+gdbarch_find_memory_regions (struct gdbarch *gdbarch, find_memory_region_ftype func, void *data)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->find_memory_regions != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_find_memory_regions called\n");
+ return gdbarch->find_memory_regions (gdbarch, func, data);
+}
+
+void
+set_gdbarch_find_memory_regions (struct gdbarch *gdbarch,
+ gdbarch_find_memory_regions_ftype find_memory_regions)
+{
+ gdbarch->find_memory_regions = find_memory_regions;
+}
+
+int
gdbarch_core_xfer_shared_libraries_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);