Repository navigation
Ensure stdin/stdout of DAP server are in binary more - #11
Closed
jcpetruzza wants to merge 1 commit into
Closed
jcpetruzza wants to merge 1 commit into
jcpetruzza wants to merge 1 commit into
Conversation
Summary: # Context The DAP server communicates with the client via a pipe on stdin/stdout. The protocol uses `\r\n` to delimit frames # Problem By default stdin/stdout are in text mode, and when we create a port in `edb_dap_transport`, even though we specify `binary` for the port, the underlying devices are already in `text` mode, so all `\r` are converted by default to `\n`. This then means that the parsing of DAP frames fail, as we don't get the `\r\n\rn` pattern that we expect # This diff Set stdio/stdout to binary mode before opening the port Differential Revision: D81579173
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D81579173 |
Closed
Contributor
|
This pull request has been merged in 4a4610f. |
jcpetruzza
added a commit
that referenced
this pull request
Sep 11, 2025
Summary: Pull Request resolved: #11 # Context The DAP server communicates with the client via a pipe on stdin/stdout. The protocol uses `\r\n` to delimit frames # Problem By default stdin/stdout are in text mode, and when we create a port in `edb_dap_transport`, even though we specify `binary` for the port, the underlying devices are already in `text` mode, so all `\r` are converted by default to `\n`. This then means that the parsing of DAP frames fail, as we don't get the `\r\n\r\n` pattern that we expect # This diff Set stdio/stdout to binary mode before opening the port Reviewed By: TheGeorge, robertoaloi Differential Revision: D81579173 fbshipit-source-id: 4ff329ad2a01e6fa96db24d66147373572420808
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Context
The DAP server communicates with the client via a pipe on stdin/stdout. The protocol uses
\r\nto delimit framesProblem
By default stdin/stdout are in text mode, and when we create a port in
edb_dap_transport, even though we specifybinaryfor the port, the underlying devices are already intextmode, so all\rare converted by default to\n.This then means that the parsing of DAP frames fail, as we don't get the
\r\n\rnpattern that we expectThis diff
Set stdio/stdout to binary mode before opening the port
Differential Revision: D81579173