rubinius-debugger 2.1.0 → 2.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a832fe4c69253b6458abd0bb1bf6743f839880d5
4
- data.tar.gz: 863249772b7628de46bc7392c8ce49fd866b5a73
3
+ metadata.gz: c435decbf9c2161060b0328b744f8430faa06df5
4
+ data.tar.gz: eb7acf5b8bf72ca9c0ff777ce3e26eab866f8b14
5
5
  SHA512:
6
- metadata.gz: 9475acd4681205b0ec14fb4a8473c42e4d7a2faebf7a666a05fdbe0a9fc693d297244188cf9cb4606b4199a91c979961f5c265cd618d52904622c23bd43bc114
7
- data.tar.gz: e47567b803b2f8b2db7c16c5e60cfc56e156e63b9ff0920a046434f68a49ca4a6a5df2ba1d6b0e65c3179335570a71eed243f043d86fb1bc76c79eee122af385
6
+ metadata.gz: 109a0daaa86d91862ef75f502f4898af65008c69b6c3a7b694b9e4b7aa2ca979dd10e0abb0d9e6d2c68ba25630bea00f7b776b955a52689e28bfe1e6a0b6cded
7
+ data.tar.gz: 871d3f032600b57f8944a03003e04841ca0b1f1ae990d4a6bcd23ed65ed453ee3d85cbf974767a44a2f63a1df8d35a21dcbd390dc68bcf44bd092b364bcff6fa
@@ -193,6 +193,7 @@ class Rubinius::Debugger
193
193
  cmd = @last_command
194
194
  else
195
195
  @last_command = cmd
196
+ Readline::History << cmd
196
197
  end
197
198
 
198
199
  command, args = cmd.to_s.strip.split(/\s+/, 2)
@@ -238,7 +239,7 @@ class Rubinius::Debugger
238
239
  end
239
240
  end
240
241
 
241
- def eval_code(args)
242
+ def eval_code(args, pretty = false)
242
243
  obj = @current_frame.run(args)
243
244
 
244
245
  idx = @user_variables
@@ -246,7 +247,13 @@ class Rubinius::Debugger
246
247
 
247
248
  str = "$d#{idx}"
248
249
  Rubinius::Globals[str.to_sym] = obj
249
- puts "#{str} = #{obj.inspect}\n"
250
+
251
+ if pretty
252
+ require 'pp'
253
+ puts "#{str} = #{obj.pretty_inspect}\n"
254
+ else
255
+ puts "#{str} = #{obj.inspect}\n"
256
+ end
250
257
  end
251
258
 
252
259
  def frame(num)
@@ -265,7 +272,7 @@ class Rubinius::Debugger
265
272
  end
266
273
  end
267
274
 
268
- def set_breakpoint_method(descriptor, method, line=nil, condition=nil)
275
+ def set_breakpoint_method(descriptor, method, line=nil, condition=nil, commands=nil, index=nil)
269
276
  exec = method.executable
270
277
 
271
278
  unless exec.kind_of?(Rubinius::CompiledCode)
@@ -288,9 +295,14 @@ class Rubinius::Debugger
288
295
  bp = BreakPoint.new(descriptor, exec, ip, line, condition)
289
296
  bp.activate
290
297
 
291
- @breakpoints << bp
292
-
293
- info "Set breakpoint #{@breakpoints.size}: #{bp.location}"
298
+ if index
299
+ bp.set_commands(commands)
300
+ @breakpoints[index] = bp
301
+ info "Set breakpoint #{index+1}: #{bp.location}"
302
+ else
303
+ @breakpoints << bp
304
+ info "Set breakpoint #{@breakpoints.size}: #{bp.location}"
305
+ end
294
306
 
295
307
  return bp
296
308
  end
@@ -104,8 +104,12 @@ class Rubinius::Debugger
104
104
  @name = name
105
105
  @line = line
106
106
  @list = list
107
+ @commands = nil
108
+ @condition = nil
107
109
  end
108
110
 
111
+ attr_reader :condition, :commands
112
+
109
113
  def descriptor
110
114
  "#{@klass_name}#{@which}#{@name}"
111
115
  end
@@ -129,7 +133,8 @@ class Rubinius::Debugger
129
133
 
130
134
  @debugger.info "Resolved breakpoint for #{@klass_name}#{@which}#{@name}"
131
135
 
132
- @debugger.set_breakpoint_method descriptor, method, @line
136
+ index = @debugger.breakpoints.index(self)
137
+ @debugger.set_breakpoint_method descriptor, method, @line, @condition, @commands, index
133
138
 
134
139
  return true
135
140
  end
@@ -143,5 +148,21 @@ class Rubinius::Debugger
143
148
  @list.delete self
144
149
  end
145
150
  end
151
+
152
+ def set_commands(commands)
153
+ @commands = commands
154
+ end
155
+
156
+ def has_commands?
157
+ !@commands.nil?
158
+ end
159
+
160
+ def set_condition(condition)
161
+ @condition = condition
162
+ end
163
+
164
+ def has_condition?
165
+ !@condition.nil?
166
+ end
146
167
  end
147
168
  end
@@ -505,6 +505,19 @@ next to the inspect output of the value.
505
505
  end
506
506
  end
507
507
 
508
+ class PrettyPrintEvalCode < Command
509
+ pattern "pp"
510
+ help "Run code in the current context"
511
+ ext_help <<-HELP
512
+ Run code in the context of the current frame. Like 'eval', but
513
+ pretty prints the result with 'pp'.
514
+ HELP
515
+
516
+ def run(args)
517
+ @debugger.eval_code(args, true)
518
+ end
519
+ end
520
+
508
521
  class Disassemble < Command
509
522
  pattern "dis", "disassemble"
510
523
  help "Show the bytecode for the current line or method"
@@ -1,5 +1,5 @@
1
1
  module Rubinius
2
2
  module Debugger
3
- VERSION = "2.1.0"
3
+ VERSION = "2.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubinius-debugger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Shirai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-26 00:00:00.000000000 Z
11
+ date: 2014-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler