From c97d658bda791a52ba7c037f2945ac09e354a81e Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Mon, 3 Jun 2002 23:22:23 +0000 Subject: [PATCH] Call VG_(read_symbols) also from the new __NR_mmap2. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@371 --- vg_syscall_mem.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/vg_syscall_mem.c b/vg_syscall_mem.c index 0e8ad1d1b1..5fc3cc7dda 100644 --- a/vg_syscall_mem.c +++ b/vg_syscall_mem.c @@ -2140,10 +2140,17 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid ) VG_(printf)("mmap2 ( %p, %d, %d, %d, %d, %d )\n", arg1, arg2, arg3, arg4, arg5, arg6 ); KERNEL_DO_SYSCALL(tid,res); - /* !!! shouldn't we also be doing the symtab loading stuff as - in __NR_mmap ? */ if (!VG_(is_kerror)(res)) approximate_mmap_permissions( (Addr)res, arg2, arg3 ); + if (!VG_(is_kerror)(res) + && (arg3 & PROT_EXEC)) { + /* The client mmap'ed a segment with executable + permissions. Tell the symbol-table loader, so that it + has an opportunity to pick up more symbols if this mmap + was caused by the client loading a new .so via + dlopen(). This is important for debugging KDE. */ + VG_(read_symbols)(); + } } break; # endif -- 2.47.3