Skip to content

Enable "step back <n>" while replay - #754

Merged
ko1 merged 1 commit into
ruby:masterfrom
ono-max:patch-6
Nov 1, 2022
Merged

Enable "step back <n>" while replay#754
ko1 merged 1 commit into
ruby:masterfrom
ono-max:patch-6

Conversation

@ono-max

@ono-maxono-max commented Sep 20, 2022

Copy link
Copy Markdown
Member

Currently, step back <n> doesn't work in replay mode. This PR fixes it.

@ono-max
ono-max marked this pull request as draft October 18, 2022 10:48
@ono-max
ono-maxforce-pushed the patch-6 branch 4 times, most recently from cf84579 to 915aabdCompareOctober 18, 2022 11:57
@ono-max
ono-max marked this pull request as ready for review October 18, 2022 12:05
def step_back iter
@index += iter
if @index > @log.size
@index = @log.size

Copy link
Copy Markdown
MemberAuthor

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.

Comment threadlib/debug/session.rb Outdated
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/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\s -> \s+

Comment threadlib/debug/session.rb Outdated
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/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
when/\A(back)\z/,/\A(reset)\z/,/\A(back)\s(\d+)\z/
when/\A(back)\z/,/\A(back)\s+(\d+)\z/,/\A(reset)\z/

Comment threadlib/debug/session.rb Outdated
else
request_tc [:step, arg.to_sym]
type = $1.to_sym
iter = $2.to_i unless $2.nil?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
iter= $2.to_iunless $2.nil?
iter= $2&.to_i

@ko1
ko1 merged commit 349f02a into ruby:masterNov 1, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@ono-max@ko1