From: Roger Pack Date: 2011-05-26T12:22:29+09:00 Subject: [ruby-core:36477] Re: Error reporting, backtraces and the debugger > Nobuyoshi Nakada offered a patch that turns each backtrace entry into a > Struct with to_str and inspect that return the existing (textual) format. > The patch uses SCRIPT_LINES to return the source code text, if that has been > populated. Oh yeah I remember that. I would be happy if something like it were accepted :) > > Roger also asked that method parameters should also be included in each > entry. This part is a bit harder, but would be ideal. > (3) Adding the method-call binding to each exception entry (like rbx' > MethodContext) This is an interesting idea, though possibly a bit tricky. You might be able to fake something like this today using ruby-debug (override Exception.new and have it save an array of bindings?) > (4) Providing a debugger hook that can be called when an exception object is > *about* to be thrown, but before it actually is thrown. This way it's easier > to discover the reason an exception is being thrown, because the call stack > which led to it still exists. Does catch Exception do this? > (6) Providing a debugger capability to step "into" a method which is being > passed a block. This is between "step over" and "step in" because it doesn't > step into the method, but will stop on the first line of the passed block > (if the method yields, otherwise it's like "step over"). This would be > especially useful for nested trace blocks (trace "foo" { ... }) where you > always want to step into the block and never into the trace method itself. That would be nice. Maybe there is already such an option you can ping the ruby-debug google group. -roger-