flipperzero-firmware icon indicating copy to clipboard operation
flipperzero-firmware copied to clipboard

Sane keyboard input not working in GDB when using the fbt tool

Open Semptum opened this issue 3 years ago • 9 comments

Describe the bug.

When using ./fbt blackmagic, a gdb interface appears. However, pressing backspace graphically adds a space to the prompt (as long as there is text to erase). Functionnally the text is erased but not graphically. Similar behavior arises as soon as the text is changed in any way such as pressing the left arrow and typing something as illustrated below.

blackmagic_backspace

Reproduction

  1. cd to the directory of the firmware
  2. Turn on gdb
  3. Type abcd
  4. Press Left
  5. Press backspace
  6. Hopefully abd will remain
  7. Exit gdb
  8. Execute ./fbt blackmagic
  9. Type abcd
  10. Press Left
  11. Press backspace
  12. The result is abcdd (with a space at the end)

Target

No response

Logs

No response

Anything else?

The system is Arch Linux with KDE. The Terminal emulator is Konsole but the problem persists in the virtual console and in XTerm. The shell is ZSH but the problem persists in SH and BASH.

I was advised to add "TERM" to the environment variables at line 15 of environ.scons but this did not help.

EDIT: The problem comes from the binary arm-none-eabi-gdb in the toolchain folder. The system version works fine. The shipped version has this problem.

Semptum avatar Sep 26 '22 12:09 Semptum

@drunkbatya we might need your help with that one.

hedger avatar Sep 26 '22 12:09 hedger

OK, in case it helps, it appears to be basically an issue with ncurses. If I remove the ncurses library from the path that the scripts append, it works fine with the system ncurses.

Semptum avatar Sep 26 '22 17:09 Semptum

@Semptum we've pushed couple updates, is your issue still there?

skotopes avatar Dec 01 '22 17:12 skotopes

@Semptum we've pushed couple updates, is your issue still there?

Yup, just checked, the problem persists on the latest dev even though it pulled in newer versions of the tools

Semptum avatar Dec 01 '22 18:12 Semptum

@Semptum we've pushed couple updates, is your issue still there?

Yup, just checked, the problem persists on the latest dev even though it pulled in newer versions of the tools. If I remember correctly, the problem is with ncurses, using the system library it works fine

Semptum avatar Dec 01 '22 18:12 Semptum

@hedger @drunkbatya your turn ;)

skotopes avatar Dec 01 '22 18:12 skotopes

@Semptum we've pushed couple toolchain updates, do you still have this issue?

skotopes avatar Mar 13 '23 14:03 skotopes

@Semptum we've pushed couple toolchain updates, do you still have this issue?

Yup, still there...

Semptum avatar Mar 13 '23 19:03 Semptum

@Semptum we've pushed couple toolchain updates, do you still have this issue?

Yup, still there...

Ok, I'll look at this soon

drunkbatya avatar Mar 13 '23 19:03 drunkbatya

@drunkbatya any updates?

skotopes avatar Jun 22 '23 08:06 skotopes

@drunkbatya any updates?

Not yet, I'll look at this today.

drunkbatya avatar Jun 22 '23 08:06 drunkbatya

@Semptum Hey! I found a core of the problem, it was a missing libtinfo ncurses compiling dependency. I'm released the new toolchain with this fix. Can you test it?

git pull
git checkout drunkbatya/23-toolchain
./fbt blackmagic

drunkbatya avatar Jul 01 '23 15:07 drunkbatya