Repository navigation
Conversation
d6a31c4 to
4d4d157
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Win64 fault redirection lacks a valid call frame, the CONTEXT layout is 96 bytes short, and the stack-walker build targets ARM64 instead of AMD64.
3 open issues
What changed in this PR
Prepares the Modula-3 Windows x64 runtime for stack-walk work while leaving stack walking disabled and relying on the C++ runtime for exception unwinding.
Changes:
- Enables C++ exception handling for MSVC-compiled sources.
- Adds and selects an AMD64-specific Windows thread-context definition.
- Introduces stack-walker build scaffolding, runtime stubs, and a C++ exception helper.
| File | Description |
|---|---|
| m3-sys/cminstall/src/config/NT.common | Adds the -EHs compiler option. |
| m3-sys/cminstall/src/config/AMD64_NT | Adds a commented stack-walker opt-in. |
| m3-libs/m3core/src/thread/WIN32/m3makefile | Skips the generic thread context on AMD64. |
| m3-libs/m3core/src/thread/m3makefile | Includes AMD64-specific thread definitions. |
| m3-libs/m3core/src/thread/AMD64_NT/ThreadContext.i3 | Defines the Windows x64 context record. |
| m3-libs/m3core/src/thread/AMD64_NT/m3makefile | Registers the AMD64 thread-context interface. |
| m3-libs/m3core/src/runtime/m3makefile | Updates walker targets and Windows library linkage. |
| m3-libs/m3core/src/runtime/ex_stack/RTExStack.m3 | Comments out unfinished exception-scope checks. |
| m3-libs/m3core/src/runtime/AMD64_NT/RTStackC.c | Adds trace stubs and a C++ exception-throwing helper. |
| m3-libs/m3core/src/runtime/AMD64_NT/RTMachine.i3 | Defines AMD64 frame information and walker capability. |
| m3-libs/m3core/src/runtime/AMD64_NT/m3makefile | Declares AMD64 runtime build inputs. |
Review effort: Balanced
|
|
||
| (* Program counter. *) | ||
| (* Hack for interop for 32bit RTSignal.m3. *) | ||
| Eip(*Rip*): INTEGER; |
There was a problem hiding this comment.
Copilot steal my source code . . .
455b667 to
97edcd8
Compare
97edcd8 to
3c4dff3
Compare
|
MinGw |
In case ignoring Pool Request -- yes |
|
And what You planed about worked patch from #1190 ? |
|
Closing this as superseded by #1271, which made ex_stack target-independent:
On master, turning on ex_stack for AMD64_NT only takes |


There's really nothing to add stackwalk support.
It is all in the C++ runtime.
This PR does some things I thought would help, but are mostly not needed.
It turns out, this is only for printing stackwalk. Actually doing this in Modula3 runtime would break language interup -- we'd skip C finally blocks and C++ destructors, unless we cloned all of RtlDispatchException, which would be bad.