Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • wine wine
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Bugzilla
    • Bugzilla
  • Merge requests 220
    • Merge requests 220
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • winewine
  • winewine
  • Merge requests
  • !1065

ntdll: Add CFI unwind info to __wine_syscall_dispatcher (x86_64)

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Florian Kübler requested to merge florian-kuebler/wine:feature/wine_syscal_dispatcher_unwind_info_x64 into master Oct 14, 2022
  • Overview 40
  • Commits 1
  • Pipelines 9
  • Changes 1

This change is adding DWARF (CFI) unwind information to the hand-written assembly of the __wine_syscall_dispatcher function. This enables unwinding through the dispatcher from the Linux stack into (and through) the Windows stack.

The general idea is that the syscall_frame struct contains the content of the callee-save registers before the function call (in particular the stack pointer and the return address). At any point of the execution, we have a pointer into the syscall_frame in $rcx, $rbp or $rsp.

For the CFI codes the general idea is that we are defining the computations of the callee-save registers based on the syscall_frame using DWARF’s breg instruction, rather than relative to CFA.

This change adds a bunch of convenience macros, to (hopefully) improve readability of the CFI instructions.

Note: Those change was used with great success for unwinding through the dispatcher using a modified LLDB shown in the “how-wine-works-101” blog post as well as for in the Orbit profiler, that has mixed-callstack unwinding support.

Test: Inspect callstacks reported by the Orbit profiler while running some Windows targets using the modified wine, as well as verify debugging reports correct callstacks when stepping with our modified LLDB through the dispatcher itself (so that we are able to unwind through the dispatcher at any instruction).

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: feature/wine_syscal_dispatcher_unwind_info_x64