Commit 75f0f30732205eeccfdf25722e4ddaaebaa9d4ca
- Date: Thu Apr 10 22:30:30 +0000 2008
- Committer: Tim Harper (timcharper@gmail.com)
- Author: Tim Harper (timcharper@gmail.com)
- Commit SHA1: 75f0f30732205eeccfdf25722e4ddaaebaa9d4ca
- Tree SHA1: 860186658f034fc910787ea69fa600cc456c2499
fixed delete all breakpoints command for ruby-debug 0.10.1
Commit diff
| |   |
| 9 | 9 | |
| 10 | 10 | require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/rdebug_cmd.rb" |
| 11 | 11 | |
| 12 | | cmd = "del" |
| 13 | | msg = 'Breakpoints deleted.' |
| 14 | 12 | |
| 15 | 13 | dcmd = DebuggerCmd.new |
| 16 | | dcmd.send_command(cmd, msg)</string> |
| 14 | count_breakpoints = dcmd.remote_eval_control_binding("Debugger.breakpoints.length").to_i |
| 15 | if count_breakpoints == 0 |
| 16 | puts "There are no breakpoints set" |
| 17 | exit |
| 18 | end |
| 19 | |
| 20 | dcmd.remote_eval_control_binding("Debugger.breakpoints.each { |b| Debugger.remove_breakpoint(b.id) }").to_i |
| 21 | new_count_breakpoints = dcmd.remote_eval_control_binding("Debugger.breakpoints.length").to_i |
| 22 | if new_count_breakpoints == 0 |
| 23 | puts "Deleted all #{count_breakpoints} breakpoint(s)" |
| 24 | else |
| 25 | puts "Error deleting breakpoints." |
| 26 | end</string> |
| 17 | 27 | <key>fallbackInput</key> |
| 18 | 28 | <string>line</string> |
| 19 | 29 | <key>input</key> |
| toggle raw diff |
--- a/Commands/Delete All Breakpoints.tmCommand
+++ b/Commands/Delete All Breakpoints.tmCommand
@@ -9,11 +9,21 @@
require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/rdebug_cmd.rb"
-cmd = "del"
-msg = 'Breakpoints deleted.'
dcmd = DebuggerCmd.new
-dcmd.send_command(cmd, msg)</string>
+count_breakpoints = dcmd.remote_eval_control_binding("Debugger.breakpoints.length").to_i
+if count_breakpoints == 0
+ puts "There are no breakpoints set"
+ exit
+end
+
+dcmd.remote_eval_control_binding("Debugger.breakpoints.each { |b| Debugger.remove_breakpoint(b.id) }").to_i
+new_count_breakpoints = dcmd.remote_eval_control_binding("Debugger.breakpoints.length").to_i
+if new_count_breakpoints == 0
+ puts "Deleted all #{count_breakpoints} breakpoint(s)"
+else
+ puts "Error deleting breakpoints."
+end</string>
<key>fallbackInput</key>
<string>line</string>
<key>input</key> |