Skip to content
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

lldb-4: Patch to fix libedit usage on Linux #26099

Merged
merged 1 commit into from
May 29, 2017

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented May 25, 2017

Idea from:
https://bugs.llvm.org//show_bug.cgi?id=28898#c7

Fixes ability to use arrow keys.

Motivation for this change
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@dtzWill dtzWill mentioned this pull request May 26, 2017
7 tasks
@@ -27,6 +27,8 @@ stdenv.mkDerivation {
cmake/modules/LLDBStandalone.cmake
sed -i 's,"$.LLVM_LIBRARY_DIR.",${llvm}/lib ${clang-unwrapped}/lib,' \
cmake/modules/LLDBStandalone.cmake

patch -p1 -i ${./lldb-libedit.patch}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why didn't you use patches?

@dtzWill
Copy link
Member Author

dtzWill commented May 27, 2017

Hold on, upstream patched this in a different way... will be comparing the two and testing.

Upstream commit: llvm-mirror/lldb@9ad9480

@dtzWill
Copy link
Member Author

dtzWill commented May 27, 2017

Both patches seem to fix usage of libedit, arrow keys/tab-completion are working (as compared to current lldb).

Unfortunately I'm not sure which patch is appropriate, neither seem to handle input containing utf8.

Dummy little program with some unicode symbols for testing with:

class ooɟ {
public:
__attribute__((noinline))
  void こんにちは() {}
};

__attribute__((noinline))
void test() {
  ooɟ f;
  f.こんにちは();
}
int main() {
  test();
}

Tested using my patch (basically same as voidlinux's patch[1]), upstream's patch, both....cross two libedit versions-- our current libedit and newest version that enables unicode by default....

  • All configurations resolve the arrow-keys/tab-completion/etc problems
  • Setting WCHAR=1 (our/void patch): unicode strings pasted as input display as escaped strings.
  • Upstream patch: unicode strings pasted as input have non-ascii characters stripped/dropped AFAICT
  • Both patches: behavior matches WCHAR=1 AFAICT.

Changing libedit version does not seem to have any impact on tested behavior.

[1] void's issue on this: https://github.com/voidlinux/void-packages/issues/6073


I vote we use the patch I originally proposed and ignore upstream's patch for now:

  • Without libedit (current situation), arrow keys, history, tab-completion .. all of these features don't work. These seem pretty important!
  • The upstream patch causes unicode characters to silently disappear which seems worse IMO; I'd rather see escaped characters that scream "I'm not being handled properly".
  • libedit features seem significantly more input than attempting to accommodate usage of commands containing unicode.
    • In all configurations I can't seem to get lldb to tab-complete non-ascii symbols or to set breakpoints on them, so this experience might be broken regardless.

@LnL7
Copy link
Member

LnL7 commented May 29, 2017

I would say we prefer upstream patches, but your argument makes sense.

@LnL7 LnL7 merged commit 4e88e82 into NixOS:master May 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants