Skip to content

Commit 6a9fd5e

Browse files
committed
cleanup backtrace from debugger
1 parent 581e8f2 commit 6a9fd5e

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

lib/ruby-debug-ide.rb

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,18 @@ def print_debug(*args)
2626
$stderr.flush
2727
end
2828
end
29-
29+
30+
def cleanup_backtrace(backtrace)
31+
cleared = []
32+
return cleared unless backtrace
33+
backtrace.each do |line|
34+
if line.index(File.expand_path(File.dirname(__FILE__))) == 0
35+
break
36+
end
37+
cleared << line
38+
end
39+
cleared
40+
end
3041
end
3142

3243
class Context
@@ -112,8 +123,8 @@ def debug_program(options)
112123
abs_prog_script = File.expand_path(Debugger::PROG_SCRIPT)
113124
bt = debug_load(abs_prog_script, options.stop, options.load_mode)
114125
if bt && !bt.is_a?(SystemExit)
115-
$stderr.print bt.backtrace.map{|l| "\t#{l}"}.join("\n"), "\n"
116126
$stderr.print "Uncaught exception: #{bt}\n"
127+
$stderr.print Debugger.cleanup_backtrace(bt.backtrace).map{|l| "\t#{l}"}.join("\n"), "\n"
117128
end
118129
end
119130

lib/ruby-debug/version.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module Debugger
2-
IDE_VERSION='0.4.17.beta6'
1+
module Debugger
2+
IDE_VERSION='0.4.17.beta7'
33
end

lib/ruby-debug/xml_printer.rb

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,13 @@ class ExceptionProxy
1111
def initialize(exception)
1212
@exception = exception
1313
@message = exception.message
14-
@backtrace = cleanup_backtrace(exception.backtrace)
14+
@backtrace = Debugger.cleanup_backtrace(exception.backtrace)
1515
end
1616

1717
private
1818
def method_missing(called, *args, &block)
1919
@exception.__send__(called, *args, &block)
2020
end
21-
22-
def cleanup_backtrace(backtrace)
23-
cleared = []
24-
return cleared unless backtrace
25-
backtrace.each do |line|
26-
if line.index(File.expand_path(File.dirname(__FILE__))) == 0
27-
break
28-
end
29-
cleared << line
30-
end
31-
cleared
32-
end
3321
end
3422

3523
def self.protect(mname)

0 commit comments

Comments
 (0)