Skip to content

add block hook with instruction count - #2378

Open
PhilippTakacs wants to merge 1 commit into
unicorn-engine:devfrom
PhilippTakacs:block_icount
Open

add block hook with instruction count#2378
PhilippTakacs wants to merge 1 commit into
unicorn-engine:devfrom
PhilippTakacs:block_icount

Conversation

@PhilippTakacs

Copy link
Copy Markdown
Contributor

TODO disallow overlapping with block hook, write tests

PhilippTakacs added a commit to PhilippTakacs/unicorn-engine-rs that referenced this pull request Aug 6, 2026
@PhilippTakacs
PhilippTakacs marked this pull request as ready for review August 7, 2026 12:19
@PhilippTakacs

Copy link
Copy Markdown
Contributor Author

@wtdcode it would be nice to have this in the next release.

Comment thread uc.c
}

if (type & UC_HOOK_CODE || type & UC_HOOK_BLOCK) {
if (type & UC_HOOK_BLOCK || type & UC_HOOK_BLOCK_ICOUNT) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wait UC_HOOK_CODE is missing from this branch?

@PhilippTakacs PhilippTakacs Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is to check if a UC_HOOK_BLOCK and a UC_HOOK_BLOCK_ICOUNT overlaps. I use this because this way the hook is simpler to implement, but doesn't allow a UC_HOOK_BLOCK and UC_HOOK_BLOCK_ICOUNT at the same tb. Overlapping with a UC_HOOK_CODE is not a problem.

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