-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(debugger): crash when stepping through locations spanning multipl…
…e lines (#3920) # Description The debugger REPL was failing under certain scenarios when a stepped location spanned multiple lines. We tracked down the failure to a missing bounds check. This PR fixes the issue, introduces a refactor to make the relevant code testable, and adds regression tests to prevent reoccurrence. This PR is best reviewed as a whole instead of commit-by-commit. ## Summary - Moves source code printing logic from the main debugger REPL module, to a new source_code_printer module. - Decouples actual printing from rendering logic to improve testability. - Adds regression tests ## Documentation Check one: - [ ] No documentation needed. - [x] Documentation included in this PR. - [ ] **[Exceptional Case]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
- Loading branch information
Showing
6 changed files
with
414 additions
and
82 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
mod context; | ||
mod dap; | ||
mod repl; | ||
mod source_code_printer; | ||
|
||
use std::io::{Read, Write}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.