0
0
mirror of https://github.com/termux/termux-packages.git synced 2024-12-12 00:10:52 +00:00
termux-packages/packages/libllvm/lldb-source-Plugins-Platform-Android-AdbClient.cpp.patch
Yaksh Bariya d0fd46af20 fix(main/libllvm): hardcoded paths to dash and libdirs in lldb
Hardcode to use $PREFIX/bin/sh instead of /system/bin/sh

Also add $PREFIX/lib to default_lib32_path and default_lib64_path.

Noticed the hardcoded shell path when playing around with lldb to debug
my C++ program
2022-06-16 11:17:28 +05:30

17 lines
951 B
Diff

LLDB uses a really broken logic to find whether the shell command failed or
not for Android. Sadly there's nothing much we can do to fix it (unless anyone
decides to work on a write a proper patch for the same).
--- a/lldb/source/Plugins/Platform/Android/AdbClient.cpp 2022-06-09 10:32:03.335331787 +0530
+++ b/lldb/source/Plugins/Platform/Android/AdbClient.cpp 2022-06-09 10:37:37.749300877 +0530
@@ -370,8 +370,8 @@
return error;
// ADB doesn't propagate return code of shell execution - if
- // output starts with /system/bin/sh: most likely command failed.
- static const char *kShellPrefix = "/system/bin/sh:";
+ // output starts with @TERMUX_PREFIX@/bin/sh: most likely command failed.
+ static const char *kShellPrefix = "@TERMUX_PREFIX@/bin/sh:";
if (output_buf.size() > strlen(kShellPrefix)) {
if (!memcmp(&output_buf[0], kShellPrefix, strlen(kShellPrefix)))
return Status("Shell command %s failed: %s", command,