diff --git a/src/MICore/ExampleClrdbgLaunch.cmd b/src/MICore/ExampleVsDbgLaunch.cmd similarity index 73% rename from src/MICore/ExampleClrdbgLaunch.cmd rename to src/MICore/ExampleVsDbgLaunch.cmd index ff3b44da3..bb9331a60 100644 --- a/src/MICore/ExampleClrdbgLaunch.cmd +++ b/src/MICore/ExampleVsDbgLaunch.cmd @@ -1,17 +1,17 @@ REM -REM This is an example script for starting a project on Windows and attaching to it with clrdbg. +REM This is an example script for starting a project on Windows and attaching to it with vsdbg. REM Various paths at the top of the script may need to be changed. REM -REM See ExampleClrdbgLaunchOptions.Windows.xml for more information. +REM See ExampleVsDbgLaunchOptions.Windows.xml for more information. REM setlocal -set clrdbg=C:\dd\VSPro_VBCS\binaries\amd64chk\Debugger\x-plat\Windows\clrdbg.exe +set vsdbg=C:\dd\VSPro_VBCS\binaries\amd64chk\Debugger\x-plat\Windows\vsdbg.exe set ProjectName=AspNet5Con set ProjectDir=C:\proj\AspNet5Con\src\AspNet5Con set dnx=%USERPROFILE%\.dnx\runtimes\dnx-coreclr-win-x64.1.0.0-beta4-11296\bin\dnx.exe -if not exist "%clrdbg%" echo ERROR: %clrdbg% does not exist.>&2 & exit /b -1 +if not exist "%vsdbg%" echo ERROR: %vsdbg% does not exist.>&2 & exit /b -1 if not exist "%dnx%" echo ERROR: %dnx% does not exist.>&2 & exit /b -1 start %dnx% --appbase %ProjectDir% "Microsoft.Framework.ApplicationHost" --configuration Debug "%ProjectName%" @@ -23,4 +23,4 @@ for /f "skip=3 tokens=2" %%p in ('tasklist /FI "IMAGENAME eq dnx.exe"') do set t if "%target_pid%"=="" echo ERROR: Failed to find dnx.exe process.>&2 & exit /b -1 -%clrdbg% --interpreter=mi --attach %target_pid% +%vsdbg% --interpreter=mi --attach %target_pid% diff --git a/src/MICore/ExampleClrdbgLaunchOptions.Windows.xml b/src/MICore/ExampleVsDbgLaunchOptions.Windows.xml similarity index 100% rename from src/MICore/ExampleClrdbgLaunchOptions.Windows.xml rename to src/MICore/ExampleVsDbgLaunchOptions.Windows.xml diff --git a/tools/InstallToVSCode/InstallToVSCode.cmd b/tools/InstallToVSCode/InstallToVSCode.cmd index a653abf77..b319af6f6 100644 --- a/tools/InstallToVSCode/InstallToVSCode.cmd +++ b/tools/InstallToVSCode/InstallToVSCode.cmd @@ -39,10 +39,10 @@ if not exist "%OpenDebugAD7BinDir%\OpenDebugAD7.dll" echo ERROR: %OpenDebugAD7Bi set MIEngineBinDir=%~dp0..\..\bin\%Configuration%\ if not exist "%MIEngineBinDir%Microsoft.MIDebugEngine.dll" echo ERROR: Microsoft.MIDebugEngine.dll has not been built & exit /b -1 -if NOT "%~5"=="-d" echo ERROR: Bad command line argument. Expected '-d ^'. & exit /b -1 -if "%~6" == "" echo ERROR: Clrdbg binaries directory not set &exit /b -1 -set CLRDBGBITSDIR=%~6 -if not exist "%CLRDBGBITSDIR%\libclrdbg.dll" echo ERROR: %CLRDBGBITSDIR%\libclrdbg.dll does not exist. & exit /b -1 +if NOT "%~5"=="-d" echo ERROR: Bad command line argument. Expected '-d ^'. & exit /b -1 +if "%~6" == "" echo ERROR: VsDbg binaries directory not set &exit /b -1 +set VSDBGBITSDIR=%~6 +if not exist "%VSDBGBITSDIR%\libvsdbg.dll" echo ERROR: %VSDBGBITSDIR%\libvsdbg.dll does not exist. & exit /b -1 set DESTDIR=%USERPROFILE%\.MIEngine-VSCode-Debug if exist "%DESTDIR%" rmdir /s /q "%DESTDIR%" @@ -92,22 +92,28 @@ for %%f in (xunit.console.netcore.exe) do call :InstallFile "%OpenDebugAD7BinDir for %%f in (%OpenDebugAD7BinDir%\*.dll) do call :InstallFile "%%f" echo. -echo Installing clrdbg bits from %CLRDBGBITSDIR%... +echo Installing vsdbg bits from %VSDBGBITSDIR%... REM NOTE: We ignore files that already exist. This is because we have already REM cleaned the directory originally, and published CoreCLR files. Replacing existing REM files will replace some of those CoreCLR files with new copies that will not work. -for %%f in (%CLRDBGBITSDIR%\*.dll) do call :InstallNewFile "%%f" -for %%f in (%CLRDBGBITSDIR%\*.exe) do call :InstallFile "%%f" -for %%f in (%CLRDBGBITSDIR%\*.vsdconfig) do call :InstallFile "%%f" -for %%f in (%CLRDBGBITSDIR%\version.txt) do call :InstallFile "%%f" -for /D %%d in (%CLRDBGBITSDIR%\*) do ( +for %%f in (%VSDBGBITSDIR%\*.dll) do call :InstallNewFile "%%f" +for %%f in (%VSDBGBITSDIR%\*.exe) do call :InstallFile "%%f" +for %%f in (%VSDBGBITSDIR%\*.vsdconfig) do call :InstallFile "%%f" +for %%f in (%VSDBGBITSDIR%\version.txt) do call :InstallFile "%%f" +for /D %%d in (%VSDBGBITSDIR%\*) do ( echo. - echo Installing clrdbg bits from %%d... to %%~nd + echo Installing vsdbg bits from %%d... to %%~nd if NOT exist "%DESTDIR%\%%~nd" mkdir "%DESTDIR%\%%~nd for %%f in (%%d\*.dll) do call :InstallFile "%%f" %%~nd\ ) +REM Rename vsdbg back to clrdbg +pushd %destdir% +ren vsdbg.exe clrdbg.exe +if not "%errorlevel%"=="0" echo error: unable to rename vsdbg.exe???& exit /b -1 +popd + for %%f in (coreclr\coreclr.ad7Engine.json) do call :InstallFile "%~dp0%%f" for %%f in (Microsoft.MICore.dll Microsoft.MIDebugEngine.dll) do call :InstallFile "%MIEngineBinDir%%%f" @@ -161,7 +167,7 @@ if NOT "%ERRORLEVEL%"=="0" echo ERROR: mklink failed. Ensure this script is runn goto eof :Help -echo InstallToVSCode ^ ^ ^ ^ -d ^ +echo InstallToVSCode ^ ^ ^ ^ -d ^ echo. echo This script is used to copy files needed to enable MIEngine based debugging echo into VS Code. @@ -179,10 +185,10 @@ echo insiders: Install to VSCode insiders echo stable: Install to VSCode stable echo. echo open-debug-ad7-dir : Root of the OpenDebugAD7 repo -echo clrdbg-binaries: Directory which contains clrdbg binaries +echo vsdbg-binaries: Directory which contains vsdbg binaries echo. echo Example: -echo .\InstallToVSCode.cmd link portable alpha c:\dd\OpenDebugAD7 -d c:\dd\vs1\out\binaries\amd64chk\Debugger\x-plat\clrdbg +echo .\InstallToVSCode.cmd link portable alpha c:\dd\OpenDebugAD7 -d c:\dd\vs1\out\binaries\amd64chk\Debugger\x-plat\vsdbg echo. :eof diff --git a/tools/InstallToVSCode/InstallToVSCode.sh b/tools/InstallToVSCode/InstallToVSCode.sh index 782926461..931c6f190 100755 --- a/tools/InstallToVSCode/InstallToVSCode.sh +++ b/tools/InstallToVSCode/InstallToVSCode.sh @@ -3,7 +3,7 @@ script_dir=`dirname $0` print_help() { - echo 'InstallToVSCode.sh -d ' + echo 'InstallToVSCode.sh -d ' echo '' echo 'This script is used to copy files needed to enable MIEngine based debugging' echo 'into VS Code.' @@ -19,10 +19,10 @@ print_help() echo ' stable: Install to VSCode stable' echo '' echo ' open-debug-ad7-dir : Root of the OpenDebugAD7 repo' - echo ' clrdbg-binaries-dir : Directory containing clrdbg binaries' + echo ' vsdbg-binaries-dir : Directory containing vsdbg binaries' echo '' echo 'Example:' - echo "$script_dir/InstallToVSCode.sh link alpha /Volumes/dd/OpenDebugAD7 -d ~/clrdbg/out/Linux/bin/x64.Debug/clrdbg" + echo "$script_dir/InstallToVSCode.sh link alpha /Volumes/dd/OpenDebugAD7 -d ~/vsdbg/out/Linux/bin/x64.Debug/vsdbg" } # Copies a file to another file or directory @@ -119,7 +119,7 @@ SetupSymLink() rm -r $1 fi fi - + ln -s $2 $1 return $? } @@ -171,15 +171,15 @@ pushd $DropDir >/dev/null DropDir=$(pwd) popd >/dev/null -[ ! "$4" == "-d" ] && echo "ERROR: Bad command line argument. Expected '-d '." && exit 1 -CLRDBGBITSDIR=${5:?"ERROR: Clrdbg binaries directory must be specified with -d option. See -h for usage."} -[ ! -f "$CLRDBGBITSDIR/clrdbg" ] && echo "ERROR: $CLRDBGBITSDIR/clrdbg does not exist." && exit 1 +[ ! "$4" == "-d" ] && echo "ERROR: Bad command line argument. Expected '-d '." && exit 1 +VSDBGBITSDIR=${5:?"ERROR: VsDbg binaries directory must be specified with -d option. See -h for usage."} +[ ! -f "$VSDBGBITSDIR/vsdbg" ] && echo "ERROR: $VSDBGBITSDIR/vsdbg does not exist." && exit 1 DESTDIR=$HOME/.MIEngine-VSCode-Debug VSCodeExtensionsRoot=$HOME/$VSCodeDirName/extensions [ ! -d "$VSCodeExtensionsRoot" ] && echo "ERROR: $VSCodeExtensionsRoot does not exist." && exit 1 -CSharpExtensionRoot="$(ls -d $VSCodeExtensionsRoot/ms-vscode.csharp-* 2>/dev/null)" +CSharpExtensionRoot="$(ls -d $VSCodeExtensionsRoot/ms-vscode.csharp-* 2>/dev/null)" [ "$CSharpExtensionRoot" == "" ] && echo "ERROR: C# extension is not installed in VS Code. No directory matching '$VSCodeExtensionsRoot/ms-vscode.csharp-*' found." && exit 1 num_results=$(echo "$CSharpExtensionRoot" | wc -l) @@ -194,7 +194,7 @@ fi mkdir -p "$DESTDIR" [ $? -ne 0 ] && echo "ERROR: unable to create destination directory '$DESTDIR'." && exit 1 -hash dotnet 2>/dev/null +hash dotnet 2>/dev/null [ $? -ne 0 ] && echo "ERROR: The .NET CLI is not installed. see: http://dotnet.github.io/getting-started/" && exit 1 SetupSymLink "$CSharpExtensionRoot/coreclr-debug/debugAdapters" "$DESTDIR" @@ -237,40 +237,44 @@ mv "$DESTDIR/dummy" "$DESTDIR/OpenDebugAD7" InstallError= install_module "$OpenDebugAD7BinDir/dar.exe" -install_module "$OpenDebugAD7BinDir/xunit.console.netcore.exe" "" ignoreMissingPdbs +install_module "$OpenDebugAD7BinDir/xunit.console.netcore.exe" "" ignoreMissingPdbs for dll in $(ls $OpenDebugAD7BinDir/*.dll); do install_module "$dll" "" ignoreMissingPdbs done echo '' -echo "Installing clrdbg bits from $CLRDBGBITSDIR" +echo "Installing vsdbg bits from $VSDBGBITSDIR" -for clrdbgFile in $(ls $CLRDBGBITSDIR/*); do - if [ -f "$clrdbgFile" ]; then +for vsdbgFile in $(ls $VSDBGBITSDIR/*); do + if [ -f "$vsdbgFile" ]; then # NOTE: We ignore files that already exist. This is because we have already # cleaned the directory originally, and published CoreCLR files. Replacing existing # files will replace some of those CoreCLR files with new copies that will not work. - install_new_file "$clrdbgFile" + install_new_file "$vsdbgFile" fi done - -for directory in $(ls -d $CLRDBGBITSDIR/*/); do + +for directory in $(ls -d $VSDBGBITSDIR/*/); do directory_name=$(basename $directory) - + if [ ! -d "$DESTDIR/$directory_name" ]; then mkdir "$DESTDIR/$directory_name" fi - + for dll in $(ls $directory/*.dll); do install_file "$dll" "$directory_name/" done done +# Rename vsdbg back to clrdbg +mv "$DESTDIR/vsdbg" "$DESTDIR/clrdbg" +[ $? -ne 0 ] && echo "ERROR: Unable to move vsdbg executable." && exit 1 + install_file "$script_dir/coreclr/coreclr.ad7Engine.json" install_file "$DropDir/osxlaunchhelper.scpt" for dll in Microsoft.MICore.dll Microsoft.MIDebugEngine.dll -do +do install_module "$DropDir/$dll" done @@ -290,7 +294,7 @@ fi # Write out an install.complete file so that the C# extension doesn't try to restore. echo "InstallToVSCode.sh done">$DESTDIR/install.complete -echo "InstallToVSCode.sh succeeded. Open directory '$OpenDebugAD7Dir' in VS Code" +echo "InstallToVSCode.sh succeeded. Open directory '$OpenDebugAD7Dir' in VS Code" echo "to debug. Edit .vscode/launch.json before launching." echo "" exit 0