ruby-debug 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +94 -2
- data/ChangeLog +5225 -0
- data/README +30 -1
- data/Rakefile +55 -24
- data/bin/rdebug +249 -128
- data/cli/ruby-debug/command.rb +30 -3
- data/cli/ruby-debug/commands/breakpoints.rb +54 -24
- data/cli/ruby-debug/commands/catchpoint.rb +13 -12
- data/cli/ruby-debug/commands/condition.rb +49 -0
- data/cli/ruby-debug/commands/continue.rb +32 -0
- data/cli/ruby-debug/commands/control.rb +19 -43
- data/cli/ruby-debug/commands/disassemble.RB +38 -0
- data/cli/ruby-debug/commands/display.rb +1 -1
- data/cli/ruby-debug/commands/edit.rb +48 -0
- data/cli/ruby-debug/commands/enable.rb +78 -35
- data/cli/ruby-debug/commands/eval.rb +6 -5
- data/cli/ruby-debug/commands/finish.rb +42 -0
- data/cli/ruby-debug/commands/frame.rb +64 -33
- data/cli/ruby-debug/commands/help.rb +19 -15
- data/cli/ruby-debug/commands/info.rb +295 -36
- data/cli/ruby-debug/commands/irb.rb +3 -1
- data/cli/ruby-debug/commands/list.rb +27 -50
- data/cli/ruby-debug/commands/quit.rb +38 -0
- data/cli/ruby-debug/commands/reload.rb +40 -0
- data/cli/ruby-debug/commands/save.rb +80 -0
- data/cli/ruby-debug/commands/{settings.rb → set.rb} +50 -12
- data/cli/ruby-debug/commands/show.rb +83 -27
- data/cli/ruby-debug/commands/source.rb +36 -0
- data/cli/ruby-debug/commands/stepping.rb +36 -72
- data/cli/ruby-debug/commands/threads.rb +32 -23
- data/cli/ruby-debug/commands/variables.rb +34 -4
- data/cli/ruby-debug/helper.rb +10 -75
- data/cli/ruby-debug/interface.rb +72 -9
- data/cli/ruby-debug/processor.rb +203 -100
- data/doc/rdebug.1 +7 -2
- data/rdbg.rb +33 -0
- data/test/{test-ruby-debug-base.rb → base/base.rb} +27 -29
- data/test/base/binding.rb +31 -0
- data/test/base/catchpoint.rb +26 -0
- data/test/base/load.rb +40 -0
- data/test/data/annotate.cmd +29 -0
- data/test/data/annotate.right +137 -0
- data/test/data/break_bad.cmd +18 -0
- data/test/data/break_bad.right +28 -0
- data/test/data/breakpoints.cmd +38 -0
- data/test/data/breakpoints.right +98 -0
- data/test/data/condition.cmd +28 -0
- data/test/data/condition.right +65 -0
- data/test/data/ctrl.cmd +23 -0
- data/test/data/ctrl.right +69 -0
- data/test/{display.cmd → data/display.cmd} +7 -1
- data/test/{display.right → data/display.right} +13 -6
- data/test/data/dollar-0.right +2 -0
- data/test/data/dollar-0a.right +2 -0
- data/test/data/dollar-0b.right +2 -0
- data/test/data/edit.cmd +12 -0
- data/test/data/edit.right +19 -0
- data/test/{breakpoints.cmd → data/emacs_basic.cmd} +0 -0
- data/test/{breakpoints.right → data/emacs_basic.right} +24 -12
- data/test/data/enable.cmd +20 -0
- data/test/data/enable.right +36 -0
- data/test/data/finish.cmd +16 -0
- data/test/data/finish.right +43 -0
- data/test/{frame.cmd → data/frame.cmd} +2 -0
- data/test/{frame.right → data/frame.right} +8 -2
- data/test/{help.cmd → data/help.cmd} +8 -0
- data/test/data/help.right +21 -0
- data/test/data/history.right +7 -0
- data/test/data/info-thread.cmd +13 -0
- data/test/data/info-thread.right +37 -0
- data/test/data/info-var-bug2.cmd +5 -0
- data/test/data/info-var-bug2.right +10 -0
- data/test/{info-var.cmd → data/info-var.cmd} +3 -3
- data/test/{info-var.right → data/info-var.right} +20 -15
- data/test/{info.cmd → data/info.cmd} +10 -1
- data/test/data/info.right +65 -0
- data/test/data/linetrace.cmd +6 -0
- data/test/data/linetrace.right +32 -0
- data/test/data/linetracep.cmd +7 -0
- data/test/data/linetracep.right +25 -0
- data/test/data/list.cmd +19 -0
- data/test/data/list.right +127 -0
- data/test/data/noquit.right +1 -0
- data/test/data/output.cmd +6 -0
- data/test/data/output.right +41 -0
- data/test/data/post-mortem-next.cmd +8 -0
- data/test/data/post-mortem-next.right +14 -0
- data/test/data/post-mortem-osx.right +31 -0
- data/test/data/post-mortem.cmd +13 -0
- data/test/data/post-mortem.right +31 -0
- data/test/{quit.cmd → data/quit.cmd} +2 -5
- data/test/data/quit.right +9 -0
- data/test/data/raise.cmd +11 -0
- data/test/data/raise.right +26 -0
- data/test/{setshow.cmd → data/setshow.cmd} +0 -1
- data/test/{setshow.right → data/setshow.right} +0 -1
- data/test/data/source.cmd +5 -0
- data/test/data/source.right +15 -0
- data/test/{stepping.cmd → data/stepping.cmd} +6 -2
- data/test/{stepping.right → data/stepping.right} +13 -3
- data/test/data/test-init-cygwin.right +7 -0
- data/test/data/test-init-osx.right +4 -0
- data/test/data/test-init.right +5 -0
- data/test/data/trace.right +23 -0
- data/test/dollar-0.rb +5 -0
- data/test/except-bug2.rb +7 -0
- data/test/gcd-dbg-nox.rb +31 -0
- data/test/gcd-dbg.rb +30 -0
- data/test/helper.rb +44 -14
- data/test/info-var-bug.rb +2 -0
- data/test/info-var-bug2.rb +2 -0
- data/test/null.rb +1 -0
- data/test/output.rb +2 -0
- data/test/pm-base.rb +22 -0
- data/test/pm.rb +11 -0
- data/test/raise.rb +3 -0
- data/test/tdebug.rb +88 -40
- data/test/test-annotate.rb +25 -0
- data/test/test-break-bad.rb +25 -0
- data/test/test-breakpoints.rb +14 -17
- data/test/test-condition.rb +25 -0
- data/test/test-ctrl.rb +54 -0
- data/test/test-display.rb +15 -15
- data/test/test-dollar-0.rb +39 -0
- data/test/test-edit.rb +26 -0
- data/test/test-emacs-basic.rb +26 -0
- data/test/test-enable.rb +25 -0
- data/test/test-finish.rb +34 -0
- data/test/test-frame.rb +15 -16
- data/test/test-help.rb +34 -18
- data/test/test-hist.rb +68 -0
- data/test/test-info-thread.rb +32 -0
- data/test/test-info-var.rb +28 -14
- data/test/test-info.rb +15 -17
- data/test/test-init.rb +41 -0
- data/test/test-list.rb +25 -0
- data/test/test-output.rb +26 -0
- data/test/test-pm.rb +46 -0
- data/test/test-quit.rb +19 -17
- data/test/test-raise.rb +25 -0
- data/test/test-setshow.rb +14 -13
- data/test/test-source.rb +25 -0
- data/test/test-stepping.rb +14 -14
- data/test/test-trace.rb +63 -0
- data/test/thread1.rb +26 -0
- metadata +125 -31
- data/cli/ruby-debug/commands/script.rb +0 -64
- data/runner.sh +0 -7
- data/test/help.right +0 -4
- data/test/info.right +0 -35
- data/test/quit.right +0 -22
- data/test/test-columnize.rb +0 -46
@@ -1,64 +0,0 @@
|
|
1
|
-
module Debugger
|
2
|
-
class SourceCommand < Command # :nodoc:
|
3
|
-
self.control = true
|
4
|
-
|
5
|
-
def regexp
|
6
|
-
/^\s*so(?:urce)?\s+(.+)$/
|
7
|
-
end
|
8
|
-
|
9
|
-
def execute
|
10
|
-
file = File.expand_path(@match[1]).strip
|
11
|
-
unless File.exists?(file)
|
12
|
-
print "Command file '#{file}' is not found\n"
|
13
|
-
return
|
14
|
-
end
|
15
|
-
Debugger.run_script(file, @state)
|
16
|
-
end
|
17
|
-
|
18
|
-
class << self
|
19
|
-
def help_command
|
20
|
-
'source'
|
21
|
-
end
|
22
|
-
|
23
|
-
def help(cmd)
|
24
|
-
%{
|
25
|
-
source FILE\texecutes a file containing debugger commands
|
26
|
-
}
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
class SaveCommand < Command # :nodoc:
|
32
|
-
self.control = true
|
33
|
-
|
34
|
-
def regexp
|
35
|
-
/^\s*sa(?:ve)?(?:\s+(.+))?$/
|
36
|
-
end
|
37
|
-
|
38
|
-
def execute
|
39
|
-
unless @match[1]
|
40
|
-
print "No filename specified.\n"
|
41
|
-
return
|
42
|
-
end
|
43
|
-
open(@match[1], 'w') do |file|
|
44
|
-
Debugger.breakpoints.each do |b|
|
45
|
-
file.puts "break #{b.source}:#{b.pos}#{" if #{b.expr}" if b.expr}"
|
46
|
-
end
|
47
|
-
file.puts "catch #{Debugger.catchpoint}" if Debugger.catchpoint
|
48
|
-
end
|
49
|
-
print "Saved to '#{@match[1]}'\n"
|
50
|
-
end
|
51
|
-
|
52
|
-
class << self
|
53
|
-
def help_command
|
54
|
-
'save'
|
55
|
-
end
|
56
|
-
|
57
|
-
def help(cmd)
|
58
|
-
%{
|
59
|
-
save FILE\tsaves current breakpoints and catchpoint as a script file
|
60
|
-
}
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
data/runner.sh
DELETED
data/test/help.right
DELETED
data/test/info.right
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
gcd.rb:4
|
2
|
-
def gcd(a, b)
|
3
|
-
# # ***************************************************
|
4
|
-
# # This tests step, next, finish and continue
|
5
|
-
# # ***************************************************
|
6
|
-
# set debuggertesting on
|
7
|
-
Currently testing the debugger is on.
|
8
|
-
# set callstyle last
|
9
|
-
Frame call-display style is last.
|
10
|
-
# help info
|
11
|
-
Generic command for showing things about the program being debugged.
|
12
|
-
--
|
13
|
-
List of info subcommands:
|
14
|
-
--
|
15
|
-
info args -- Argument variables of current stack frame
|
16
|
-
info breakpoints -- Status of user-settable breakpoints
|
17
|
-
info display -- Expressions to display when program stops
|
18
|
-
info file -- File names and timestamps of files read in
|
19
|
-
info global_variables -- global variables
|
20
|
-
info instance_variables -- instance variables
|
21
|
-
info line -- Line number and file name of current position in source
|
22
|
-
info locals -- Local variables of the current stack frame
|
23
|
-
info program -- Execution status of the program
|
24
|
-
info stack -- Backtrace of the stack
|
25
|
-
info threads -- IDs of currently known threads
|
26
|
-
info variables -- local and instance variables
|
27
|
-
# info args
|
28
|
-
# info line
|
29
|
-
Line 4 of "./gcd.rb"
|
30
|
-
# info locals
|
31
|
-
# info stack
|
32
|
-
--> #0 at line gcd.rb:4
|
33
|
-
# info display
|
34
|
-
There are no auto-display expressions now.
|
35
|
-
# quit
|
data/test/quit.right
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
gcd.rb:4
|
2
|
-
def gcd(a, b)
|
3
|
-
# # ***************************************************
|
4
|
-
# # This tests display expressions.
|
5
|
-
# # ***************************************************
|
6
|
-
# set debuggertesting on
|
7
|
-
Currently testing the debugger is on.
|
8
|
-
# c
|
9
|
-
The program has finished and will be restarted.
|
10
|
-
gcd.rb:4
|
11
|
-
def gcd(a, b)
|
12
|
-
# break 18
|
13
|
-
Breakpoint 1 file gcd.rb, line 18
|
14
|
-
# c
|
15
|
-
Breakpoint 1 at gcd.rb:18
|
16
|
-
gcd.rb:18
|
17
|
-
gcd(3,5)
|
18
|
-
# next
|
19
|
-
The program has finished and will be restarted.
|
20
|
-
gcd.rb:4
|
21
|
-
def gcd(a, b)
|
22
|
-
# quit
|
data/test/test-columnize.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require "test/unit"
|
3
|
-
|
4
|
-
$: << File.expand_path(File.dirname(__FILE__)) + '/../ext'
|
5
|
-
$: << File.expand_path(File.dirname(__FILE__)) + '/../cli'
|
6
|
-
$: << File.expand_path(File.dirname(__FILE__)) + '/../cli/ruby-debug'
|
7
|
-
require "ruby_debug"
|
8
|
-
|
9
|
-
# Test of Columnize function. Note: Columnize is moving out of ruby-debug,
|
10
|
-
# so this test will disappear.
|
11
|
-
class TestColumnize < Test::Unit::TestCase
|
12
|
-
include Debugger
|
13
|
-
|
14
|
-
require "command.rb"
|
15
|
-
include ColumnizeFunctions
|
16
|
-
def test_columize
|
17
|
-
assert_equal("one two three\n", columnize(["one", "two", "three"]))
|
18
|
-
assert_equal("oneitem\n", columnize(["oneitem"]))
|
19
|
-
assert_equal(
|
20
|
-
"one 6hree 11o 16e 21ree 26o 31e 36ree 41o 46e three\n" +
|
21
|
-
"two 7ne 12ree 17o 22e 27ree 32o 37e 42ree 47o \n" +
|
22
|
-
"three 8wo 13e 18ree 23o 28e 33ree 38o 43e 48ree\n" +
|
23
|
-
"4ne 9hree 14o 19e 24ree 29o 34e 39ree 44o one \n" +
|
24
|
-
"5wo 10e 15ree 20o 25e 30ree 35o 40e 45ree two \n",
|
25
|
-
columnize([
|
26
|
-
"one", "two", "three",
|
27
|
-
"4ne", "5wo", "6hree",
|
28
|
-
"7ne", "8wo", "9hree",
|
29
|
-
"10e", "11o", "12ree",
|
30
|
-
"13e", "14o", "15ree",
|
31
|
-
"16e", "17o", "18ree",
|
32
|
-
"19e", "20o", "21ree",
|
33
|
-
"22e", "23o", "24ree",
|
34
|
-
"25e", "26o", "27ree",
|
35
|
-
"28e", "29o", "30ree",
|
36
|
-
"31e", "32o", "33ree",
|
37
|
-
"34e", "35o", "36ree",
|
38
|
-
"37e", "38o", "39ree",
|
39
|
-
"40e", "41o", "42ree",
|
40
|
-
"43e", "44o", "45ree",
|
41
|
-
"46e", "47o", "48ree",
|
42
|
-
"one", "two", "three"]))
|
43
|
-
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|