From: Rocky Bernstein Date: 2012-08-21T13:25:21+09:00 Subject: [ruby-core:47259] Re: [ruby-trunk - Feature #6895] TracePoint API --e89a8ff254b0851edb04c7beeb3a Content-Type: text/plain; charset=ISO-8859-1 Looks good so far. What I'd ask though is that for return events one be able to get the return value and for exception events one be able to get the exception message. Thanks. On Mon, Aug 20, 2012 at 10:03 PM, SASADA Koichi wrote: > (2012/08/21 6:11), trans (Thomas Sawyer) wrote: > > Can we use TracePoint.new to get instance that is not automatically > active? eg. > > > > tracer = TracePoint.new{ |tp| ... } > > tracer.trace > > > > Is same as: > > > > tc = TracePoint.trace{ |tp| ... } > > I understand your proposal. I use "Thread.new (Thread.start)" analogy > (and current set_trace_func analogy). I think two different behavior is > not good. Which one do you like? > > > Also, I assume that if no events are given as arguments, it includes all > events? > Yes. > > >> `eventN' parameter for TracePoint.trace() is set of symbols. You can > specify events what you want to trace. If you don't specify any events on > it, then all events are activate (similar to set_trace_func). > > But there is an issue. Now "all" means same events that set_trace_func > supports. But if I add other events like "block invoke", then what mean > the "all"? > > -- > // SASADA Koichi at atdot dot net > > --e89a8ff254b0851edb04c7beeb3a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Looks good so far. What I'd ask though is that for return events one be= able to get the return value and for exception events one be able to get t= he exception message.

Thanks.

On Mon, Aug 20, 2012 at 10:03 PM, SASADA Koichi <ko1@atdot.net> = wrote:
(2012/08/21 6:11), trans (Thomas Sawyer) wrote:
> Can we use TracePoint.new to get instance that is not automatically ac= tive? eg.
>
> =A0 tracer =3D TracePoint.new{ |tp| ... }
> =A0 tracer.trace
>
> Is same as:
>
> =A0 tc =3D TracePoint.trace{ |tp| ... }

I understand your proposal. =A0I use "Thread.new (Thread.start)&= quot; analogy
(and current set_trace_func analogy). =A0I think two different behavior is<= br> not good. =A0Which one do you like?

> Also, I assume that if no events are given as arguments, it includes a= ll events?
Yes.

>> `eventN' parameter for TracePoint.trace() is set of symbols. = =A0You can specify events what you want to trace. =A0If you don't speci= fy any events on it, then all events are activate (similar to set_trace_fun= c).

But there is an issue. =A0Now "all" means same events that = set_trace_func
supports. =A0But if I add other events like "block invoke", then = what mean
the "all"?

--
// SASADA Koichi at atdot dot net


--e89a8ff254b0851edb04c7beeb3a--