Skip to content

Commit

Permalink
Auto merge of rust-lang#62671 - lzutao:tidy-lldb, r=alexcrichton
Browse files Browse the repository at this point in the history
Check for lldb existences
  • Loading branch information
bors committed Jul 18, 2019
2 parents 2c3b05d + d649ff3 commit 21d5b8b
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions src/etc/rust-lldb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 21d5b8b

Please sign in to comment.