module Byebug::EnableDisableFunctions
def enable_disable_breakpoints(is_enable, args)
def enable_disable_breakpoints(is_enable, args) breakpoints = Byebug.breakpoints.sort_by{|b| b.id } largest = breakpoints.inject(0) do |tally, b| tally = b.id if b.id > tally end if 0 == largest errmsg "No breakpoints have been set.\n" return end args.each do |pos| pos = get_int(pos, "#{is_enable} breakpoints", 1, largest) return nil unless pos breakpoints.each do |b| if b.id == pos enabled = ('Enable' == is_enable) if enabled unless syntax_valid?(b.expr) errmsg "Expression \"#{b.expr}\" syntactically incorrect; " \ "breakpoint remains disabled.\n" break end end b.enabled = ('Enable' == is_enable) break end end end end
def enable_disable_display(is_enable, args)
def enable_disable_display(is_enable, args) if 0 == @state.display.size errmsg "No display expressions have been set.\n" return end args.each do |pos| pos = get_int(pos, "#{is_enable} display", 1, @state.display.size) return nil unless pos @state.display[pos-1][0] = ('Enable' == is_enable) end end