8000 Support `ivar_set` TracePoint event by st0012 · Pull Request #13369 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

Support ivar_set TracePoint event #13369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add ivar_set event
  • Loading branch information
st0012 committed Jun 6, 2025
commit 8b0f136c7d447a8d15f1e39e8bcf8c4db3aecb6f
1 change: 1 addition & 0 deletions include/ruby/internal/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#define RUBY_EVENT_FIBER_SWITCH 0x1000 /**< Encountered a `Fiber#yield`. */
#define RUBY_EVENT_SCRIPT_COMPILED 0x2000 /**< Encountered an `eval`. */
#define RUBY_EVENT_RESCUE 0x4000 /**< Encountered a `rescue` statement. */
#define RUBY_EVENT_IVAR_SET 0x8000 /**< Encountered an ivar set. */
#define RUBY_EVENT_TRACEPOINT_ALL 0xffff /**< Bitmask of extended events. */

/** @} */
Expand Down
1 change: 1 addition & 0 deletions iseq.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ ISEQ_ORIGINAL_ISEQ_ALLOC(const rb_iseq_t *iseq, long size)
RUBY_EVENT_B_CALL | \
RUBY_EVENT_B_RETURN | \
RUBY_EVENT_RESCUE | \
RUBY_EVENT_IVAR_SET | \
RUBY_EVENT_COVERAGE_LINE| \
RUBY_EVENT_COVERAGE_BRANCH)

Expand Down
4 changes: 4 additions & 0 deletions vm_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ get_event_name(rb_event_flag_t event)
case RUBY_EVENT_C_CALL: return "c-call";
case RUBY_EVENT_C_RETURN: return "c-return";
case RUBY_EVENT_RAISE: return "raise";
case RUBY_EVENT_IVAR_SET: return "ivar_set";
default:
return "unknown";
}
Expand Down Expand Up @@ -684,6 +685,7 @@ get_event_id(rb_event_flag_t event)
C(fiber_switch, FIBER_SWITCH);
C(script_compiled, SCRIPT_COMPILED);
C(rescue, RESCUE);
C(ivar_set, IVAR_SET);
#undef C
default:
return 0;
Expand Down Expand Up @@ -825,6 +827,7 @@ symbol2event_flag(VALUE v)
C(fiber_switch, FIBER_SWITCH);
C(script_compiled, SCRIPT_COMPILED);
C(rescue, RESCUE);
C(ivar_set, IVAR_SET);

/* joke */
C(a 5FC4 _call, A_CALL);
Expand Down Expand Up @@ -943,6 +946,7 @@ rb_tracearg_parameters(rb_trace_arg_t *trace_arg)
}
break;
}
case RUBY_EVENT_IVAR_SET:
case RUBY_EVENT_RAISE:
case RUBY_EVENT_LINE:
case RUBY_EVENT_CLASS:
Expand Down
0