This is an archive of the discontinued LLVM Phabricator instance.

[LLDB][GUI] Fix text field incorrect key handling
ClosedPublic

Authored by OmarEmaraDev on Aug 18 2021, 1:32 PM.

Details

Summary

The isprint libc function was used to determine if the key code
represents a printable character. The problem is that the specification
leaves the behavior undefined if the key is not representable as an
unsigned char, which is the case for many ncurses keys. This patch adds
and explicit check for this undefined behavior and make it consistent.

The llvm::isPrint function didn't work correctly for some reason, most
likely because it takes a char instead of an int, which I guess makes it
unsuitable for checking ncurses key codes.

Diff Detail

Event Timeline

OmarEmaraDev created this revision.Aug 18 2021, 1:32 PM
OmarEmaraDev requested review of this revision.Aug 18 2021, 1:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 18 2021, 1:32 PM
clayborg accepted this revision.Aug 18 2021, 3:04 PM

This works much better now!

This revision is now accepted and ready to land.Aug 18 2021, 3:04 PM
This revision was landed with ongoing or failed builds.Aug 18 2021, 3:06 PM
This revision was automatically updated to reflect the committed changes.