debugger 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/README.md +9 -3
- data/debugger.gemspec +1 -1
- data/ext/ruby_debug/192/ruby_debug.c +21 -9
- data/ext/ruby_debug/193/ruby_debug.c +15 -5
- data/lib/debugger/test.rb +6 -0
- data/{test/support → lib/debugger/test}/breakpoint.rb +0 -0
- data/{test/support → lib/debugger/test}/context.rb +0 -0
- data/{test/support → lib/debugger/test}/matchers.rb +0 -0
- data/{test/support → lib/debugger/test}/mocha_extensions.rb +1 -1
- data/lib/debugger/test/printer_helpers.rb +8 -0
- data/{test/support → lib/debugger/test}/processor.rb +0 -0
- data/{test/support → lib/debugger/test}/test_dsl.rb +22 -2
- data/{test/support → lib/debugger/test}/test_interface.rb +4 -0
- data/lib/debugger/version.rb +1 -1
- data/lib/ruby-debug.rb +4 -1
- data/lib/ruby-debug/command.rb +18 -6
- data/lib/ruby-debug/commands/breakpoints.rb +27 -29
- data/lib/ruby-debug/commands/condition.rb +7 -2
- data/lib/ruby-debug/commands/continue.rb +1 -2
- data/lib/ruby-debug/commands/control.rb +8 -9
- data/lib/ruby-debug/commands/display.rb +7 -15
- data/lib/ruby-debug/commands/edit.rb +6 -6
- data/lib/ruby-debug/commands/enable.rb +6 -7
- data/lib/ruby-debug/commands/eval.rb +1 -3
- data/lib/ruby-debug/commands/frame.rb +72 -101
- data/lib/ruby-debug/commands/info.rb +8 -14
- data/lib/ruby-debug/commands/irb.rb +1 -1
- data/lib/ruby-debug/commands/jump.rb +6 -6
- data/lib/ruby-debug/commands/kill.rb +0 -1
- data/lib/ruby-debug/commands/list.rb +4 -4
- data/lib/ruby-debug/commands/method.rb +8 -11
- data/lib/ruby-debug/commands/quit.rb +1 -1
- data/lib/ruby-debug/commands/reload.rb +1 -1
- data/lib/ruby-debug/commands/save.rb +1 -1
- data/lib/ruby-debug/commands/set.rb +10 -15
- data/lib/ruby-debug/commands/show.rb +28 -42
- data/lib/ruby-debug/commands/skip.rb +1 -1
- data/lib/ruby-debug/commands/source.rb +1 -1
- data/lib/ruby-debug/commands/start.rb +26 -0
- data/lib/ruby-debug/commands/threads.rb +29 -18
- data/lib/ruby-debug/commands/tmate.rb +1 -1
- data/lib/ruby-debug/commands/trace.rb +6 -7
- data/lib/ruby-debug/commands/variables.rb +36 -19
- data/lib/ruby-debug/helper.rb +5 -5
- data/lib/ruby-debug/interface.rb +15 -3
- data/lib/ruby-debug/printers/base.rb +58 -0
- data/lib/ruby-debug/printers/plain.rb +41 -0
- data/lib/ruby-debug/printers/texts/base.yml +146 -0
- data/lib/ruby-debug/printers/texts/plain.yml +60 -0
- data/lib/ruby-debug/processor.rb +56 -47
- data/test/breakpoints_test.rb +43 -54
- data/test/conditions_test.rb +18 -6
- data/test/continue_test.rb +1 -1
- data/test/display_test.rb +11 -11
- data/test/edit_test.rb +1 -2
- data/test/eval_test.rb +5 -6
- data/test/finish_test.rb +1 -1
- data/test/frame_test.rb +29 -27
- data/test/help_test.rb +0 -1
- data/test/info_test.rb +10 -14
- data/test/irb_test.rb +0 -1
- data/test/jump_test.rb +21 -2
- data/test/method_test.rb +3 -3
- data/test/new/printers/plain_test.rb +84 -0
- data/test/reload_test.rb +2 -2
- data/test/restart_test.rb +1 -2
- data/test/set_test.rb +8 -7
- data/test/show_test.rb +22 -22
- data/test/source_test.rb +1 -1
- data/test/test_helper.rb +2 -1
- data/test/thread_test.rb +11 -13
- data/test/trace_test.rb +7 -7
- data/test/variables_test.rb +33 -15
- metadata +20 -12
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -89,16 +89,20 @@ tutorial](http://bashdb.sourceforge.net/ruby-debug/rdebug-emacs.html)
|
|
89
89
|
* 1.9.3 points to ruby-debug-base19-0.11.26 headers
|
90
90
|
* Install painlessly for rvm and rbenv rubies i.e. no compiler flags needed
|
91
91
|
* No downloading ruby source during install - was behavior of old ruby_core_source dependency
|
92
|
-
*
|
93
|
-
* Fix where command failing at top level
|
92
|
+
* Add output adapters, Printers, to support output besides plain text e.g. xml
|
94
93
|
* A new and improved test suite
|
95
94
|
* Passing tests are up on travis-ci
|
95
|
+
* Fix several bugs
|
96
|
+
* Fix LocalJumpError caused by using proc in extconf.rb
|
97
|
+
* Fix where command failing at top level
|
98
|
+
* See changelog for more
|
96
99
|
* Minor
|
97
100
|
* The gem name matches the module namespace, Debugger, and main required file, debugger.
|
98
101
|
* ruby-debug-base19 and ruby-debug19 are released as one gem
|
99
102
|
* Rake tasks have been updated
|
100
103
|
* No more $LOAD_PATH manipulation or runtime code outside of lib
|
101
104
|
* man page available via gem-man
|
105
|
+
* Test helpers for third-party debugger libraries can be accessed from debugger/test. See debugger-xml for an example
|
102
106
|
|
103
107
|
## Issues
|
104
108
|
Please report them [on github](http://github.com/cldwalker/debugger/issues).
|
@@ -117,6 +121,8 @@ Let's keep this working for the ruby community!
|
|
117
121
|
|
118
122
|
* [debugger-completion](https://github.com/cldwalker/debugger-completion) - autocompletion for
|
119
123
|
debugger commands and more
|
124
|
+
* [debugger-xml](https://github.com/astashov/debugger-xml) - XML interface for debugger, compatible
|
125
|
+
with ruby-debug-ide
|
120
126
|
* [debugger-pry](https://github.com/pry/debugger-pry) - using pry within debugger
|
121
127
|
* [pry-debugger](https://github.com/nixme/pry-debugger) - using debugger within pry
|
122
128
|
* [ruby-debug-passenger](https://github.com/davejamesmiller/ruby-debug-passenger) - rake task to
|
@@ -128,7 +134,7 @@ Let's keep this working for the ruby community!
|
|
128
134
|
## Credits
|
129
135
|
|
130
136
|
* Thanks to the original authors: Kent Sibilev and Mark Moseley
|
131
|
-
* Thanks to astashov for bringing in a new and improved test suite and various bug fixes.
|
137
|
+
* Thanks to astashov for bringing in a new and improved test suite, adding printers support and various bug fixes.
|
132
138
|
* Thanks to windwiny for porting to 2.0.0
|
133
139
|
* Contributors: ericpromislow, jnimety, adammck, hipe, FooBarWidget, aghull
|
134
140
|
* Fork started on awesome @relevance fridays!
|
data/debugger.gemspec
CHANGED
@@ -21,7 +21,7 @@ handling, bindings for stack frames among other things.
|
|
21
21
|
s.executables = ["rdebug"]
|
22
22
|
s.add_dependency "columnize", ">= 0.3.1"
|
23
23
|
s.add_dependency "debugger-ruby_core_source", '~> 1.2.0'
|
24
|
-
s.add_dependency "debugger-linecache", '~> 1.
|
24
|
+
s.add_dependency "debugger-linecache", '~> 1.2.0'
|
25
25
|
s.add_development_dependency 'rake', '~> 0.9.2.2'
|
26
26
|
s.add_development_dependency 'rake-compiler', '~> 0.8.0'
|
27
27
|
s.add_development_dependency 'minitest', '~> 2.12.1'
|
@@ -1787,8 +1787,13 @@ context_frame_id(int argc, VALUE *argv, VALUE self)
|
|
1787
1787
|
frame = optional_frame_position(argc, argv);
|
1788
1788
|
Data_Get_Struct(self, debug_context_t, debug_context);
|
1789
1789
|
|
1790
|
-
|
1791
|
-
|
1790
|
+
rb_iseq_t *iseq = GET_FRAME->info.runtime.cfp->iseq;
|
1791
|
+
if (iseq) {
|
1792
|
+
id = iseq->defined_method_id;
|
1793
|
+
return id ? ID2SYM(id): Qnil;
|
1794
|
+
} else {
|
1795
|
+
return Qnil;
|
1796
|
+
}
|
1792
1797
|
}
|
1793
1798
|
|
1794
1799
|
/*
|
@@ -1815,7 +1820,7 @@ context_frame_line(int argc, VALUE *argv, VALUE self)
|
|
1815
1820
|
cfp = GET_FRAME->info.runtime.cfp;
|
1816
1821
|
while (cfp >= th->cfp)
|
1817
1822
|
{
|
1818
|
-
if ((cfp->iseq
|
1823
|
+
if ((cfp->iseq) && (pc >= cfp->iseq->iseq_encoded) && (pc < cfp->iseq->iseq_encoded + cfp->iseq->iseq_size))
|
1819
1824
|
return(INT2FIX(rb_vm_get_sourceline(cfp)));
|
1820
1825
|
cfp = RUBY_VM_NEXT_CONTROL_FRAME(cfp);
|
1821
1826
|
}
|
@@ -1839,7 +1844,12 @@ context_frame_file(int argc, VALUE *argv, VALUE self)
|
|
1839
1844
|
frame = optional_frame_position(argc, argv);
|
1840
1845
|
Data_Get_Struct(self, debug_context_t, debug_context);
|
1841
1846
|
|
1842
|
-
|
1847
|
+
rb_iseq_t *iseq = GET_FRAME->info.runtime.cfp->iseq;
|
1848
|
+
if (iseq) {
|
1849
|
+
return iseq->filename;
|
1850
|
+
} else {
|
1851
|
+
return Qnil;
|
1852
|
+
}
|
1843
1853
|
}
|
1844
1854
|
|
1845
1855
|
static int
|
@@ -2058,11 +2068,13 @@ context_frame_class(int argc, VALUE *argv, VALUE self)
|
|
2058
2068
|
|
2059
2069
|
debug_frame = GET_FRAME;
|
2060
2070
|
|
2061
|
-
|
2062
|
-
|
2063
|
-
|
2064
|
-
|
2065
|
-
|
2071
|
+
rb_iseq_t *iseq = debug_frame->info.runtime.cfp->iseq;
|
2072
|
+
if (iseq) {
|
2073
|
+
klass = real_class(iseq->klass);
|
2074
|
+
if (TYPE(klass) == T_CLASS || TYPE(klass) == T_MODULE) {
|
2075
|
+
return klass;
|
2076
|
+
}
|
2077
|
+
}
|
2066
2078
|
return Qnil;
|
2067
2079
|
}
|
2068
2080
|
|
@@ -1764,12 +1764,17 @@ context_frame_id(int argc, VALUE *argv, VALUE self)
|
|
1764
1764
|
Data_Get_Struct(self, debug_context_t, debug_context);
|
1765
1765
|
|
1766
1766
|
cfp = GET_FRAME->info.runtime.cfp;
|
1767
|
+
rb_iseq_t *iseq = cfp->iseq;
|
1768
|
+
if (iseq) {
|
1767
1769
|
#if defined HAVE_RB_CONTROL_FRAME_T_METHOD_ID
|
1768
|
-
|
1770
|
+
frame_id = RUBYVM_CFUNC_FRAME_P(cfp) ? cfp->method_id : cfp->iseq->defined_method_id;
|
1769
1771
|
#elif defined HAVE_RB_METHOD_ENTRY_T_CALLED_ID
|
1770
|
-
|
1772
|
+
frame_id = RUBYVM_CFUNC_FRAME_P(cfp) ? cfp->me->called_id : cfp->iseq->defined_method_id;
|
1771
1773
|
#endif
|
1772
|
-
|
1774
|
+
return frame_id ? ID2SYM(frame_id) : Qnil;
|
1775
|
+
} else {
|
1776
|
+
return Qnil;
|
1777
|
+
}
|
1773
1778
|
}
|
1774
1779
|
|
1775
1780
|
/*
|
@@ -1796,7 +1801,7 @@ context_frame_line(int argc, VALUE *argv, VALUE self)
|
|
1796
1801
|
cfp = GET_FRAME->info.runtime.cfp;
|
1797
1802
|
while (cfp >= th->cfp)
|
1798
1803
|
{
|
1799
|
-
if ((cfp->iseq
|
1804
|
+
if ((cfp->iseq) && (pc >= cfp->iseq->iseq_encoded) && (pc < cfp->iseq->iseq_encoded + cfp->iseq->iseq_size))
|
1800
1805
|
return(INT2FIX(rb_vm_get_sourceline(cfp)));
|
1801
1806
|
cfp = RUBY_VM_NEXT_CONTROL_FRAME(cfp);
|
1802
1807
|
}
|
@@ -1820,7 +1825,12 @@ context_frame_file(int argc, VALUE *argv, VALUE self)
|
|
1820
1825
|
frame = optional_frame_position(argc, argv);
|
1821
1826
|
Data_Get_Struct(self, debug_context_t, debug_context);
|
1822
1827
|
|
1823
|
-
|
1828
|
+
rb_iseq_t *iseq = GET_FRAME->info.runtime.cfp->iseq;
|
1829
|
+
if (iseq) {
|
1830
|
+
return iseq->filename;
|
1831
|
+
} else {
|
1832
|
+
return Qnil;
|
1833
|
+
}
|
1824
1834
|
}
|
1825
1835
|
|
1826
1836
|
static int
|
File without changes
|
File without changes
|
File without changes
|
@@ -40,7 +40,7 @@ module Mocha
|
|
40
40
|
message = UnexpectedInvocation.new(self, symbol, *arguments).to_s
|
41
41
|
require 'mocha/mockery'
|
42
42
|
message << Mockery.instance.mocha_inspect
|
43
|
-
raise ExpectationError.new(message
|
43
|
+
raise ExpectationError.new(message)
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module TestDsl
|
2
2
|
module Shared
|
3
3
|
def fullpath(filename)
|
4
|
-
|
4
|
+
File.join($debugger_test_dir, "examples", "#{filename}.rb")
|
5
5
|
end
|
6
6
|
end
|
7
7
|
include Shared
|
@@ -70,7 +70,7 @@ module TestDsl
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
Debugger.start do
|
73
|
-
|
73
|
+
Debugger.debug_load(fullpath(filename))
|
74
74
|
debug_completed = true
|
75
75
|
end
|
76
76
|
flunk "Debug block was not completed" unless debug_completed
|
@@ -114,6 +114,10 @@ module TestDsl
|
|
114
114
|
state.context
|
115
115
|
end
|
116
116
|
|
117
|
+
def binding
|
118
|
+
context.frame_binding(state.frame_pos)
|
119
|
+
end
|
120
|
+
|
117
121
|
def breakpoint
|
118
122
|
Debugger.breakpoints.first
|
119
123
|
end
|
@@ -161,6 +165,22 @@ module TestDsl
|
|
161
165
|
end
|
162
166
|
end
|
163
167
|
|
168
|
+
def pi
|
169
|
+
puts
|
170
|
+
puts "Output Queue:"
|
171
|
+
puts interface.output_queue.join("")
|
172
|
+
puts
|
173
|
+
puts "Error Queue:"
|
174
|
+
puts interface.error_queue.join("")
|
175
|
+
puts
|
176
|
+
puts "Confirm Queue:"
|
177
|
+
puts interface.confirm_queue.join("")
|
178
|
+
puts
|
179
|
+
puts "Print Queue:"
|
180
|
+
puts interface.print_queue.join("")
|
181
|
+
puts
|
182
|
+
end
|
183
|
+
|
164
184
|
module ClassMethods
|
165
185
|
include Shared
|
166
186
|
|
data/lib/debugger/version.rb
CHANGED
data/lib/ruby-debug.rb
CHANGED
@@ -4,6 +4,7 @@ require 'socket'
|
|
4
4
|
require 'thread'
|
5
5
|
require 'ruby-debug-base'
|
6
6
|
require 'ruby-debug/processor'
|
7
|
+
Dir.glob(File.expand_path("../ruby-debug/printers/**/*.rb", __FILE__)).each { |f| require f }
|
7
8
|
|
8
9
|
module Debugger
|
9
10
|
self.handler = CommandProcessor.new
|
@@ -35,13 +36,14 @@ module Debugger
|
|
35
36
|
# if the call stack is truncated.
|
36
37
|
attr_accessor :start_sentinal
|
37
38
|
|
39
|
+
attr_accessor :printer
|
40
|
+
|
38
41
|
attr_reader :thread, :control_thread, :cmd_port, :ctrl_port
|
39
42
|
|
40
43
|
def interface=(value) # :nodoc:
|
41
44
|
handler.interface = value
|
42
45
|
end
|
43
46
|
|
44
|
-
#
|
45
47
|
# Starts a remote debugger.
|
46
48
|
#
|
47
49
|
def start_remote(host = nil, port = PORT)
|
@@ -150,6 +152,7 @@ module Debugger
|
|
150
152
|
processor.process_commands(verbose)
|
151
153
|
end
|
152
154
|
end
|
155
|
+
self.printer ||= Printers::Plain.new
|
153
156
|
end
|
154
157
|
|
155
158
|
module Kernel
|
data/lib/ruby-debug/command.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'columnize'
|
2
|
+
require 'forwardable'
|
2
3
|
require 'ruby-debug/helper'
|
3
4
|
|
4
5
|
module Debugger
|
@@ -11,6 +12,11 @@ module Debugger
|
|
11
12
|
|
12
13
|
include Columnize
|
13
14
|
|
15
|
+
extend Forwardable
|
16
|
+
def_delegator :"Debugger.printer", :print, :pr
|
17
|
+
def_delegator :"Debugger.printer", :print_collection, :prc
|
18
|
+
def_delegator :"Debugger.printer", :print_variables, :prv
|
19
|
+
|
14
20
|
# Find param in subcmds. param id downcased and can be abbreviated
|
15
21
|
# to the minimum length listed in the subcommands
|
16
22
|
def find(subcmds, param)
|
@@ -164,23 +170,29 @@ module Debugger
|
|
164
170
|
@state.print(*args)
|
165
171
|
end
|
166
172
|
|
173
|
+
def print_debug(*args)
|
174
|
+
@state.print_debug(*args)
|
175
|
+
end
|
176
|
+
|
167
177
|
def confirm(msg)
|
168
178
|
@state.confirm(msg) == 'y'
|
169
179
|
end
|
170
180
|
|
181
|
+
# TODO: Add optional timeout
|
171
182
|
def debug_eval(str, b = get_binding)
|
172
183
|
begin
|
173
184
|
val = eval(str, b)
|
174
185
|
rescue StandardError, ScriptError => e
|
175
|
-
if Command.settings[:stack_trace_on_error]
|
186
|
+
text_message = if Command.settings[:stack_trace_on_error]
|
176
187
|
at = eval("caller(1)", b)
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
188
|
+
backtraces = []
|
189
|
+
backtraces << "#{at.shift}:#{e.to_s.sub(/\(eval\):1:(in `.*?':)?/, '')}"
|
190
|
+
backtraces += at.map { |i| "\tfrom #{i}" }
|
191
|
+
backtraces.join("\n")
|
181
192
|
else
|
182
|
-
|
193
|
+
"#{e.class} Exception: #{e.message}\n"
|
183
194
|
end
|
195
|
+
errmsg pr("eval.exception", text_message: text_message, class: e.class, value: e.to_s)
|
184
196
|
throw :debug_error
|
185
197
|
end
|
186
198
|
end
|
@@ -3,7 +3,7 @@ module Debugger
|
|
3
3
|
# Implements debugger "break" command.
|
4
4
|
class AddBreakpoint < Command
|
5
5
|
self.allow_in_control = true
|
6
|
-
|
6
|
+
|
7
7
|
def regexp
|
8
8
|
/ ^\s*
|
9
9
|
b(?:reak)?
|
@@ -13,18 +13,22 @@ module Debugger
|
|
13
13
|
/x
|
14
14
|
end
|
15
15
|
|
16
|
+
def pr(path, *args)
|
17
|
+
super("breakpoints.#{path}", *args)
|
18
|
+
end
|
19
|
+
|
16
20
|
def execute
|
17
21
|
if @match[1]
|
18
22
|
line, _, _, expr = @match.captures
|
19
23
|
else
|
20
24
|
_, file, line, expr = @match.captures
|
21
25
|
end
|
22
|
-
if expr
|
26
|
+
if expr
|
23
27
|
if expr !~ /^\s*if\s+(.+)/
|
24
28
|
if file or line
|
25
|
-
errmsg "
|
29
|
+
errmsg pr("errors.if", expr: expr)
|
26
30
|
else
|
27
|
-
errmsg "
|
31
|
+
errmsg pr("errors.location", expr: expr)
|
28
32
|
end
|
29
33
|
return
|
30
34
|
else
|
@@ -35,12 +39,12 @@ module Debugger
|
|
35
39
|
brkpt_filename = nil
|
36
40
|
if file.nil?
|
37
41
|
unless @state.context
|
38
|
-
errmsg "
|
39
|
-
return
|
42
|
+
errmsg pr("errors.state_add")
|
43
|
+
return
|
40
44
|
end
|
41
45
|
brkpt_filename = @state.file
|
42
46
|
file = File.basename(@state.file)
|
43
|
-
if line.nil?
|
47
|
+
if line.nil?
|
44
48
|
# Set breakpoint at current line
|
45
49
|
line = @state.line.to_s
|
46
50
|
end
|
@@ -50,7 +54,7 @@ module Debugger
|
|
50
54
|
if klass && klass.kind_of?(Module)
|
51
55
|
class_name = klass.name if klass
|
52
56
|
else
|
53
|
-
errmsg "
|
57
|
+
errmsg pr("errors.class", file: file)
|
54
58
|
throw :debug_error
|
55
59
|
end
|
56
60
|
else
|
@@ -59,38 +63,34 @@ module Debugger
|
|
59
63
|
File::ALT_SEPARATOR && file.index(File::ALT_SEPARATOR)
|
60
64
|
brkpt_filename = file
|
61
65
|
end
|
62
|
-
|
66
|
+
|
63
67
|
if line =~ /^\d+$/
|
64
68
|
line = line.to_i
|
65
69
|
if LineCache.cache(brkpt_filename, Command.settings[:reload_source_on_change])
|
66
70
|
last_line = LineCache.size(brkpt_filename)
|
67
71
|
if line > last_line
|
68
|
-
errmsg("
|
69
|
-
return
|
70
|
-
end
|
71
|
-
unless LineCache.trace_line_numbers(brkpt_filename).member?(line)
|
72
|
-
errmsg("Line %d is not a stopping point in file \"%s\".\n", line, file)
|
72
|
+
errmsg pr("errors.far_line", lines: last_line, file: file)
|
73
73
|
return
|
74
74
|
end
|
75
75
|
else
|
76
|
-
errmsg("
|
77
|
-
return unless confirm(
|
76
|
+
errmsg pr("errors.source", file: file)
|
77
|
+
return unless confirm(pr("confirmations.set_breakpoint"))
|
78
78
|
end
|
79
79
|
|
80
|
-
|
81
|
-
errmsg "
|
82
|
-
return
|
80
|
+
if file.nil? && !@state.context
|
81
|
+
errmsg pr("errors.state")
|
82
|
+
return
|
83
83
|
end
|
84
84
|
b = Debugger.add_breakpoint brkpt_filename, line, expr
|
85
|
-
print "
|
85
|
+
print pr("set_breakpoint_to_line", id: b.id, file: brkpt_filename, line: line)
|
86
86
|
unless syntax_valid?(expr)
|
87
|
-
errmsg("
|
87
|
+
errmsg pr("errors.expression", expr: expr)
|
88
88
|
b.enabled = false
|
89
89
|
end
|
90
90
|
else
|
91
91
|
method = line.intern.id2name
|
92
92
|
b = Debugger.add_breakpoint class_name, method, expr
|
93
|
-
print "
|
93
|
+
print pr("set_breakpoint_to_method", id: b.id, class: class_name, method: method)
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
@@ -118,21 +118,19 @@ module Debugger
|
|
118
118
|
end
|
119
119
|
|
120
120
|
def execute
|
121
|
-
unless @state.context
|
122
|
-
errmsg "We are not in a state we can delete breakpoints.\n"
|
123
|
-
return
|
124
|
-
end
|
125
121
|
brkpts = @match[1]
|
126
122
|
unless brkpts
|
127
|
-
if confirm("
|
123
|
+
if confirm(pr("breakpoints.confirmations.delete_all"))
|
128
124
|
Debugger.breakpoints.clear
|
129
125
|
end
|
130
126
|
else
|
131
127
|
brkpts.split(/[ \t]+/).each do |pos|
|
132
128
|
pos = get_int(pos, "Delete", 1)
|
133
129
|
return unless pos
|
134
|
-
|
135
|
-
|
130
|
+
if Debugger.remove_breakpoint(pos)
|
131
|
+
print pr("breakpoints.delete", id: pos)
|
132
|
+
else
|
133
|
+
errmsg pr("breakpoints.errors.no_breakpoint", id: pos)
|
136
134
|
end
|
137
135
|
end
|
138
136
|
end
|