mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Bump debug version to 0.2.1
This commit is contained in:
parent
c6d9bd75ee
commit
8ddad13dcd
2 changed files with 22 additions and 8 deletions
|
|
@ -1,6 +1,6 @@
|
|||
Gem::Specification.new do |spec|
|
||||
spec.name = "debug"
|
||||
spec.version = "0.2.0"
|
||||
spec.version = "0.2.1"
|
||||
spec.authors = ["Yukihiro Matsumoto"]
|
||||
spec.email = ["matz@ruby-lang.org"]
|
||||
|
||||
|
|
|
|||
28
lib/debug.rb
28
lib/debug.rb
|
|
@ -3,7 +3,10 @@
|
|||
# Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
# Copyright (C) 2000-2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
|
||||
|
||||
require 'continuation'
|
||||
if $SAFE > 0
|
||||
STDERR.print "-r debug.rb is not available in safe mode\n"
|
||||
exit 1
|
||||
end
|
||||
|
||||
require 'tracer'
|
||||
require 'pp'
|
||||
|
|
@ -178,6 +181,9 @@ SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__ # :nodoc:
|
|||
|
||||
class DEBUGGER__
|
||||
MUTEX = Thread::Mutex.new # :nodoc:
|
||||
CONTINUATIONS_SUPPORTED = RUBY_ENGINE == 'ruby'
|
||||
|
||||
require 'continuation' if CONTINUATIONS_SUPPORTED
|
||||
|
||||
class Context # :nodoc:
|
||||
DEBUG_LAST_CMD = []
|
||||
|
|
@ -375,8 +381,10 @@ class DEBUGGER__
|
|||
|
||||
def debug_command(file, line, id, binding)
|
||||
MUTEX.lock
|
||||
unless defined?($debugger_restart) and $debugger_restart
|
||||
callcc{|c| $debugger_restart = c}
|
||||
if CONTINUATIONS_SUPPORTED
|
||||
unless defined?($debugger_restart) and $debugger_restart
|
||||
callcc{|c| $debugger_restart = c}
|
||||
end
|
||||
end
|
||||
set_last_thread(Thread.current)
|
||||
frame_pos = 0
|
||||
|
|
@ -648,7 +656,11 @@ class DEBUGGER__
|
|||
stdout.printf "%s\n", debug_eval($', binding).inspect
|
||||
|
||||
when /^\s*r(?:estart)?$/
|
||||
$debugger_restart.call
|
||||
if CONTINUATIONS_SUPPORTED
|
||||
$debugger_restart.call
|
||||
else
|
||||
stdout.print "Restart requires continuations.\n"
|
||||
end
|
||||
|
||||
when /^\s*h(?:elp)?$/
|
||||
debug_print_help()
|
||||
|
|
@ -1097,9 +1109,11 @@ EOHELP
|
|||
|
||||
stdout.printf "Debug.rb\n"
|
||||
stdout.printf "Emacs support available.\n\n"
|
||||
RubyVM::InstructionSequence.compile_option = {
|
||||
trace_instruction: true
|
||||
}
|
||||
if defined?(RubyVM::InstructionSequence)
|
||||
RubyVM::InstructionSequence.compile_option = {
|
||||
trace_instruction: true
|
||||
}
|
||||
end
|
||||
set_trace_func proc { |event, file, line, id, binding, klass, *rest|
|
||||
DEBUGGER__.context.trace_func event, file, line, id, binding, klass
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue