From 82763a3d329b0d342d0273941b1521be9ef0c604 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Tue, 7 Aug 2012 13:26:29 +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/defs.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gdb/defs.h') diff --git a/gdb/defs.h b/gdb/defs.h index 7be99a2d60f..de34740f323 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -362,9 +362,14 @@ extern void init_source_path (void); /* From exec.c */ +/* Process memory area starting at ADDR with length SIZE. Area is readable iff + READ is non-zero, writable if WRITE is non-zero, executable if EXEC is + non-zero. Area is possibly changed against its original file based copy if + MODIFIED is non-zero. DATA is passed without changes from a caller. */ + typedef int (*find_memory_region_ftype) (CORE_ADDR addr, unsigned long size, int read, int write, int exec, - void *data); + int modified, void *data); /* Take over the 'find_mapped_memory' vector from exec.c. */ extern void exec_set_find_memory_regions -- cgit v1.2.1