Skip to content

Commit 7d72a62

Browse files
authored
Merge pull request #72883 from apple/gottesmm-patch-1
[Debugging The Compiler.md] Add documentation that says how to lookup Windows Error Codes
2 parents 1deaf0b + 0922665 commit 7d72a62

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/DebuggingTheCompiler.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ benefit of all Swift developers.
4949
- [Manually symbolication using LLDB](#manually-symbolication-using-lldb)
5050
- [Viewing allocation history, references, and page-level info](#viewing-allocation-history-references-and-page-level-info)
5151
- [Printing memory contents](#printing-memory-contents)
52+
- [Windows Error Codes](#windows-error-codes)
5253
- [Debugging LLDB failures](#debugging-lldb-failures)
5354
- ["Types" Log](#types-log)
5455
- ["Expression" Log](#expression-log)
@@ -1058,6 +1059,36 @@ The following specifiers are available:
10581059
* w - word (32-bit value)
10591060
* g - giant word (64-bit value)
10601061

1062+
## Windows Error Codes
1063+
1064+
When debugging programs on Windows, sometimes one will run into an error message with a mysterious error code. E.x.:
1065+
1066+
```
1067+
note: command had no output on stdout or stderr
1068+
error: command failed with exit status: 0xc0000135
1069+
```
1070+
1071+
These on windows are called HRESULT values. In the case above, the HRESULT is telling me that a DLL was not found. I discovered this
1072+
by running the Microsoft provided [System Error Code Lookup Tool](https://learn.microsoft.com/en-us/windows/win32/debug/system-error-code-lookup-tool). After running
1073+
this tool with the relevant error code on a windows machine, I got back the following result:
1074+
1075+
```
1076+
# for hex 0xc0000135 / decimal -1073741515
1077+
STATUS_DLL_NOT_FOUND ntstatus.h
1078+
# The code execution cannot proceed because %hs was not
1079+
# found. Reinstalling the program may fix this problem.
1080+
# as an HRESULT: Severity: FAILURE (1), FACILITY_NULL (0x0), Code 0x135
1081+
# for hex 0x135 / decimal 309
1082+
ERROR_NOTIFICATION_GUID_ALREADY_DEFINED winerror.h
1083+
# The specified file already has a notification GUID
1084+
# associated with it.
1085+
```
1086+
1087+
Some relevant Microsoft documentation:
1088+
1089+
* https://learn.microsoft.com/en-us/windows/win32/seccrypto/common-hresult-values
1090+
* https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a
1091+
* https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-
10611092

10621093
# Debugging LLDB failures
10631094

0 commit comments

Comments
 (0)