Skip to content

script_debug: expose decoded opcode and op_count in callback#144

Merged
sedited merged 3 commits intosedited:feature_script_debugfrom
febyeji:script-debug/opcode-opcount
Mar 26, 2026
Merged

script_debug: expose decoded opcode and op_count in callback#144
sedited merged 3 commits intosedited:feature_script_debugfrom
febyeji:script-debug/opcode-opcount

Conversation

@febyeji
Copy link
Copy Markdown

@febyeji febyeji commented Mar 5, 2026

Summary

  • Move DEBUG_SCRIPT from before GetOp to after opcode decoding and nOpCount update
  • Expose opcode and op_count through ScriptDebugFrame

Tests

  • test_script_debug: asserts opcode and op_count values

Depends on #143.

@febyeji febyeji force-pushed the script-debug/opcode-opcount branch from 005fd3a to a633c0d Compare March 5, 2026 08:35
Copy link
Copy Markdown
Owner

@sedited sedited left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a small comment to give here, lgtm otherwise.


DEBUG_SCRIPT(stack, script, opcode_pos, altstack, vfExec.all_true());
opcode = OP_INVALIDOPCODE;
DEBUG_SCRIPT(stack, script, opcode_pos, altstack, vfExec.all_true(), static_cast<uint8_t>(opcode), nOpCount);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of changing the opcode on the line above here and on line 424, can you pass it directly to the debug step instead? I think it is prudent that we keep the changes to this file to an absolute minimum - ideally only to calls through the macro.

Keep the interpreter patch narrowly scoped so the debug hook extension stays easy to review and future upstream syncs remain low risk.
Copy link
Copy Markdown
Owner

@sedited sedited left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sedited sedited merged commit c072347 into sedited:feature_script_debug Mar 26, 2026
9 checks passed
@febyeji febyeji deleted the script-debug/opcode-opcount branch March 26, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants