aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2009-12-01 22:46:15 +0000
committerJoseph Myers <joseph@codesourcery.com>2009-12-01 22:46:15 +0000
commitde18c1d81e0722779ce942110fb271e94db9635b (patch)
tree9e9c8edb06dd77c05617f2d55ba4c7c5bdc6789a /gdb/solib.c
parent16af530a6fd6d33174ae322fb1739bcbcbeaf96d (diff)
downloadfsf-binutils-gdb-de18c1d81e0722779ce942110fb271e94db9635b.zip
fsf-binutils-gdb-de18c1d81e0722779ce942110fb271e94db9635b.tar.gz
fsf-binutils-gdb-de18c1d81e0722779ce942110fb271e94db9635b.tar.bz2
* gcore.c: Include solib.h.
(gcore_create_callback): Call solib_keep_data_in_core when considering not saving memory in core file. * solib-svr4.c (svr4_keep_data_in_core): New. (_initialize_svr4_solib): Initialize svr4_so_ops.keep_data_in_core. * solib.c (solib_keep_data_in_core): New. * solib.h (solib_keep_data_in_core): Declare. * solist.h (struct target_so_ops): Add keep_data_in_core.
Diffstat (limited to 'gdb/solib.c')
-rw-r--r--gdb/solib.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/solib.c b/gdb/solib.c
index 6ad22fe..e563512 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -948,6 +948,23 @@ solib_name_from_address (struct program_space *pspace, CORE_ADDR address)
return (0);
}
+/* Return whether the data starting at VADDR, size SIZE, must be kept
+ in a core file for shared libraries loaded before "gcore" is used
+ to be handled correctly when the core file is loaded. This only
+ applies when the section would otherwise not be kept in the core
+ file (in particular, for readonly sections). */
+
+int
+solib_keep_data_in_core (CORE_ADDR vaddr, unsigned long size)
+{
+ struct target_so_ops *ops = solib_ops (target_gdbarch);
+
+ if (ops->keep_data_in_core)
+ return ops->keep_data_in_core (vaddr, size);
+ else
+ return 0;
+}
+
/* Called by free_all_symtabs */
void