Skip to content

Commit

Permalink
rename method.
Browse files Browse the repository at this point in the history
`request_tc_with_freed_threads` -> `request_tc_with_restarted_threads`
because `freed` is ambiguous (with memory management).
  • Loading branch information
ko1 committed Nov 11, 2023
1 parent 3255b71 commit 2e130ff
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/debug/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,15 @@ def request_tc(req)
@tc << req
end

def request_tc_with_freed_threads(req)
def request_tc_with_restarted_threads(req)
restart_all_threads
request_tc(req)
end

def request_eval type, src
request_tc_with_restarted_threads [:eval, type, src]
end

def process_event evt
# variable `@internal_info` is only used for test
tc, output, ev, @internal_info, *ev_args = evt
Expand Down Expand Up @@ -817,15 +821,15 @@ def register_default_command

case sub
when nil
request_tc_with_freed_threads [:show, :default, pat] # something useful
request_tc_with_restarted_threads [:show, :default, pat] # something useful
when :locals
request_tc_with_freed_threads [:show, :locals, pat]
request_tc_with_restarted_threads [:show, :locals, pat]
when :ivars
request_tc_with_freed_threads [:show, :ivars, pat, opt]
request_tc_with_restarted_threads [:show, :ivars, pat, opt]
when :consts
request_tc_with_freed_threads [:show, :consts, pat, opt]
request_tc_with_restarted_threads [:show, :consts, pat, opt]
when :globals
request_tc_with_freed_threads [:show, :globals, pat]
request_tc_with_restarted_threads [:show, :globals, pat]
when :threads
thread_list
:retry
Expand All @@ -845,7 +849,7 @@ def register_default_command
# * Show you available methods and instance variables of the given object.
# * If the object is a class/module, it also lists its constants.
register_command 'outline', 'o', 'ls', unsafe: false do |arg|
request_tc_with_freed_threads [:show, :outline, arg]
request_tc_with_restarted_threads [:show, :outline, arg]
end

# * `display`
Expand Down Expand Up @@ -990,7 +994,7 @@ def register_default_command
:retry

when /\Aobject\s+(.+)/
request_tc_with_freed_threads [:trace, :object, $1.strip, {pattern: pattern, into: into}]
request_tc_with_restarted_threads [:trace, :object, $1.strip, {pattern: pattern, into: into}]

when /\Aoff\s+(\d+)\z/
if t = @tracers.values[$1.to_i]
Expand Down Expand Up @@ -1171,10 +1175,6 @@ def process_command line
return :retry
end

def request_eval type, src
request_tc_with_freed_threads [:eval, type, src]
end

def step_command type, arg
if type == :until
leave_subsession [:step, type, arg]
Expand Down

0 comments on commit 2e130ff

Please sign in to comment.