Repository: astral-sh/uv
File: crates/uv/src/windows_exception.rs (Rust)

Code before:
        X17,
        X18,
        X19,
        X20,
        X21,
        X22,
        X23,
        X24,
        X25,
        X26,
        X27,
        X28,
        Fp,
        Lr,
    } = regs;
    writeln!(e, "cpsr={Cpsr:016x}  sp={Sp :016x}  pc={Pc :016x}")?;
    writeln!(e, "  x0={X0  :016x}  x1={X1 :016x}  x2={X2 :016x}")?;
    writeln!(e, "  x3={X3  :016x}  x4={X4 :016x}  x5={X5 :016x}")?;
    writeln!(e, "  x6={X6  :016x}  x7={X7 :016x}  x8={X8 :016x}")?;
    writeln!(e, "  x9={X9  :016x} x10={X10:016x} x11={X11:016x}")?;
    writeln!(e, " x12={X12 :016x} x13={X13:016x} x14={X14:016x}")?;
    writeln!(e, " x15={X15 :016x} x16={X16:016x} x17={X17:016x}")?;
    writeln!(e, " x18={X18 :016x} x19={X19:016x} x20={X20:016x}")?;
    writeln!(e, " x21={X21 :016x} x22={X22:016x} x23={X23:016x}")?;
    writeln!(e, " x24={X24 :016x} x25={X25:016x} x26={X26:016x}")?;
    writeln!(e, " x27={X24 :016x} x28={X25:016x}")?;
    writeln!(e, "  fp={Fp  :016x}  lr={Lr :016x}")?;
    Ok(())
}

fn dump_exception(exception_info: *const EXCEPTION_POINTERS) -> std::fmt::Result {
    let mut e = ExceptionSafeStderr::new().map_err(|_| std::fmt::Error)?;
    writeln!(e, "error: unhandled exception in uv, please report a bug:")?;
    let mut context = None;
    // SAFETY: Pointer comes from the OS
    if let Some(info) = unsafe { exception_info.as_ref() } {
        // SAFETY: Pointer comes from the OS
        if let Some(exc) = unsafe { info.ExceptionRecord.as_ref() } {
            writeln!(
                e,
                "code {:#X} at address {:?}",
                exc.ExceptionCode.0, exc.ExceptionAddress
            )?;
            match exc.ExceptionCode {
                Foundation::EXCEPTION_ACCESS_VIOLATION => {
                    display_exception_info(
                        &mut e,
                        "EXCEPTION_ACCESS_VIOLATION",
                        &exc.ExceptionInformation,
                    )?;
                }

Review comment (suggestion):
```suggestion
    writeln!(e, " x27={X27 :016x} x28={X28:016x}")?;
```

Code after:
        X17,
        X18,
        X19,
        X20,
        X21,
        X22,
        X23,
        X24,
        X25,
        X26,
        X27,
        X28,
        Fp,
        Lr,
    } = regs;
    writeln!(e, "cpsr={Cpsr:016x}  sp={Sp :016x}  pc={Pc :016x}")?;
    writeln!(e, "  x0={X0  :016x}  x1={X1 :016x}  x2={X2 :016x}")?;
    writeln!(e, "  x3={X3  :016x}  x4={X4 :016x}  x5={X5 :016x}")?;
    writeln!(e, "  x6={X6  :016x}  x7={X7 :016x}  x8={X8 :016x}")?;
    writeln!(e, "  x9={X9  :016x} x10={X10:016x} x11={X11:016x}")?;
    writeln!(e, " x12={X12 :016x} x13={X13:016x} x14={X14:016x}")?;
    writeln!(e, " x15={X15 :016x} x16={X16:016x} x17={X17:016x}")?;
    writeln!(e, " x18={X18 :016x} x19={X19:016x} x20={X20:016x}")?;
    writeln!(e, " x21={X21 :016x} x22={X22:016x} x23={X23:016x}")?;
    writeln!(e, " x24={X24 :016x} x25={X25:016x} x26={X26:016x}")?;
    writeln!(e, " x27={X27 :016x} x28={X28:016x}")?;
    writeln!(e, "  fp={Fp  :016x}  lr={Lr :016x}")?;
    Ok(())
}

fn dump_exception(exception_info: *const EXCEPTION_POINTERS) -> std::fmt::Result {
    let mut e = ExceptionSafeStderr::new().map_err(|_| std::fmt::Error)?;
    writeln!(e, "error: unhandled exception in uv, please report a bug:")?;
    let mut context = None;
    // SAFETY: Pointer comes from the OS
    if let Some(info) = unsafe { exception_info.as_ref() } {
        // SAFETY: Pointer comes from the OS
        if let Some(exc) = unsafe { info.ExceptionRecord.as_ref() } {
            writeln!(
                e,
                "code {:#X} at address {:?}",
                exc.ExceptionCode.0, exc.ExceptionAddress
            )?;
            match exc.ExceptionCode {
                Foundation::EXCEPTION_ACCESS_VIOLATION => {
                    display_exception_info(
                        &mut e,
                        "EXCEPTION_ACCESS_VIOLATION",
                        &exc.ExceptionInformation,
                    )?;
                }