Commit a38a858638d761388746e2b99af7593a95072927

fixed breakpoint setting / deleting for ruby-debug-0.10.1

Commit diff

Commands/Delete All Breakpoints.tmCommand

 
1111
1212
1313dcmd = DebuggerCmd.new
14count_breakpoints = dcmd.remote_eval_control_binding("Debugger.breakpoints.length").to_i
14count_breakpoints = eval(dcmd.remote_eval_control_binding("Debugger.breakpoints.length"))
1515if count_breakpoints == 0
1616 puts "There are no breakpoints set"
1717 exit
1818end
1919
20dcmd.remote_eval_control_binding("Debugger.breakpoints.each { |b| Debugger.remove_breakpoint(b.id) }").to_i
21new_count_breakpoints = dcmd.remote_eval_control_binding("Debugger.breakpoints.length").to_i
20dcmd.remote_eval_control_binding("Debugger.breakpoints.map{ |b| b.id }.each { |b_id| Debugger.remove_breakpoint(b_id) }")
21
22new_count_breakpoints = eval(dcmd.remote_eval_control_binding("Debugger.breakpoints.length"))
2223if new_count_breakpoints == 0
2324 puts "Deleted all #{count_breakpoints} breakpoint(s)"
2425else
toggle raw diff

Commands/Set Breakpoint at Current Line.tmCommand

 
99
1010require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/rdebug_cmd.rb"
1111
12cmd = "break #{ENV['TM_FILEPATH']}:#{ENV['TM_LINE_NUMBER']}"
13msg = 'Breakpoint added.'
1412
1513dcmd = DebuggerCmd.new
16dcmd.send_command(cmd, msg)</string>
14result = dcmd.remote_eval_control_binding &lt;&lt;-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
21EOF
22
23puts eval(result)
24</string>
1725 <key>fallbackInput</key>
1826 <string>line</string>
1927 <key>input</key>
toggle raw diff