From 4f69f4c267a21e787685116945fb40729a7297a5 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Tue, 7 Aug 2012 13:26:33 +0000 Subject: gdb/ PR 11804 * defs.h (find_memory_region_ftype): New comment. New arg modified. * fbsd-nat.c (fbsd_find_memory_regions): Add the passed modified value. * gcore.c (gcore_create_callback): New function comment. Add modified parameter. Only write modified regions. Set SEC_READONLY exactly according to MODIFIED. (objfile_find_memory_regions): Ignore separate debug info files. Ass the passed modified value to FUNC. * gnu-nat.c (gnu_find_memory_regions): Add the passed modified value. * linux-tdep.c (linux_find_memory_regions): Try to reads smaps file first. New variables modified and has_anonymous. Parse the lines of smaps file. Add the passed MODIFIED value to FUNC. * procfs.c (find_memory_regions_callback): Add the passed modified value. gdb/testsuite/ PR 11804 * gdb.base/gcore-relro.exp: New file. * gdb.base/gcore-relro-main.c: New file. * gdb.base/gcore-relro-lib.c: New file. --- gdb/fbsd-nat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gdb/fbsd-nat.c') diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c index b3e4fabbb93..4a8a50915c3 100644 --- a/gdb/fbsd-nat.c +++ b/gdb/fbsd-nat.c @@ -131,8 +131,9 @@ fbsd_find_memory_regions (find_memory_region_ftype func, void *obfd) exec ? 'x' : '-'); } - /* Invoke the callback function to create the corefile segment. */ - func (start, size, read, write, exec, obfd); + /* Invoke the callback function to create the corefile segment. + Pass MODIFIED as true, we do not know the real modification state. */ + func (start, size, read, write, exec, 1, obfd); } do_cleanups (cleanup); -- cgit v1.2.1