ruby-debug 0.7.4-mswin32 → 0.7.5-mswin32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGES CHANGED
@@ -1,3 +1,8 @@
1
+ 0.7.5
2
+ - Fixed 'reload on' command
3
+ - 'reload on' command is removed in favor of 'set autoreload'
4
+ - rdebug will evaluate ~/.rdebugrc script on startup
5
+
1
6
  0.7.4
2
7
  - Added a workaround of the Ruby interpreter problem where a method created with Module#define_method
3
8
  and which raises an exception doesn't trigger a :return event, this way screwing the stack trace.
data/bin/rdebug CHANGED
@@ -93,12 +93,16 @@ else
93
93
  Debugger.wait_connection = options.wait
94
94
  Debugger.keep_frame_binding = options.frame_bind
95
95
 
96
- # load user script
97
- load "#{ENV["HOME"]}/.rdebugrc" if File.exists?("#{ENV["HOME"]}/.rdebugrc")
96
+ load_initrc = lambda do
97
+ script_file = "#{ENV["HOME"] || ENV["HOMEPATH" || "."]}/.rdebugrc"
98
+ Debugger.run_script script_file if File.exists?(script_file)
99
+ end
98
100
 
99
101
  if options.server
100
102
  # start remote mode
101
103
  Debugger.start_remote(options.host, [options.port, options.cport], options.post_mortem)
104
+ # load initrc script
105
+ load_initrc.call
102
106
  # load script
103
107
  Debugger.debug_load Debugger::PROG_SCRIPT
104
108
  else
@@ -106,6 +110,9 @@ else
106
110
  Debugger.start
107
111
  # start control thread
108
112
  Debugger.start_control(options.host, options.cport)
113
+
114
+ # load initrc script
115
+ load_initrc.call
109
116
 
110
117
  # run startup script if specified
111
118
  if options.script
data/ext/ruby_debug.c CHANGED
@@ -4,7 +4,7 @@
4
4
  #include <rubysig.h>
5
5
  #include <st.h>
6
6
 
7
- #define DEBUG_VERSION "0.7.4"
7
+ #define DEBUG_VERSION "0.7.5"
8
8
 
9
9
  #ifdef _WIN32
