]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Call VG_(read_symbols) also from the new __NR_mmap2.
authorJulian Seward <jseward@acm.org>
Mon, 3 Jun 2002 23:22:23 +0000 (23:22 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 3 Jun 2002 23:22:23 +0000 (23:22 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@371

vg_syscall_mem.c

index 0e8ad1d1b1c102912c8fe8054b53be3fd15c20b8..5fc3cc7ddac3edac7fd9fd2b2764d2d9ff88ced0 100644 (file)
@@ -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