From 15e01bd5536d1f627dd37bebed26cfac2a7ce9d5 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 19 Feb 2016 12:49:59 -0800 Subject: [PATCH] Improve debug.sh script - Move to the `bin` directly so that SOS works properly. - Check for LLDB and PowerShell programs. - Display help text. --- debug.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/debug.sh b/debug.sh index 1bca26500a..056758f6d0 100755 --- a/debug.sh +++ b/debug.sh @@ -1 +1,21 @@ -lldb-3.6 -o "plugin load ./bin/libsosplugin.so" -- ./bin/powershell $@ +#!/usr/bin/env bash + +hash lldb-3.6 2>/dev/null || { echo >&2 "No lldb-3.6, please run 'sudo apt-get install lldb-3.6'"; exit 1; } +test -x bin/powershell || { echo >&2 "No bin/powershell, please run './build.sh'"; exit 1; } + +cat << EOF + +Launching LLDB with SOS plugin... +Type 'run' or 'r' to start PowerShell. +Press Ctrl-C to interrupt PowerShell and run LLDB commands. +Type 'exit' when interrupted to leave LLDB. + +Visit https://git.io/v2Jhh for CoreCLR debugging help. + +Most useful commands are 'clrstack', 'clrthreads', and 'pe'. + +EOF + +pushd bin +lldb-3.6 -o "plugin load libsosplugin.so" -- ./powershell $@ +popd