File tree Expand file tree Collapse file tree 3 files changed +16
-17
lines changed
Expand file tree Collapse file tree 3 files changed +16
-17
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 1- module Debugger
2- IDE_VERSION = '0.4.17.beta6 '
1+ module Debugger
2+ IDE_VERSION = '0.4.17.beta7 '
33end
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments