summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-25 23:55:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-25 23:55:34 +0000
commitdc513a13bb95babf7175da2df8cc47ce62527134 (patch)
treede9b1186123b54939870246bb805d18229a17bfc
parent89a2fd52bd966238c63904afbb95015edc8a4351 (diff)
vm_trace.c: unified a_call and a_return
* vm_trace.c (symbol2event_flag): use a uniform macro for a_call and a_return too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--vm_trace.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/vm_trace.c b/vm_trace.c
index bc3d475..cec0dee 100644
--- a/vm_trace.c
+++ b/vm_trace.c
@@ -684,6 +684,10 @@ symbol2event_flag(VALUE v)
{
ID id;
VALUE sym = rb_convert_type(v, T_SYMBOL, "Symbol", "to_sym");
+ const rb_event_flag_t RUBY_EVENT_A_CALL =
+ RUBY_EVENT_CALL | RUBY_EVENT_B_CALL | RUBY_EVENT_C_CALL;
+ const rb_event_flag_t RUBY_EVENT_A_RETURN =
+ RUBY_EVENT_RETURN | RUBY_EVENT_B_RETURN | RUBY_EVENT_C_RETURN;
#define C(name, NAME) CONST_ID(id, #name); if (sym == ID2SYM(id)) return RUBY_EVENT_##NAME
C(line, LINE);
@@ -699,9 +703,9 @@ symbol2event_flag(VALUE v)
C(thread_begin, THREAD_BEGIN);
C(thread_end, THREAD_END);
C(specified_line, SPECIFIED_LINE);
+ C(a_call, A_CALL);
+ C(a_return, A_RETURN);
#undef C
- CONST_ID(id, "a_call"); if (sym == ID2SYM(id)) return RUBY_EVENT_CALL | RUBY_EVENT_B_CALL | RUBY_EVENT_C_CALL;
- CONST_ID(id, "a_return"); if (sym == ID2SYM(id)) return RUBY_EVENT_RETURN | RUBY_EVENT_B_RETURN | RUBY_EVENT_C_RETURN;
rb_raise(rb_eArgError, "unknown event: %"PRIsVALUE, rb_sym2str(sym));
}