diff --git a/.travis.yml b/.travis.yml index 7fb7cdba7..86c7a3fb5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ git: before_install: - git config --global url.git@github.com:.insteadOf https://github.com/ - git submodule update --init -- src/windows-build src/Modules/Pester src/libpsl-native/test/googletest - - ./download.sh + - ./tools/download.sh script: - ulimit -n 4096; powershell -c "Import-Module ./build.psm1; Start-PSBootstrap; Start-PSBuild; Start-PSPester" notifications: diff --git a/docs/building/linux.md b/docs/building/linux.md index d1171794e..130e104b7 100644 --- a/docs/building/linux.md +++ b/docs/building/linux.md @@ -46,7 +46,7 @@ package cannot be downloaded as simply as with `wget`. We have a script that wraps the GitHub API and uses a personal access token to authorize in order to obtain the package. -The `./download.sh` script will also install the PowerShell package. +The `./tools/download.sh` script will also install the PowerShell package. > You can alternativelly download via a browser, upload it to your > box via some other method, and manually install it. @@ -54,7 +54,7 @@ The `./download.sh` script will also install the PowerShell package. In Bash: ```sh -GITHUB_TOKEN= ./download.sh +GITHUB_TOKEN= ./tools/download.sh powershell ``` diff --git a/docs/debugging/README.md b/docs/debugging/README.md index 531393baa..ff0b681da 100644 --- a/docs/debugging/README.md +++ b/docs/debugging/README.md @@ -98,6 +98,19 @@ Trace-Command -Expression { Get-ChildItem . } -Name PathResolution -PSHost The `-PSHost` specifies the sink, in this case the console host, so we can see the tracing messages. +LLDB with SOS plugin +==================== + +The `./tools/debug.sh` script can be used to launch PowerShell inside of LLDB +with the SOS plugin provided by .NET Core. This provides an additional way to +debug PowerShell on Linux, but VS Code is recommended for a better user +experience (and its single-stepping capabilities). + +The script is self-documented and contains a link to the +[CoreCLR debugging help][clr-debug] . + +[clr-debug]: https://github.com/dotnet/coreclr/blob/master/Documentation/building/debugging-instructions.md#debugging-coreclr-on-linux + corehost ======== diff --git a/debug.sh b/tools/debug.sh similarity index 65% rename from debug.sh rename to tools/debug.sh index 056758f6d..6a542ab92 100755 --- a/debug.sh +++ b/tools/debug.sh @@ -1,7 +1,8 @@ #!/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; } +test -x debug/powershell || { echo >&2 "No debug/powershell, please run 'Start-PSBuild -Publish -Output debug'"; exit 1; } +test -x debug/libsosplugin.so || { echo >&2 "No debug/libsosplugin.so, please run 'Start-PSBuild -Publish -Output debug'"; exit 1; } cat << EOF @@ -16,6 +17,6 @@ Most useful commands are 'clrstack', 'clrthreads', and 'pe'. EOF -pushd bin +pushd debug lldb-3.6 -o "plugin load libsosplugin.so" -- ./powershell $@ popd diff --git a/download.sh b/tools/download.sh similarity index 100% rename from download.sh rename to tools/download.sh