How xrayxl/xrayxl-addin works
XRayXL is an in-process Excel add-in that records XLL and VBA execution to a shared trace file. The user arms tracing, runs calculations or macros, then inspects the resulting trace; the ribbon and Excel commands provide controls, while diagnostics and event capture complement the main trace. The graph reflects documented tracer behavior and relationships visible in excerpts or the source index; several implementation details and UI paths are unsampled, so uncertain connections are omitted.
Main entry points: session.cpp Session lifecycle · csv.cpp Trace writer · xllarm.cpp Arm XLL hooks · vbapatch.cpp VBA interpreter hooks
Components 19
Session Control
- Session lifecycle
src/app/session.cpp - Excel commands
src/app/commands.cpp - Excel events
src/app/appevents.cpp
XLL Tracing
- Arm XLL hooks
src/xll/xllarm.cpp - Registration lookup
src/xll/xllregistry.cpp - Late registrations
src/xll/xllregister_watch.cpp - XLL detours
src/xll/xllhook.cpp - XLL recorder
src/xll/xlltrace.cpp
VBA Tracing
- VBA interpreter hooks
src/vba/vbapatch.cpp - Opcode analysis
src/vba/vbapcode.cpp - VBA recorder
src/vba/vbatrace.cpp - Procedure identity
src/vba/vbaidentity.cpp
Trace Output
- Trace writer
src/emit/csv.cpp - Buffered drain
src/emit/ring.cpp - CSV or JSONL trace
User Support
- Ribbon controls
src/ui/ribbon.cpp - Crash diagnostics
src/core/crashlog.cpp
Other components
- Excel user
- Excel process
Connections 22
- Excel user → Ribbon controls: controls
src/ui/ribbon.cpp - Ribbon controls → Session lifecycle: arms or disarms
src/ui/ribbon.cpp - Excel process → Excel commands: invokes
- Excel commands → Session lifecycle: controls session
- Session lifecycle → Arm XLL hooks: arms XLL
src/app/session.cpp - Session lifecycle → VBA interpreter hooks: arms VBA
src/app/session.cpp - Session lifecycle → Excel events: starts event capture
src/app/session.cpp - Arm XLL hooks → Registration lookup: resolves exports
src/xll/xllarm.cpp - Arm XLL hooks → Late registrations: installs watcher
src/xll/xllarm.cpp - Arm XLL hooks → XLL detours: installs detours
src/xll/xllarm.cpp - XLL detours → XLL recorder: records calls
src/xll/xllhook.cpp - VBA interpreter hooks → Opcode analysis: analyzes opcodes
src/vba/vbapatch.cpp - VBA interpreter hooks → Procedure identity: resolves procedures
src/vba/vbapatch.cpp - VBA interpreter hooks → VBA recorder: hooks interpreter
src/vba/vbapatch.cpp - VBA recorder → Procedure identity: uses identity
src/vba/vbatrace.cpp - XLL recorder → Trace writer: writes rows
- VBA recorder → Trace writer: writes rows
src/vba/vbatrace.cpp - Excel events → Trace writer: writes event rows
- Session lifecycle → Trace writer: opens and closes
src/app/session.cpp - Trace writer → Buffered drain: buffers and drains
src/emit/csv.cpp - Trace writer → CSV or JSONL trace: writes trace
src/emit/csv.cpp - Excel process → Crash diagnostics: reports faults