Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/exe_root.../opt/alt/ruby30/share/ruby
File: debug.rb
# frozen_string_literal: true
[0] Fix | Delete
# Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
[1] Fix | Delete
# Copyright (C) 2000 Information-technology Promotion Agency, Japan
[2] Fix | Delete
# Copyright (C) 2000-2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
[3] Fix | Delete
[4] Fix | Delete
if $SAFE > 0
[5] Fix | Delete
STDERR.print "-r debug.rb is not available in safe mode\n"
[6] Fix | Delete
exit 1
[7] Fix | Delete
end
[8] Fix | Delete
[9] Fix | Delete
require 'tracer'
[10] Fix | Delete
require 'pp'
[11] Fix | Delete
[12] Fix | Delete
class Tracer # :nodoc:
[13] Fix | Delete
def Tracer.trace_func(*vars)
[14] Fix | Delete
Single.trace_func(*vars)
[15] Fix | Delete
end
[16] Fix | Delete
end
[17] Fix | Delete
[18] Fix | Delete
SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__ # :nodoc:
[19] Fix | Delete
[20] Fix | Delete
##
[21] Fix | Delete
# This library provides debugging functionality to Ruby.
[22] Fix | Delete
#
[23] Fix | Delete
# To add a debugger to your code, start by requiring +debug+ in your
[24] Fix | Delete
# program:
[25] Fix | Delete
#
[26] Fix | Delete
# def say(word)
[27] Fix | Delete
# require 'debug'
[28] Fix | Delete
# puts word
[29] Fix | Delete
# end
[30] Fix | Delete
#
[31] Fix | Delete
# This will cause Ruby to interrupt execution and show a prompt when the +say+
[32] Fix | Delete
# method is run.
[33] Fix | Delete
#
[34] Fix | Delete
# Once you're inside the prompt, you can start debugging your program.
[35] Fix | Delete
#
[36] Fix | Delete
# (rdb:1) p word
[37] Fix | Delete
# "hello"
[38] Fix | Delete
#
[39] Fix | Delete
# == Getting help
[40] Fix | Delete
#
[41] Fix | Delete
# You can get help at any time by pressing +h+.
[42] Fix | Delete
#
[43] Fix | Delete
# (rdb:1) h
[44] Fix | Delete
# Debugger help v.-0.002b
[45] Fix | Delete
# Commands
[46] Fix | Delete
# b[reak] [file:|class:]<line|method>
[47] Fix | Delete
# b[reak] [class.]<line|method>
[48] Fix | Delete
# set breakpoint to some position
[49] Fix | Delete
# wat[ch] <expression> set watchpoint to some expression
[50] Fix | Delete
# cat[ch] (<exception>|off) set catchpoint to an exception
[51] Fix | Delete
# b[reak] list breakpoints
[52] Fix | Delete
# cat[ch] show catchpoint
[53] Fix | Delete
# del[ete][ nnn] delete some or all breakpoints
[54] Fix | Delete
# disp[lay] <expression> add expression into display expression list
[55] Fix | Delete
# undisp[lay][ nnn] delete one particular or all display expressions
[56] Fix | Delete
# c[ont] run until program ends or hit breakpoint
[57] Fix | Delete
# s[tep][ nnn] step (into methods) one line or till line nnn
[58] Fix | Delete
# n[ext][ nnn] go over one line or till line nnn
[59] Fix | Delete
# w[here] display frames
[60] Fix | Delete
# f[rame] alias for where
[61] Fix | Delete
# l[ist][ (-|nn-mm)] list program, - lists backwards
[62] Fix | Delete
# nn-mm lists given lines
[63] Fix | Delete
# up[ nn] move to higher frame
[64] Fix | Delete
# down[ nn] move to lower frame
[65] Fix | Delete
# fin[ish] return to outer frame
[66] Fix | Delete
# tr[ace] (on|off) set trace mode of current thread
[67] Fix | Delete
# tr[ace] (on|off) all set trace mode of all threads
[68] Fix | Delete
# q[uit] exit from debugger
[69] Fix | Delete
# v[ar] g[lobal] show global variables
[70] Fix | Delete
# v[ar] l[ocal] show local variables
[71] Fix | Delete
# v[ar] i[nstance] <object> show instance variables of object
[72] Fix | Delete
# v[ar] c[onst] <object> show constants of object
[73] Fix | Delete
# m[ethod] i[nstance] <obj> show methods of object
[74] Fix | Delete
# m[ethod] <class|module> show instance methods of class or module
[75] Fix | Delete
# th[read] l[ist] list all threads
[76] Fix | Delete
# th[read] c[ur[rent]] show current thread
[77] Fix | Delete
# th[read] [sw[itch]] <nnn> switch thread context to nnn
[78] Fix | Delete
# th[read] stop <nnn> stop thread nnn
[79] Fix | Delete
# th[read] resume <nnn> resume thread nnn
[80] Fix | Delete
# p expression evaluate expression and print its value
[81] Fix | Delete
# h[elp] print this help
[82] Fix | Delete
# <everything else> evaluate
[83] Fix | Delete
#
[84] Fix | Delete
# == Usage
[85] Fix | Delete
#
[86] Fix | Delete
# The following is a list of common functionalities that the debugger
[87] Fix | Delete
# provides.
[88] Fix | Delete
#
[89] Fix | Delete
# === Navigating through your code
[90] Fix | Delete
#
[91] Fix | Delete
# In general, a debugger is used to find bugs in your program, which
[92] Fix | Delete
# often means pausing execution and inspecting variables at some point
[93] Fix | Delete
# in time.
[94] Fix | Delete
#
[95] Fix | Delete
# Let's look at an example:
[96] Fix | Delete
#
[97] Fix | Delete
# def my_method(foo)
[98] Fix | Delete
# require 'debug'
[99] Fix | Delete
# foo = get_foo if foo.nil?
[100] Fix | Delete
# raise if foo.nil?
[101] Fix | Delete
# end
[102] Fix | Delete
#
[103] Fix | Delete
# When you run this program, the debugger will kick in just before the
[104] Fix | Delete
# +foo+ assignment.
[105] Fix | Delete
#
[106] Fix | Delete
# (rdb:1) p foo
[107] Fix | Delete
# nil
[108] Fix | Delete
#
[109] Fix | Delete
# In this example, it'd be interesting to move to the next line and
[110] Fix | Delete
# inspect the value of +foo+ again. You can do that by pressing +n+:
[111] Fix | Delete
#
[112] Fix | Delete
# (rdb:1) n # goes to next line
[113] Fix | Delete
# (rdb:1) p foo
[114] Fix | Delete
# nil
[115] Fix | Delete
#
[116] Fix | Delete
# You now know that the original value of +foo+ was nil, and that it
[117] Fix | Delete
# still was nil after calling +get_foo+.
[118] Fix | Delete
#
[119] Fix | Delete
# Other useful commands for navigating through your code are:
[120] Fix | Delete
#
[121] Fix | Delete
# +c+::
[122] Fix | Delete
# Runs the program until it either exists or encounters another breakpoint.
[123] Fix | Delete
# You usually press +c+ when you are finished debugging your program and
[124] Fix | Delete
# want to resume its execution.
[125] Fix | Delete
# +s+::
[126] Fix | Delete
# Steps into method definition. In the previous example, +s+ would take you
[127] Fix | Delete
# inside the method definition of +get_foo+.
[128] Fix | Delete
# +r+::
[129] Fix | Delete
# Restart the program.
[130] Fix | Delete
# +q+::
[131] Fix | Delete
# Quit the program.
[132] Fix | Delete
#
[133] Fix | Delete
# === Inspecting variables
[134] Fix | Delete
#
[135] Fix | Delete
# You can use the debugger to easily inspect both local and global variables.
[136] Fix | Delete
# We've seen how to inspect local variables before:
[137] Fix | Delete
#
[138] Fix | Delete
# (rdb:1) p my_arg
[139] Fix | Delete
# 42
[140] Fix | Delete
#
[141] Fix | Delete
# You can also pretty print the result of variables or expressions:
[142] Fix | Delete
#
[143] Fix | Delete
# (rdb:1) pp %w{a very long long array containing many words}
[144] Fix | Delete
# ["a",
[145] Fix | Delete
# "very",
[146] Fix | Delete
# "long",
[147] Fix | Delete
# ...
[148] Fix | Delete
# ]
[149] Fix | Delete
#
[150] Fix | Delete
# You can list all local variables with +v l+:
[151] Fix | Delete
#
[152] Fix | Delete
# (rdb:1) v l
[153] Fix | Delete
# foo => "hello"
[154] Fix | Delete
#
[155] Fix | Delete
# Similarly, you can show all global variables with +v g+:
[156] Fix | Delete
#
[157] Fix | Delete
# (rdb:1) v g
[158] Fix | Delete
# all global variables
[159] Fix | Delete
#
[160] Fix | Delete
# Finally, you can omit +p+ if you simply want to evaluate a variable or
[161] Fix | Delete
# expression
[162] Fix | Delete
#
[163] Fix | Delete
# (rdb:1) 5**2
[164] Fix | Delete
# 25
[165] Fix | Delete
#
[166] Fix | Delete
# === Going beyond basics
[167] Fix | Delete
#
[168] Fix | Delete
# Ruby Debug provides more advanced functionalities like switching
[169] Fix | Delete
# between threads, setting breakpoints and watch expressions, and more.
[170] Fix | Delete
# The full list of commands is available at any time by pressing +h+.
[171] Fix | Delete
#
[172] Fix | Delete
# == Staying out of trouble
[173] Fix | Delete
#
[174] Fix | Delete
# Make sure you remove every instance of +require 'debug'+ before
[175] Fix | Delete
# shipping your code. Failing to do so may result in your program
[176] Fix | Delete
# hanging unpredictably.
[177] Fix | Delete
#
[178] Fix | Delete
# Debug is not available in safe mode.
[179] Fix | Delete
[180] Fix | Delete
class DEBUGGER__
[181] Fix | Delete
MUTEX = Thread::Mutex.new # :nodoc:
[182] Fix | Delete
CONTINUATIONS_SUPPORTED = RUBY_ENGINE == 'ruby'
[183] Fix | Delete
[184] Fix | Delete
require 'continuation' if CONTINUATIONS_SUPPORTED
[185] Fix | Delete
[186] Fix | Delete
class Context # :nodoc:
[187] Fix | Delete
DEBUG_LAST_CMD = []
[188] Fix | Delete
[189] Fix | Delete
begin
[190] Fix | Delete
require 'readline'
[191] Fix | Delete
def readline(prompt, hist)
[192] Fix | Delete
Readline::readline(prompt, hist)
[193] Fix | Delete
end
[194] Fix | Delete
rescue LoadError
[195] Fix | Delete
def readline(prompt, hist)
[196] Fix | Delete
STDOUT.print prompt
[197] Fix | Delete
STDOUT.flush
[198] Fix | Delete
line = STDIN.gets
[199] Fix | Delete
exit unless line
[200] Fix | Delete
line.chomp!
[201] Fix | Delete
line
[202] Fix | Delete
end
[203] Fix | Delete
USE_READLINE = false
[204] Fix | Delete
end
[205] Fix | Delete
[206] Fix | Delete
def initialize
[207] Fix | Delete
if Thread.current == Thread.main
[208] Fix | Delete
@stop_next = 1
[209] Fix | Delete
else
[210] Fix | Delete
@stop_next = 0
[211] Fix | Delete
end
[212] Fix | Delete
@last_file = nil
[213] Fix | Delete
@file = nil
[214] Fix | Delete
@line = nil
[215] Fix | Delete
@no_step = nil
[216] Fix | Delete
@frames = []
[217] Fix | Delete
@finish_pos = 0
[218] Fix | Delete
@trace = false
[219] Fix | Delete
@catch = "StandardError"
[220] Fix | Delete
@suspend_next = false
[221] Fix | Delete
end
[222] Fix | Delete
[223] Fix | Delete
def stop_next(n=1)
[224] Fix | Delete
@stop_next = n
[225] Fix | Delete
end
[226] Fix | Delete
[227] Fix | Delete
def set_suspend
[228] Fix | Delete
@suspend_next = true
[229] Fix | Delete
end
[230] Fix | Delete
[231] Fix | Delete
def clear_suspend
[232] Fix | Delete
@suspend_next = false
[233] Fix | Delete
end
[234] Fix | Delete
[235] Fix | Delete
def suspend_all
[236] Fix | Delete
DEBUGGER__.suspend
[237] Fix | Delete
end
[238] Fix | Delete
[239] Fix | Delete
def resume_all
[240] Fix | Delete
DEBUGGER__.resume
[241] Fix | Delete
end
[242] Fix | Delete
[243] Fix | Delete
def check_suspend
[244] Fix | Delete
while MUTEX.synchronize {
[245] Fix | Delete
if @suspend_next
[246] Fix | Delete
DEBUGGER__.waiting.push Thread.current
[247] Fix | Delete
@suspend_next = false
[248] Fix | Delete
true
[249] Fix | Delete
end
[250] Fix | Delete
}
[251] Fix | Delete
end
[252] Fix | Delete
end
[253] Fix | Delete
[254] Fix | Delete
def trace?
[255] Fix | Delete
@trace
[256] Fix | Delete
end
[257] Fix | Delete
[258] Fix | Delete
def set_trace(arg)
[259] Fix | Delete
@trace = arg
[260] Fix | Delete
end
[261] Fix | Delete
[262] Fix | Delete
def stdout
[263] Fix | Delete
DEBUGGER__.stdout
[264] Fix | Delete
end
[265] Fix | Delete
[266] Fix | Delete
def break_points
[267] Fix | Delete
DEBUGGER__.break_points
[268] Fix | Delete
end
[269] Fix | Delete
[270] Fix | Delete
def display
[271] Fix | Delete
DEBUGGER__.display
[272] Fix | Delete
end
[273] Fix | Delete
[274] Fix | Delete
def context(th)
[275] Fix | Delete
DEBUGGER__.context(th)
[276] Fix | Delete
end
[277] Fix | Delete
[278] Fix | Delete
def set_trace_all(arg)
[279] Fix | Delete
DEBUGGER__.set_trace(arg)
[280] Fix | Delete
end
[281] Fix | Delete
[282] Fix | Delete
def set_last_thread(th)
[283] Fix | Delete
DEBUGGER__.set_last_thread(th)
[284] Fix | Delete
end
[285] Fix | Delete
[286] Fix | Delete
def debug_eval(str, binding)
[287] Fix | Delete
begin
[288] Fix | Delete
eval(str, binding)
[289] Fix | Delete
rescue StandardError, ScriptError => e
[290] Fix | Delete
at = eval("caller(1)", binding)
[291] Fix | Delete
stdout.printf "%s:%s\n", at.shift, e.to_s.sub(/\(eval\):1:(in `.*?':)?/, '')
[292] Fix | Delete
for i in at
[293] Fix | Delete
stdout.printf "\tfrom %s\n", i
[294] Fix | Delete
end
[295] Fix | Delete
throw :debug_error
[296] Fix | Delete
end
[297] Fix | Delete
end
[298] Fix | Delete
[299] Fix | Delete
def debug_silent_eval(str, binding)
[300] Fix | Delete
begin
[301] Fix | Delete
eval(str, binding)
[302] Fix | Delete
rescue StandardError, ScriptError
[303] Fix | Delete
nil
[304] Fix | Delete
end
[305] Fix | Delete
end
[306] Fix | Delete
[307] Fix | Delete
def var_list(ary, binding)
[308] Fix | Delete
ary.sort!
[309] Fix | Delete
for v in ary
[310] Fix | Delete
stdout.printf " %s => %s\n", v, eval(v.to_s, binding).inspect
[311] Fix | Delete
end
[312] Fix | Delete
end
[313] Fix | Delete
[314] Fix | Delete
def debug_variable_info(input, binding)
[315] Fix | Delete
case input
[316] Fix | Delete
when /^\s*g(?:lobal)?\s*$/
[317] Fix | Delete
var_list(global_variables, binding)
[318] Fix | Delete
[319] Fix | Delete
when /^\s*l(?:ocal)?\s*$/
[320] Fix | Delete
var_list(eval("local_variables", binding), binding)
[321] Fix | Delete
[322] Fix | Delete
when /^\s*i(?:nstance)?\s+/
[323] Fix | Delete
obj = debug_eval($', binding)
[324] Fix | Delete
var_list(obj.instance_variables, obj.instance_eval{binding()})
[325] Fix | Delete
[326] Fix | Delete
when /^\s*c(?:onst(?:ant)?)?\s+/
[327] Fix | Delete
obj = debug_eval($', binding)
[328] Fix | Delete
unless obj.kind_of? Module
[329] Fix | Delete
stdout.print "Should be Class/Module: ", $', "\n"
[330] Fix | Delete
else
[331] Fix | Delete
var_list(obj.constants, obj.module_eval{binding()})
[332] Fix | Delete
end
[333] Fix | Delete
end
[334] Fix | Delete
end
[335] Fix | Delete
[336] Fix | Delete
def debug_method_info(input, binding)
[337] Fix | Delete
case input
[338] Fix | Delete
when /^i(:?nstance)?\s+/
[339] Fix | Delete
obj = debug_eval($', binding)
[340] Fix | Delete
[341] Fix | Delete
len = 0
[342] Fix | Delete
for v in obj.methods.sort
[343] Fix | Delete
len += v.size + 1
[344] Fix | Delete
if len > 70
[345] Fix | Delete
len = v.size + 1
[346] Fix | Delete
stdout.print "\n"
[347] Fix | Delete
end
[348] Fix | Delete
stdout.print v, " "
[349] Fix | Delete
end
[350] Fix | Delete
stdout.print "\n"
[351] Fix | Delete
[352] Fix | Delete
else
[353] Fix | Delete
obj = debug_eval(input, binding)
[354] Fix | Delete
unless obj.kind_of? Module
[355] Fix | Delete
stdout.print "Should be Class/Module: ", input, "\n"
[356] Fix | Delete
else
[357] Fix | Delete
len = 0
[358] Fix | Delete
for v in obj.instance_methods(false).sort
[359] Fix | Delete
len += v.size + 1
[360] Fix | Delete
if len > 70
[361] Fix | Delete
len = v.size + 1
[362] Fix | Delete
stdout.print "\n"
[363] Fix | Delete
end
[364] Fix | Delete
stdout.print v, " "
[365] Fix | Delete
end
[366] Fix | Delete
stdout.print "\n"
[367] Fix | Delete
end
[368] Fix | Delete
end
[369] Fix | Delete
end
[370] Fix | Delete
[371] Fix | Delete
def thnum
[372] Fix | Delete
num = DEBUGGER__.instance_eval{@thread_list[Thread.current]}
[373] Fix | Delete
unless num
[374] Fix | Delete
DEBUGGER__.make_thread_list
[375] Fix | Delete
num = DEBUGGER__.instance_eval{@thread_list[Thread.current]}
[376] Fix | Delete
end
[377] Fix | Delete
num
[378] Fix | Delete
end
[379] Fix | Delete
[380] Fix | Delete
def debug_command(file, line, id, binding)
[381] Fix | Delete
MUTEX.lock
[382] Fix | Delete
if CONTINUATIONS_SUPPORTED
[383] Fix | Delete
unless defined?($debugger_restart) and $debugger_restart
[384] Fix | Delete
callcc{|c| $debugger_restart = c}
[385] Fix | Delete
end
[386] Fix | Delete
end
[387] Fix | Delete
set_last_thread(Thread.current)
[388] Fix | Delete
frame_pos = 0
[389] Fix | Delete
binding_file = file
[390] Fix | Delete
binding_line = line
[391] Fix | Delete
previous_line = nil
[392] Fix | Delete
if ENV['EMACS']
[393] Fix | Delete
stdout.printf "\032\032%s:%d:\n", binding_file, binding_line
[394] Fix | Delete
else
[395] Fix | Delete
stdout.printf "%s:%d:%s", binding_file, binding_line,
[396] Fix | Delete
line_at(binding_file, binding_line)
[397] Fix | Delete
end
[398] Fix | Delete
@frames[0] = [binding, file, line, id]
[399] Fix | Delete
display_expressions(binding)
[400] Fix | Delete
prompt = true
[401] Fix | Delete
while prompt and input = readline("(rdb:%d) "%thnum(), true)
[402] Fix | Delete
catch(:debug_error) do
[403] Fix | Delete
if input == ""
[404] Fix | Delete
next unless DEBUG_LAST_CMD[0]
[405] Fix | Delete
input = DEBUG_LAST_CMD[0]
[406] Fix | Delete
stdout.print input, "\n"
[407] Fix | Delete
else
[408] Fix | Delete
DEBUG_LAST_CMD[0] = input
[409] Fix | Delete
end
[410] Fix | Delete
[411] Fix | Delete
case input
[412] Fix | Delete
when /^\s*tr(?:ace)?(?:\s+(on|off))?(?:\s+(all))?$/
[413] Fix | Delete
if defined?( $2 )
[414] Fix | Delete
if $1 == 'on'
[415] Fix | Delete
set_trace_all true
[416] Fix | Delete
else
[417] Fix | Delete
set_trace_all false
[418] Fix | Delete
end
[419] Fix | Delete
elsif defined?( $1 )
[420] Fix | Delete
if $1 == 'on'
[421] Fix | Delete
set_trace true
[422] Fix | Delete
else
[423] Fix | Delete
set_trace false
[424] Fix | Delete
end
[425] Fix | Delete
end
[426] Fix | Delete
if trace?
[427] Fix | Delete
stdout.print "Trace on.\n"
[428] Fix | Delete
else
[429] Fix | Delete
stdout.print "Trace off.\n"
[430] Fix | Delete
end
[431] Fix | Delete
[432] Fix | Delete
when /^\s*b(?:reak)?\s+(?:(.+):)?([^.:]+)$/
[433] Fix | Delete
pos = $2
[434] Fix | Delete
if $1
[435] Fix | Delete
klass = debug_silent_eval($1, binding)
[436] Fix | Delete
file = File.expand_path($1)
[437] Fix | Delete
end
[438] Fix | Delete
if pos =~ /^\d+$/
[439] Fix | Delete
pname = pos
[440] Fix | Delete
pos = pos.to_i
[441] Fix | Delete
else
[442] Fix | Delete
pname = pos = pos.intern.id2name
[443] Fix | Delete
end
[444] Fix | Delete
break_points.push [true, 0, klass || file, pos]
[445] Fix | Delete
stdout.printf "Set breakpoint %d at %s:%s\n", break_points.size, klass || file, pname
[446] Fix | Delete
[447] Fix | Delete
when /^\s*b(?:reak)?\s+(.+)[#.]([^.:]+)$/
[448] Fix | Delete
pos = $2.intern.id2name
[449] Fix | Delete
klass = debug_eval($1, binding)
[450] Fix | Delete
break_points.push [true, 0, klass, pos]
[451] Fix | Delete
stdout.printf "Set breakpoint %d at %s.%s\n", break_points.size, klass, pos
[452] Fix | Delete
[453] Fix | Delete
when /^\s*wat(?:ch)?\s+(.+)$/
[454] Fix | Delete
exp = $1
[455] Fix | Delete
break_points.push [true, 1, exp]
[456] Fix | Delete
stdout.printf "Set watchpoint %d:%s\n", break_points.size, exp
[457] Fix | Delete
[458] Fix | Delete
when /^\s*b(?:reak)?$/
[459] Fix | Delete
if break_points.find{|b| b[1] == 0}
[460] Fix | Delete
n = 1
[461] Fix | Delete
stdout.print "Breakpoints:\n"
[462] Fix | Delete
break_points.each do |b|
[463] Fix | Delete
if b[0] and b[1] == 0
[464] Fix | Delete
stdout.printf " %d %s:%s\n", n, b[2], b[3]
[465] Fix | Delete
end
[466] Fix | Delete
n += 1
[467] Fix | Delete
end
[468] Fix | Delete
end
[469] Fix | Delete
if break_points.find{|b| b[1] == 1}
[470] Fix | Delete
n = 1
[471] Fix | Delete
stdout.print "\n"
[472] Fix | Delete
stdout.print "Watchpoints:\n"
[473] Fix | Delete
for b in break_points
[474] Fix | Delete
if b[0] and b[1] == 1
[475] Fix | Delete
stdout.printf " %d %s\n", n, b[2]
[476] Fix | Delete
end
[477] Fix | Delete
n += 1
[478] Fix | Delete
end
[479] Fix | Delete
end
[480] Fix | Delete
if break_points.size == 0
[481] Fix | Delete
stdout.print "No breakpoints\n"
[482] Fix | Delete
else
[483] Fix | Delete
stdout.print "\n"
[484] Fix | Delete
end
[485] Fix | Delete
[486] Fix | Delete
when /^\s*del(?:ete)?(?:\s+(\d+))?$/
[487] Fix | Delete
pos = $1
[488] Fix | Delete
unless pos
[489] Fix | Delete
input = readline("Clear all breakpoints? (y/n) ", false)
[490] Fix | Delete
if input == "y"
[491] Fix | Delete
for b in break_points
[492] Fix | Delete
b[0] = false
[493] Fix | Delete
end
[494] Fix | Delete
end
[495] Fix | Delete
else
[496] Fix | Delete
pos = pos.to_i
[497] Fix | Delete
if break_points[pos-1]
[498] Fix | Delete
break_points[pos-1][0] = false
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function