10
10
  struct FRAME {
@@ -1952,12 +1952,12 @@ context_set_tracing(VALUE self, VALUE value)
1952
1952
 
1953
1953
  /*
1954
1954
  * call-seq:
1955
- * context.ignore -> bool
1955
+ * context.ignored? -> bool
1956
1956
  *
1957
1957
  * Returns the ignore flag for the current context.
1958
1958
  */
1959
1959
  static VALUE
1960
- context_ignore(VALUE self)
1960
+ context_ignored(VALUE self)
1961
1961
  {
1962
1962
  debug_context_t *debug_context;
1963
1963
 
@@ -2069,7 +2069,7 @@ Init_context()
2069
2069
  rb_define_method(cContext, "resume", context_resume, 0);
2070
2070
  rb_define_method(cContext, "tracing", context_tracing, 0);
2071
2071
  rb_define_method(cContext, "tracing=", context_set_tracing, 1);
2072
- rb_define_method(cContext, "ignore", context_ignore, 0);
2072
+ rb_define_method(cContext, "ignored?", context_ignored, 0);
2073
2073
  rb_define_method(cContext, "frame_binding", context_frame_binding, 1);
2074
2074
  rb_define_method(cContext, "frame_id", context_frame_id, 1);
2075
2075
  rb_define_method(cContext, "frame_line", context_frame_line, 1);
data/lib/ruby-debug.rb CHANGED
@@ -173,23 +173,23 @@ module Debugger
173
173
 
174
174
  def source_for(file) # :nodoc:
175
175
  finder = lambda do
176
- unless File.exists?(file)
177
- return (SCRIPT_LINES__[file] == true ? nil : SCRIPT_LINES__[file])
178
- end
176
+ if File.exists?(file)
177
+ if SCRIPT_LINES__[file].nil? || SCRIPT_LINES__[file] == true
178
+ SCRIPT_LINES__[file] = File.readlines(file)
179
+ end
179
180
 
180
- if SCRIPT_LINES__[file].nil? || SCRIPT_LINES__[file] == true
181
- SCRIPT_LINES__[file] = File.readlines(file)
182
- end
181
+ change_time = test(?M, file)
182
+ SCRIPT_TIMESTAMPS__[file] ||= change_time
183
+ if @reload_source_on_change && SCRIPT_TIMESTAMPS__[file] < change_time
184
+ SCRIPT_LINES__[file] = File.readlines(file)
185
+ end
183
186
 
184
- change_time = test(?M, file)
185
- SCRIPT_TIMESTAMPS__[file] ||= change_time
186
- if @reload_source_on_change && SCRIPT_TIMESTAMPS__[file] < change_time
187
- SCRIPT_LINES__[file] = File.readlines(file)
187
+ SCRIPT_LINES__[file]
188
188
  end
189
-
190
- SCRIPT_LINES__[file]
191
189
  end
192
- Dir.chdir(File.dirname($0)){finder.call} || finder.call
190
+
191
+ Dir.chdir(File.dirname($0)){finder.call} || finder.call ||
192
+ (SCRIPT_LINES__[file] == true ? nil : SCRIPT_LINES__[file])
193
193
  end
194
194
 
195
195
  def source_reload
@@ -70,13 +70,13 @@ module Debugger
70
70
  rescue StandardError, ScriptError => e
71
71
  if @@display_stack_trace
72
72
  at = eval("caller(1)", b)
73
- print "%s:%s\n", at.shift, e.to_s.sub(/\(eval\):1:(in `.*?':)?/, '')
73
+ print "%s:%s\n", at.shift, e.to_s.sub(/\(eval\):1:(in `.*?':)?/, '')
74
74
  for i in at
75
75
  print "\tfrom %s\n", i
76
76
  end
77
- else
78
- print "Exception #{e.class}: #{e.message}\n"
79
- end
77
+ else
78
+ print "#{e.class} Exception: #{e.message}\n"
79
+ end
80
80
  throw :debug_error
81
81
  end
82
82
  end
@@ -70,17 +70,12 @@ module Debugger
70
70
  self.control = true
71
71
 
72
72
  def regexp
73
- /^\s*r(?:eload)?(?:\s*(on|off))?$/
73
+ /^\s*r(?:eload)?$/
74
74
  end
75
75
 
76
76
  def execute
77
- if @match[1]
78
- Debugger.reload_source_on_change = (@match[1] == 'on')
79
- print "Automatic reloading is #{source_reloading}.\n"
80
- else
81
- Debugger.source_reload
82
- print "Source code is reloaded. Automatic reloading is #{source_reloading}.\n"
83
- end
77
+ Debugger.source_reload
78
+ print "Source code is reloaded. Automatic reloading is #{source_reloading}.\n"
84
79
  end
85
80
 
86
81
  private
@@ -97,7 +92,6 @@ module Debugger
97
92
  def help(cmd)
98
93
  %{
99
94
  r[eload]\tforces source code reloading
100
- r[eload] on/off\tenales/disables automatic source code reloading
101
95
  }
102
96
  end
103
97
  end
@@ -10,13 +10,16 @@ module Debugger
10
10
  case @match[1]
11
11
  when /^(no)?autolist$/
12
12
  ListCommand.always_run = $1.nil?
13
- print "Listing is #{$1.nil? ? 'on' : 'off'}.\n"
13
+ print "autolist is #{$1.nil? ? 'on' : 'off'}.\n"
14
14
  when /^(no)?autoeval$/
15
15
  EvalCommand.unknown = $1.nil?
16
- print "Evaluation of unrecognized command is #{$1.nil? ? 'on' : 'off'}.\n"
16
+ print "autoeval is #{$1.nil? ? 'on' : 'off'}.\n"
17
17
  when /^(no)?trace$/
18
18
  @@display_stack_trace = $1.nil?
19
19
  print "Display stack trace is #{$1.nil? ? 'on' : 'off'}.\n"
20
+ when /^(no)?autoreload$/
21
+ Debugger.reload_source_on_change = $1.nil?
22
+ print "autoreload is #{$1.nil? ? 'on' : 'off'}.\n"
20
23
  else
21
24
  print "Unknown setting.\n"
22
25
  end
@@ -30,9 +33,10 @@ module Debugger
30
33
  def help(cmd)
31
34
  %{
32
35
  set <setting>, where <setting>:
33
- autolist - execute 'list' command on every breakpoint
34
- autoeval - evaluate every unrecognized command
35
- trace - display stack trace when 'eval' raises exception
36
+ autolist - execute 'list' command on every breakpoint
37
+ autoeval - evaluate every unrecognized command
38
+ autoreload - enables automatic source code reloading
39
+ trace - display stack trace when 'eval' raises exception
36
40
  To disable setting, use 'no' prefix, like 'noautolist'
37
41
  }
38
42
  end
@@ -3,7 +3,7 @@ module Debugger
3
3
  def display_context(c)
4
4
  c_flag = c.thread == Thread.current ? '+' : ' '
5
5
  c_flag = '$' if c.suspended?
6
- d_flag = debugger_thread?(c) ? '!' : ' '
6
+ d_flag = c.ignored? ? '!' : ' '
7
7
  print "%s%s", c_flag, d_flag
8
8
  print "%d ", c.thnum
9
9
  print "%s\t", c.thread.inspect
@@ -12,10 +12,6 @@ module Debugger
12
12
  end
13
13
  print "\n"
14
14
  end
15
-
16
- def debugger_thread?(c)
17
- [Debugger.thread, Debugger.control_thread].include?(c.thread)
18
- end
19
15
  end
20
16
 
21
17
  class ThreadListCommand < Command # :nodoc:
@@ -60,7 +56,7 @@ module Debugger
60
56
  case
61
57
  when c == @state.context
62
58
  print "It's the current thread.\n"
63
- when debugger_thread?(c)
59
+ when c.ignored?
64
60
  print "Can't switch to the debugger thread.\n"
65
61
  else
66
62
  display_context(c)
@@ -98,7 +94,7 @@ module Debugger
98
94
  case
99
95
  when c == @state.context
100
96
  print "It's the current thread.\n"
101
- when debugger_thread?(c)
97
+ when c.ignored?
102
98
  print "Can't stop the debugger thread.\n"
103
99
  else
104
100
  c.suspend
@@ -160,7 +156,7 @@ module Debugger
160
156
  case
161
157
  when c == @state.context
162
158
  print "It's the current thread.\n"
163
- when debugger_thread?(c)
159
+ when c.ignored?
164
160
  print "Can't resume the debugger thread.\n"
165
161
  when !c.thread.stop?
166
162
  print "Already running."
@@ -96,19 +96,19 @@ module Debugger
96
96
  commands.select{|cmd| cmd.class.always_run }.each{|cmd| cmd.execute }
97
97
 
98
98
  splitter = lambda do |str|
99
- str.split(/;/).inject([]) do |m, v|
100
- if m.empty?
101
- m << v
102
- else
103
- if m.last[-1] == ?\\
104
- m.last[-1,1] = ''
105
- m.last << ';' << v
106
- else
107
- m << v
108
- end
109
- end
110
- m
111
- end
99
+ str.split(/;/).inject([]) do |m, v|
100
+ if m.empty?
101
+ m << v
102
+ else
103
+ if m.last[-1] == ?\\
104
+ m.last[-1,1] = ''
105
+ m.last << ';' << v
106
+ else
107
+ m << v
108
+ end
109
+ end
110
+ m
111
+ end
112
112
  end
113
113
 
114
114
  while !state.proceed? and input = @interface.read_command(prompt(context))
data/lib/ruby_debug.so CHANGED
Binary file
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.1
3
3
  specification_version: 1
4
4
  name: ruby-debug
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.7.4
7
- date: 2007-02-05 17:50:34 -05:00
6
+ version: 0.7.5
7
+ date: 2007-02-09 02:00:35 -05:00
8
8
  summary: Fast Ruby debugger
9
9
  require_paths:
10
10
  - lib