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”](https://werat.dev/blog/how-wine-works-101/)
blog post as well as for in the [Orbit profiler](https://github.com/google/orbit),
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).
--
v8: ntdll: Add CFI unwind info to __wine_syscall_dispatcher (x86_64)
https://gitlab.winehq.org/wine/wine/-/merge_requests/1065
More font links are added to avoid issues related to missing font links.
Data comes from: https://testbot.winehq.org/JobDetails.pl?Key=125079
Test program in the tests above: [font_link_reg.c](/uploads/9d4a722450f0dd88344a2b098770aaa0/font_link_reg.c)
--
v3: win32u: Add font links for MS Gothic.
win32u: Add font links for MingLiU.
win32u: Add font links for Microsoft JhengHei.
win32u: Add locale_dependent member to struct system_link_reg.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1089
Huw Davies (@huw) commented about dlls/win32u/font.c:
> + len = link_reg->link_jp_len;
> + break;
> + case 936:
> + link = link_reg->link_sc;
> + len = link_reg->link_sc_len;
> + break;
> + case 949:
> + link = link_reg->link_kr;
> + len = link_reg->link_kr_len;
> + break;
> + case 950:
> + link = link_reg->link_tc;
> + len = link_reg->link_tc_len;
> + break;
> + default:
> + break;
You should be able to remove the `default` label.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1089#note_11470