I want to continue discussion at
https://github.com/rocky/rb-threadframe/issues/3#issuecomment-10865038
Your patch is not acceptable because of performance issue.
From 2.0, Module#prepend can make breakpoint around method call.
Is it not enough?
I ask someone using debugger on ruby.
They require:(1) single step exec (TracePoint will help)
(2) break point for methods (Module#prepend/TracePoint will help)
(3) inspection (rb_debug_inspector will help)
I want to postpone fine-grained break point support to 2.1.
Maybe we need to consider about instruction swap and so on.
Breakpoint is highly required?
TracePoint is faster than "set_trace_func".
(2012/11/30 21:21), SASADA Koichi wrote:One more question.
> Now, how to know where trace should be inserted?
> line?
Your breakpoint hack invoke new tracefunc event.
Is that enough?
Other option is registering C function (or Proc) and invoke different
one for each breakpoints.
My 2 cents on benchmarks. I've tried to measure overhead of implementing debugger using pure ruby set_trace_func on Ruby 1.9,so I've implemented some basic context tracking stuff.After that I've tried to launch tests from some ruby application (unfortunately I don't remember which one). Here are results:none ruby-debug-base debase1 3.67 5.857 47.5212 3.664 5.923 47.883 3.713 6.014 48.0714 3.697 5.8685 3.738 5.9636 3.653 5.9067 3.78 5.8968 3.753 5.9189 3.746 5.90510 3.767 5.898Times are in seconds,None represents normal run of the tests without any debugger at all.There were no breakpoints, no catchpoints, etc. Debuggers were just capturing context info (such as file, line, binding).I think that's good idea on how overhead should be measured: just take some real app and check how much longer it takes to run the program when debugger is only tracing it's execution.
On Fri, Nov 30, 2012 at 8:04 AM, SASADA Koichi <k...@atdot.net> wrote:(2012/11/30 21:21), SASADA Koichi wrote:One more question.
> Now, how to know where trace should be inserted?
> line?
Your breakpoint hack invoke new tracefunc event.
Is that enough?
I am not sure I understand the question but I'll try to answer.
(2012/12/01 3:26), SASADA Koichi wrote:
> But I don't think it is good way because VM instruction set is notThank you many comments.
> defined clearly.
>
> This is why I propose https://bugs.ruby-lang.org/issues/6714
> (without implementation).
> I'll try it for next version.
Finally, I implement ISeq#line_trace_specify() method.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=38076&view=revision
This API provides only one interesting point "line".
Similar to current "line" event.
However, using this API, you can make "specified_line" hook for specific
line.
It is limited breakpoint, as you say.
However, it is limitation of dead-line, my skill, and so on.
Feedback is welcome.
(ex: Bad naming)
(Such halfway feature is harmful?)
(2012/11/30 22:37), Rocky Bernstein wrote:TracePoint#raised_exception also help you, doesn't it?
> It is a little like worrying about the overhead that is incurred when a
> program has a fatal exception. The quality and the handling of the fatal
> exception is much more of a concern than comparing how fast the
> fatal-exception handlers run.