about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-07-18 08:38:56 +0000
committerbors <bors@rust-lang.org>2019-07-18 08:38:56 +0000
commit21d5b8bf0c26e3ee4c270ce5527df66b1af56513 (patch)
tree64bad9144c0109e60e7cdb4ddef32afb759d474a /src
parent2c3b05d90d4dee879a0d9f33e721c930b087d7d1 (diff)
parentd649ff3c0c048520c054a539d7c9eb9cf77b127a (diff)
downloadrust-21d5b8bf0c26e3ee4c270ce5527df66b1af56513.tar.gz
rust-21d5b8bf0c26e3ee4c270ce5527df66b1af56513.zip
Auto merge of #62671 - lzutao:tidy-lldb, r=alexcrichton
Check for lldb existences
Diffstat (limited to 'src')
-rwxr-xr-xsrc/etc/rust-lldb33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/etc/rust-lldb b/src/etc/rust-lldb
index 0eb99423df5..7b9b40e6b4a 100755
--- a/src/etc/rust-lldb
+++ b/src/etc/rust-lldb
@@ -3,25 +3,30 @@
 # Exit if anything fails
 set -e
 
-# Find out where to look for the pretty printer Python module
-RUSTC_SYSROOT=`rustc --print sysroot`
-
 # Find the host triple so we can find lldb in rustlib.
-host=`rustc -vV | sed -n -e 's/^host: //p'`
+host=$(rustc -vV | sed -n -e 's/^host: //p')
+
+# Find out where to look for the pretty printer Python module
+RUSTC_SYSROOT=$(rustc --print sysroot)
+RUST_LLDB="$RUSTC_SYSROOT/lib/rustlib/$host/bin/lldb"
 
 lldb=lldb
-if [ -f "$RUSTC_SYSROOT/lib/rustlib/$host/bin/lldb" ]; then
-    lldb="$RUSTC_SYSROOT/lib/rustlib/$host/bin/lldb"
+if [ -f "$RUST_LLDB" ]; then
+    lldb="$RUST_LLDB"
 else
-    LLDB_VERSION=`"$lldb" --version 2>/dev/null | head -1 | cut -d. -f1`
+    if ! command -v "$lldb" > /dev/null; then
+        echo "$lldb not found! Please install it." >&2
+        exit 1
+    else
+        LLDB_VERSION=$("$lldb" --version | cut -d ' ' -f3)
 
-    if [ "$LLDB_VERSION" = "lldb-350" ]
-    then
-        echo "***"
-	echo \
-"WARNING: This version of LLDB has known issues with Rust and cannot \
-display the contents of local variables!"
-        echo "***"
+        if [ "$LLDB_VERSION" = "3.5.0" ]; then
+            cat << EOF >&2
+***
+WARNING: This version of LLDB has known issues with Rust and cannot display the contents of local variables!
+***
+EOF
+        fi
     fi
 fi