[PATCH v4 3/4] ntdll: Also capture first frame in back trace on x86.

Paul Gofman pgofman at codeweavers.com
Mon Nov 1 06:13:59 CDT 2021


Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
v4:
    - now when extra frame is provided by the helper no need in asm wrapper.

 dlls/ntdll/signal_i386.c     | 5 +----
 dlls/ntdll/tests/exception.c | 2 --
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index ff3e837c784..b28684839b7 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -490,9 +490,6 @@ ULONG WINAPI capture_stack_back_trace( ULONG skip, ULONG count, PVOID *buffer, U
     ULONG *frame;
     ULONG num_entries = 0;
 
-    ++skip;
-    ++count;
-
     RtlCaptureContext( &context );
     if (hash) *hash = 0;
     frame = (ULONG *)context.Ebp;
@@ -507,7 +504,7 @@ ULONG WINAPI capture_stack_back_trace( ULONG skip, ULONG count, PVOID *buffer, U
         }
         frame = (ULONG *)*frame;
     }
-    return i ? i - 1 : 0;
+    return i;
 }
 
 
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
index d73e75ee529..121fbedc72e 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -9134,10 +9134,8 @@ static void test_walk_stack(void)
 
     start = test_walk_stack;
     end = (BYTE *)start + 0x1000;
-    todo_wine_if(sizeof(void *) == 4)
     ok(addrs[0] >= start && addrs[0] < end, "Address is not inside test function, start %p, end %p, addr %p.\n",
             start, end, addrs[0]);
-    todo_wine_if(sizeof(void *) == 4)
     ok(addrs2[0] >= start && addrs2[0] < end, "Address is not inside test function, start %p, end %p, addr %p.\n",
             start, end, addrs2[0]);
 
-- 
2.31.1




More information about the wine-devel mailing list