Continue single stepping if the same line reached in all cases. Factor out some code code. Fixes #13065.