... | ... | @@ -112,7 +112,6 @@ It can be useful to set a breakpoint on `_invalid_parameter` to catch invalid C |
|
|
|
|
|
https://stackoverflow.com/questions/36968475/how-to-debug-invalid-parameter-passed-to-c-runtime-function
|
|
|
|
|
|
|
|
|
### Diabling ASLR
|
|
|
|
|
|
One can disable address-space layout randomization for a process with the following PowerShell incantation:
|
... | ... | @@ -132,4 +131,35 @@ There are a few ways to accomplish this: |
|
|
|
|
|
* GHC itself can generate a dump in "minidump" format with the `+RTS --generate-crash-dumps` flag. This can be opened with WinDbg.
|
|
|
* the `gflags.exe` utility (specifically the "Silent Process Exit" tab) can be used to enable dumps globally on crashing processes.
|
|
|
* the `procdump.exe` [Sysinternals](https://docs.microsoft.com/en-us/sysinternals/downloads/procdump) utility can be used to collect a dump from a single process. |
|
|
\ No newline at end of file |
|
|
* the `procdump.exe` [Sysinternals](https://docs.microsoft.com/en-us/sysinternals/downloads/procdump) utility can be used to collect a dump from a single process.
|
|
|
|
|
|
## Setting up a development environment
|
|
|
|
|
|
### Enabling symbolic links
|
|
|
|
|
|
By default creation of symbolic links requires Administrative privileges. It is recommended to remove this requirement by [enabling](https://stackoverflow.com/questions/44158326/win10-how-to-activate-developer-mode-using-powershell-or-cmd-exe) "developer mode":
|
|
|
```
|
|
|
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
|
|
|
DISM /Online /Add-Capability /CapabilityName:Tools.DeveloperMode.Core~~~~0.0.1.0
|
|
|
```
|
|
|
|
|
|
|
|
|
### Virtual machine
|
|
|
|
|
|
If you are running Windows under `qemu` you almost certainly want to install the [SPICE Guest Tools](https://www.spice-space.org/download.html#guest). These include not only virtio paravirtualisation drivers which significantly improve performance, but also things like clipboard integration which make life considerably nicer.
|
|
|
|
|
|
You likely also want to look at the various hints described [here](https://kevinlocke.name/bits/2021/12/10/windows-11-guest-virtio-libvirt/).
|
|
|
|
|
|
You also should probably [disable](https://serverfault.com/questions/1092404/windows-vm-suddenly-run-very-slow-in-kvm-qemu) Hypervisor-protected code integrity (HVCI) since it incurs a considerable overhead:
|
|
|
```
|
|
|
reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" /v "Enabled" /t REG_DWORD /d 0 /f
|
|
|
```
|
|
|
|
|
|
|
|
|
### Disabling Windows Defender
|
|
|
|
|
|
If you are careful and merely using your VM for GHC builds, you likely want to disable Windows Defender:
|
|
|
```
|
|
|
REG add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender" /t REG_DWORD /f /v "DisableAntiSpyware" /d "1"
|
|
|
```
|
|
|
It's hard to overstate how significant of a performance improvement this is for compilation workloads like GHC. |
|
|
\ No newline at end of file |