Repository navigation
Conversation
R0Y00#1758) tools/startup/msvc_throw_info.py reads the public x64 throw info (magic, thrown object, _ThrowInfo, _CatchableTypeArray, _CatchableType, type_info name) through a read_mem callback and returns a record with no address and no path: the catchable types (built-in scalars and public library classes by name, any other class as other) and, for a thrown 32-bit scalar such as long, the HRESULT as a public name with its facility. It is not wired into debug_launch.py yet.
Collaborator
Author
|
Closing this draft for now to help keep the open PR queue manageable; the branch stays preserved on the fork so it can be reopened once the queue clears. |
This was referenced Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1758. This is the decoder only: it is not wired into
tools/startup/debug_launch.py(untouched, so it does not collide with #1408 or the other open PRs that edit that file). The follow-up that calls it at the first-chance stop is a separate change.What it does
tools/startup/msvc_throw_info.pyturns a0xE06D7363exception record into a sanitized summary. #1758 needs the thrown HRESULT of the BVH builder, whose throw info says the catchable type is the built-inlong(.J), without putting addresses or names from the title in a public comment.decode_throw(exception_code, params, read_mem)follows the public MSVC x64 layout (ehdata.h):params[0]magic,[1]thrown object,[2]_ThrowInfo,[3]image base;_ThrowInfo→ RVA of_CatchableTypeArray→ RVAs of_CatchableType→ RVA oftype_info, whose decorated name is at offset 16.read_mem(address, size) -> bytes | Noneis the only access to memory, so the core has no Win32 dependency: indebug_launch.pyit would be the existingread.The record it returns has:
status:ok,not_msvc_exception,missing_parameters(fewer than four, so no image base),bad_magic,no_throw_info,unreadable,bad_throw_info,too_many_types(cap of 16, a safety limit).types: one entry per catchable type. Built-in scalars and a short list of public library classes (std::runtime_error,_com_error, ...) are named; any other class isother, so a class of the title never appears.value, only when the first catchable type is a 32-bit scalar (.J,.H,.I,.K) of size 4: the HRESULT as a public name (E_INVALIDARG,E_OUTOFMEMORY,DXGI_ERROR_DEVICE_REMOVED,DXGI_ERROR_DEVICE_HUNG,D3D12_ERROR_*, commonHRESULT_FROM_WIN32(...)), orHRESULT(0x........), with its facility category (win32,dxgi,d3d12,other). A positive number above 65535 is not reported.describe(record)gives a one-line form made of those fields only.Test
tests/startup_msvc_throw_info_check.pybuilds synthetic exception records in a fake address space (no title data) and checks 83 cases: ten HRESULTs through.J(E_INVALIDARG,E_OUTOFMEMORY,DXGI_ERROR_DEVICE_REMOVED, a generic one, ...),.Hand.I, another exception code, wrong magic, three parameters, null throw info and image base, a read that fails at each of the four steps (and a callback that returns short data or raises), an RVA beyond the readable range and one that overflows 64 bits, a negative count, 16 and 17 catchable types, a zero RVA,runtime_error,_com_error, a class of the title, alongof the wrong size, malformed names, a name that ends before unmapped memory, and a sweep that no record contains an address, a path, long hex or a number over 32 bits.It is registered in
CMakeLists.txtafterstartup_triage_runand in the Python check list of.github/workflows/windows.ymlnext tostartup_triage_run_check.py.Results (Linux, local)
python3 -B tests/startup_msvc_throw_info_check.py: 83 ok, PASS.msvc_throw_info.py, each restored withgit checkout --; all nine fail the test: magic not checked, facility0x87Achanged to0x87B, cap>=instead of>, other classes reported by name, negative count accepted, type name read at +8, scalar size not checked, two DXGI names swapped, a raising callback not caught.tests/docs_links_check.pyandtests/bidi_controls_check.pypass;git diff --check origin/main...HEADis clean.git merge-treeof this branch against the head of every open PR (109, including startup: hold other threads while a hook steps over its byte #1408, startup: pass OMSetStencilRef (slot 24) to the desktop list #1787, startup: name the command list slots the noop log can state #1788, build: write the variants of each x87 fixture in one Python process #1789): no conflict thatorigin/maindoes not already have.Not run, not established
HRESULT(0x........)with its facility.AI-assisted; commands listed were executed locally.