ruby-debug-ide22 0.7.4 → 0.7.5

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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +75 -75
  3. data/ChangeLog.archive +1073 -1073
  4. data/ChangeLog.md +594 -594
  5. data/Gemfile +38 -38
  6. data/MIT-LICENSE +24 -24
  7. data/Rakefile +92 -92
  8. data/bin/gdb_wrapper +96 -96
  9. data/bin/rdebug-ide +200 -200
  10. data/ext/mkrf_conf.rb +44 -44
  11. data/lib/ruby-debug-ide/attach/debugger_loader.rb +20 -20
  12. data/lib/ruby-debug-ide/attach/gdb.rb +73 -73
  13. data/lib/ruby-debug-ide/attach/lldb.rb +71 -71
  14. data/lib/ruby-debug-ide/attach/native_debugger.rb +133 -133
  15. data/lib/ruby-debug-ide/attach/process_thread.rb +54 -54
  16. data/lib/ruby-debug-ide/attach/util.rb +114 -114
  17. data/lib/ruby-debug-ide/command.rb +187 -187
  18. data/lib/ruby-debug-ide/commands/breakpoints.rb +128 -128
  19. data/lib/ruby-debug-ide/commands/catchpoint.rb +64 -64
  20. data/lib/ruby-debug-ide/commands/condition.rb +51 -51
  21. data/lib/ruby-debug-ide/commands/control.rb +164 -158
  22. data/lib/ruby-debug-ide/commands/enable.rb +203 -203
  23. data/lib/ruby-debug-ide/commands/eval.rb +64 -64
  24. data/lib/ruby-debug-ide/commands/expression_info.rb +71 -71
  25. data/lib/ruby-debug-ide/commands/file_filtering.rb +106 -106
  26. data/lib/ruby-debug-ide/commands/frame.rb +155 -155
  27. data/lib/ruby-debug-ide/commands/inspect.rb +25 -25
  28. data/lib/ruby-debug-ide/commands/load.rb +17 -17
  29. data/lib/ruby-debug-ide/commands/stepping.rb +108 -108
  30. data/lib/ruby-debug-ide/commands/threads.rb +178 -178
  31. data/lib/ruby-debug-ide/commands/variables.rb +154 -154
  32. data/lib/ruby-debug-ide/event_processor.rb +71 -71
  33. data/lib/ruby-debug-ide/greeter.rb +42 -42
  34. data/lib/ruby-debug-ide/helper.rb +33 -33
  35. data/lib/ruby-debug-ide/ide_processor.rb +155 -155
  36. data/lib/ruby-debug-ide/interface.rb +47 -45
  37. data/lib/ruby-debug-ide/multiprocess/monkey.rb +46 -46
  38. data/lib/ruby-debug-ide/multiprocess/pre_child.rb +58 -58
  39. data/lib/ruby-debug-ide/multiprocess/starter.rb +10 -10
  40. data/lib/ruby-debug-ide/multiprocess/unmonkey.rb +30 -30
  41. data/lib/ruby-debug-ide/multiprocess.rb +22 -22
  42. data/lib/ruby-debug-ide/thread_alias.rb +26 -26
  43. data/lib/ruby-debug-ide/version.rb +3 -3
  44. data/lib/ruby-debug-ide/xml_printer.rb +570 -570
  45. data/lib/ruby-debug-ide.rb +230 -228
  46. data/ruby-debug-ide.gemspec +47 -47
  47. metadata +4 -4
