Rémi Bernon (@rbernon) commented about dlls/ntdll/unix/signal_i386.c:
user_mode_abort_thread
- */
+extern void DECLSPEC_NORETURN user_mode_abort_thread( NTSTATUS status, struct syscall_frame *frame ); +__ASM_GLOBAL_FUNC( user_mode_abort_thread,
"movl 8(%esp),%eax\n\t" /* frame */
"movl 0x38(%eax),%ebp\n\t" /* frame->syscall_cfa */
"movl 4(%esp),%eax\n\t " /* status */
"subl $8,%ebp\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
__ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
__ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
__ASM_CFI(".cfi_rel_offset %ebx,-4\n\t")
__ASM_CFI(".cfi_rel_offset %esi,-8\n\t")
__ASM_CFI(".cfi_rel_offset %edi,-12\n\t")
/* switch to kernel stack */
"leal -16(%ebp),%esp\n\t"
I find it a bit awkward to rely on the current frame offsets to build the syscall frame CFI. I'd use absolute offsets instead, like in the dispatchers.
Also, as we use %esp to decide whether we are in or out of a syscall, I think it's better to connect the frames *after* %esp is updated. It probably does not matter so much here as it's aborting anyway, but I find it more consistent.
```suggestion:-7+0 /* switch to kernel stack */ "leal -16(%ebp),%esp\n\t" /* we're now on the kernel stack, stitch unwind info with previous frame */ __ASM_CFI(".cfi_def_cfa %ebp,8\n\t") __ASM_CFI(".cfi_val_offset %esp,0\n\t") /* <~~ Not completely sure about this one? */ __ASM_CFI(".cfi_offset %eip,+4\n\t") __ASM_CFI(".cfi_offset %ebp,0\n\t") __ASM_CFI(".cfi_offset %ebx,-4\n\t") __ASM_CFI(".cfi_offset %esi,-8\n\t") __ASM_CFI(".cfi_offset %edi,-12\n\t") ```