From 575d4a276cceae9dca086aced83dece6146a5fe6 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 1 Dec 2009 22:46:07 +0000 Subject: * 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. --- gdb/solist.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gdb/solist.h') diff --git a/gdb/solist.h b/gdb/solist.h index 4c164e64834..4e8e88b9ce6 100644 --- a/gdb/solist.h +++ b/gdb/solist.h @@ -126,6 +126,14 @@ struct target_so_ops Falls back to using strcmp on so_original_name field when set to NULL. */ int (*same) (struct so_list *gdb, struct so_list *inferior); + + /* Return whether a region of memory 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 (*keep_data_in_core) (CORE_ADDR vaddr, + unsigned long size); }; /* Free the memory associated with a (so_list *). */ -- cgit v1.2.1