@@ -1,128 +1,128 @@
1
- module Debugger
2
- class AddBreakpoint < Command # :nodoc:
3
- self.control = true
4
-
5
- def regexp
6
- / ^\s*
7
- b(?:reak)?
8
- (?: \s+
9
- (?:
10
- (\d+) |
11
- (.+?)[:.#]([^.:\s]+)
12
- ))?
13
- (?:\s+
14
- if\s+(.+)
15
- )?
16
- $
17
- /x
18
- end
19
-
20
- def execute
21
- if @match[1]
22
- line, _, _, expr = @match.captures
23
- else
24
- _, file, line, expr = @match.captures
25
- end
26
-
27
- if file.nil?
28
- file = File.basename(@state.file)
29
- else
30
- if line !~ /^\d+$/
31
- klass = debug_silent_eval(file)
32
- if klass && !klass.kind_of?(Module)
33
- print_error "Unknown class #{file}"
34
- throw :debug_error
35
- end
36
- file = klass.name if klass
37
- else
38
- file = realpath(file)
39
- end
40
- end
41
-
42
- if line =~ /^\d+$/
43
- line = line.to_i
44
- else
45
- line = line.intern.id2name
46
- end
47
-
48
- b = Debugger.add_breakpoint file, line, expr
49
- print_breakpoint_added b
50
- end
51
-
52
- class << self
53
- def help_command
54
- 'break'
55
- end
56
-
57
- def help(cmd)
58
- %{
59
- b[reak] file:line [if expr]
60
- b[reak] [file|class(:|.|#)]<line|method> [if expr] -
61
- \tset breakpoint to some position, (optionally) if expr == true
62
- }
63
- end
64
- end
65
- end
66
-
67
- class BreakpointsCommand < Command # :nodoc:
68
- self.control = true
69
-
70
- def regexp
71
- /^\s*info\s*break$/
72
- end
73
-
74
- def execute
75
- print_breakpoints Debugger.breakpoints
76
- end
77
-
78
- class << self
79
- def help_command
80
- 'break'
81
- end
82
-
83
- def help(cmd)
84
- %{
85
- b[reak]\tlist breakpoints
86
- }
87
- end
88
- end
89
- end
90
-
91
- class DeleteBreakpointCommand < Command # :nodoc:
92
- self.control = true
93
-
94
- def regexp
95
- /^\s*del(?:ete)?(?:\s+(.*))?$/
96
- end
97
-
98
- def execute
99
- brkpts = @match[1]
100
- unless brkpts
101
- Debugger.breakpoints.clear
102
- else
103
- brkpts.split(/[ \t]+/).each do |pos|
104
- pos = get_int(pos, "Delete", 1)
105
- return unless pos
106
- b = Debugger.remove_breakpoint(pos)
107
- if b
108
- print_breakpoint_deleted b
109
- else
110
- print_error "No breakpoint number %d\n", pos
111
- end
112
- end
113
- end
114
- end
115
-
116
- class << self
117
- def help_command
118
- 'delete'
119
- end
120
-
121
- def help(cmd)
122
- %{
123
- del[ete][ nnn...]\tdelete some or all breakpoints
124
- }
125
- end
126
- end
127
- end
128
- end
1
+ module Debugger
2
+ class AddBreakpoint < Command # :nodoc:
3
+ self.control = true
4
+
5
+ def regexp
6
+ / ^\s*
7
+ b(?:reak)?
8
+ (?: \s+
9
+ (?:
10
+ (\d+) |
11
+ (.+?)[:.#]([^.:\s]+)
12
+ ))?
13
+ (?:\s+
14
+ if\s+(.+)
15
+ )?
16
+ $
17
+ /x
18
+ end
19
+
20
+ def execute
21
+ if @match[1]
22
+ line, _, _, expr = @match.captures
23
+ else
24
+ _, file, line, expr = @match.captures
25
+ end
26
+
27
+ if file.nil?
28
+ file = File.basename(@state.file)
29
+ else
30
+ if line !~ /^\d+$/
31
+ klass = debug_silent_eval(file)
32
+ if klass && !klass.kind_of?(Module)
33
+ print_error "Unknown class #{file}"
34
+ throw :debug_error
35
+ end
36
+ file = klass.name if klass
37
+ else
38
+ file = realpath(file)
39
+ end
40
+ end
41
+
42
+ if line =~ /^\d+$/
43
+ line = line.to_i
44
+ else
45
+ line = line.intern.id2name
46
+ end
47
+
48
+ b = Debugger.add_breakpoint file, line, expr
49
+ print_breakpoint_added b
50
+ end
51
+
52
+ class << self
53
+ def help_command
54
+ 'break'
55
+ end
56
+
57
+ def help(cmd)
58
+ %{
59
+ b[reak] file:line [if expr]
60
+ b[reak] [file|class(:|.|#)]<line|method> [if expr] -
61
+ \tset breakpoint to some position, (optionally) if expr == true
62
+ }
63
+ end
64
+ end
65
+ end
66
+
67
+ class BreakpointsCommand < Command # :nodoc:
68
+ self.control = true
69
+
70
+ def regexp
71
+ /^\s*info\s*break$/
72
+ end
73
+
74
+ def execute
75
+ print_breakpoints Debugger.breakpoints
76
+ end
77
+
78
+ class << self
79
+ def help_command
80
+ 'break'
81
+ end
82
+
83
+ def help(cmd)
84
+ %{
85
+ b[reak]\tlist breakpoints
86
+ }
87
+ end
88
+ end
89
+ end
90
+
91
+ class DeleteBreakpointCommand < Command # :nodoc:
92
+ self.control = true
93
+
94
+ def regexp
95
+ /^\s*del(?:ete)?(?:\s+(.*))?$/
96
+ end
97
+
98
+ def execute
99
+ brkpts = @match[1]
100
+ unless brkpts
101
+ Debugger.breakpoints.clear
102
+ else
103
+ brkpts.split(/[ \t]+/).each do |pos|
104
+ pos = get_int(pos, "Delete", 1)
105
+ return unless pos
106
+ b = Debugger.remove_breakpoint(pos)
107
+ if b
108
+ print_breakpoint_deleted b
109
+ else
110
+ print_error "No breakpoint number %d\n", pos
111
+ end
112
+ end
113
+ end
114
+ end
115
+
116
+ class << self
117
+ def help_command
118
+ 'delete'
119
+ end
120
+
121
+ def help(cmd)
122
+ %{
123
+ del[ete][ nnn...]\tdelete some or all breakpoints
124
+ }
125
+ end
126
+ end
127
+ end
128
+ end
@@ -1,64 +1,64 @@
1
- module Debugger
2
- class CatchCommand < Command # :nodoc:
3
- self.control = true
4
-
5
- def regexp
6
- /^\s* cat(?:ch)?
7
- (?:\s+ (\S+))?
8
- (?:\s+ (off))? \s* $/ix
9
- end
10
-
11
- def execute
12
- excn = @match[1]
13
- if not excn
14
- # No args given.
15
- errmsg "Exception class must be specified for 'catch' command"
16
- elsif not @match[2]
17
- # One arg given.
18
- if 'off' == excn
19
- clear_catchpoints
20
- else
21
- Debugger.add_catchpoint(excn)
22
- print_catchpoint_set(excn)
23
- end
24
- elsif @match[2] != 'off'
25
- errmsg "Off expected. Got %s\n", @match[2]
26
- elsif remove_catchpoint(excn)
27
- print_catchpoint_deleted(excn)
28
- else
29
- errmsg "Catch for exception %s not found.\n", excn
30
- end
31
- end
32
-
33
- class << self
34
- def help_command
35
- 'catch'
36
- end
37
-
38
- def help(cmd)
39
- %{
40
- cat[ch]\t\t\tshow catchpoint
41
- cat[ch] off \tremove all catch points
42
- cat[ch] <an Exception>\tset catchpoint to an exception
43
- cat[ch] <an Exception> off \tremove catchpoint for an exception
44
- }
45
- end
46
- end
47
-
48
- private
49
-
50
- def clear_catchpoints
51
- if Debugger.respond_to?(:clear_catchpoints)
52
- Debugger.clear_catchpoints
53
- else
54
- Debugger.catchpoints.clear
55
- end
56
- end
57
-
58
- def remove_catchpoint(excn)
59
- return Debugger.remove_catchpoint(excn) if Debugger.respond_to?(:remove_catchpoint)
60
- return Debugger.catchpoints.delete(excn) if Debugger.catchpoints.member?(excn)
61
- false
62
- end
63
- end
64
- end
1
+ module Debugger
2
+ class CatchCommand < Command # :nodoc:
3
+ self.control = true
4
+
5
+ def regexp
6
+ /^\s* cat(?:ch)?
7
+ (?:\s+ (\S+))?
8
+ (?:\s+ (off))? \s* $/ix
9
+ end
10
+
11
+ def execute
12
+ excn = @match[1]
13
+ if not excn
14
+ # No args given.
15
+ errmsg "Exception class must be specified for 'catch' command"
16
+ elsif not @match[2]
17
+ # One arg given.
18
+ if 'off' == excn
19
+ clear_catchpoints
20
+ else
21
+ Debugger.add_catchpoint(excn)
22
+ print_catchpoint_set(excn)
23
+ end
24
+ elsif @match[2] != 'off'
25
+ errmsg "Off expected. Got %s\n", @match[2]
26
+ elsif remove_catchpoint(excn)
27
+ print_catchpoint_deleted(excn)
28
+ else
29
+ errmsg "Catch for exception %s not found.\n", excn
30
+ end
31
+ end
32
+
33
+ class << self
34
+ def help_command
35
+ 'catch'
36
+ end
37
+
38
+ def help(cmd)
39
+ %{
40
+ cat[ch]\t\t\tshow catchpoint
41
+ cat[ch] off \tremove all catch points
42
+ cat[ch] <an Exception>\tset catchpoint to an exception
43
+ cat[ch] <an Exception> off \tremove catchpoint for an exception
44
+ }
45
+ end
46
+ end
47
+
48
+ private
49
+
50
+ def clear_catchpoints
51
+ if Debugger.respond_to?(:clear_catchpoints)
52
+ Debugger.clear_catchpoints
53
+ else
54
+ Debugger.catchpoints.clear
55
+ end
56
+ end
57
+
58
+ def remove_catchpoint(excn)
59
+ return Debugger.remove_catchpoint(excn) if Debugger.respond_to?(:remove_catchpoint)
60
+ return Debugger.catchpoints.delete(excn) if Debugger.catchpoints.member?(excn)
61
+ false
62
+ end
63
+ end
64
+ end
@@ -1,51 +1,51 @@
1
- module Debugger
2
-
3
- class ConditionCommand < Command # :nodoc:
4
- self.control = true
5
-
6
- def regexp
7
- /^\s* cond(?:ition)? (?:\s+(\d+)\s*(.*))?$/ix
8
- end
9
-
10
- def execute
11
- if not @match[1]
12
- errmsg "\"condition\" must be followed a breakpoint number and expression\n"
13
- else
14
- breakpoints = Debugger.breakpoints.sort_by{|b| b.id }
15
- largest = breakpoints.inject(0) do |largest_so_far, b|
16
- b.id if b.id > largest_so_far
17
- end
18
- if 0 == largest
19
- print "No breakpoints have been set.\n"
20
- return
21
- end
22
- pos = get_int(@match[1], "Condition", 1, largest)
23
- return unless pos
24
- breakpoints.each do |b|
25
- if b.id == pos
26
- b.expr = @match[2].empty? ? nil : Command.unescape_incoming(@match[2])
27
- print_contdition_set(b.id)
28
- break
29
- end
30
- end
31
-
32
- end
33
- end
34
-
35
- class << self
36
- def help_command
37
- 'condition'
38
- end
39
-
40
- def help(cmd)
41
- %{
42
- Condition breakpoint-number expression
43
- Specify breakpoint number N to break only if COND is true.
44
- N is an integer and COND is an expression to be evaluated whenever
45
- breakpoint N is reached. If the empty string is used, the condition is removed.
46
- }
47
- end
48
- end
49
- end
50
-
51
- end # module Debugger
1
+ module Debugger
2
+
3
+ class ConditionCommand < Command # :nodoc:
4
+ self.control = true
5
+
6
+ def regexp
7
+ /^\s* cond(?:ition)? (?:\s+(\d+)\s*(.*))?$/ix
8
+ end
9
+
10
+ def execute
11
+ if not @match[1]
12
+ errmsg "\"condition\" must be followed a breakpoint number and expression\n"
13
+ else
14
+ breakpoints = Debugger.breakpoints.sort_by{|b| b.id }
15
+ largest = breakpoints.inject(0) do |largest_so_far, b|
16
+ b.id if b.id > largest_so_far
17
+ end
18
+ if 0 == largest
19
+ print "No breakpoints have been set.\n"
20
+ return
21
+ end
22
+ pos = get_int(@match[1], "Condition", 1, largest)
23
+ return unless pos
24
+ breakpoints.each do |b|
25
+ if b.id == pos
26
+ b.expr = @match[2].empty? ? nil : Command.unescape_incoming(@match[2])
27
+ print_contdition_set(b.id)
28
+ break
29
+ end
30
+ end
31
+
32
+ end
33
+ end
34
+
35
+ class << self
36
+ def help_command
37
+ 'condition'
38
+ end
39
+
40
+ def help(cmd)
41
+ %{
42
+ Condition breakpoint-number expression
43
+ Specify breakpoint number N to break only if COND is true.
44
+ N is an integer and COND is an expression to be evaluated whenever
45
+ breakpoint N is reached. If the empty string is used, the condition is removed.
46
+ }
47
+ end
48
+ end
49
+ end
50
+
51
+ end # module Debugger