Ensure stdin/stdout of DAP server are in binary more #11
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