-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable "step back <n>" while replay #754
Conversation
cf84579
to
915aabd
Compare
def step_back iter | ||
@index += iter | ||
if @index > @log.size | ||
@index = @log.size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When n of "step back " is larger than current @index
, @index
will be size of log.
lib/debug/session.rb
Outdated
@@ -1056,12 +1056,14 @@ def step_command type, arg | |||
else | |||
leave_subsession [:step, type, arg&.to_i] | |||
end | |||
when /\Aback\z/, /\Areset\z/ | |||
when /\A(back)\z/, /\A(reset)\z/, /\A(back)\s(\d+)\z/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\s -> \s+
lib/debug/session.rb
Outdated
@@ -1056,12 +1056,14 @@ def step_command type, arg | |||
else | |||
leave_subsession [:step, type, arg&.to_i] | |||
end | |||
when /\Aback\z/, /\Areset\z/ | |||
when /\A(back)\z/, /\A(reset)\z/, /\A(back)\s(\d+)\z/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when /\A(back)\z/, /\A(reset)\z/, /\A(back)\s(\d+)\z/ | |
when /\A(back)\z/, /\A(back)\s+(\d+)\z/, /\A(reset)\z/ |
lib/debug/session.rb
Outdated
if type != :in | ||
@ui.puts "only `step #{arg}` is supported." | ||
:retry | ||
else | ||
request_tc [:step, arg.to_sym] | ||
type = $1.to_sym | ||
iter = $2.to_i unless $2.nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iter = $2.to_i unless $2.nil? | |
iter = $2&.to_i |
Currently,
step back <n>
doesn't work in replay mode. This PR fixes it.