Commit a38a858638d761388746e2b99af7593a95072927
- Date: Thu Apr 10 22:42:05 +0000 2008
- Committer: Tim Harper (timcharper@gmail.com)
- Author: Tim Harper (timcharper@gmail.com)
- Commit SHA1: a38a858638d761388746e2b99af7593a95072927
- Tree SHA1: 3eeaa6abff9087c51a3a6383874131ef6a2692a7
fixed breakpoint setting / deleting for ruby-debug-0.10.1
Commit diff
| |   |
| 11 | 11 | |
| 12 | 12 | |
| 13 | 13 | dcmd = DebuggerCmd.new |
| 14 | | count_breakpoints = dcmd.remote_eval_control_binding("Debugger.breakpoints.length").to_i |
| 14 | count_breakpoints = eval(dcmd.remote_eval_control_binding("Debugger.breakpoints.length")) |
| 15 | 15 | if count_breakpoints == 0 |
| 16 | 16 | puts "There are no breakpoints set" |
| 17 | 17 | exit |
| 18 | 18 | end |
| 19 | 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 |
| 20 | dcmd.remote_eval_control_binding("Debugger.breakpoints.map{ |b| b.id }.each { |b_id| Debugger.remove_breakpoint(b_id) }") |
| 21 | |
| 22 | new_count_breakpoints = eval(dcmd.remote_eval_control_binding("Debugger.breakpoints.length")) |
| 22 | 23 | if new_count_breakpoints == 0 |
| 23 | 24 | puts "Deleted all #{count_breakpoints} breakpoint(s)" |
| 24 | 25 | else |
| toggle raw diff |
--- a/Commands/Delete All Breakpoints.tmCommand
+++ b/Commands/Delete All Breakpoints.tmCommand
@@ -11,14 +11,15 @@ require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/rdebug_cmd.rb"
dcmd = DebuggerCmd.new
-count_breakpoints = dcmd.remote_eval_control_binding("Debugger.breakpoints.length").to_i
+count_breakpoints = eval(dcmd.remote_eval_control_binding("Debugger.breakpoints.length"))
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
+dcmd.remote_eval_control_binding("Debugger.breakpoints.map{ |b| b.id }.each { |b_id| Debugger.remove_breakpoint(b_id) }")
+
+new_count_breakpoints = eval(dcmd.remote_eval_control_binding("Debugger.breakpoints.length"))
if new_count_breakpoints == 0
puts "Deleted all #{count_breakpoints} breakpoint(s)"
else |
| |   |
| 9 | 9 | |
| 10 | 10 | require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/rdebug_cmd.rb" |
| 11 | 11 | |
| 12 | | cmd = "break #{ENV['TM_FILEPATH']}:#{ENV['TM_LINE_NUMBER']}" |
| 13 | | msg = 'Breakpoint added.' |
| 14 | 12 | |
| 15 | 13 | dcmd = DebuggerCmd.new |
| 16 | | dcmd.send_command(cmd, msg)</string> |
| 14 | result = dcmd.remote_eval_control_binding <<-EOF |
| 15 | bp = Debugger.add_breakpoint #{ENV['TM_FILEPATH'].to_s.inspect}, #{ENV['TM_LINE_NUMBER']} |
| 16 | if bp |
| 17 | "Set breakpoint at \#{bp.source}:\#{bp.pos}" |
| 18 | else |
| 19 | "Failed to set breakpoint." |
| 20 | end |
| 21 | EOF |
| 22 | |
| 23 | puts eval(result) |
| 24 | </string> |
| 17 | 25 | <key>fallbackInput</key> |
| 18 | 26 | <string>line</string> |
| 19 | 27 | <key>input</key> |
| toggle raw diff |
--- a/Commands/Set Breakpoint at Current Line.tmCommand
+++ b/Commands/Set Breakpoint at Current Line.tmCommand
@@ -9,11 +9,19 @@
require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/rdebug_cmd.rb"
-cmd = "break #{ENV['TM_FILEPATH']}:#{ENV['TM_LINE_NUMBER']}"
-msg = 'Breakpoint added.'
dcmd = DebuggerCmd.new
-dcmd.send_command(cmd, msg)</string>
+result = dcmd.remote_eval_control_binding <<-EOF
+ bp = Debugger.add_breakpoint #{ENV['TM_FILEPATH'].to_s.inspect}, #{ENV['TM_LINE_NUMBER']}
+ if bp
+ "Set breakpoint at \#{bp.source}:\#{bp.pos}"
+ else
+ "Failed to set breakpoint."
+ end
+EOF
+
+puts eval(result)
+</string>
<key>fallbackInput</key>
<string>line</string>
<key>input</key> |