From 06f2a86f1a57ded8177f0611bb107f0c4bcc2e70 Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 7 Jan 2013 08:38:25 +0000 Subject: [PATCH] * include/ruby/ruby.h (RUBY_EVENT_SPECIFIED_LINE): make it special. This flag is not contained by RUBY_EVENT_TRACEPOINT_ALL. This event is experimental one. It is possible to remove/rename flag name after 2.0.1. * vm_trace.c (get_event_id): return :line if SPECIFIED_LINE was occurred. `:specified_line' never been returned. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 10 ++++++++++ include/ruby/ruby.h | 9 ++++++--- vm_trace.c | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 67c2618d62..d0c429d89a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Mon Jan 7 17:34:22 2013 Koichi Sasada + + * include/ruby/ruby.h (RUBY_EVENT_SPECIFIED_LINE): make it special. + This flag is not contained by RUBY_EVENT_TRACEPOINT_ALL. + This event is experimental one. It is possible to remove/rename + flag name after 2.0.1. + + * vm_trace.c (get_event_id): return :line if SPECIFIED_LINE was + occurred. `:specified_line' never been returned. + Mon Jan 7 15:42:10 2013 Nobuyoshi Nakada * parse.y (f_kwrest): allow bare kwrest_mark as valid syntax. its diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 0a1d29a1fe..d80eaed681 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -1568,6 +1568,7 @@ static char *dln_libs_to_be_linked[] = { EXTLIB, 0 }; #define HAVE_NATIVETHREAD int ruby_native_thread_p(void); +/* traditional set_trace_func events */ #define RUBY_EVENT_NONE 0x0000 #define RUBY_EVENT_LINE 0x0001 #define RUBY_EVENT_CLASS 0x0002 @@ -1578,17 +1579,19 @@ int ruby_native_thread_p(void); #define RUBY_EVENT_C_RETURN 0x0040 #define RUBY_EVENT_RAISE 0x0080 #define RUBY_EVENT_ALL 0x00ff -#define RUBY_EVENT_SWITCH 0x20000 -#define RUBY_EVENT_COVERAGE 0x40000 /* for TracePoint extended events */ #define RUBY_EVENT_B_CALL 0x0100 #define RUBY_EVENT_B_RETURN 0x0200 #define RUBY_EVENT_THREAD_BEGIN 0x0400 #define RUBY_EVENT_THREAD_END 0x0800 -#define RUBY_EVENT_SPECIFIED_LINE 0x8000 #define RUBY_EVENT_TRACEPOINT_ALL 0xFFFF +/* special events */ +#define RUBY_EVENT_SPECIFIED_LINE 0x10000 +#define RUBY_EVENT_SWITCH 0x20000 +#define RUBY_EVENT_COVERAGE 0x40000 + typedef unsigned long rb_event_flag_t; typedef void (*rb_event_hook_func_t)(rb_event_flag_t evflag, VALUE data, VALUE self, ID mid, VALUE klass); diff --git a/vm_trace.c b/vm_trace.c index 425ca9fae0..9165e37bf3 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -546,6 +546,7 @@ get_event_id(rb_event_flag_t event) C(thread_begin, THREAD_BEGIN); C(thread_end, THREAD_END); C(specified_line, SPECIFIED_LINE); + case RUBY_EVENT_LINE | RUBY_EVENT_SPECIFIED_LINE: CONST_ID(id, "line"); return id; #undef C default: return 0;