ruby-debug19 0.11.5 → 0.11.6

Sign up to get free protection for your applications and to get access to all the features.
data/AUTHORS CHANGED
@@ -4,6 +4,7 @@ Kent Sibilev
4
4
  Contributors:
5
5
  Markus Barchfeld
6
6
  R. Bernstein
7
+ Anders Lindgren
7
8
 
8
9
  Contributor and maintainer:
9
10
  Mark Moseley
@@ -91,7 +91,7 @@ item. If \'verbose\' is given then the entire stack frame is shown.'],
91
91
  end
92
92
 
93
93
  def execute
94
- if @match[1].empty?
94
+ if !@match[1]
95
95
  errmsg "\"info\" must be followed by the name of an info command:\n"
96
96
  print "List of info subcommands:\n\n"
97
97
  for subcmd in Subcommands do
@@ -0,0 +1,66 @@
1
+ module Debugger
2
+
3
+ # Implements debugger "jump" command
4
+ class JumpCommand < Command
5
+ self.allow_in_control = true
6
+
7
+ def numeric?(object)
8
+ true if Float(object) rescue false
9
+ end
10
+
11
+ def regexp
12
+ / ^\s*
13
+ j(?:ump)? \s*
14
+ (?:\s+(\S+))?\s*
15
+ (?:\s+(\S+))?\s*
16
+ $
17
+ /ix
18
+ end
19
+
20
+ def execute
21
+ if !@match[1]
22
+ errmsg "\"jump\" must be followed by a line number\n"
23
+ return
24
+ end
25
+ if !numeric?(@match[1])
26
+ puts "Bad line number: " + @match[1]
27
+ return
28
+ end
29
+ line = @match[1].to_i
30
+ line = @state.context.frame_line(0) + line if @match[1][0] == '+' or @match[1][0] == '-'
31
+ if line == @state.context.frame_line(0)
32
+ CommandProcessor.print_location_and_text(@state.context.frame_file(0), line)
33
+ return
34
+ end
35
+ file = @match[2]
36
+ file = @state.context.frame_file(file.to_i) if numeric?(file)
37
+ file = @state.context.frame_file(0) if !file
38
+ case Debugger.current_context.jump(line, file)
39
+ when 0
40
+ @state.proceed
41
+ when 1
42
+ errmsg "Not possible to jump from here\n"
43
+ when 2
44
+ errmsg "Couldn't find debugged frame\n"
45
+ when 3
46
+ errmsg "Couldn't find active code at " + file + ":" + line.to_s + "\n"
47
+ end
48
+ end
49
+
50
+ class << self
51
+ def help_command
52
+ %w[jump]
53
+ end
54
+
55
+ def help(cmd)
56
+ %{
57
+ j[ump] line\tjump to line number (absolute)
58
+ j[ump] -line\tjump back to line (relative)
59
+ j[ump] +line\tjump ahead to line (relative)
60
+
61
+ Change the next line of code to be executed.
62
+ }
63
+ end
64
+ end
65
+ end
66
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-debug19
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.5
4
+ version: 0.11.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kent Sibilev
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-08-24 00:00:00 -07:00
13
+ date: 2009-09-01 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -41,7 +41,7 @@ dependencies:
41
41
  requirements:
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- version: 0.11.15
44
+ version: 0.11.19
45
45
  version:
46
46
  description: A generic command line interface for ruby-debug.
47
47
  email: mark@fast-software.com
@@ -76,6 +76,7 @@ files:
76
76
  - cli/ruby-debug/commands/help.rb
77
77
  - cli/ruby-debug/commands/info.rb
78
78
  - cli/ruby-debug/commands/irb.rb
79
+ - cli/ruby-debug/commands/jump.rb
79
80
  - cli/ruby-debug/commands/kill.rb
80
81
  - cli/ruby-debug/commands/list.rb
81
82
  - cli/ruby-debug/commands/method.rb