-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug with parsing UART output #318
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks fine to me, but it would be nice to have a test that demonstrates it and prevents it regressing.
I will add a test. |
Great! Seeing as there are already some failing tests with the change you provided it may be worth looking into whether there is already a test that just needs a modification. |
Can you re-run the tests? @jonahgraham I don't know what the one that's failing is about. |
All the tests are passing now. Can you release a new version on Open VSX for this change? Thanks. |
I'll try to look at it soon, but it may have to wait until Monday. |
That works. Thank you. |
Adds support for these features/bug fixes in the adapter: - A fix the newline handling for the UART - eclipse-cdt-cloud/cdt-gdb-adapter#318 - New feature of supporting stepping granularity - eclipse-cdt-cloud/cdt-gdb-adapter#309
This PR fixes issue #317.
Problematic code snippet in
GDBTargetDebugSession.ts
:If
data
isCoreTimer timer interrupt.\r\n
- for example - without settingeolCharacter
in launch configuration, the adapter uses default\n
to parsedata
. It accumulatesCoreTimer timer interrupt.\r
in variabletcpUartData
and then appendsos.EOL
at the end. On Windows, the finaltcpUartData
becomesCoreTimer timer interrupt.\r\r\n
. The extra new line comes from here. To fix this, the adapter appends\n
instead of\r\n
because\r
is already intcpUartData
.I tried setting
eolCharacter
toCRLF
in launch configuration. This didn't work.char
is one character in length, buteolChar
is two in length, sochar === eolChar
is nevertrue
. The adapter also can't parse two characters at a time because one burst ofdata
might beCoreTimer timer interrupt.\r
and the next one\n
. If this happens,\r\n
will never be detected together.I have tested this change fixes the problem I described in issue #317.