]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Initial rough hack to spot the stack segment at startup by looking
authorJulian Seward <jseward@acm.org>
Sun, 23 Feb 2003 03:54:59 +0000 (03:54 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 23 Feb 2003 03:54:59 +0000 (03:54 +0000)
   for a rwx mapping which contains the startup %esp.

Might be better to look for just rw-.  Stack might not be executable
if there's a noexec patch, and x86-64 actually enforces the x bit
distinctly from r.

--> Look for just rw-.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1431

coregrind/vg_main.c

index 739a8f04243e4e0571458d1d5d9179cc637e4741..f129f2e1f6b9c3ff8203e20b92cd53562064960e 100644 (file)
@@ -627,7 +627,9 @@ static void vg_findstack_callback ( Addr start, UInt size,
 {
    Addr lastword;
    if (size == 0) return;
-   if (r != 'r' || w != 'w' || x != 'x') return;
+   if (r != 'r' || w != 'w' 
+       /* || x != 'x'  --not necessarily so on x86-64*/
+      ) return;
    lastword = start + size - 4;
    if (start <= VG_(esp_at_startup) 
        && VG_(esp_at_startup) <= lastword) {