-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sys/shell: refactor readline function #13196
Conversation
@HendrikVE thank you very much for taking over |
758547c
to
a3c1fca
Compare
This one needs a rebase now! |
I'm already on it ;) The same with #13197 |
a3c1fca
to
886bcd3
Compare
886bcd3
to
cb12b5d
Compare
Rebased and ready for review :) |
I tried this on particle-xenon and nucleo-f072rb. Just typing a long line (hammering the keyboard) causes a failed assertio. Please take a look.
|
@HendrikVE can you test if the failing test fails in master as well? I saw it fail in another PR |
This problem definitely has nothing to do with this PR, it only occurs sporadically in Murdock. Let's rerun the test and see what happens. |
There is something wrong with |
It seems like not only esp32-wroom32 is failing tests though. :( |
sorry, I think I misread the output, you're right. |
Yeah, I already saw it in the nightlies. According to the nightlies the tests fail since May 10th. So it seems to be related to the fix in PR #14041 that was merged on May, 9th. This fix sets |
Probably now it is used too much ;) CI splits building and testing. One (fast) worker compiles the elf and sends it to a queue as "test job", then a RasPi picks that, copies the .elf to its place and calls "make test". it seems that due to that change, it tries to rebuild the .elf, or something in that direction. |
Let's continue in #14041! |
Hopefully this build will the the last.. |
Looks good now! |
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.
ACK!
Cool! Thanks a lot @kaspar030, @fjmolinas and @gschorcht for your reviews! #13197 needs a rebase now, I'll do that soon. |
In RIOT-OS#12955 optimization was switched to O2 because with the '-Os' option, the ESP32 hangs sporadically in 'tests/bench*' if interrupts where disabled too early by benchmark tests. Since it hasn't been reproduced since and in RIOT-OS#13196 O2 was causing un-explained hardfaults, since the aforementioned issue could not be reproduced we switch back to Os by removing O2, as Os will be used by default.
In RIOT-OS#12955 optimization was switched to O2 because with the '-Os' option, the ESP32 hangs sporadically in 'tests/bench*' if interrupts where disabled too early by benchmark tests. Since it hasn't been reproduced since and in RIOT-OS#13196 O2 was causing un-explained hardfaults, since the aforementioned issue could not be reproduced we switch back to Os by removing O2, as Os will be used by default.
Contribution description
With this PR I simply copied PR #12099 authored by @jcarrano. Since he left the team, I hereby offer to take care of rebasing and implement required changes.
This makes the code of readline() clearer and shorter. It also fixes a minor artifact of the long line handling.
Previously, it was not possible to recover from a long line. That is, if too many characters were sent, the line would be invalidated and pressing backspace would not fix it. The only option was to discard the line. It is now possible to bring the line back to size. Note that visual effects when deleting characters will still depend on the host's terminal.
The new code is written in a way that all writes to memory are guarded by bounds check, so an assertion was removed.
Testing procedure
Test vectors were added to
tests/shell
. The test is not really testing a lot right now because the host is still line buffering.Issues/PRs references
Copy of #12099
Dependencies: