diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..771f97f6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,124 @@
+
+# samples
+samples/FallingBlocks/FallingBlocks.sdf
+samples/FallingBlocks/FallingBlocks.sln.DotSettings
+samples/FallingBlocks/FallingBlocks.suo
+samples/FallingBlocks/FallingBlocks.v11.suo
+samples/FallingBlocks/FallingBlocks.v12.suo
+samples/FallingBlocks/FallingBlocks/Debug/
+samples/FallingBlocks/FallingBlocks/FallingBlocks.vcxproj.user
+samples/HelloWorldDisplay/HelloWorldDisplay.sdf
+samples/HelloWorldDisplay/HelloWorldDisplay.v12.suo
+samples/HelloWorldDisplay/HelloWorldDisplay/HelloWorldDisplay.vcxproj.user
+samples/HelloWorldDisplay/HelloWorldDisplay/Device-Debug/
+samples/HelloWorldDisplay/HelloWorldDisplay/Simulator-Debug/
+
+# user configuration files
+src_vs2010/BlackBerry.NativePlugin.opensdf
+src_vs2010/BlackBerry.NativePlugin.sdf
+src_vs2010/BlackBerry.NativePlugin.sln.DotSettings
+src_vs2010/BlackBerry.NativePlugin.sln.DotSettings.user
+src_vs2010/BlackBerry.NativePlugin.suo
+src_vs2010/GDBParser/GDBParser.vcxproj.user
+src_vs2010/BuildTasks/BlackBerry.BuildTasks.csproj.user
+src_vs2010/DebugEngine/BlackBerry.DebugEngine.csproj.user
+src_vs2010/DebugEngine/BlackBerry.DebugEngine.csproj.DotSettings
+src_vs2010/GDBHost/BlackBerry.GDBHost.vcxproj.user
+src_vs2010/NativeCore/BlackBerry.NativeCore.csproj.user
+src_vs2010/Package/BlackBerry.Package.csproj.user
+src_vs2010/Tasks/BlackBerry.Tasks.csproj.user
+src_vs2010/UnitTests/UnitTests.csproj.user
+
+src_vs2012/BuildTasks/BlackBerry.BuildTasks.csproj.user
+src_vs2012/BlackBerry.NativePlugin.sdf
+src_vs2012/BlackBerry.NativePlugin.opensdf
+src_vs2012/BlackBerry.NativePlugin.sln.DotSettings
+src_vs2012/BlackBerry.NativePlugin.sln.DotSettings.user
+src_vs2012/BlackBerry.NativePlugin.v11.suo
+src_vs2012/GDBParser/GDBParser.vcxproj.user
+src_vs2012/DebugEngine/BlackBerry.DebugEngine.csproj.user
+src_vs2012/GDBHost/BlackBerry.GDBHost.vcxproj.user
+src_vs2012/NativeCore/BlackBerry.NativeCore.csproj.user
+src_vs2012/Package/BlackBerry.Package.csproj.user
+src_vs2012/Package/BlackBerry.Package.csproj.DotSettings
+src_vs2012/Tasks/BlackBerry.Tasks.csproj.user
+src_vs2012/UnitTests/UnitTests.csproj.user
+
+src_vs2013/BuildTasks/BlackBerry.BuildTasks.csproj.user
+src_vs2013/BlackBerry.NativePlugin.sdf
+src_vs2013/BlackBerry.NativePlugin.opensdf
+src_vs2013/BlackBerry.NativePlugin.sln.DotSettings
+src_vs2013/BlackBerry.NativePlugin.sln.DotSettings.user
+src_vs2013/BlackBerry.NativePlugin.v12.suo
+src_vs2013/DebugEngine/BlackBerry.DebugEngine.csproj.user
+src_vs2013/GDBHost/BlackBerry.GDBHost.vcxproj.user
+src_vs2013/NativeCore/BlackBerry.NativeCore.csproj.user
+src_vs2013/Package/BlackBerry.Package.csproj.user
+src_vs2013/Tasks/BlackBerry.Tasks.csproj.user
+src_vs2013/UnitTests/UnitTests.csproj.user
+
+
+# build temp outputs
+_BuildResults/
+BuildResults/
+src_vs2010/Debug/
+src_vs2010/Release/
+src_vs2010/GDBParser.UnitTests/bin/
+src_vs2010/GDBParser.UnitTests/obj/
+src_vs2010/GDBParser/Debug/
+src_vs2010/GDBParser/Release/
+src_vs2010/ipch/
+src_vs2010/BuildTasks/bin/
+src_vs2010/BuildTasks/obj/
+src_vs2010/DebugEngine/bin/
+src_vs2010/DebugEngine/obj/
+src_vs2010/GDBHost/Debug/
+src_vs2010/GDBHost/Release/
+src_vs2010/NativeCore/bin/
+src_vs2010/NativeCore/obj/
+src_vs2010/Package/bin/
+src_vs2010/Package/obj/
+src_vs2010/UnitTests/bin/
+src_vs2010/UnitTests/obj/
+
+src_vs2012/Debug/
+src_vs2012/Release/
+src_vs2012/GDBParser/Debug/
+src_vs2012/GDBParser/Release/
+src_vs2012/GDBParser.UnitTests/bin/
+src_vs2012/GDBParser.UnitTests/obj/
+src_vs2012/ipch/
+src_vs2012/BuildTasks/bin/
+src_vs2012/BuildTasks/obj/
+src_vs2012/DebugEngine/bin/
+src_vs2012/DebugEngine/obj/
+src_vs2012/GDBHost/Debug/
+src_vs2012/GDBHost/Release/
+src_vs2012/NativeCore/bin/
+src_vs2012/NativeCore/obj/
+src_vs2012/Package/bin/
+src_vs2012/Package/obj/
+src_vs2012/UnitTests/bin/
+src_vs2012/UnitTests/obj/
+
+src_vs2013/Debug/
+src_vs2013/Release/
+src_vs2013/GDBParser.UnitTests/bin/
+src_vs2013/GDBParser.UnitTests/obj/
+src_vs2013/GDBParser/Debug/
+src_vs2013/GDBParser/Release/
+src_vs2013/ipch/
+src_vs2013/BuildTasks/bin/
+src_vs2013/BuildTasks/obj/
+src_vs2013/DebugEngine/bin/
+src_vs2013/DebugEngine/obj/
+src_vs2013/GDBHost/Debug/
+src_vs2013/GDBHost/Release/
+src_vs2013/NativeCore/bin/
+src_vs2013/NativeCore/obj/
+src_vs2013/Package/bin/
+src_vs2013/Package/obj/
+src_vs2013/UnitTests/bin/
+src_vs2013/UnitTests/obj/
+
+
diff --git a/README.md b/README.md
index 77982f0d..fe1c9266 100644
--- a/README.md
+++ b/README.md
@@ -6,24 +6,36 @@ All assets in this repository, unless otherwise stated through sub-directory LIC
##Build requirements
Install
-* [Microsoft Visual Studio Professional 2012 SDK] (http://www.microsoft.com/en-us/download/details.aspx?id=30668)
-
-or
-
* [Microsoft Visual Studio Professional 2013 SDK] (http://www.microsoft.com/en-us/download/details.aspx?id=40758)
+Note: Currently, there is a bug in DIA SDK of Visual Studio 2013.
+If Microsoft Visual Studio 2013 is installed on a machine where Microsoft Visual Studio 2012 was installed, the DIA SDK folder for Microsoft Visual Studio 2013 is installed in the DIA SDK folder for Microsoft Visual Studio 2012.
+More info [here] (http://connect.microsoft.com/VisualStudio/feedback/details/814147/dia-sdk-installed-into-wrong-directory).
+
##Build commands
-1. VSNDKPluginBuild.bat – A batch file that builds the various components of the BlackBerry Native Plug-in to the ..\buildresults folder.
-2. VSNDKPluginSetup.bat – A batch file that installs the newly built components of the BlackBerry Native Plug-in to the correct locations on your computer.
+**build.bat** – A batch file that builds the various components of the BlackBerry Native Plug-in for Microsoft Visual Studio to the "_BuildResults" folder.
+
+**setup.bat** – A batch file that installs the newly built components of the BlackBerry Native Plug-in for Microsoft Visual Studio to the correct locations on your computer.
+
+Examples:
+
+ **build.bat** - default, builds everything
+ **build.bat vs2010** - builds only for Microsoft Visual Studio 2010
+ **build.bat vs2012 "/out:D:\Shared folder\\_BuildResults"** - builds only for Microsoft Visual Studio 2012 into the specified directory
+
+ **setup.bat** - installs the plug-in for all Microsoft Visual Studio versions
+ **setup.bat vs2010** - installs the plug-in for only Microsoft Visual Studio 2010
+ **setup.bat vs2012 /no-tools** - installs the plug-in for Microsoft Visual Studio 2012 without copying the bbndk_vs and qnxtools folders
+ **setup.bat vs2012 /msbuild-only** - updates only the local MSBuild for Microsoft Visual Studio 2012 and adds the 'BlackBerry' and 'BlackBerrySimulator' target platforms
##Contributing
The BlackBerry Native Plug-in for Microsoft Visual Studio project currently contains the following code branches:
-**Master Branch** - The master branch contains the latest production release of the source code. This code is considered stable and is fully tested by the Test team. You can [download the binaries] (http://developer.blackberry.com/native/downloads/) from the Downloads page on the BlackBerry developer website.
+**Master Branch** - This branch contains the latest production release of the source code. This code is considered stable and is fully tested by the test team. You can [download the binaries] (http://developer.blackberry.com/native/downloads/) from the Downloads page on the BlackBerry developer website.
-**Next Branch** - The next branch contains the latest beta release of the source code. This code may be unstable and is not fully tested because it has passed unit tests only. At some point, a full regression test cycle is performed on the next branch and the code is promoted to the master branch.
+**Next Branch** - This branch contains the latest beta release of the source code. This code may be unstable and is not fully tested because it has passed unit tests only. At some point, a full regression test cycle is performed on the next branch and the code is promoted to the master branch.
-**Feature Branch** - Feature branches contain the code changes required to implement specific features or issues being worked on for the next release. This code is considered unstable. These branches are denoted by the following naming scheme in the repository: next-### (where ### is the related issue number). When implementation is completed, the branch is unit and integration tested and then merged into the next branch.
+**Feature Branch** - This branch contains the code changes required to implement specific features or issues being worked on for the next release. This code is considered unstable. These branches are denoted by the following naming scheme in the repository: next-### (where ### is the related issue number). When implementation is completed, the branch is unit and integration tested and then merged into the next branch.
**To contribute code to this repository you must be [signed up as an official contributor](http://blackberry.github.com/howToContribute.html).**
@@ -42,5 +54,5 @@ The BlackBerry Native Plug-in for Microsoft Visual Studio project currently cont
* [Gustavo Arnold](http://github.com/guarnold)
## Reference material
-* [Using Microsoft Visual Studio] (https://developer.blackberry.com/native/documentation/core/vs_using_microsoft_visual_studio.html)
-* Although Microsoft Visual Studio 2010 is no longer supported, you can still [download the plug-in and the docs] (http://developer.blackberry.com/native/downloads/) from the Downloads page.
+* [Microsoft Visual Studio:] (http://developer.blackberry.com/native/documentation/dev/visual_studio/vs_using_microsoft_visual_studio.html)
+* [GDB Commands] (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI.html)
diff --git a/VSNDKPluginBuild.bat b/VSNDKPluginBuild.bat
deleted file mode 100644
index 0c26eee5..00000000
--- a/VSNDKPluginBuild.bat
+++ /dev/null
@@ -1,60 +0,0 @@
-echo off
-
-REM ********************************************************************************************
-REM Declare Constants
-REM ********************************************************************************************
-set thisDir=%~dp0
-set buildresults="%thisDir%\..\buildresults"
-set dotNetFrameworkPath="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MsBuild.exe"
-set dotNetFrameworkPath2013="C:\Program Files (x86)\MSBuild\12.0\Bin\MsBuild.exe"
-set solutionPath2010="%thisDir%\src\VSNDK.sln"
-set AddIn2012="%thisDir%\src_vs2012\VSNDK.AddIn\VSNDK.AddIn.csproj"
-set DebugEngine2012="%thisDir%\src_vs2012\VSNDK.DebugEngine\VSNDK.DebugEngine.csproj"
-set GDWrapper2012="%thisDir%\src_vs2012\GDBWrapper\GDBWrapper.vcxproj"
-set VSPackage2012="%thisDir%\src_vs2012\VSNDK.Package\VSNDK.Package.csproj"
-set VSTasks2012="%thisDir%\src_vs2012\VSNDK.Tasks\VSNDK.Tasks.csproj"
-set AddIn2013="%thisDir%\src_vs2013\VSNDK.AddIn\VSNDK.AddIn.csproj"
-set DebugEngine2013="%thisDir%\src_vs2013\VSNDK.DebugEngine\VSNDK.DebugEngine.csproj"
-set GDWrapper2013="%thisDir%\src_vs2013\GDBWrapper\GDBWrapper.vcxproj"
-set VSPackage2013="%thisDir%\src_vs2013\VSNDK.Package\VSNDK.Package.csproj"
-set VSTasks2013="%thisDir%\src_vs2013\VSNDK.Tasks\VSNDK.Tasks.csproj"
-
-REM ********************************************************************************************
-REM Clean up old bin folder
-REM ********************************************************************************************
-echo Removing previous code
-if not exist "%buildresults%" goto build
- echo Remove Build Results
- RMDIR /Q "%buildresults%" /S
- MKDIR "%buildresults%"
-:build
-
-REM ********************************************************************************************
-REM Build VS2010
-REM ********************************************************************************************
-REM echo Building Solution for VS2010
-REM %dotNetFrameworkPath% %solutionPath2010% /property:Configuration=Release /target:Clean;Build /p:OutputPath="%buildresults%\VS2010" > %buildresult%\VS2010_buildlog.txt
-REM echo Build Success
-
-REM ********************************************************************************************
-REM Build VS2012
-REM ********************************************************************************************
-echo Building Solution for VS2012
-%dotNetFrameworkPath% %AddIn2012% /property:Configuration=Release /target:Clean;Build /p:VisualStudioVersion=11.0 /p:OutputPath="%buildresults%\VS2012" > %buildresult%\VS2012_buildlog_AddIn.txt
-%dotNetFrameworkPath% %DebugEngine2012% /property:Configuration=Release /target:Clean;Build /p:VisualStudioVersion=11.0 /p:OutputPath="%buildresults%\VS2012" > %buildresult%\VS2012_buildlog_DBEngine.txt
-%dotNetFrameworkPath% %GDWrapper2012% /property:Configuration=Release /target:Clean;Build /p:VisualStudioVersion=11.0 /p:OutputPath="%buildresults%\VS2012" > %buildresult%\VS2012_buildlog_GDBWrapper.txt
-%dotNetFrameworkPath% %VSPackage2012% /property:Configuration=Release /target:Clean;Build /p:VisualStudioVersion=11.0 /p:OutputPath="%buildresults%\VS2012" > %buildresult%\VS2012_buildlog_Package.txt
-%dotNetFrameworkPath% %VSTasks2012% /property:Configuration=Release /target:Clean;Build /p:VisualStudioVersion=11.0 /p:OutputPath="%buildresults%\VS2012" > %buildresult%\VS2012_buildlog_Tasks.txt
-echo Build Success
-
-REM ********************************************************************************************
-REM Build VS2013
-REM ********************************************************************************************
-echo Building Solution for VS2013
-%dotNetFrameworkPath2013% %AddIn2013% /property:Configuration=Release /target:Clean;Build /p:VisualStudioVersion=12.0 /p:OutputPath="%buildresults%\VS2013" > %buildresults%\VS2013_buildlog_AddIn.txt
-%dotNetFrameworkPath2013% %DebugEngine2013% /property:Configuration=Release /target:Clean;Build /p:VisualStudioVersion=12.0 /p:OutputPath="%buildresults%\VS2013" > %buildresults%\VS2013_buildlog_DBEngine.txt
-%dotNetFrameworkPath2013% %GDWrapper2013% /property:Configuration=Release /target:Clean;Build /p:VisualStudioVersion=12.0 /p:OutputPath="%buildresults%\VS2013" > %buildresults%\VS2013_buildlog_GDBWrapper.txt
-%dotNetFrameworkPath2013% %VSPackage2013% /property:Configuration=Release /target:Clean;Build /p:VisualStudioVersion=12.0 /p:OutputPath="%buildresults%\VS2013" > %buildresults%\VS2013_buildlog_Package.txt
-%dotNetFrameworkPath2013% %VSTasks2013% /property:Configuration=Release /target:Clean;Build /p:VisualStudioVersion=12.0 /p:OutputPath="%buildresults%\VS2013" > %buildresults%\VS2013_buildlog_Tasks.txt
-echo Build Success
-
diff --git a/VSNDKPluginSetup.bat b/VSNDKPluginSetup.bat
deleted file mode 100644
index dcf95c0e..00000000
--- a/VSNDKPluginSetup.bat
+++ /dev/null
@@ -1,118 +0,0 @@
-echo off
-
-REM //********************************************************************************************
-REM // Batch Constants
-REM // thisDir = working directory of current batch file.
-REM // buildresults = Directory containing the build results.
-REM **********************************************************************************************
-set thisDir=%~dp0
-set buildresults=%thisDir%..\buildresults\VS2010
-set ProgRoot=%ProgramFiles(x86)%
-set AllUsers=%ALLUSERSPROFILE%
-set AppData=%APPDATA%
-set drive=%cd:~0,3%
-
-if "%ProgramFiles(x86)%XXX"=="XXX" (
-echo 32-bit
-set ProgRoot=%ProgramFiles%
-)
-echo %ProgRoot%
-
-REM //********************************************************************************************
-REM // Copy AddIn Files
-REM **********************************************************************************************
-echo Copy "%buildresults%\VSNDK.AddIn.AddIn" to "%AllUsers%\Microsoft\MSEnvShared\Addins\VSNDK.AddIn.AddIn"
-copy "%buildresults%\VSNDK.AddIn.AddIn" "%AllUsers%\Microsoft\MSEnvShared\Addins\VSNDK.AddIn.AddIn"
-echo Copy "%buildresults%\VSNDK.AddIn.dll" to "%AllUsers%\Microsoft\MSEnvShared\Addins\VSNDK.AddIn.dll"
-copy "%buildresults%\VSNDK.AddIn.dll" "%AllUsers%\Microsoft\MSEnvShared\Addins\VSNDK.AddIn.dll"
-
-REM //********************************************************************************************
-REM // Copy GDBParser and DebugEngine Files
-REM **********************************************************************************************
-echo Make Directory "%ProgRoot%\BlackBerry\VSPlugin-NDK"
-md "%ProgRoot%\BlackBerry\VSPlugin-NDK"
-echo Copy "%buildresults%\GDBParser.dll" to "%ProgRoot%\BlackBerry\VSPlugin-NDK\GDBParser.dll"
-copy "%buildresults%\GDBParser.dll" "%ProgRoot%\BlackBerry\VSPlugin-NDK\GDBParser.dll"
-echo Copy "%buildresults%\GDBWrapper.exe" to "%ProgRoot%\BlackBerry\VSPlugin-NDK\GDBWrapper.exe"
-copy "%buildresults%\GDBWrapper.exe" "%ProgRoot%\BlackBerry\VSPlugin-NDK\GDBWrapper.exe"
-echo Copy "%buildresults%\Instructions.txt" to "%ProgRoot%\BlackBerry\VSPlugin-NDK\Instructions.txt"
-copy "%buildresults%\Instructions.txt" "%ProgRoot%\BlackBerry\VSPlugin-NDK\Instructions.txt"
-echo Copy "%buildresults%\VSNDK.DebugEngine.dll" to "%ProgRoot%\BlackBerry\VSPlugin-NDK\VSNDK.DebugEngine.dll"
-copy "%buildresults%\VSNDK.DebugEngine.dll" "%ProgRoot%\BlackBerry\VSPlugin-NDK\VSNDK.DebugEngine.dll"
-
-REM //********************************************************************************************
-REM // Copy Package Files
-REM **********************************************************************************************
-echo Make Directory "%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\NDK Plugin"
-md "%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\NDK Plugin"
-echo "%buildresults%\extension.vsixmanifest" to "%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\NDK Plugin\extension.vsixmanifest"
-copy "%buildresults%\extension.vsixmanifest" "%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\NDK Plugin\extension.vsixmanifest"
-echo "%buildresults%\VSNDK.Package.dll" to "%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\NDK Plugin\VSNDK.Package.dll"
-copy "%buildresults%\VSNDK.Package.dll" "%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\NDK Plugin\VSNDK.Package.dll"
-echo "%buildresults%\VSNDK.Package.pkgdef" to "%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\NDK Plugin\VSNDK.Package.pkgdef"
-copy "%buildresults%\VSNDK.Package.pkgdef" "%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\NDK Plugin\VSNDK.Package.pkgdef"
-
-REM //********************************************************************************************
-REM // Copy MSBuild Files
-REM **********************************************************************************************
-echo Copy BlackBerry MSBuild directory
-xcopy "%buildresults%\BlackBerry" "%ProgRoot%\MSBuild\Microsoft.Cpp\v4.0\Platforms\BlackBerry" /e /i /y
-copy "%buildresults%\VSNDK.Tasks.dll" "%ProgRoot%\MSBuild\Microsoft.Cpp\v4.0\Platforms\BlackBerry\VSNDK.Tasks.dll"
-echo Copy GDBWrapper.exe
-echo Copy BlackBerrySimulator MSBuild directory
-xcopy "%buildresults%\BlackBerrySimulator" "%ProgRoot%\MSBuild\Microsoft.Cpp\v4.0\Platforms\BlackBerrySimulator" /e /i /y
-copy "%buildresults%\VSNDK.Tasks.dll" "%ProgRoot%\MSBuild\Microsoft.Cpp\v4.0\Platforms\BlackBerrySimulator\VSNDK.Tasks.dll"
-
-REM //********************************************************************************************
-REM // Copy Template Files
-REM **********************************************************************************************
-echo Copy BlackBerry VCWizards directory
-xcopy "%buildresults%\Templates\VCWizards" "%ProgRoot%\Microsoft Visual Studio 10.0\VC\VCWizards\CodeWiz" /e /i /y
-
-REM //********************************************************************************************
-REM // Copy SDK Command Line Tool Files
-REM **********************************************************************************************
-echo xcopy "%thisDir%bbndk_vs" "%drive%bbndk_vs" /e /i /y
-md "%drive%bbndk_vs"
-xcopy "%thisDir%bbndk_vs" "%drive%bbndk_vs" /e /i /y
-
-REM //********************************************************************************************
-REM // Copy QNX Tools
-REM **********************************************************************************************
-echo xcopy "%thisDir%qnxtools" "%ProgRoot%\BlackBerry\VSPlugin-NDK\qnxtools" /e /i /y
-md "%ProgRoot%\BlackBerry\VSPlugin-NDK\qnxtools"
-xcopy "%thisDir%qnxtools" "%ProgRoot%\BlackBerry\VSPlugin-NDK\qnxtools" /e /i /y
-
-REM //********************************************************************************************
-REM // Register clases
-REM **********************************************************************************************
-echo registering setup
-REGEDIT.EXE /S "thisDir"VSNDKPluginSetup.reg
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VSNDKPluginSetup.reg b/VSNDKPluginSetup.reg
deleted file mode 100644
index 3f826dd5..00000000
--- a/VSNDKPluginSetup.reg
+++ /dev/null
@@ -1,102 +0,0 @@
-REGEDIT4
-
-[HKEY_CURRENT_USER\SOFTWARE\BlackBerry\BlackBerryVSPlugin]
-"device_password"="AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA7fSRRS7m1Em+yoK0ioAYhwQAAAACAAAAAAADZgAAwAAAABAAAAAb9QNNQPNG1qB5uDOFabBjAAAAAASAAACgAAAAEAAAAOu49T6nbn0mHnBMoGvre5cIAAAA2NG7RxOCGYgUAAAAi84MGQ9ELFYdXZ5pOhVSayDK2V4="
-"device_IP"="169.254.0.1"
-"simulator_password"="AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA7fSRRS7m1Em+yoK0ioAYhwQAAAACAAAAAAADZgAAwAAAABAAAAAb9QNNQPNG1qB5uDOFabBjAAAAAASAAACgAAAAEAAAAOu49T6nbn0mHnBMoGvre5cIAAAA2NG7RxOCGYgUAAAAi84MGQ9ELFYdXZ5pOhVSayDK2V4="
-"simulator_IP"=""
-"NDKHostPath"=""
-"NDKTargetPath"=""
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}]
-"AddressBP"=dword:00000000
-"AutoSelectPriority"=dword:00000004
-"CallstackBP"=dword:00000001
-"ProgramProvider"="{AD06FD46-C790-4D5C-A274-8815DF9511B8}"
-"Attach"=dword:00000001
-"CLSID"="{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}"
-"AlwaysLoadLocal"="1"
-"PortSupplier"="{92A2B753-00BD-40FF-9964-6AB64A1D6C9F}"
-"Name"="VSNDK Debug Engine"
-@="guidDebuggingSampleEngine"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}\IncompatibleList]
-"guidScriptEng"="{F200A7E7-DEA5-11D0-B854-00A0244A1DE2}"
-"guidNativeOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidCOMPlusOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidCOMPlusNativeEng"="{92EF0900-2251-11D2-B72E-0000F87572EF}"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\CLSID\{AD06FD46-C790-4D5C-A274-8815DF9511B8}]
-"CodeBase"="C:\\Program Files (x86)\\BlackBerry\\VSPlugin-NDK\\VSNDK.DebugEngine.dll"
-"InprocServer32"="c:\\windows\\system32\\mscoree.dll"
-"Class"="VSNDK.DebugEngine.AD7ProgramProvider"
-"Assembly"="VSNDK.DebugEngine"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\CLSID\{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}]
-"CodeBase"="C:\\Program Files (x86)\\BlackBerry\\VSPlugin-NDK\\VSNDK.DebugEngine.dll"
-"InprocServer32"="c:\\windows\\system32\\mscoree.dll"
-"Class"="VSNDK.DebugEngine.AD7Engine"
-"Assembly"="VSNDK.DebugEngine"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\CLSID\{BDC2218C-D50C-4A5A-A2F6-66BDC94FF8D6}]
-@="BlackBerrySupplier"
-"Assembly"="VSNDK.DebugEngine"
-"Class"="VSNDK.DebugEngine.AD7PortSupplier"
-"InprocServer32"="c:\\windows\\system32\\mscoree.dll"
-"CodeBase"="C:\\Program Files (x86)\\BlackBerry\\VSPlugin-NDK\\VSNDK.DebugEngine.dll"
-"ThreadingModel"="Free"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\AD7Metrics\PortSupplier\{92A2B753-00BD-40FF-9964-6AB64A1D6C9F}]
-"Name"="BlackBerry"
-"DisallowUserEnteredPorts"=dword:00000000
-"CLSID"="{BDC2218C-D50C-4A5A-A2F6-66BDC94FF8D6}"
-@="Visual Studio Plug-in for BlackBerry"
-"PortPickerCLSID"="{3FAA02D6-72D8-4F69-A1E6-BB05ECB4E37A}"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}]
-"AlwaysLoadLocal"="1"
-"PortSupplier"="{BDC2218C-D50C-4A5A-A2F6-66BDC94FF8D6}"
-"Name"="VSNDK Debug Engine"
-"CallstackBP"=dword:00000001
-"AutoSelectPriority"=dword:00000004
-"AddressBP"=dword:00000000
-"Attach"=dword:00000001
-"ProgramProvider"="{AD06FD46-C790-4D5C-A274-8815DF9511B8}"
-"CLSID"="{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}"
-@="guidDebuggingSampleEngine"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}\IncompatibleList]
-"guidScriptEng"="{F200A7E7-DEA5-11D0-B854-00A0244A1DE2}"
-"guidNativeOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidCOMPlusOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidCOMPlusNativeEng"="{92EF0900-2251-11D2-B72E-0000F87572EF}"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\CLSID\{AD06FD46-C790-4D5C-A274-8815DF9511B8}]
-"CodeBase"="C:\\Program Files (x86)\\BlackBerry\\VSPlugin-NDK\\VSNDK.DebugEngine.dll"
-"InprocServer32"="c:\\windows\\system32\\mscoree.dll"
-"Class"="VSNDK.DebugEngine.AD7ProgramProvider"
-"Assembly"="VSNDK.DebugEngine"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\CLSID\{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}]
-"CodeBase"="C:\\Program Files (x86)\\BlackBerry\\VSPlugin-NDK\\VSNDK.DebugEngine.dll"
-"Assembly"="VSNDK.DebugEngine"
-"Class"="VSNDK.DebugEngine.AD7Engine"
-"InprocServer32"="c:\\windows\\system32\\mscoree.dll"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}]
-"Attach"=dword:00000001
-"ProgramProvider"="{AD06FD46-C790-4D5C-A274-8815DF9511B8}"
-"CLSID"="{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}"
-@="guidDebuggingSampleEngine"
-"AlwaysLoadLocal"="1"
-"AutoSelectPriority"=dword:00000004
-"PortSupplier"="{92A2B753-00BD-40FF-9964-6AB64A1D6C9F}"
-"Name"="VSNDK Debug Engine"
-"CallstackBP"=dword:00000001
-"AddressBP"=dword:00000000
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}\IncompatibleList]
-"guidNativeOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidCOMPlusOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidScriptEng"="{F200A7E7-DEA5-11D0-B854-00A0244A1DE2}"
-"guidCOMPlusNativeEng"="{92EF0900-2251-11D2-B72E-0000F87572EF}"
\ No newline at end of file
diff --git a/VSNDKPluginSetupVS2012.bat b/VSNDKPluginSetupVS2012.bat
deleted file mode 100644
index 579ee868..00000000
--- a/VSNDKPluginSetupVS2012.bat
+++ /dev/null
@@ -1,118 +0,0 @@
-echo off
-
-REM //********************************************************************************************
-REM // Batch Constants
-REM // thisDir = working directory of current batch file.
-REM // buildresults = Directory containing the build results.
-REM **********************************************************************************************
-set thisDir=%~dp0
-set buildresults=%thisDir%..\buildresults\VS2012
-set ProgRoot=%ProgramFiles(x86)%
-set AllUsers=%ALLUSERSPROFILE%
-set AppData=%APPDATA%
-set drive=%cd:~0,3%
-
-if "%ProgramFiles(x86)%XXX"=="XXX" (
-echo 32-bit
-set ProgRoot=%ProgramFiles%
-)
-echo %ProgRoot%
-
-REM //********************************************************************************************
-REM // Copy AddIn Files
-REM **********************************************************************************************
-echo Copy "%buildresults%\VSNDK.AddIn.AddIn" to "%AllUsers%\Microsoft\MSEnvShared\Addins\VSNDK.AddIn.AddIn"
-copy "%buildresults%\VSNDK.AddIn.AddIn" "%AllUsers%\Microsoft\MSEnvShared\Addins\VSNDK.AddIn.AddIn"
-echo Copy "%buildresults%\VSNDK.AddIn.dll" to "%AllUsers%\Microsoft\MSEnvShared\Addins\VSNDK.AddIn.dll"
-copy "%buildresults%\VSNDK.AddIn.dll" "%AllUsers%\Microsoft\MSEnvShared\Addins\VSNDK.AddIn.dll"
-
-REM //********************************************************************************************
-REM // Copy GDBParser and DebugEngine Files
-REM **********************************************************************************************
-echo Make Directory "%ProgRoot%\BlackBerry\VSPlugin-NDK"
-md "%ProgRoot%\BlackBerry\VSPlugin-NDK"
-echo "%buildresults%\GDBParser.dll" to "%ProgRoot%\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\NDK Plugin\GDBParser.dll"
-copy "%buildresults%\GDBParser.dll" "%ProgRoot%\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\NDK Plugin\GDBParser.dll"
-echo Copy "%buildresults%\GDBWrapper.exe" to "%ProgRoot%\BlackBerry\VSPlugin-NDK\GDBWrapper.exe"
-copy "%buildresults%\GDBWrapper.exe" "%ProgRoot%\BlackBerry\VSPlugin-NDK\GDBWrapper.exe"
-echo Copy "%buildresults%\Instructions.txt" to "%ProgRoot%\BlackBerry\VSPlugin-NDK\Instructions.txt"
-copy "%buildresults%\Instructions.txt" "%ProgRoot%\BlackBerry\VSPlugin-NDK\Instructions.txt"
-echo Copy "%buildresults%\VSNDK.DebugEngine.dll" to "%ProgRoot%\BlackBerry\VSPlugin-NDK\VSNDK.DebugEngine.dll"
-copy "%buildresults%\VSNDK.DebugEngine.dll" "%ProgRoot%\BlackBerry\VSPlugin-NDK\VSNDK.DebugEngine.dll"
-
-REM //********************************************************************************************
-REM // Copy Package Files
-REM **********************************************************************************************
-echo Make Directory "%ProgRoot%\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\NDK Plugin"
-md "%ProgRoot%\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\NDK Plugin"
-echo "%buildresults%\extension.vsixmanifest" to "%ProgRoot%\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\NDK Plugin\extension.vsixmanifest"
-copy "%buildresults%\extension.vsixmanifest" "%ProgRoot%\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\NDK Plugin\extension.vsixmanifest"
-echo "%buildresults%\VSNDK.Package.dll" to "%ProgRoot%\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\NDK Plugin\VSNDK.Package.dll"
-copy "%buildresults%\VSNDK.Package.dll" "%ProgRoot%\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\NDK Plugin\VSNDK.Package.dll"
-echo "%buildresults%\VSNDK.Package.pkgdef" to "%ProgRoot%\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\NDK Plugin\VSNDK.Package.pkgdef"
-copy "%buildresults%\VSNDK.Package.pkgdef" "%ProgRoot%\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\NDK Plugin\VSNDK.Package.pkgdef"
-
-REM //********************************************************************************************
-REM // Copy MSBuild Files
-REM **********************************************************************************************
-echo Copy BlackBerry MSBuild directory
-xcopy "%buildresults%\BlackBerry" "%ProgRoot%\MSBuild\Microsoft.Cpp\v4.0\Platforms\BlackBerry" /e /i /y
-copy "%buildresults%\VSNDK.Tasks.dll" "%ProgRoot%\MSBuild\Microsoft.Cpp\v4.0\Platforms\BlackBerry\VSNDK.Tasks.dll"
-echo Copy GDBWrapper.exe
-echo Copy BlackBerrySimulator MSBuild directory
-xcopy "%buildresults%\BlackBerrySimulator" "%ProgRoot%\MSBuild\Microsoft.Cpp\v4.0\Platforms\BlackBerrySimulator" /e /i /y
-copy "%buildresults%\VSNDK.Tasks.dll" "%ProgRoot%\MSBuild\Microsoft.Cpp\v4.0\Platforms\BlackBerrySimulator\VSNDK.Tasks.dll"
-
-REM //********************************************************************************************
-REM // Copy Template Files
-REM **********************************************************************************************
-echo Copy BlackBerry VCWizards directory
-xcopy "%buildresults%\Templates\VCWizards" "%ProgRoot%\Microsoft Visual Studio 11.0\VC\VCWizards\CodeWiz" /e /i /y
-
-REM //********************************************************************************************
-REM // Copy SDK Command Line Tool Files
-REM **********************************************************************************************
-echo xcopy "%thisDir%bbndk_vs" "%drive%bbndk_vs" /e /i /y
-md "%drive%bbndk_vs"
-xcopy "%thisDir%bbndk_vs" "%drive%bbndk_vs" /e /i /y
-
-REM //********************************************************************************************
-REM // Copy QNX Tools
-REM **********************************************************************************************
-echo xcopy "%thisDir%qnxtools" "%ProgRoot%\BlackBerry\VSPlugin-NDK\qnxtools" /e /i /y
-md "%ProgRoot%\BlackBerry\VSPlugin-NDK\qnxtools"
-xcopy "%thisDir%qnxtools" "%ProgRoot%\BlackBerry\VSPlugin-NDK\qnxtools" /e /i /y
-
-REM //********************************************************************************************
-REM // Register clases
-REM **********************************************************************************************
-echo registering setup
-REGEDIT.EXE /S "thisDir"VSNDKPluginSetup2012.reg
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VSNDKPluginSetupVS2012.reg b/VSNDKPluginSetupVS2012.reg
deleted file mode 100644
index 5245ef89..00000000
--- a/VSNDKPluginSetupVS2012.reg
+++ /dev/null
@@ -1,103 +0,0 @@
-REGEDIT4
-
-[HKEY_CURRENT_USER\SOFTWARE\BlackBerry\BlackBerryVSPlugin]
-"device_password"="AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA7fSRRS7m1Em+yoK0ioAYhwQAAAACAAAAAAADZgAAwAAAABAAAAAb9QNNQPNG1qB5uDOFabBjAAAAAASAAACgAAAAEAAAAOu49T6nbn0mHnBMoGvre5cIAAAA2NG7RxOCGYgUAAAAi84MGQ9ELFYdXZ5pOhVSayDK2V4="
-"device_IP"="169.254.0.1"
-"simulator_password"="AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA7fSRRS7m1Em+yoK0ioAYhwQAAAACAAAAAAADZgAAwAAAABAAAAAb9QNNQPNG1qB5uDOFabBjAAAAAASAAACgAAAAEAAAAOu49T6nbn0mHnBMoGvre5cIAAAA2NG7RxOCGYgUAAAAi84MGQ9ELFYdXZ5pOhVSayDK2V4="
-"simulator_IP"=""
-"NDKHostPath"=""
-"NDKTargetPath"=""
-"NDKRemotePath"=""
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}]
-"AddressBP"=dword:00000000
-"AutoSelectPriority"=dword:00000004
-"CallstackBP"=dword:00000001
-"ProgramProvider"="{AD06FD46-C790-4D5C-A274-8815DF9511B8}"
-"Attach"=dword:00000001
-"CLSID"="{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}"
-"AlwaysLoadLocal"="1"
-"PortSupplier"="{92A2B753-00BD-40FF-9964-6AB64A1D6C9F}"
-"Name"="VSNDK Debug Engine"
-@="guidDebuggingSampleEngine"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}\IncompatibleList]
-"guidScriptEng"="{F200A7E7-DEA5-11D0-B854-00A0244A1DE2}"
-"guidNativeOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidCOMPlusOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidCOMPlusNativeEng"="{92EF0900-2251-11D2-B72E-0000F87572EF}"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\CLSID\{AD06FD46-C790-4D5C-A274-8815DF9511B8}]
-"CodeBase"="C:\\Program Files (x86)\\BlackBerry\\VSPlugin-NDK\\VSNDK.DebugEngine.dll"
-"InprocServer32"="c:\\windows\\system32\\mscoree.dll"
-"Class"="VSNDK.DebugEngine.AD7ProgramProvider"
-"Assembly"="VSNDK.DebugEngine"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\CLSID\{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}]
-"CodeBase"="C:\\Program Files (x86)\\BlackBerry\\VSPlugin-NDK\\VSNDK.DebugEngine.dll"
-"InprocServer32"="c:\\windows\\system32\\mscoree.dll"
-"Class"="VSNDK.DebugEngine.AD7Engine"
-"Assembly"="VSNDK.DebugEngine"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\CLSID\{BDC2218C-D50C-4A5A-A2F6-66BDC94FF8D6}]
-@="BlackBerrySupplier"
-"Assembly"="VSNDK.DebugEngine"
-"Class"="VSNDK.DebugEngine.AD7PortSupplier"
-"InprocServer32"="c:\\windows\\system32\\mscoree.dll"
-"CodeBase"="C:\\Program Files (x86)\\BlackBerry\\VSPlugin-NDK\\VSNDK.DebugEngine.dll"
-"ThreadingModel"="Free"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\AD7Metrics\PortSupplier\{92A2B753-00BD-40FF-9964-6AB64A1D6C9F}]
-"Name"="BlackBerry"
-"DisallowUserEnteredPorts"=dword:00000000
-"CLSID"="{BDC2218C-D50C-4A5A-A2F6-66BDC94FF8D6}"
-@="Visual Studio Plug-in for BlackBerry"
-"PortPickerCLSID"="{3FAA02D6-72D8-4F69-A1E6-BB05ECB4E37A}"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}]
-"AlwaysLoadLocal"="1"
-"PortSupplier"="{BDC2218C-D50C-4A5A-A2F6-66BDC94FF8D6}"
-"Name"="VSNDK Debug Engine"
-"CallstackBP"=dword:00000001
-"AutoSelectPriority"=dword:00000004
-"AddressBP"=dword:00000000
-"Attach"=dword:00000001
-"ProgramProvider"="{AD06FD46-C790-4D5C-A274-8815DF9511B8}"
-"CLSID"="{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}"
-@="guidDebuggingSampleEngine"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}\IncompatibleList]
-"guidScriptEng"="{F200A7E7-DEA5-11D0-B854-00A0244A1DE2}"
-"guidNativeOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidCOMPlusOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidCOMPlusNativeEng"="{92EF0900-2251-11D2-B72E-0000F87572EF}"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0\CLSID\{AD06FD46-C790-4D5C-A274-8815DF9511B8}]
-"CodeBase"="C:\\Program Files (x86)\\BlackBerry\\VSPlugin-NDK\\VSNDK.DebugEngine.dll"
-"InprocServer32"="c:\\windows\\system32\\mscoree.dll"
-"Class"="VSNDK.DebugEngine.AD7ProgramProvider"
-"Assembly"="VSNDK.DebugEngine"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0\CLSID\{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}]
-"CodeBase"="C:\\Program Files (x86)\\BlackBerry\\VSPlugin-NDK\\VSNDK.DebugEngine.dll"
-"Assembly"="VSNDK.DebugEngine"
-"Class"="VSNDK.DebugEngine.AD7Engine"
-"InprocServer32"="c:\\windows\\system32\\mscoree.dll"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}]
-"Attach"=dword:00000001
-"ProgramProvider"="{AD06FD46-C790-4D5C-A274-8815DF9511B8}"
-"CLSID"="{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}"
-@="guidDebuggingSampleEngine"
-"AlwaysLoadLocal"="1"
-"AutoSelectPriority"=dword:00000004
-"PortSupplier"="{92A2B753-00BD-40FF-9964-6AB64A1D6C9F}"
-"Name"="VSNDK Debug Engine"
-"CallstackBP"=dword:00000001
-"AddressBP"=dword:00000000
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}\IncompatibleList]
-"guidNativeOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidCOMPlusOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidScriptEng"="{F200A7E7-DEA5-11D0-B854-00A0244A1DE2}"
-"guidCOMPlusNativeEng"="{92EF0900-2251-11D2-B72E-0000F87572EF}"
\ No newline at end of file
diff --git a/VSNDKPluginSetupVS2013.bat b/VSNDKPluginSetupVS2013.bat
deleted file mode 100644
index af05df1f..00000000
--- a/VSNDKPluginSetupVS2013.bat
+++ /dev/null
@@ -1,118 +0,0 @@
-echo off
-
-REM //********************************************************************************************
-REM // Batch Constants
-REM // thisDir = working directory of current batch file.
-REM // buildresults = Directory containing the build results.
-REM **********************************************************************************************
-set thisDir=%~dp0
-set buildresults=%thisDir%..\buildresults\VS2013
-set ProgRoot=%ProgramFiles(x86)%
-set AllUsers=%ALLUSERSPROFILE%
-set AppData=%APPDATA%
-set drive=%cd:~0,3%
-
-if "%ProgramFiles(x86)%XXX"=="XXX" (
-echo 32-bit
-set ProgRoot=%ProgramFiles%
-)
-echo %ProgRoot%
-
-REM //********************************************************************************************
-REM // Copy AddIn Files
-REM **********************************************************************************************
-echo Copy "%buildresults%\VSNDK.AddIn.AddIn" to "%AllUsers%\Microsoft\MSEnvShared\Addins\VSNDK.AddIn.AddIn"
-copy "%buildresults%\VSNDK.AddIn.AddIn" "%AllUsers%\Microsoft\MSEnvShared\Addins\VSNDK.AddIn.AddIn"
-echo Copy "%buildresults%\VSNDK.AddIn.dll" to "%AllUsers%\Microsoft\MSEnvShared\Addins\VSNDK.AddIn.dll"
-copy "%buildresults%\VSNDK.AddIn.dll" "%AllUsers%\Microsoft\MSEnvShared\Addins\VSNDK.AddIn.dll"
-
-REM //********************************************************************************************
-REM // Copy GDBParser and DebugEngine Files
-REM **********************************************************************************************
-echo Make Directory "%ProgRoot%\BlackBerry\VSPlugin-NDK"
-md "%ProgRoot%\BlackBerry\VSPlugin-NDK"
-echo "%buildresults%\GDBParser.dll" to "%ProgRoot%\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\NDK Plugin\GDBParser.dll"
-copy "%buildresults%\GDBParser.dll" "%ProgRoot%\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\NDK Plugin\GDBParser.dll"
-echo Copy "%buildresults%\GDBWrapper.exe" to "%ProgRoot%\BlackBerry\VSPlugin-NDK\GDBWrapper.exe"
-copy "%buildresults%\GDBWrapper.exe" "%ProgRoot%\BlackBerry\VSPlugin-NDK\GDBWrapper.exe"
-echo Copy "%buildresults%\Instructions.txt" to "%ProgRoot%\BlackBerry\VSPlugin-NDK\Instructions.txt"
-copy "%buildresults%\Instructions.txt" "%ProgRoot%\BlackBerry\VSPlugin-NDK\Instructions.txt"
-echo Copy "%buildresults%\VSNDK.DebugEngine.dll" to "%ProgRoot%\BlackBerry\VSPlugin-NDK\VSNDK.DebugEngine.dll"
-copy "%buildresults%\VSNDK.DebugEngine.dll" "%ProgRoot%\BlackBerry\VSPlugin-NDK\VSNDK.DebugEngine.dll"
-
-REM //********************************************************************************************
-REM // Copy Package Files
-REM **********************************************************************************************
-echo Make Directory "%ProgRoot%\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\NDK Plugin"
-md "%ProgRoot%\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\NDK Plugin"
-echo "%buildresults%\extension.vsixmanifest" to "%ProgRoot%\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\NDK Plugin\extension.vsixmanifest"
-copy "%buildresults%\extension.vsixmanifest" "%ProgRoot%\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\NDK Plugin\extension.vsixmanifest"
-echo "%buildresults%\VSNDK.Package.dll" to "%ProgRoot%\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\NDK Plugin\VSNDK.Package.dll"
-copy "%buildresults%\VSNDK.Package.dll" "%ProgRoot%\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\NDK Plugin\VSNDK.Package.dll"
-echo "%buildresults%\VSNDK.Package.pkgdef" to "%ProgRoot%\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\NDK Plugin\VSNDK.Package.pkgdef"
-copy "%buildresults%\VSNDK.Package.pkgdef" "%ProgRoot%\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\NDK Plugin\VSNDK.Package.pkgdef"
-
-REM //********************************************************************************************
-REM // Copy MSBuild Files
-REM **********************************************************************************************
-echo Copy BlackBerry MSBuild directory
-xcopy "%buildresults%\BlackBerry" "%ProgRoot%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\BlackBerry" /e /i /y
-copy "%buildresults%\VSNDK.Tasks.dll" "%ProgRoot%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\BlackBerry\VSNDK.Tasks.dll"
-echo Copy GDBWrapper.exe
-echo Copy BlackBerrySimulator MSBuild directory
-xcopy "%buildresults%\BlackBerrySimulator" "%ProgRoot%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\BlackBerrySimulator" /e /i /y
-copy "%buildresults%\VSNDK.Tasks.dll" "%ProgRoot%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\BlackBerrySimulator\VSNDK.Tasks.dll"
-
-REM //********************************************************************************************
-REM // Copy Template Files
-REM **********************************************************************************************
-echo Copy BlackBerry VCWizards directory
-xcopy "%buildresults%\Templates\VCWizards" "%ProgRoot%\Microsoft Visual Studio 12.0\VC\VCWizards\CodeWiz" /e /i /y
-
-REM //********************************************************************************************
-REM // Copy SDK Command Line Tool Files
-REM **********************************************************************************************
-echo xcopy "%thisDir%bbndk_vs" "%drive%bbndk_vs" /e /i /y
-md "%drive%bbndk_vs"
-xcopy "%thisDir%bbndk_vs" "%drive%bbndk_vs" /e /i /y
-
-REM //********************************************************************************************
-REM // Copy QNX Tools
-REM **********************************************************************************************
-echo xcopy "%thisDir%qnxtools" "%ProgRoot%\BlackBerry\VSPlugin-NDK\qnxtools" /e /i /y
-md "%ProgRoot%\BlackBerry\VSPlugin-NDK\qnxtools"
-xcopy "%thisDir%qnxtools" "%ProgRoot%\BlackBerry\VSPlugin-NDK\qnxtools" /e /i /y
-
-REM //********************************************************************************************
-REM // Register clases
-REM **********************************************************************************************
-echo registering setup
-REGEDIT.EXE /S "thisDir"VSNDKPluginSetup2013.reg
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VSNDKPluginSetupVS2013.reg b/VSNDKPluginSetupVS2013.reg
deleted file mode 100644
index 3061b5ed..00000000
--- a/VSNDKPluginSetupVS2013.reg
+++ /dev/null
@@ -1,103 +0,0 @@
-REGEDIT4
-
-[HKEY_CURRENT_USER\SOFTWARE\BlackBerry\BlackBerryVSPlugin]
-"device_password"="AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA7fSRRS7m1Em+yoK0ioAYhwQAAAACAAAAAAADZgAAwAAAABAAAAAb9QNNQPNG1qB5uDOFabBjAAAAAASAAACgAAAAEAAAAOu49T6nbn0mHnBMoGvre5cIAAAA2NG7RxOCGYgUAAAAi84MGQ9ELFYdXZ5pOhVSayDK2V4="
-"device_IP"="169.254.0.1"
-"simulator_password"="AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA7fSRRS7m1Em+yoK0ioAYhwQAAAACAAAAAAADZgAAwAAAABAAAAAb9QNNQPNG1qB5uDOFabBjAAAAAASAAACgAAAAEAAAAOu49T6nbn0mHnBMoGvre5cIAAAA2NG7RxOCGYgUAAAAi84MGQ9ELFYdXZ5pOhVSayDK2V4="
-"simulator_IP"=""
-"NDKHostPath"=""
-"NDKTargetPath"=""
-"NDKRemotePath"=""
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}]
-"AddressBP"=dword:00000000
-"AutoSelectPriority"=dword:00000004
-"CallstackBP"=dword:00000001
-"ProgramProvider"="{AD06FD46-C790-4D5C-A274-8815DF9511B8}"
-"Attach"=dword:00000001
-"CLSID"="{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}"
-"AlwaysLoadLocal"="1"
-"PortSupplier"="{92A2B753-00BD-40FF-9964-6AB64A1D6C9F}"
-"Name"="VSNDK Debug Engine"
-@="guidDebuggingSampleEngine"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}\IncompatibleList]
-"guidScriptEng"="{F200A7E7-DEA5-11D0-B854-00A0244A1DE2}"
-"guidNativeOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidCOMPlusOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidCOMPlusNativeEng"="{92EF0900-2251-11D2-B72E-0000F87572EF}"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\CLSID\{AD06FD46-C790-4D5C-A274-8815DF9511B8}]
-"CodeBase"="C:\\Program Files (x86)\\BlackBerry\\VSPlugin-NDK\\VSNDK.DebugEngine.dll"
-"InprocServer32"="c:\\windows\\system32\\mscoree.dll"
-"Class"="VSNDK.DebugEngine.AD7ProgramProvider"
-"Assembly"="VSNDK.DebugEngine"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\CLSID\{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}]
-"CodeBase"="C:\\Program Files (x86)\\BlackBerry\\VSPlugin-NDK\\VSNDK.DebugEngine.dll"
-"InprocServer32"="c:\\windows\\system32\\mscoree.dll"
-"Class"="VSNDK.DebugEngine.AD7Engine"
-"Assembly"="VSNDK.DebugEngine"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\CLSID\{BDC2218C-D50C-4A5A-A2F6-66BDC94FF8D6}]
-@="BlackBerrySupplier"
-"Assembly"="VSNDK.DebugEngine"
-"Class"="VSNDK.DebugEngine.AD7PortSupplier"
-"InprocServer32"="c:\\windows\\system32\\mscoree.dll"
-"CodeBase"="C:\\Program Files (x86)\\BlackBerry\\VSPlugin-NDK\\VSNDK.DebugEngine.dll"
-"ThreadingModel"="Free"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\AD7Metrics\PortSupplier\{92A2B753-00BD-40FF-9964-6AB64A1D6C9F}]
-"Name"="BlackBerry"
-"DisallowUserEnteredPorts"=dword:00000000
-"CLSID"="{BDC2218C-D50C-4A5A-A2F6-66BDC94FF8D6}"
-@="Visual Studio Plug-in for BlackBerry"
-"PortPickerCLSID"="{3FAA02D6-72D8-4F69-A1E6-BB05ECB4E37A}"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}]
-"AlwaysLoadLocal"="1"
-"PortSupplier"="{BDC2218C-D50C-4A5A-A2F6-66BDC94FF8D6}"
-"Name"="VSNDK Debug Engine"
-"CallstackBP"=dword:00000001
-"AutoSelectPriority"=dword:00000004
-"AddressBP"=dword:00000000
-"Attach"=dword:00000001
-"ProgramProvider"="{AD06FD46-C790-4D5C-A274-8815DF9511B8}"
-"CLSID"="{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}"
-@="guidDebuggingSampleEngine"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}\IncompatibleList]
-"guidScriptEng"="{F200A7E7-DEA5-11D0-B854-00A0244A1DE2}"
-"guidNativeOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidCOMPlusOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidCOMPlusNativeEng"="{92EF0900-2251-11D2-B72E-0000F87572EF}"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0\CLSID\{AD06FD46-C790-4D5C-A274-8815DF9511B8}]
-"CodeBase"="C:\\Program Files (x86)\\BlackBerry\\VSPlugin-NDK\\VSNDK.DebugEngine.dll"
-"InprocServer32"="c:\\windows\\system32\\mscoree.dll"
-"Class"="VSNDK.DebugEngine.AD7ProgramProvider"
-"Assembly"="VSNDK.DebugEngine"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0\CLSID\{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}]
-"CodeBase"="C:\\Program Files (x86)\\BlackBerry\\VSPlugin-NDK\\VSNDK.DebugEngine.dll"
-"Assembly"="VSNDK.DebugEngine"
-"Class"="VSNDK.DebugEngine.AD7Engine"
-"InprocServer32"="c:\\windows\\system32\\mscoree.dll"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}]
-"Attach"=dword:00000001
-"ProgramProvider"="{AD06FD46-C790-4D5C-A274-8815DF9511B8}"
-"CLSID"="{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}"
-@="guidDebuggingSampleEngine"
-"AlwaysLoadLocal"="1"
-"AutoSelectPriority"=dword:00000004
-"PortSupplier"="{92A2B753-00BD-40FF-9964-6AB64A1D6C9F}"
-"Name"="VSNDK Debug Engine"
-"CallstackBP"=dword:00000001
-"AddressBP"=dword:00000000
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}\IncompatibleList]
-"guidNativeOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidCOMPlusOnlyEng"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
-"guidScriptEng"="{F200A7E7-DEA5-11D0-B854-00A0244A1DE2}"
-"guidCOMPlusNativeEng"="{92EF0900-2251-11D2-B72E-0000F87572EF}"
\ No newline at end of file
diff --git a/VSNDKPluginUninstall.bat b/VSNDKPluginUninstall.bat
deleted file mode 100644
index 7f03daf6..00000000
--- a/VSNDKPluginUninstall.bat
+++ /dev/null
@@ -1,105 +0,0 @@
-echo off
-
-REM //********************************************************************************************
-REM // Batch Constants
-REM // thisDir = working directory of current batch file.
-REM // buildresults = Directory containing the build results.
-REM **********************************************************************************************
-set thisDir=%~dp0
-set buildresults=%thisDir%..\buildresults
-set ProgRoot=%ProgramFiles(x86)%
-set AllUsers=%ALLUSERSPROFILE%
-set AppData=%APPDATA%
-set drive=%cd:~0,3%
-
-if "%ProgramFiles(x86)%XXX"=="XXX" (
-echo 32-bit
-set ProgRoot=%ProgramFiles%
-)
-echo %ProgRoot%
-
-REM //********************************************************************************************
-REM // Remove AddIn Files
-REM **********************************************************************************************
-echo Deleting "%AllUsers%\Microsoft\MSEnvShared\Addins\VSNDK.AddIn.AddIn"
-del "%AllUsers%\Microsoft\MSEnvShared\Addins\VSNDK.AddIn.AddIn"
-echo Deleting "%AllUsers%\Microsoft\MSEnvShared\Addins\VSNDK.AddIn.dll"
-del "%AllUsers%\Microsoft\MSEnvShared\Addins\VSNDK.AddIn.dll"
-
-REM //********************************************************************************************
-REM // Remove GDBParser and DebugEngine Files
-REM **********************************************************************************************
-echo Deleting "%ProgRoot%\BlackBerry\VSPlugin-NDK\GDBParser.dll"
-del "%ProgRoot%\BlackBerry\VSPlugin-NDK\GDBParser.dll"
-echo Deleting "%ProgRoot%\BlackBerry\VSPlugin-NDK\GDBWrapper.exe"
-del "%ProgRoot%\BlackBerry\VSPlugin-NDK\GDBWrapper.exe"
-echo Deleting "%ProgRoot%\BlackBerry\VSPlugin-NDK\Instructions.txt"
-del "%ProgRoot%\BlackBerry\VSPlugin-NDK\Instructions.txt"
-echo Deleting "%ProgRoot%\BlackBerry\VSPlugin-NDK\VSNDK.DebugEngine.dll"
-del "%ProgRoot%\BlackBerry\VSPlugin-NDK\VSNDK.DebugEngine.dll"
-echo Remove Directory "%ProgRoot%\BlackBerry\VSPlugin-NDK"
-rd "%ProgRoot%\BlackBerry\VSPlugin-NDK"
-
-REM //********************************************************************************************
-REM // Remove Package Files
-REM **********************************************************************************************
-echo Deleting "%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\NDK Plugin\extension.vsixmanifest"
-del "%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\NDK Plugin\extension.manifest"
-echo Deleting "%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\NDK Plugin\VSNDK.Package.dll"
-del "%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\NDK Plugin\VSNDK.Package.dll"
-echo Deleting "%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\NDK Plugin\VSNDK.Package.pkgdef"
-del "%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\NDK Plugin\VSNDK.Package.pkgdef"
-echo Remove Directory "%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\NDK Plugin"
-rd "%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\NDK Plugin"
-
-
-REM //********************************************************************************************
-REM // Remove MSBuild Files
-REM **********************************************************************************************
-echo Delete BlackBerry MSBuild directory
-rd "%ProgRoot%\MSBuild\Microsoft.Cpp\v4.0\Platforms\BlackBerry" /s /q
-echo Delete BlackBerrySimulator MSBuild directory
-rd "%buildresults%\BlackBerrySimulator" "%ProgRoot%\MSBuild\Microsoft.Cpp\v4.0\Platforms\BlackBerrySimulator" /s /q
-
-REM //********************************************************************************************
-REM // Remove Template Files
-REM **********************************************************************************************
-echo Delete BlackBerry VCWizards directory
-rd "%ProgRoot%\Microsoft Visual Studio 10.0\VC\VCWizards\CodeWiz\BlackBerry" /s /q
-
-REM //********************************************************************************************
-REM // Remove command line tools
-REM **********************************************************************************************
-echo Delete %drive%bbndk_vs directory
-rd "%drive%bbndk_vs" /s /q
-
-REM //********************************************************************************************
-REM // Remove qnx tools
-REM **********************************************************************************************
-echo Delete "%ProgRoot%\BlackBerry\VSPlugin-NDK\qnxtools" directory
-rd "%ProgRoot%\BlackBerry\VSPlugin-NDK\qnxtools" /s /q
-
-REM //********************************************************************************************
-REM // Register clases
-REM **********************************************************************************************
-echo Unregistering - %thisDir%VSNDKPluginUninstall.reg
-REGEDIT.EXE -S %thisDir%VSNDKPluginUninstall.reg
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VSNDKPluginUninstall.reg b/VSNDKPluginUninstall.reg
deleted file mode 100644
index 634e9486..00000000
--- a/VSNDKPluginUninstall.reg
+++ /dev/null
@@ -1,27 +0,0 @@
-REGEDIT4
-
-[-HKEY_CURRENT_USER\SOFTWARE\BlackBerry\BlackBerryVSPlugin]
-
-[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}\IncompatibleList]
-
-[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}]
-
-[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\CLSID\{AD06FD46-C790-4D5C-A274-8815DF9511B8}]
-
-[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\CLSID\{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}]
-
-[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\CLSID\{BDC2218C-D50C-4A5A-A2F6-66BDC94FF8D6}]
-
-[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\AD7Metrics\PortSupplier\{92A2B753-00BD-40FF-9964-6AB64A1D6C9F}]
-
-[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}\IncompatibleList]
-
-[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}]
-
-[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\CLSID\{AD06FD46-C790-4D5C-A274-8815DF9511B8}]
-
-[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\CLSID\{904AA6E0-942C-4D11-9094-7BAAEB3EE4B9}]
-
-[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}\IncompatibleList]
-
-[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\AD7Metrics\Engine\{E5A37609-2F43-4830-AA85-D94CFA035DD2}]
\ No newline at end of file
diff --git a/build.bat b/build.bat
new file mode 100644
index 00000000..f17bd5ba
--- /dev/null
+++ b/build.bat
@@ -0,0 +1,211 @@
+@echo off
+echo Starting...
+setlocal EnableExtensions
+
+REM ********************************************************************************************
+REM Allow selective build
+REM ********************************************************************************************
+
+:: Process parameters, to limit the solutions to build
+if "%~1" == "" (
+ set ActionClean=1
+ set ActionBuildPackage=0
+ set ActionBuildVS2010=1
+ set ActionBuildVS2012=1
+ set ActionBuildVS2013=1
+ set PackageVersion=
+) else (
+ set ActionClean=1
+ set ActionBuildPackage=0
+ set ActionBuildVS2010=0
+ set ActionBuildVS2012=0
+ set ActionBuildVS2013=0
+ set PackageVersion=
+)
+
+:args_parsing
+set arg=%~1
+if "%arg%" == "" (goto args_parsing_done)
+if /i "%arg%" == "/all" set ActionBuildVS2010=1 && set ActionBuildVS2012=1 && set ActionBuildVS2013=1
+if /i "%arg%" == "/noclean" set ActionClean=0
+if /i "%arg%" == "/no-clean" set ActionClean=0
+if /i "%arg%" == "vs2010" set ActionBuildVS2010=1
+if /i "%arg%" == "vs2012" set ActionBuildVS2012=1
+if /i "%arg%" == "vs2013" set ActionBuildVS2013=1
+if /i "%arg:~0,5%" == "/out:" set CustomOutputDir=%arg:~5%
+if /i "%arg:~0,8%" == "/package" set ActionClean=1 && set ActionBuildPackage=1
+if /i "%arg:~0,9%" == "/package:" set PackageVersion=%arg:~9%
+
+shift /1
+goto args_parsing
+
+:args_parsing_done
+set arg=
+
+REM ********************************************************************************************
+REM Declare Constants
+REM ********************************************************************************************
+set /A actionNo=1
+set thisDir=%~dp0
+set thisDir=%thisDir:~0,-1%
+
+REM Make sure version of the release package is set
+if "%PackageVersion%" == "" set PackageVersion=1.0.0-alpha
+if "%PackageVersion:~0,1%" == "v" set PackageVersion=%PackageVersion:~1%
+if "%PackageVersion:~0,1%" == "V" set PackageVersion=%PackageVersion:~1%
+
+REM Allow to override the BuildReults path, in case someone dislikes the default one
+set BuildResults=%thisDir%\_BuildResults
+if "%CustomOutputDir%" == "" goto skip_buildoutput_override
+ set BuildResults=%CustomOutputDir%
+ if "%BuildResults:~-1%" == "\" set BuildResults=%BuildResults:~0,-1%
+:skip_buildoutput_override
+
+set ProgFilesRoot=%ProgramFiles(x86)%
+if "%ProgFilesRoot%" == "" set ProgFilesRoot=%ProgramFiles%
+set QnxToolsDir=%thisDir%\qnxtools
+
+set ZipTool=%thisDir%\ext\7zip\7z.exe
+set MsBuild="C:\Windows\Microsoft.NET\Framework\v4.0.30319\MsBuild.exe"
+set MsBuild2013="%ProgFilesRoot%\MSBuild\12.0\Bin\MsBuild.exe"
+set MsBuildCmd=%MsBuild% /property:Configuration=Release /target:Rebuild
+set MsBuild2013Cmd=%MsBuild2013% /property:Configuration=Release /target:Rebuild
+
+set SolutionPath2010="%thisDir%\src_vs2010\BlackBerry.NativePlugin.sln"
+set SolutionPath2012="%thisDir%\src_vs2012\BlackBerry.NativePlugin.sln"
+set SolutionPath2013="%thisDir%\src_vs2013\BlackBerry.NativePlugin.sln"
+
+set PackageResults=%BuildResults%\Package
+set PackageNamePrefix=BBNDK-
+
+echo Current folder: "%thisDir%"
+echo Output folder: "%BuildResults%"
+
+REM ********************************************************************************************
+REM Clean up old bin folder
+REM ********************************************************************************************
+if %ActionClean% equ 0 (goto skip_clean)
+
+echo %actionNo%: Removing previous code...
+if not exist "%BuildResults%" (
+ mkdir "%BuildResults%"
+ echo %actionNo%: Created empty folder - DONE
+
+) else (
+ rmdir /Q "%BuildResults%" /S
+ if errorlevel 1 ( exit /b %errorlevel% )
+
+ mkdir "%BuildResults%"
+ if errorlevel 1 ( exit /b %errorlevel% )
+ echo %actionNo%: Cleanup - DONE
+)
+set /a actionNo += 1
+
+:skip_clean
+
+REM ********************************************************************************************
+REM Build VS2010
+REM ********************************************************************************************
+if %ActionBuildVS2010% equ 0 (goto skip_vs2010)
+
+echo %actionNo%: Building Solution for Visual Studio 2010
+%MsBuildCmd% %SolutionPath2010% /p:OutputPath="%BuildResults%\VS2010" > "%BuildResults%\VS2010_buildlog.txt"
+if errorlevel 1 ( exit /b %errorlevel% )
+echo %actionNo%: Build - DONE
+set /a actionNo += 1
+
+:skip_vs2010
+
+REM ********************************************************************************************
+REM Build VS2012
+REM ********************************************************************************************
+if %ActionBuildVS2012% equ 0 (goto skip_vs2012)
+
+echo %actionNo%: Building Solution for Visual Studio 2012
+%MsBuildCmd% %SolutionPath2012% /p:OutputPath="%BuildResults%\VS2012" /p:VisualStudioVersion=11.0 > "%BuildResults%\VS2012_buildlog.txt"
+if errorlevel 1 ( exit /b %errorlevel% )
+echo %actionNo%: Build - DONE
+set /a actionNo += 1
+
+:skip_vs2012
+
+REM ********************************************************************************************
+REM Build VS2013
+REM ********************************************************************************************
+if %ActionBuildVS2013% equ 0 (goto skip_vs2013)
+
+echo %actionNo%: Building Solution for Visual Studio 2013
+%MsBuild2013Cmd% %SolutionPath2013% /p:OutputPath="%BuildResults%\VS2013" /p:VisualStudioVersion=12.0 > "%BuildResults%\VS2013_buildlog.txt"
+if errorlevel 1 ( exit /b %errorlevel% )
+echo %actionNo%: Build - DONE
+set /a actionNo += 1
+
+:skip_vs2013
+
+REM ********************************************************************************************
+REM Release Package ZIP files creation
+REM ********************************************************************************************
+if %ActionBuildPackage% equ 0 (goto skip_package)
+
+if exist "%PackageResults%" rmdir /Q "%PackageResults%" /S
+mkdir "%PackageResults%"
+
+echo %actionNo%: Creating release package version: v%PackageVersion% (MSBuild platforms part)
+if exist "%PackageResults%\BlackBerry" rmdir /Q "%PackageResults%\BlackBerry" /S
+if exist "%PackageResults%\Microsoft.Cpp" rmdir /Q "%PackageResults%\Microsoft.Cpp" /S
+
+echo Creating folder structure compatible with MSBuild v4.0
+xcopy "%QnxToolsDir%" "%PackageResults%\BlackBerry\QnxTools" /e /i /y /q
+if exist "%BuildResults%\VS2010\BlackBerry" (
+ xcopy "%BuildResults%\VS2010\BlackBerry" "%PackageResults%\Microsoft.Cpp\v4.0\Platforms\BlackBerry\" /e /i /y /q
+ copy "%BuildResults%\VS2010\BlackBerry.BuildTasks.dll" "%PackageResults%\Microsoft.Cpp\v4.0\Platforms\BlackBerry\BlackBerry.BuildTasks.dll"
+)
+if exist "%BuildResults%\VS2012\BlackBerry" (
+ xcopy "%BuildResults%\VS2012\BlackBerry" "%PackageResults%\Microsoft.Cpp\v4.0\V110\Platforms\BlackBerry\" /e /i /y /q
+ copy "%BuildResults%\VS2012\BlackBerry.BuildTasks.dll" "%PackageResults%\Microsoft.Cpp\v4.0\V110\Platforms\BlackBerry\BlackBerry.BuildTasks.dll"
+)
+if exist "%BuildResults%\VS2013\BlackBerry" (
+ xcopy "%BuildResults%\VS2013\BlackBerry" "%PackageResults%\Microsoft.Cpp\v4.0\V120\Platforms\BlackBerry\" /e /i /y /q
+ copy "%BuildResults%\VS2013\BlackBerry.BuildTasks.dll" "%PackageResults%\Microsoft.Cpp\v4.0\V120\Platforms\BlackBerry\BlackBerry.BuildTasks.dll"
+)
+
+echo Compressing...
+%ZipTool% a -tzip -mx9 "%PackageResults%\MSBuild_Platforms_v%PackageVersion%.zip" "%PackageResults%\BlackBerry" "%PackageResults%\Microsoft.Cpp" > nul
+if errorlevel 1 ( exit /b %errorlevel% )
+echo Created ZIP archive
+
+if exist "%PackageResults%\BlackBerry" rmdir /Q "%PackageResults%\BlackBerry" /S
+if exist "%PackageResults%\Microsoft.Cpp" rmdir /Q "%PackageResults%\Microsoft.Cpp" /S
+echo %actionNo%: Package - MSBuild - DONE
+set /a actionNo += 1
+
+echo %actionNo%: Copying VSIX packages...
+
+REM Copy VSIX packages:
+if exist "%BuildResults%\VS2010\BlackBerry.Package.vsix" (
+ copy /B "%BuildResults%\VS2010\BlackBerry.Package.vsix" "%PackageResults%\%PackageNamePrefix%plugin_vs2010_v%PackageVersion%.vsix"
+ if errorlevel 1 ( exit /b %errorlevel% )
+)
+if exist "%BuildResults%\VS2012\BlackBerry.Package.vsix" (
+ copy /B "%BuildResults%\VS2012\BlackBerry.Package.vsix" "%PackageResults%\%PackageNamePrefix%plugin_vs2012_v%PackageVersion%.vsix"
+ if errorlevel 1 ( exit /b %errorlevel% )
+)
+if exist "%BuildResults%\VS2013\BlackBerry.Package.vsix" (
+ copy /B "%BuildResults%\VS2013\BlackBerry.Package.vsix" "%PackageResults%\%PackageNamePrefix%plugin_vs2013_v%PackageVersion%.vsix"
+ if errorlevel 1 ( exit /b %errorlevel% )
+)
+
+echo %actionNo%: VSIX - DONE
+set /a actionNo += 1
+
+:skip_package
+
+goto EOF
+
+REM ********************************************************************************************
+REM DONE
+REM ********************************************************************************************
+
+:EOF
+endlocal
+echo [ALL DONE]
diff --git a/CleanFiles.bat b/clean.bat
similarity index 100%
rename from CleanFiles.bat
rename to clean.bat
diff --git a/ext/7zip/7z.exe b/ext/7zip/7z.exe
new file mode 100644
index 00000000..101884c3
Binary files /dev/null and b/ext/7zip/7z.exe differ
diff --git a/ext/7zip/License.txt b/ext/7zip/License.txt
new file mode 100644
index 00000000..e25910a6
--- /dev/null
+++ b/ext/7zip/License.txt
@@ -0,0 +1,56 @@
+ 7-Zip
+ ~~~~~
+ License for use and distribution
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ 7-Zip Copyright (C) 1999-2010 Igor Pavlov.
+
+ Licenses for files are:
+
+ 1) 7z.dll: GNU LGPL + unRAR restriction
+ 2) All other files: GNU LGPL
+
+ The GNU LGPL + unRAR restriction means that you must follow both
+ GNU LGPL rules and unRAR restriction rules.
+
+
+ Note:
+ You can use 7-Zip on any computer, including a computer in a commercial
+ organization. You don't need to register or pay for 7-Zip.
+
+
+ GNU LGPL information
+ --------------------
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You can receive a copy of the GNU Lesser General Public License from
+ http://www.gnu.org/
+
+
+ unRAR restriction
+ -----------------
+
+ The decompression engine for RAR archives was developed using source
+ code of unRAR program.
+ All copyrights to original unRAR code are owned by Alexander Roshal.
+
+ The license for original unRAR code has the following restriction:
+
+ The unRAR sources cannot be used to re-create the RAR compression algorithm,
+ which is proprietary. Distribution of modified unRAR sources in separate form
+ or as a part of other software is permitted, provided that it is clearly
+ stated in the documentation and source comments that the code may
+ not be used to develop a RAR (WinRAR) compatible archiver.
+
+
+ --
+ Igor Pavlov
diff --git a/ext/NUnit/license.txt b/ext/NUnit/license.txt
new file mode 100644
index 00000000..b12903af
--- /dev/null
+++ b/ext/NUnit/license.txt
@@ -0,0 +1,15 @@
+Copyright 2002-2013 Charlie Poole
+Copyright 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov
+Copyright 2000-2002 Philip A. Craig
+
+This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required.
+
+Portions Copyright 2002-2013 Charlie Poole or Copyright 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright 2000-2002 Philip A. Craig
+
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source distribution.
diff --git a/ext/NUnit/nunit.framework.dll b/ext/NUnit/nunit.framework.dll
new file mode 100644
index 00000000..780727f2
Binary files /dev/null and b/ext/NUnit/nunit.framework.dll differ
diff --git a/ext/NUnit/nunit.framework.xml b/ext/NUnit/nunit.framework.xml
new file mode 100644
index 00000000..4c8c26e8
--- /dev/null
+++ b/ext/NUnit/nunit.framework.xml
@@ -0,0 +1,10960 @@
+
+
+
+ nunit.framework
+
+
+
+
+ The different targets a test action attribute can be applied to
+
+
+
+
+ Default target, which is determined by where the action attribute is attached
+
+
+
+
+ Target a individual test case
+
+
+
+
+ Target a suite of test cases
+
+
+
+
+ Delegate used by tests that execute code and
+ capture any thrown exception.
+
+
+
+
+ The Assert class contains a collection of static methods that
+ implement the most common assertions used in NUnit.
+
+
+
+
+ We don't actually want any instances of this object, but some people
+ like to inherit from it to add other static methods. Hence, the
+ protected constructor disallows any instances of this object.
+
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+
+ Throws a with the message and arguments
+ that are passed in. This allows a test to be cut short, with a result
+ of success returned to NUnit.
+
+ The message to initialize the with.
+ Arguments to be used in formatting the message
+
+
+
+ Throws a with the message and arguments
+ that are passed in. This allows a test to be cut short, with a result
+ of success returned to NUnit.
+
+ The message to initialize the with.
+
+
+
+ Throws a with the message and arguments
+ that are passed in. This allows a test to be cut short, with a result
+ of success returned to NUnit.
+
+
+
+
+ Throws an with the message and arguments
+ that are passed in. This is used by the other Assert functions.
+
+ The message to initialize the with.
+ Arguments to be used in formatting the message
+
+
+
+ Throws an with the message that is
+ passed in. This is used by the other Assert functions.
+
+ The message to initialize the with.
+
+
+
+ Throws an .
+ This is used by the other Assert functions.
+
+
+
+
+ Throws an with the message and arguments
+ that are passed in. This causes the test to be reported as ignored.
+
+ The message to initialize the with.
+ Arguments to be used in formatting the message
+
+
+
+ Throws an with the message that is
+ passed in. This causes the test to be reported as ignored.
+
+ The message to initialize the with.
+
+
+
+ Throws an .
+ This causes the test to be reported as ignored.
+
+
+
+
+ Throws an with the message and arguments
+ that are passed in. This causes the test to be reported as inconclusive.
+
+ The message to initialize the with.
+ Arguments to be used in formatting the message
+
+
+
+ Throws an with the message that is
+ passed in. This causes the test to be reported as inconclusive.
+
+ The message to initialize the with.
+
+
+
+ Throws an .
+ This causes the test to be reported as Inconclusive.
+
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ The actual value to test
+ A Constraint to be applied
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ The actual value to test
+ A Constraint to be applied
+ The message that will be displayed on failure
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ The actual value to test
+ A Constraint expression to be applied
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display if the condition is false
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display if the condition is false
+
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ An ActualValueDelegate returning the value to be tested
+ A Constraint expression to be applied
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ An ActualValueDelegate returning the value to be tested
+ A Constraint expression to be applied
+ The message that will be displayed on failure
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ An ActualValueDelegate returning the value to be tested
+ A Constraint expression to be applied
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ The actual value to test
+ A Constraint to be applied
+
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ The actual value to test
+ A Constraint to be applied
+ The message that will be displayed on failure
+
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ The actual value to test
+ A Constraint to be applied
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that the code represented by a delegate throws an exception
+ that satisfies the constraint provided.
+
+ A TestDelegate to be executed
+ A ThrowsConstraint used in the test
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+ Used as a synonym for That in rare cases where a private setter
+ causes a Visual Basic compilation error.
+
+ The actual value to test
+ A Constraint to be applied
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+ Used as a synonym for That in rare cases where a private setter
+ causes a Visual Basic compilation error.
+
+ The actual value to test
+ A Constraint to be applied
+ The message that will be displayed on failure
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+ Used as a synonym for That in rare cases where a private setter
+ causes a Visual Basic compilation error.
+
+
+ This method is provided for use by VB developers needing to test
+ the value of properties with private setters.
+
+ The actual value to test
+ A Constraint expression to be applied
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ A constraint to be satisfied by the exception
+ A TestDelegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ A constraint to be satisfied by the exception
+ A TestDelegate
+ The message that will be displayed on failure
+
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ A constraint to be satisfied by the exception
+ A TestDelegate
+
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ The exception Type expected
+ A TestDelegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ The exception Type expected
+ A TestDelegate
+ The message that will be displayed on failure
+
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ The exception Type expected
+ A TestDelegate
+
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ Type of the expected exception
+ A TestDelegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ Type of the expected exception
+ A TestDelegate
+ The message that will be displayed on failure
+
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ Type of the expected exception
+ A TestDelegate
+
+
+
+ Verifies that a delegate throws an exception when called
+ and returns it.
+
+ A TestDelegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Verifies that a delegate throws an exception when called
+ and returns it.
+
+ A TestDelegate
+ The message that will be displayed on failure
+
+
+
+ Verifies that a delegate throws an exception when called
+ and returns it.
+
+ A TestDelegate
+
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+ The message that will be displayed on failure
+
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+ The message that will be displayed on failure
+
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+
+
+
+ Verifies that a delegate does not throw an exception
+
+ A TestDelegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Verifies that a delegate does not throw an exception.
+
+ A TestDelegate
+ The message that will be displayed on failure
+
+
+
+ Verifies that a delegate does not throw an exception.
+
+ A TestDelegate
+
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null then an
+ is thrown.
+
+ The object that is to be tested
+
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null then an
+ is thrown.
+
+ The object that is to be tested
+
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null then an
+ is thrown.
+
+ The object that is to be tested
+
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null then an
+ is thrown.
+
+ The object that is to be tested
+
+
+
+ Verifies that two ints are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that two ints are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+
+ Verifies that two ints are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+
+ Verifies that two longs are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that two longs are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+
+ Verifies that two longs are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+
+ Verifies that two unsigned ints are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that two unsigned ints are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+
+ Verifies that two unsigned ints are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+
+ Verifies that two unsigned longs are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that two unsigned longs are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+
+ Verifies that two unsigned longs are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+
+ Verifies that two decimals are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that two decimals are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+
+ Verifies that two decimals are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+ The message to display in case of failure
+
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+ The message to display in case of failure
+
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+
+
+
+ Verifies that two objects are equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are not equal an is thrown.
+
+ The value that is expected
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that two objects are equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are not equal an is thrown.
+
+ The value that is expected
+ The actual value
+ The message to display in case of failure
+
+
+
+ Verifies that two objects are equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are not equal an is thrown.
+
+ The value that is expected
+ The actual value
+
+
+
+ Verifies that two ints are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that two ints are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+
+ Verifies that two ints are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+
+ Verifies that two longs are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that two longs are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+
+ Verifies that two longs are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+
+ Verifies that two unsigned ints are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that two unsigned ints are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+
+ Verifies that two unsigned ints are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+
+ Verifies that two unsigned longs are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that two unsigned longs are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+
+ Verifies that two unsigned longs are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+
+ Verifies that two decimals are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that two decimals are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+
+ Verifies that two decimals are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+
+ Verifies that two floats are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that two floats are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+
+ Verifies that two floats are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+
+ Verifies that two doubles are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that two doubles are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+
+ Verifies that two doubles are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+
+ Verifies that two objects are not equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are equal an is thrown.
+
+ The value that is expected
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that two objects are not equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are equal an is thrown.
+
+ The value that is expected
+ The actual value
+ The message to display in case of failure
+
+
+
+ Verifies that two objects are not equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are equal an is thrown.
+
+ The value that is expected
+ The actual value
+
+
+
+ Asserts that two objects refer to the same object. If they
+ are not the same an is thrown.
+
+ The expected object
+ The actual object
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that two objects refer to the same object. If they
+ are not the same an is thrown.
+
+ The expected object
+ The actual object
+ The message to display in case of failure
+
+
+
+ Asserts that two objects refer to the same object. If they
+ are not the same an is thrown.
+
+ The expected object
+ The actual object
+
+
+
+ Asserts that two objects do not refer to the same object. If they
+ are the same an is thrown.
+
+ The expected object
+ The actual object
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that two objects do not refer to the same object. If they
+ are the same an is thrown.
+
+ The expected object
+ The actual object
+ The message to display in case of failure
+
+
+
+ Asserts that two objects do not refer to the same object. If they
+ are the same an is thrown.
+
+ The expected object
+ The actual object
+
+
+
+ Verifies that the double that is passed in is an NaN value.
+ If the object is not NaN then an
+ is thrown.
+
+ The value that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the double that is passed in is an NaN value.
+ If the object is not NaN then an
+ is thrown.
+
+ The value that is to be tested
+ The message to display in case of failure
+
+
+
+ Verifies that the double that is passed in is an NaN value.
+ If the object is not NaN then an
+ is thrown.
+
+ The value that is to be tested
+
+
+
+ Verifies that the double that is passed in is an NaN value.
+ If the object is not NaN then an
+ is thrown.
+
+ The value that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the double that is passed in is an NaN value.
+ If the object is not NaN then an
+ is thrown.
+
+ The value that is to be tested
+ The message to display in case of failure
+
+
+
+ Verifies that the double that is passed in is an NaN value.
+ If the object is not NaN then an
+ is thrown.
+
+ The value that is to be tested
+
+
+
+ Assert that a string is empty - that is equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Assert that a string is empty - that is equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+
+
+
+ Assert that a string is empty - that is equal to string.Empty
+
+ The string to be tested
+
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing ICollection
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing ICollection
+ The message to display in case of failure
+
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing ICollection
+
+
+
+ Assert that a string is not empty - that is not equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Assert that a string is not empty - that is not equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+
+
+
+ Assert that a string is not empty - that is not equal to string.Empty
+
+ The string to be tested
+
+
+
+ Assert that an array, list or other collection is not empty
+
+ An array, list or other collection implementing ICollection
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Assert that an array, list or other collection is not empty
+
+ An array, list or other collection implementing ICollection
+ The message to display in case of failure
+
+
+
+ Assert that an array, list or other collection is not empty
+
+ An array, list or other collection implementing ICollection
+
+
+
+ Assert that a string is either null or equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Assert that a string is either null or equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+
+
+
+ Assert that a string is either null or equal to string.Empty
+
+ The string to be tested
+
+
+
+ Assert that a string is not null or empty
+
+ The string to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Assert that a string is not null or empty
+
+ The string to be tested
+ The message to display in case of failure
+
+
+
+ Assert that a string is not null or empty
+
+ The string to be tested
+
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+
+ Asserts that an object is contained in a list.
+
+ The expected object
+ The list to be examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Asserts that an object is contained in a list.
+
+ The expected object
+ The list to be examined
+ The message to display in case of failure
+
+
+
+ Asserts that an object is contained in a list.
+
+ The expected object
+ The list to be examined
+
+
+
+ Helper for Assert.AreEqual(double expected, double actual, ...)
+ allowing code generation to work consistently.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+
+ Gets the number of assertions executed so far and
+ resets the counter to zero.
+
+
+
+
+ AssertionHelper is an optional base class for user tests,
+ allowing the use of shorter names for constraints and
+ asserts and avoiding conflict with the definition of
+ , from which it inherits much of its
+ behavior, in certain mock object frameworks.
+
+
+
+
+ Helper class with properties and methods that supply
+ a number of constraints used in Asserts.
+
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding only if a specified number of them succeed.
+
+
+
+
+ Returns a new PropertyConstraintExpression, which will either
+ test for the existence of the named property on the object
+ being tested or apply any following constraint to that property.
+
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+
+ Returns a constraint that tests two items for equality
+
+
+
+
+ Returns a constraint that tests that two references are the same object
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a collection containing the same elements as the
+ collection supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a subset of the collection supplied as an argument.
+
+
+
+
+ Returns a new CollectionContainsConstraint checking for the
+ presence of a particular object in the collection.
+
+
+
+
+ Returns a new CollectionContainsConstraint checking for the
+ presence of a particular object in the collection.
+
+
+
+
+ Returns a new ContainsConstraint. This constraint
+ will, in turn, make use of the appropriate second-level
+ constraint, depending on the type of the actual argument.
+ This overload is only used if the item sought is a string,
+ since any other type implies that we are looking for a
+ collection member.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that fails if the actual
+ value contains the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that fails if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that fails if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the regular expression supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the regular expression supplied as an argument.
+
+
+
+
+ Returns a constraint that fails if the actual
+ value matches the pattern supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same as an expected path after canonicalization.
+
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+
+ Returns a constraint that tests whether the actual value falls
+ within a specified range.
+
+
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them succeed.
+
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if at least one of them succeeds.
+
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them fail.
+
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Length property of the object being tested.
+
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Count property of the object being tested.
+
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Message property of the object being tested.
+
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the InnerException property of the object being tested.
+
+
+
+
+ Returns a constraint that tests for null
+
+
+
+
+ Returns a constraint that tests for True
+
+
+
+
+ Returns a constraint that tests for False
+
+
+
+
+ Returns a constraint that tests for a positive value
+
+
+
+
+ Returns a constraint that tests for a negative value
+
+
+
+
+ Returns a constraint that tests for NaN
+
+
+
+
+ Returns a constraint that tests for empty
+
+
+
+
+ Returns a constraint that tests whether a collection
+ contains all unique items.
+
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in binary format.
+
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in xml format.
+
+
+
+
+ Returns a constraint that tests whether a collection is ordered
+
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure. Works
+ identically to Assert.That.
+
+ The actual value to test
+ A Constraint to be applied
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure. Works
+ identically to Assert.That.
+
+ The actual value to test
+ A Constraint to be applied
+ The message to be displayed in case of failure
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure. Works
+ identically to Assert.That.
+
+ The actual value to test
+ A Constraint to be applied
+ The message to be displayed in case of failure
+ Arguments to use in formatting the message
+
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an . Works Identically to
+ .
+
+ The evaluated condition
+ The message to display if the condition is false
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an . Works Identically to
+ .
+
+ The evaluated condition
+ The message to display if the condition is false
+
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an . Works Identically to .
+
+ The evaluated condition
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint expression to be applied
+ An ActualValueDelegate returning the value to be tested
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint expression to be applied
+ An ActualValueDelegate returning the value to be tested
+ The message that will be displayed on failure
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ An ActualValueDelegate returning the value to be tested
+ A Constraint expression to be applied
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ The actual value to test
+ A Constraint to be applied
+
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ The actual value to test
+ A Constraint to be applied
+ The message that will be displayed on failure
+
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ The actual value to test
+ A Constraint to be applied
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that the code represented by a delegate throws an exception
+ that satisfies the constraint provided.
+
+ A TestDelegate to be executed
+ A ThrowsConstraint used in the test
+
+
+
+ Returns a ListMapper based on a collection.
+
+ The original collection
+
+
+
+
+ Provides static methods to express the assumptions
+ that must be met for a test to give a meaningful
+ result. If an assumption is not met, the test
+ should produce an inconclusive result.
+
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+ The message that will be displayed on failure
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display if the condition is false
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display if the condition is false
+
+
+
+ Asserts that a condition is true. If the condition is false the
+ method throws an .
+
+ The evaluated condition
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ An ActualValueDelegate returning the value to be tested
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ An ActualValueDelegate returning the value to be tested
+ The message that will be displayed on failure
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ An ActualValueDelegate returning the value to be tested
+ A Constraint expression to be applied
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+ The message that will be displayed on failure
+
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that the code represented by a delegate throws an exception
+ that satisfies the constraint provided.
+
+ A TestDelegate to be executed
+ A ThrowsConstraint used in the test
+
+
+
+ Waits for pending asynchronous operations to complete, if appropriate,
+ and returns a proper result of the invocation by unwrapping task results
+
+ The raw result of the method invocation
+ The unwrapped result, if necessary
+
+
+
+ A set of Assert methods operationg on one or more collections
+
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+
+ Asserts that all items contained in collection are of the type specified by expectedType.
+
+ IEnumerable containing objects to be considered
+ System.Type that all objects in collection must be instances of
+
+
+
+ Asserts that all items contained in collection are of the type specified by expectedType.
+
+ IEnumerable containing objects to be considered
+ System.Type that all objects in collection must be instances of
+ The message that will be displayed on failure
+
+
+
+ Asserts that all items contained in collection are of the type specified by expectedType.
+
+ IEnumerable containing objects to be considered
+ System.Type that all objects in collection must be instances of
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that all items contained in collection are not equal to null.
+
+ IEnumerable containing objects to be considered
+
+
+
+ Asserts that all items contained in collection are not equal to null.
+
+ IEnumerable containing objects to be considered
+ The message that will be displayed on failure
+
+
+
+ Asserts that all items contained in collection are not equal to null.
+
+ IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Ensures that every object contained in collection exists within the collection
+ once and only once.
+
+ IEnumerable of objects to be considered
+
+
+
+ Ensures that every object contained in collection exists within the collection
+ once and only once.
+
+ IEnumerable of objects to be considered
+ The message that will be displayed on failure
+
+
+
+ Ensures that every object contained in collection exists within the collection
+ once and only once.
+
+ IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+ The message that will be displayed on failure
+
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+
+
+
+ Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+
+
+
+ Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that expected and actual are not exactly equal.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+
+
+
+ Asserts that expected and actual are not exactly equal.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+
+
+
+ Asserts that expected and actual are not exactly equal.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+
+
+
+ Asserts that expected and actual are not exactly equal.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+ The message that will be displayed on failure
+
+
+
+ Asserts that expected and actual are not exactly equal.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that expected and actual are not exactly equal.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that expected and actual are not equivalent.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+
+
+
+ Asserts that expected and actual are not equivalent.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+
+
+
+ Asserts that expected and actual are not equivalent.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that collection contains actual as an item.
+
+ IEnumerable of objects to be considered
+ Object to be found within collection
+
+
+
+ Asserts that collection contains actual as an item.
+
+ IEnumerable of objects to be considered
+ Object to be found within collection
+ The message that will be displayed on failure
+
+
+
+ Asserts that collection contains actual as an item.
+
+ IEnumerable of objects to be considered
+ Object to be found within collection
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that collection does not contain actual as an item.
+
+ IEnumerable of objects to be considered
+ Object that cannot exist within collection
+
+
+
+ Asserts that collection does not contain actual as an item.
+
+ IEnumerable of objects to be considered
+ Object that cannot exist within collection
+ The message that will be displayed on failure
+
+
+
+ Asserts that collection does not contain actual as an item.
+
+ IEnumerable of objects to be considered
+ Object that cannot exist within collection
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that superset is not a subject of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+
+
+
+ Asserts that superset is not a subject of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+ The message that will be displayed on failure
+
+
+
+ Asserts that superset is not a subject of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that superset is a subset of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+
+
+
+ Asserts that superset is a subset of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+ The message that will be displayed on failure
+
+
+
+ Asserts that superset is a subset of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+
+
+
+ Assert that an array,list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+
+
+
+ Assert that an array,list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+ A custom comparer to perform the comparisons
+ The message to be displayed on failure
+ Arguments to be used in formatting the message
+
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+ A custom comparer to perform the comparisons
+ The message to be displayed on failure
+
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+ A custom comparer to perform the comparisons
+
+
+
+ Helper class with properties and methods that supply
+ a number of constraints used in Asserts.
+
+
+
+
+ Returns a new CollectionContainsConstraint checking for the
+ presence of a particular object in the collection.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+
+ Summary description for DirectoryAssert
+
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+
+ We don't actually want any instances of this object, but some people
+ like to inherit from it to add other static methods. Hence, the
+ protected constructor disallows any instances of this object.
+
+
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+ The message to display if directories are not equal
+
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+ The message to display if directories are not equal
+
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+ The message to display if directories are not equal
+
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+ The message to display if directories are equal
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+ The message to display if directories are equal
+
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+
+
+
+ Summary description for FileAssert.
+
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+
+ We don't actually want any instances of this object, but some people
+ like to inherit from it to add other static methods. Hence, the
+ protected constructor disallows any instances of this object.
+
+
+
+
+ Verifies that two Streams are equal. Two Streams are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The expected Stream
+ The actual Stream
+ The message to display if Streams are not equal
+ Arguments to be used in formatting the message
+
+
+
+ Verifies that two Streams are equal. Two Streams are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The expected Stream
+ The actual Stream
+ The message to display if objects are not equal
+
+
+
+ Verifies that two Streams are equal. Two Streams are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The expected Stream
+ The actual Stream
+
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+ The message to display if Streams are not equal
+ Arguments to be used in formatting the message
+
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+ The message to display if objects are not equal
+
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+ The message to display if Streams are not equal
+ Arguments to be used in formatting the message
+
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+ The message to display if objects are not equal
+
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+
+
+
+ Asserts that two Streams are not equal. If they are equal
+ an is thrown.
+
+ The expected Stream
+ The actual Stream
+ The message to be displayed when the two Stream are the same.
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that two Streams are not equal. If they are equal
+ an is thrown.
+
+ The expected Stream
+ The actual Stream
+ The message to be displayed when the Streams are the same.
+
+
+
+ Asserts that two Streams are not equal. If they are equal
+ an is thrown.
+
+ The expected Stream
+ The actual Stream
+
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+ The message to display if Streams are not equal
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+ The message to display if objects are not equal
+
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+ The message to display if Streams are not equal
+ Arguments to be used in formatting the message
+
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+ The message to display if objects are not equal
+
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+
+
+
+ GlobalSettings is a place for setting default values used
+ by the framework in performing asserts.
+
+
+
+
+ Default tolerance for floating point equality
+
+
+
+
+ Class used to guard against unexpected argument values
+ by throwing an appropriate exception.
+
+
+
+
+ Throws an exception if an argument is null
+
+ The value to be tested
+ The name of the argument
+
+
+
+ Throws an exception if a string argument is null or empty
+
+ The value to be tested
+ The name of the argument
+
+
+
+ Helper class with properties and methods that supply
+ a number of constraints used in Asserts.
+
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding only if a specified number of them succeed.
+
+
+
+
+ Returns a new PropertyConstraintExpression, which will either
+ test for the existence of the named property on the object
+ being tested or apply any following constraint to that property.
+
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+
+ Returns a new CollectionContainsConstraint checking for the
+ presence of a particular object in the collection.
+
+
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them succeed.
+
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if at least one of them succeeds.
+
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them fail.
+
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Length property of the object being tested.
+
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Count property of the object being tested.
+
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Message property of the object being tested.
+
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the InnerException property of the object being tested.
+
+
+
+
+ Interface implemented by a user fixture in order to
+ validate any expected exceptions. It is only called
+ for test methods marked with the ExpectedException
+ attribute.
+
+
+
+
+ Method to handle an expected exception
+
+ The exception to be handled
+
+
+
+ Helper class with properties and methods that supply
+ a number of constraints used in Asserts.
+
+
+
+
+ Returns a constraint that tests two items for equality
+
+
+
+
+ Returns a constraint that tests that two references are the same object
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a collection containing the same elements as the
+ collection supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a subset of the collection supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the regular expression supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same as an expected path after canonicalization.
+
+
+
+
+ Returns a constraint that tests whether the path provided
+ is under an expected path after canonicalization.
+
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+
+ Returns a constraint that tests whether the actual value falls
+ within a specified range.
+
+
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them succeed.
+
+
+
+
+ Returns a constraint that tests for null
+
+
+
+
+ Returns a constraint that tests for True
+
+
+
+
+ Returns a constraint that tests for False
+
+
+
+
+ Returns a constraint that tests for a positive value
+
+
+
+
+ Returns a constraint that tests for a negative value
+
+
+
+
+ Returns a constraint that tests for NaN
+
+
+
+
+ Returns a constraint that tests for empty
+
+
+
+
+ Returns a constraint that tests whether a collection
+ contains all unique items.
+
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in binary format.
+
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in xml format.
+
+
+
+
+ Returns a constraint that tests whether a collection is ordered
+
+
+
+
+ The ITestCaseData interface is implemented by a class
+ that is able to return complete testcases for use by
+ a parameterized test method.
+
+ NOTE: This interface is used in both the framework
+ and the core, even though that results in two different
+ types. However, sharing the source code guarantees that
+ the various implementations will be compatible and that
+ the core is able to reflect successfully over the
+ framework implementations of ITestCaseData.
+
+
+
+
+ Gets the argument list to be provided to the test
+
+
+
+
+ Gets the expected result
+
+
+
+
+ Indicates whether a result has been specified.
+ This is necessary because the result may be
+ null, so it's value cannot be checked.
+
+
+
+
+ Gets the expected exception Type
+
+
+
+
+ Gets the FullName of the expected exception
+
+
+
+
+ Gets the name to be used for the test
+
+
+
+
+ Gets the description of the test
+
+
+
+
+ Gets a value indicating whether this is ignored.
+
+ true if ignored; otherwise, false.
+
+
+
+ Gets a value indicating whether this is explicit.
+
+ true if explicit; otherwise, false.
+
+
+
+ Gets the ignore reason.
+
+ The ignore reason.
+
+
+
+ The Iz class is a synonym for Is intended for use in VB,
+ which regards Is as a keyword.
+
+
+
+
+ The List class is a helper class with properties and methods
+ that supply a number of constraints used with lists and collections.
+
+
+
+
+ List.Map returns a ListMapper, which can be used to map
+ the original collection to another collection.
+
+
+
+
+
+
+ ListMapper is used to transform a collection used as an actual argument
+ producing another collection to be used in the assertion.
+
+
+
+
+ Construct a ListMapper based on a collection
+
+ The collection to be transformed
+
+
+
+ Produces a collection containing all the values of a property
+
+ The collection of property values
+
+
+
+
+ Randomizer returns a set of random values in a repeatable
+ way, to allow re-running of tests if necessary.
+
+
+
+
+ Get a randomizer for a particular member, returning
+ one that has already been created if it exists.
+ This ensures that the same values are generated
+ each time the tests are reloaded.
+
+
+
+
+ Get a randomizer for a particular parameter, returning
+ one that has already been created if it exists.
+ This ensures that the same values are generated
+ each time the tests are reloaded.
+
+
+
+
+ Construct a randomizer using a random seed
+
+
+
+
+ Construct a randomizer using a specified seed
+
+
+
+
+ Return an array of random doubles between 0.0 and 1.0.
+
+
+
+
+
+
+ Return an array of random doubles with values in a specified range.
+
+
+
+
+ Return an array of random ints with values in a specified range.
+
+
+
+
+ Get a random seed for use in creating a randomizer.
+
+
+
+
+ The SpecialValue enum is used to represent TestCase arguments
+ that cannot be used as arguments to an Attribute.
+
+
+
+
+ Null represents a null value, which cannot be used as an
+ argument to an attribute under .NET 1.x
+
+
+
+
+ Basic Asserts on strings.
+
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+
+ Asserts that a string is found within another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+
+ Asserts that a string is found within another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+
+ Asserts that a string is found within another string.
+
+ The expected string
+ The string to be examined
+
+
+
+ Asserts that a string is not found within another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+
+ Asserts that a string is found within another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+
+ Asserts that a string is found within another string.
+
+ The expected string
+ The string to be examined
+
+
+
+ Asserts that a string starts with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+
+ Asserts that a string starts with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+
+ Asserts that a string starts with another string.
+
+ The expected string
+ The string to be examined
+
+
+
+ Asserts that a string does not start with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+
+ Asserts that a string does not start with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+
+ Asserts that a string does not start with another string.
+
+ The expected string
+ The string to be examined
+
+
+
+ Asserts that a string ends with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+
+ Asserts that a string ends with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+
+ Asserts that a string ends with another string.
+
+ The expected string
+ The string to be examined
+
+
+
+ Asserts that a string does not end with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+
+ Asserts that a string does not end with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+
+ Asserts that a string does not end with another string.
+
+ The expected string
+ The string to be examined
+
+
+
+ Asserts that two strings are equal, without regard to case.
+
+ The expected string
+ The actual string
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+
+ Asserts that two strings are equal, without regard to case.
+
+ The expected string
+ The actual string
+ The message to display in case of failure
+
+
+
+ Asserts that two strings are equal, without regard to case.
+
+ The expected string
+ The actual string
+
+
+
+ Asserts that two strings are not equal, without regard to case.
+
+ The expected string
+ The actual string
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+
+ Asserts that two strings are Notequal, without regard to case.
+
+ The expected string
+ The actual string
+ The message to display in case of failure
+
+
+
+ Asserts that two strings are not equal, without regard to case.
+
+ The expected string
+ The actual string
+
+
+
+ Asserts that a string matches an expected regular expression pattern.
+
+ The regex pattern to be matched
+ The actual string
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+
+ Asserts that a string matches an expected regular expression pattern.
+
+ The regex pattern to be matched
+ The actual string
+ The message to display in case of failure
+
+
+
+ Asserts that a string matches an expected regular expression pattern.
+
+ The regex pattern to be matched
+ The actual string
+
+
+
+ Asserts that a string does not match an expected regular expression pattern.
+
+ The regex pattern to be used
+ The actual string
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+
+ Asserts that a string does not match an expected regular expression pattern.
+
+ The regex pattern to be used
+ The actual string
+ The message to display in case of failure
+
+
+
+ Asserts that a string does not match an expected regular expression pattern.
+
+ The regex pattern to be used
+ The actual string
+
+
+
+ The TestCaseData class represents a set of arguments
+ and other parameter info to be used for a parameterized
+ test case. It provides a number of instance modifiers
+ for use in initializing the test case.
+
+ Note: Instance modifiers are getters that return
+ the same instance after modifying it's state.
+
+
+
+
+ The argument list to be provided to the test
+
+
+
+
+ The expected result to be returned
+
+
+
+
+ Set to true if this has an expected result
+
+
+
+
+ The expected exception Type
+
+
+
+
+ The FullName of the expected exception
+
+
+
+
+ The name to be used for the test
+
+
+
+
+ The description of the test
+
+
+
+
+ A dictionary of properties, used to add information
+ to tests without requiring the class to change.
+
+
+
+
+ If true, indicates that the test case is to be ignored
+
+
+
+
+ If true, indicates that the test case is marked explicit
+
+
+
+
+ The reason for ignoring a test case
+
+
+
+
+ Initializes a new instance of the class.
+
+ The arguments.
+
+
+
+ Initializes a new instance of the class.
+
+ The argument.
+
+
+
+ Initializes a new instance of the class.
+
+ The first argument.
+ The second argument.
+
+
+
+ Initializes a new instance of the class.
+
+ The first argument.
+ The second argument.
+ The third argument.
+
+
+
+ Sets the expected result for the test
+
+ The expected result
+ A modified TestCaseData
+
+
+
+ Sets the expected exception type for the test
+
+ Type of the expected exception.
+ The modified TestCaseData instance
+
+
+
+ Sets the expected exception type for the test
+
+ FullName of the expected exception.
+ The modified TestCaseData instance
+
+
+
+ Sets the name of the test case
+
+ The modified TestCaseData instance
+
+
+
+ Sets the description for the test case
+ being constructed.
+
+ The description.
+ The modified TestCaseData instance.
+
+
+
+ Applies a category to the test
+
+
+
+
+
+
+ Applies a named property to the test
+
+
+
+
+
+
+
+ Applies a named property to the test
+
+
+
+
+
+
+
+ Applies a named property to the test
+
+
+
+
+
+
+
+ Ignores this TestCase.
+
+
+
+
+
+ Ignores this TestCase, specifying the reason.
+
+ The reason.
+
+
+
+
+ Marks this TestCase as Explicit
+
+
+
+
+
+ Marks this TestCase as Explicit, specifying the reason.
+
+ The reason.
+
+
+
+
+ Gets the argument list to be provided to the test
+
+
+
+
+ Gets the expected result
+
+
+
+
+ Returns true if the result has been set
+
+
+
+
+ Gets the expected exception Type
+
+
+
+
+ Gets the FullName of the expected exception
+
+
+
+
+ Gets the name to be used for the test
+
+
+
+
+ Gets the description of the test
+
+
+
+
+ Gets a value indicating whether this is ignored.
+
+ true if ignored; otherwise, false.
+
+
+
+ Gets a value indicating whether this is explicit.
+
+ true if explicit; otherwise, false.
+
+
+
+ Gets the ignore reason.
+
+ The ignore reason.
+
+
+
+ Gets a list of categories associated with this test.
+
+
+
+
+ Gets the property dictionary for this test
+
+
+
+
+ Provide the context information of the current test
+
+
+
+
+ Constructs a TestContext using the provided context dictionary
+
+ A context dictionary
+
+
+
+ Get the current test context. This is created
+ as needed. The user may save the context for
+ use within a test, but it should not be used
+ outside the test for which it is created.
+
+
+
+
+ Gets a TestAdapter representing the currently executing test in this context.
+
+
+
+
+ Gets a ResultAdapter representing the current result for the test
+ executing in this context.
+
+
+
+
+ Gets the directory containing the current test assembly.
+
+
+
+
+ Gets the directory to be used for outputing files created
+ by this test run.
+
+
+
+
+ TestAdapter adapts a Test for consumption by
+ the user test code.
+
+
+
+
+ Constructs a TestAdapter for this context
+
+ The context dictionary
+
+
+
+ The name of the test.
+
+
+
+
+ The FullName of the test
+
+
+
+
+ The properties of the test.
+
+
+
+
+ ResultAdapter adapts a TestResult for consumption by
+ the user test code.
+
+
+
+
+ Construct a ResultAdapter for a context
+
+ The context holding the result
+
+
+
+ The TestState of current test. This maps to the ResultState
+ used in nunit.core and is subject to change in the future.
+
+
+
+
+ The TestStatus of current test. This enum will be used
+ in future versions of NUnit and so is to be preferred
+ to the TestState value.
+
+
+
+
+ Provides details about a test
+
+
+
+
+ Creates an instance of TestDetails
+
+ The fixture that the test is a member of, if available.
+ The method that implements the test, if available.
+ The full name of the test.
+ A string representing the type of test, e.g. "Test Case".
+ Indicates if the test represents a suite of tests.
+
+
+
+ The fixture that the test is a member of, if available.
+
+
+
+
+ The method that implements the test, if available.
+
+
+
+
+ The full name of the test.
+
+
+
+
+ A string representing the type of test, e.g. "Test Case".
+
+
+
+
+ Indicates if the test represents a suite of tests.
+
+
+
+
+ The ResultState enum indicates the result of running a test
+
+
+
+
+ The result is inconclusive
+
+
+
+
+ The test was not runnable.
+
+
+
+
+ The test has been skipped.
+
+
+
+
+ The test has been ignored.
+
+
+
+
+ The test succeeded
+
+
+
+
+ The test failed
+
+
+
+
+ The test encountered an unexpected exception
+
+
+
+
+ The test was cancelled by the user
+
+
+
+
+ The TestStatus enum indicates the result of running a test
+
+
+
+
+ The test was inconclusive
+
+
+
+
+ The test has skipped
+
+
+
+
+ The test succeeded
+
+
+
+
+ The test failed
+
+
+
+
+ Helper class with static methods used to supply constraints
+ that operate on strings.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that fails if the actual
+ value contains the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that fails if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that fails if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the Regex pattern supplied as an argument.
+
+
+
+
+ Returns a constraint that fails if the actual
+ value matches the pattern supplied as an argument.
+
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them succeed.
+
+
+
+
+ TextMessageWriter writes constraint descriptions and messages
+ in displayable form as a text stream. It tailors the display
+ of individual message components to form the standard message
+ format of NUnit assertion failure messages.
+
+
+
+
+ MessageWriter is the abstract base for classes that write
+ constraint descriptions and messages in some form. The
+ class has separate methods for writing various components
+ of a message, allowing implementations to tailor the
+ presentation as needed.
+
+
+
+
+ Construct a MessageWriter given a culture
+
+
+
+
+ Method to write single line message with optional args, usually
+ written to precede the general failure message.
+
+ The message to be written
+ Any arguments used in formatting the message
+
+
+
+ Method to write single line message with optional args, usually
+ written to precede the general failure message, at a givel
+ indentation level.
+
+ The indentation level of the message
+ The message to be written
+ Any arguments used in formatting the message
+
+
+
+ Display Expected and Actual lines for a constraint. This
+ is called by MessageWriter's default implementation of
+ WriteMessageTo and provides the generic two-line display.
+
+ The constraint that failed
+
+
+
+ Display Expected and Actual lines for given values. This
+ method may be called by constraints that need more control over
+ the display of actual and expected values than is provided
+ by the default implementation.
+
+ The expected value
+ The actual value causing the failure
+
+
+
+ Display Expected and Actual lines for given values, including
+ a tolerance value on the Expected line.
+
+ The expected value
+ The actual value causing the failure
+ The tolerance within which the test was made
+
+
+
+ Display the expected and actual string values on separate lines.
+ If the mismatch parameter is >=0, an additional line is displayed
+ line containing a caret that points to the mismatch point.
+
+ The expected string value
+ The actual string value
+ The point at which the strings don't match or -1
+ If true, case is ignored in locating the point where the strings differ
+ If true, the strings should be clipped to fit the line
+
+
+
+ Writes the text for a connector.
+
+ The connector.
+
+
+
+ Writes the text for a predicate.
+
+ The predicate.
+
+
+
+ Writes the text for an expected value.
+
+ The expected value.
+
+
+
+ Writes the text for a modifier
+
+ The modifier.
+
+
+
+ Writes the text for an actual value.
+
+ The actual value.
+
+
+
+ Writes the text for a generalized value.
+
+ The value.
+
+
+
+ Writes the text for a collection value,
+ starting at a particular point, to a max length
+
+ The collection containing elements to write.
+ The starting point of the elements to write
+ The maximum number of elements to write
+
+
+
+ Abstract method to get the max line length
+
+
+
+
+ Prefix used for the expected value line of a message
+
+
+
+
+ Prefix used for the actual value line of a message
+
+
+
+
+ Length of a message prefix
+
+
+
+
+ Construct a TextMessageWriter
+
+
+
+
+ Construct a TextMessageWriter, specifying a user message
+ and optional formatting arguments.
+
+
+
+
+
+
+ Method to write single line message with optional args, usually
+ written to precede the general failure message, at a givel
+ indentation level.
+
+ The indentation level of the message
+ The message to be written
+ Any arguments used in formatting the message
+
+
+
+ Display Expected and Actual lines for a constraint. This
+ is called by MessageWriter's default implementation of
+ WriteMessageTo and provides the generic two-line display.
+
+ The constraint that failed
+
+
+
+ Display Expected and Actual lines for given values. This
+ method may be called by constraints that need more control over
+ the display of actual and expected values than is provided
+ by the default implementation.
+
+ The expected value
+ The actual value causing the failure
+
+
+
+ Display Expected and Actual lines for given values, including
+ a tolerance value on the expected line.
+
+ The expected value
+ The actual value causing the failure
+ The tolerance within which the test was made
+
+
+
+ Display the expected and actual string values on separate lines.
+ If the mismatch parameter is >=0, an additional line is displayed
+ line containing a caret that points to the mismatch point.
+
+ The expected string value
+ The actual string value
+ The point at which the strings don't match or -1
+ If true, case is ignored in string comparisons
+ If true, clip the strings to fit the max line length
+
+
+
+ Writes the text for a connector.
+
+ The connector.
+
+
+
+ Writes the text for a predicate.
+
+ The predicate.
+
+
+
+ Write the text for a modifier.
+
+ The modifier.
+
+
+
+ Writes the text for an expected value.
+
+ The expected value.
+
+
+
+ Writes the text for an actual value.
+
+ The actual value.
+
+
+
+ Writes the text for a generalized value.
+
+ The value.
+
+
+
+ Writes the text for a collection value,
+ starting at a particular point, to a max length
+
+ The collection containing elements to write.
+ The starting point of the elements to write
+ The maximum number of elements to write
+
+
+
+ Write the generic 'Expected' line for a constraint
+
+ The constraint that failed
+
+
+
+ Write the generic 'Expected' line for a given value
+
+ The expected value
+
+
+
+ Write the generic 'Expected' line for a given value
+ and tolerance.
+
+ The expected value
+ The tolerance within which the test was made
+
+
+
+ Write the generic 'Actual' line for a constraint
+
+ The constraint for which the actual value is to be written
+
+
+
+ Write the generic 'Actual' line for a given value
+
+ The actual value causing a failure
+
+
+
+ Gets or sets the maximum line length for this writer
+
+
+
+
+ Helper class with properties and methods that supply
+ constraints that operate on exceptions.
+
+
+
+
+ Creates a constraint specifying the exact type of exception expected
+
+
+
+
+ Creates a constraint specifying the exact type of exception expected
+
+
+
+
+ Creates a constraint specifying the type of exception expected
+
+
+
+
+ Creates a constraint specifying the type of exception expected
+
+
+
+
+ Creates a constraint specifying an expected exception
+
+
+
+
+ Creates a constraint specifying an exception with a given InnerException
+
+
+
+
+ Creates a constraint specifying an expected TargetInvocationException
+
+
+
+
+ Creates a constraint specifying an expected TargetInvocationException
+
+
+
+
+ Creates a constraint specifying an expected TargetInvocationException
+
+
+
+
+ Creates a constraint specifying that no exception is thrown
+
+
+
+
+ Attribute used to apply a category to a test
+
+
+
+
+ The name of the category
+
+
+
+
+ Construct attribute for a given category based on
+ a name. The name may not contain the characters ',',
+ '+', '-' or '!'. However, this is not checked in the
+ constructor since it would cause an error to arise at
+ as the test was loaded without giving a clear indication
+ of where the problem is located. The error is handled
+ in NUnitFramework.cs by marking the test as not
+ runnable.
+
+ The name of the category
+
+
+
+ Protected constructor uses the Type name as the name
+ of the category.
+
+
+
+
+ The name of the category
+
+
+
+
+ Used to mark a field for use as a datapoint when executing a theory
+ within the same fixture that requires an argument of the field's Type.
+
+
+
+
+ Used to mark an array as containing a set of datapoints to be used
+ executing a theory within the same fixture that requires an argument
+ of the Type of the array elements.
+
+
+
+
+ Attribute used to provide descriptive text about a
+ test case or fixture.
+
+
+
+
+ Construct the attribute
+
+ Text describing the test
+
+
+
+ Gets the test description
+
+
+
+
+ Enumeration indicating how the expected message parameter is to be used
+
+
+
+ Expect an exact match
+
+
+ Expect a message containing the parameter string
+
+
+ Match the regular expression provided as a parameter
+
+
+ Expect a message that starts with the parameter string
+
+
+
+ ExpectedExceptionAttribute
+
+
+
+
+
+ Constructor for a non-specific exception
+
+
+
+
+ Constructor for a given type of exception
+
+ The type of the expected exception
+
+
+
+ Constructor for a given exception name
+
+ The full name of the expected exception
+
+
+
+ Gets or sets the expected exception type
+
+
+
+
+ Gets or sets the full Type name of the expected exception
+
+
+
+
+ Gets or sets the expected message text
+
+
+
+
+ Gets or sets the user message displayed in case of failure
+
+
+
+
+ Gets or sets the type of match to be performed on the expected message
+
+
+
+
+ Gets the name of a method to be used as an exception handler
+
+
+
+
+ ExplicitAttribute marks a test or test fixture so that it will
+ only be run if explicitly executed from the gui or command line
+ or if it is included by use of a filter. The test will not be
+ run simply because an enclosing suite is run.
+
+
+
+
+ Default constructor
+
+
+
+
+ Constructor with a reason
+
+ The reason test is marked explicit
+
+
+
+ The reason test is marked explicit
+
+
+
+
+ Attribute used to mark a test that is to be ignored.
+ Ignored tests result in a warning message when the
+ tests are run.
+
+
+
+
+ Constructs the attribute without giving a reason
+ for ignoring the test.
+
+
+
+
+ Constructs the attribute giving a reason for ignoring the test
+
+ The reason for ignoring the test
+
+
+
+ The reason for ignoring a test
+
+
+
+
+ Abstract base for Attributes that are used to include tests
+ in the test run based on environmental settings.
+
+
+
+
+ Constructor with no included items specified, for use
+ with named property syntax.
+
+
+
+
+ Constructor taking one or more included items
+
+ Comma-delimited list of included items
+
+
+
+ Name of the item that is needed in order for
+ a test to run. Multiple itemss may be given,
+ separated by a comma.
+
+
+
+
+ Name of the item to be excluded. Multiple items
+ may be given, separated by a comma.
+
+
+
+
+ The reason for including or excluding the test
+
+
+
+
+ PlatformAttribute is used to mark a test fixture or an
+ individual method as applying to a particular platform only.
+
+
+
+
+ Constructor with no platforms specified, for use
+ with named property syntax.
+
+
+
+
+ Constructor taking one or more platforms
+
+ Comma-deliminted list of platforms
+
+
+
+ CultureAttribute is used to mark a test fixture or an
+ individual method as applying to a particular Culture only.
+
+
+
+
+ Constructor with no cultures specified, for use
+ with named property syntax.
+
+
+
+
+ Constructor taking one or more cultures
+
+ Comma-deliminted list of cultures
+
+
+
+ Marks a test to use a combinatorial join of any argument data
+ provided. NUnit will create a test case for every combination of
+ the arguments provided. This can result in a large number of test
+ cases and so should be used judiciously. This is the default join
+ type, so the attribute need not be used except as documentation.
+
+
+
+
+ PropertyAttribute is used to attach information to a test as a name/value pair..
+
+
+
+
+ Construct a PropertyAttribute with a name and string value
+
+ The name of the property
+ The property value
+
+
+
+ Construct a PropertyAttribute with a name and int value
+
+ The name of the property
+ The property value
+
+
+
+ Construct a PropertyAttribute with a name and double value
+
+ The name of the property
+ The property value
+
+
+
+ Constructor for derived classes that set the
+ property dictionary directly.
+
+
+
+
+ Constructor for use by derived classes that use the
+ name of the type as the property name. Derived classes
+ must ensure that the Type of the property value is
+ a standard type supported by the BCL. Any custom
+ types will cause a serialization Exception when
+ in the client.
+
+
+
+
+ Gets the property dictionary for this attribute
+
+
+
+
+ Default constructor
+
+
+
+
+ Marks a test to use pairwise join of any argument data provided.
+ NUnit will attempt too excercise every pair of argument values at
+ least once, using as small a number of test cases as it can. With
+ only two arguments, this is the same as a combinatorial join.
+
+
+
+
+ Default constructor
+
+
+
+
+ Marks a test to use a sequential join of any argument data
+ provided. NUnit will use arguements for each parameter in
+ sequence, generating test cases up to the largest number
+ of argument values provided and using null for any arguments
+ for which it runs out of values. Normally, this should be
+ used with the same number of arguments for each parameter.
+
+
+
+
+ Default constructor
+
+
+
+
+ Summary description for MaxTimeAttribute.
+
+
+
+
+ Construct a MaxTimeAttribute, given a time in milliseconds.
+
+ The maximum elapsed time in milliseconds
+
+
+
+ RandomAttribute is used to supply a set of random values
+ to a single parameter of a parameterized test.
+
+
+
+
+ ValuesAttribute is used to provide literal arguments for
+ an individual parameter of a test.
+
+
+
+
+ Abstract base class for attributes that apply to parameters
+ and supply data for the parameter.
+
+
+
+
+ Gets the data to be provided to the specified parameter
+
+
+
+
+ The collection of data to be returned. Must
+ be set by any derived attribute classes.
+ We use an object[] so that the individual
+ elements may have their type changed in GetData
+ if necessary.
+
+
+
+
+ Construct with one argument
+
+
+
+
+
+ Construct with two arguments
+
+
+
+
+
+
+ Construct with three arguments
+
+
+
+
+
+
+
+ Construct with an array of arguments
+
+
+
+
+
+ Get the collection of values to be used as arguments
+
+
+
+
+ Construct a set of doubles from 0.0 to 1.0,
+ specifying only the count.
+
+
+
+
+
+ Construct a set of doubles from min to max
+
+
+
+
+
+
+
+ Construct a set of ints from min to max
+
+
+
+
+
+
+
+ Get the collection of values to be used as arguments
+
+
+
+
+ RangeAttribute is used to supply a range of values to an
+ individual parameter of a parameterized test.
+
+
+
+
+ Construct a range of ints using default step of 1
+
+
+
+
+
+
+ Construct a range of ints specifying the step size
+
+
+
+
+
+
+
+ Construct a range of longs
+
+
+
+
+
+
+
+ Construct a range of doubles
+
+
+
+
+
+
+
+ Construct a range of floats
+
+
+
+
+
+
+
+ RepeatAttribute may be applied to test case in order
+ to run it multiple times.
+
+
+
+
+ Construct a RepeatAttribute
+
+ The number of times to run the test
+
+
+
+ RequiredAddinAttribute may be used to indicate the names of any addins
+ that must be present in order to run some or all of the tests in an
+ assembly. If the addin is not loaded, the entire assembly is marked
+ as NotRunnable.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The required addin.
+
+
+
+ Gets the name of required addin.
+
+ The required addin name.
+
+
+
+ Summary description for SetCultureAttribute.
+
+
+
+
+ Construct given the name of a culture
+
+
+
+
+
+ Summary description for SetUICultureAttribute.
+
+
+
+
+ Construct given the name of a culture
+
+
+
+
+
+ SetUpAttribute is used in a TestFixture to identify a method
+ that is called immediately before each test is run. It is
+ also used in a SetUpFixture to identify the method that is
+ called once, before any of the subordinate tests are run.
+
+
+
+
+ Attribute used to mark a class that contains one-time SetUp
+ and/or TearDown methods that apply to all the tests in a
+ namespace or an assembly.
+
+
+
+
+ Attribute used to mark a static (shared in VB) property
+ that returns a list of tests.
+
+
+
+
+ Attribute used in a TestFixture to identify a method that is
+ called immediately after each test is run. It is also used
+ in a SetUpFixture to identify the method that is called once,
+ after all subordinate tests have run. In either case, the method
+ is guaranteed to be called, even if an exception is thrown.
+
+
+
+
+ Provide actions to execute before and after tests.
+
+
+
+
+ When implemented by an attribute, this interface implemented to provide actions to execute before and after tests.
+
+
+
+
+ Executed before each test is run
+
+ Provides details about the test that is going to be run.
+
+
+
+ Executed after each test is run
+
+ Provides details about the test that has just been run.
+
+
+
+ Provides the target for the action attribute
+
+ The target for the action attribute
+
+
+
+ Adding this attribute to a method within a
+ class makes the method callable from the NUnit test runner. There is a property
+ called Description which is optional which you can provide a more detailed test
+ description. This class cannot be inherited.
+
+
+
+ [TestFixture]
+ public class Fixture
+ {
+ [Test]
+ public void MethodToTest()
+ {}
+
+ [Test(Description = "more detailed description")]
+ publc void TestDescriptionMethod()
+ {}
+ }
+
+
+
+
+
+ Descriptive text for this test
+
+
+
+
+ TestCaseAttribute is used to mark parameterized test cases
+ and provide them with their arguments.
+
+
+
+
+ Construct a TestCaseAttribute with a list of arguments.
+ This constructor is not CLS-Compliant
+
+
+
+
+
+ Construct a TestCaseAttribute with a single argument
+
+
+
+
+
+ Construct a TestCaseAttribute with a two arguments
+
+
+
+
+
+
+ Construct a TestCaseAttribute with a three arguments
+
+
+
+
+
+
+
+ Gets the list of arguments to a test case
+
+
+
+
+ Gets or sets the expected result. Use
+ ExpectedResult by preference.
+
+ The result.
+
+
+
+ Gets or sets the expected result.
+
+ The result.
+
+
+
+ Gets a flag indicating whether an expected
+ result has been set.
+
+
+
+
+ Gets a list of categories associated with this test;
+
+
+
+
+ Gets or sets the category associated with this test.
+ May be a single category or a comma-separated list.
+
+
+
+
+ Gets or sets the expected exception.
+
+ The expected exception.
+
+
+
+ Gets or sets the name the expected exception.
+
+ The expected name of the exception.
+
+
+
+ Gets or sets the expected message of the expected exception
+
+ The expected message of the exception.
+
+
+
+ Gets or sets the type of match to be performed on the expected message
+
+
+
+
+ Gets or sets the description.
+
+ The description.
+
+
+
+ Gets or sets the name of the test.
+
+ The name of the test.
+
+
+
+ Gets or sets the ignored status of the test
+
+
+
+
+ Gets or sets the ignored status of the test
+
+
+
+
+ Gets or sets the explicit status of the test
+
+
+
+
+ Gets or sets the reason for not running the test
+
+
+
+
+ Gets or sets the reason for not running the test.
+ Set has the side effect of marking the test as ignored.
+
+ The ignore reason.
+
+
+
+ FactoryAttribute indicates the source to be used to
+ provide test cases for a test method.
+
+
+
+
+ Construct with the name of the data source, which must
+ be a property, field or method of the test class itself.
+
+ An array of the names of the factories that will provide data
+
+
+
+ Construct with a Type, which must implement IEnumerable
+
+ The Type that will provide data
+
+
+
+ Construct with a Type and name.
+ that don't support params arrays.
+
+ The Type that will provide data
+ The name of the method, property or field that will provide data
+
+
+
+ The name of a the method, property or fiend to be used as a source
+
+
+
+
+ A Type to be used as a source
+
+
+
+
+ Gets or sets the category associated with this test.
+ May be a single category or a comma-separated list.
+
+
+
+
+ [TestFixture]
+ public class ExampleClass
+ {}
+
+
+
+
+ Default constructor
+
+
+
+
+ Construct with a object[] representing a set of arguments.
+ In .NET 2.0, the arguments may later be separated into
+ type arguments and constructor arguments.
+
+
+
+
+
+ Descriptive text for this fixture
+
+
+
+
+ Gets and sets the category for this fixture.
+ May be a comma-separated list of categories.
+
+
+
+
+ Gets a list of categories for this fixture
+
+
+
+
+ The arguments originally provided to the attribute
+
+
+
+
+ Gets or sets a value indicating whether this should be ignored.
+
+ true if ignore; otherwise, false.
+
+
+
+ Gets or sets the ignore reason. May set Ignored as a side effect.
+
+ The ignore reason.
+
+
+
+ Get or set the type arguments. If not set
+ explicitly, any leading arguments that are
+ Types are taken as type arguments.
+
+
+
+
+ Attribute used to identify a method that is
+ called before any tests in a fixture are run.
+
+
+
+
+ Attribute used to identify a method that is called after
+ all the tests in a fixture have run. The method is
+ guaranteed to be called, even if an exception is thrown.
+
+
+
+
+ Adding this attribute to a method within a
+ class makes the method callable from the NUnit test runner. There is a property
+ called Description which is optional which you can provide a more detailed test
+ description. This class cannot be inherited.
+
+
+
+ [TestFixture]
+ public class Fixture
+ {
+ [Test]
+ public void MethodToTest()
+ {}
+
+ [Test(Description = "more detailed description")]
+ publc void TestDescriptionMethod()
+ {}
+ }
+
+
+
+
+
+ Used on a method, marks the test with a timeout value in milliseconds.
+ The test will be run in a separate thread and is cancelled if the timeout
+ is exceeded. Used on a method or assembly, sets the default timeout
+ for all contained test methods.
+
+
+
+
+ Construct a TimeoutAttribute given a time in milliseconds
+
+ The timeout value in milliseconds
+
+
+
+ Marks a test that must run in the STA, causing it
+ to run in a separate thread if necessary.
+
+ On methods, you may also use STAThreadAttribute
+ to serve the same purpose.
+
+
+
+
+ Construct a RequiresSTAAttribute
+
+
+
+
+ Marks a test that must run in the MTA, causing it
+ to run in a separate thread if necessary.
+
+ On methods, you may also use MTAThreadAttribute
+ to serve the same purpose.
+
+
+
+
+ Construct a RequiresMTAAttribute
+
+
+
+
+ Marks a test that must run on a separate thread.
+
+
+
+
+ Construct a RequiresThreadAttribute
+
+
+
+
+ Construct a RequiresThreadAttribute, specifying the apartment
+
+
+
+
+ ValueSourceAttribute indicates the source to be used to
+ provide data for one parameter of a test method.
+
+
+
+
+ Construct with the name of the factory - for use with languages
+ that don't support params arrays.
+
+ The name of the data source to be used
+
+
+
+ Construct with a Type and name - for use with languages
+ that don't support params arrays.
+
+ The Type that will provide data
+ The name of the method, property or field that will provide data
+
+
+
+ The name of a the method, property or fiend to be used as a source
+
+
+
+
+ A Type to be used as a source
+
+
+
+
+ AllItemsConstraint applies another constraint to each
+ item in a collection, succeeding if they all succeed.
+
+
+
+
+ Abstract base class used for prefixes
+
+
+
+
+ The Constraint class is the base of all built-in constraints
+ within NUnit. It provides the operator overloads used to combine
+ constraints.
+
+
+
+
+ The IConstraintExpression interface is implemented by all
+ complete and resolvable constraints and expressions.
+
+
+
+
+ Return the top-level constraint for this expression
+
+
+
+
+
+ Static UnsetObject used to detect derived constraints
+ failing to set the actual value.
+
+
+
+
+ The actual value being tested against a constraint
+
+
+
+
+ The display name of this Constraint for use by ToString()
+
+
+
+
+ Argument fields used by ToString();
+
+
+
+
+ The builder holding this constraint
+
+
+
+
+ Construct a constraint with no arguments
+
+
+
+
+ Construct a constraint with one argument
+
+
+
+
+ Construct a constraint with two arguments
+
+
+
+
+ Sets the ConstraintBuilder holding this constraint
+
+
+
+
+ Write the failure message to the MessageWriter provided
+ as an argument. The default implementation simply passes
+ the constraint and the actual value to the writer, which
+ then displays the constraint description and the value.
+
+ Constraints that need to provide additional details,
+ such as where the error occured can override this.
+
+ The MessageWriter on which to display the message
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Test whether the constraint is satisfied by an
+ ActualValueDelegate that returns the value to be tested.
+ The default implementation simply evaluates the delegate
+ but derived classes may override it to provide for delayed
+ processing.
+
+ An
+ True for success, false for failure
+
+
+
+ Test whether the constraint is satisfied by a given reference.
+ The default implementation simply dereferences the value but
+ derived classes may override it to provide for delayed processing.
+
+ A reference to the value to be tested
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+
+ Default override of ToString returns the constraint DisplayName
+ followed by any arguments within angle brackets.
+
+
+
+
+
+ Returns the string representation of this constraint
+
+
+
+
+ This operator creates a constraint that is satisfied only if both
+ argument constraints are satisfied.
+
+
+
+
+ This operator creates a constraint that is satisfied if either
+ of the argument constraints is satisfied.
+
+
+
+
+ This operator creates a constraint that is satisfied if the
+ argument constraint is not satisfied.
+
+
+
+
+ Returns a DelayedConstraint with the specified delay time.
+
+ The delay in milliseconds.
+
+
+
+
+ Returns a DelayedConstraint with the specified delay time
+ and polling interval.
+
+ The delay in milliseconds.
+ The interval at which to test the constraint.
+
+
+
+
+ The display name of this Constraint for use by ToString().
+ The default value is the name of the constraint with
+ trailing "Constraint" removed. Derived classes may set
+ this to another name in their constructors.
+
+
+
+
+ Returns a ConstraintExpression by appending And
+ to the current constraint.
+
+
+
+
+ Returns a ConstraintExpression by appending And
+ to the current constraint.
+
+
+
+
+ Returns a ConstraintExpression by appending Or
+ to the current constraint.
+
+
+
+
+ Class used to detect any derived constraints
+ that fail to set the actual value in their
+ Matches override.
+
+
+
+
+ The base constraint
+
+
+
+
+ Construct given a base constraint
+
+
+
+
+
+ Construct an AllItemsConstraint on top of an existing constraint
+
+
+
+
+
+ Apply the item constraint to each item in the collection,
+ failing if any item fails.
+
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+
+ AndConstraint succeeds only if both members succeed.
+
+
+
+
+ BinaryConstraint is the abstract base of all constraints
+ that combine two other constraints in some fashion.
+
+
+
+
+ The first constraint being combined
+
+
+
+
+ The second constraint being combined
+
+
+
+
+ Construct a BinaryConstraint from two other constraints
+
+ The first constraint
+ The second constraint
+
+
+
+ Create an AndConstraint from two other constraints
+
+ The first constraint
+ The second constraint
+
+
+
+ Apply both member constraints to an actual value, succeeding
+ succeeding only if both of them succeed.
+
+ The actual value
+ True if the constraints both succeeded
+
+
+
+ Write a description for this contraint to a MessageWriter
+
+ The MessageWriter to receive the description
+
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+
+ AssignableFromConstraint is used to test that an object
+ can be assigned from a given Type.
+
+
+
+
+ TypeConstraint is the abstract base for constraints
+ that take a Type as their expected value.
+
+
+
+
+ The expected Type used by the constraint
+
+
+
+
+ Construct a TypeConstraint for a given Type
+
+
+
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. TypeConstraints override this method to write
+ the name of the type.
+
+ The writer on which the actual value is displayed
+
+
+
+ Construct an AssignableFromConstraint for the type provided
+
+
+
+
+
+ Test whether an object can be assigned from the specified type
+
+ The object to be tested
+ True if the object can be assigned a value of the expected Type, otherwise false.
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+ The MessageWriter to use
+
+
+
+ AssignableToConstraint is used to test that an object
+ can be assigned to a given Type.
+
+
+
+
+ Construct an AssignableToConstraint for the type provided
+
+
+
+
+
+ Test whether an object can be assigned to the specified type
+
+ The object to be tested
+ True if the object can be assigned a value of the expected Type, otherwise false.
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+ The MessageWriter to use
+
+
+
+ AttributeConstraint tests that a specified attribute is present
+ on a Type or other provider and that the value of the attribute
+ satisfies some other constraint.
+
+
+
+
+ Constructs an AttributeConstraint for a specified attriute
+ Type and base constraint.
+
+
+
+
+
+
+ Determines whether the Type or other provider has the
+ expected attribute and if its value matches the
+ additional constraint specified.
+
+
+
+
+ Writes a description of the attribute to the specified writer.
+
+
+
+
+ Writes the actual value supplied to the specified writer.
+
+
+
+
+ Returns a string representation of the constraint.
+
+
+
+
+ AttributeExistsConstraint tests for the presence of a
+ specified attribute on a Type.
+
+
+
+
+ Constructs an AttributeExistsConstraint for a specific attribute Type
+
+
+
+
+
+ Tests whether the object provides the expected attribute.
+
+ A Type, MethodInfo, or other ICustomAttributeProvider
+ True if the expected attribute is present, otherwise false
+
+
+
+ Writes the description of the constraint to the specified writer
+
+
+
+
+ BasicConstraint is the abstract base for constraints that
+ perform a simple comparison to a constant value.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The expected.
+ The description.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ BinarySerializableConstraint tests whether
+ an object is serializable in binary format.
+
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+
+ Returns the string representation
+
+
+
+
+ CollectionConstraint is the abstract base class for
+ constraints that operate on collections.
+
+
+
+
+ Construct an empty CollectionConstraint
+
+
+
+
+ Construct a CollectionConstraint
+
+
+
+
+
+ Determines whether the specified enumerable is empty.
+
+ The enumerable.
+
+ true if the specified enumerable is empty; otherwise, false.
+
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Protected method to be implemented by derived classes
+
+
+
+
+
+
+ CollectionContainsConstraint is used to test whether a collection
+ contains an expected object as a member.
+
+
+
+
+ CollectionItemsEqualConstraint is the abstract base class for all
+ collection constraints that apply some notion of item equality
+ as a part of their operation.
+
+
+
+
+ Construct an empty CollectionConstraint
+
+
+
+
+ Construct a CollectionConstraint
+
+
+
+
+
+ Flag the constraint to use the supplied EqualityAdapter.
+ NOTE: For internal use only.
+
+ The EqualityAdapter to use.
+ Self.
+
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+
+ Flag the constraint to use the supplied Comparison object.
+
+ The IComparer object to use.
+ Self.
+
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+
+ Compares two collection members for equality
+
+
+
+
+ Return a new CollectionTally for use in making tests
+
+ The collection to be included in the tally
+
+
+
+ Flag the constraint to ignore case and return self.
+
+
+
+
+ Construct a CollectionContainsConstraint
+
+
+
+
+
+ Test whether the expected item is contained in the collection
+
+
+
+
+
+
+ Write a descripton of the constraint to a MessageWriter
+
+
+
+
+
+ CollectionEquivalentCOnstraint is used to determine whether two
+ collections are equivalent.
+
+
+
+
+ Construct a CollectionEquivalentConstraint
+
+
+
+
+
+ Test whether two collections are equivalent
+
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+
+ CollectionOrderedConstraint is used to test whether a collection is ordered.
+
+
+
+
+ Construct a CollectionOrderedConstraint
+
+
+
+
+ Modifies the constraint to use an IComparer and returns self.
+
+
+
+
+ Modifies the constraint to use an IComparer<T> and returns self.
+
+
+
+
+ Modifies the constraint to use a Comparison<T> and returns self.
+
+
+
+
+ Modifies the constraint to test ordering by the value of
+ a specified property and returns self.
+
+
+
+
+ Test whether the collection is ordered
+
+
+
+
+
+
+ Write a description of the constraint to a MessageWriter
+
+
+
+
+
+ Returns the string representation of the constraint.
+
+
+
+
+
+ If used performs a reverse comparison
+
+
+
+
+ CollectionSubsetConstraint is used to determine whether
+ one collection is a subset of another
+
+
+
+
+ Construct a CollectionSubsetConstraint
+
+ The collection that the actual value is expected to be a subset of
+
+
+
+ Test whether the actual collection is a subset of
+ the expected collection provided.
+
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+
+ CollectionTally counts (tallies) the number of
+ occurences of each object in one or more enumerations.
+
+
+
+
+ Construct a CollectionTally object from a comparer and a collection
+
+
+
+
+ Try to remove an object from the tally
+
+ The object to remove
+ True if successful, false if the object was not found
+
+
+
+ Try to remove a set of objects from the tally
+
+ The objects to remove
+ True if successful, false if any object was not found
+
+
+
+ The number of objects remaining in the tally
+
+
+
+
+ ComparisonAdapter class centralizes all comparisons of
+ values in NUnit, adapting to the use of any provided
+ IComparer, IComparer<T> or Comparison<T>
+
+
+
+
+ Returns a ComparisonAdapter that wraps an IComparer
+
+
+
+
+ Returns a ComparisonAdapter that wraps an IComparer<T>
+
+
+
+
+ Returns a ComparisonAdapter that wraps a Comparison<T>
+
+
+
+
+ Compares two objects
+
+
+
+
+ Gets the default ComparisonAdapter, which wraps an
+ NUnitComparer object.
+
+
+
+
+ Construct a ComparisonAdapter for an IComparer
+
+
+
+
+ Compares two objects
+
+
+
+
+
+
+
+ Construct a default ComparisonAdapter
+
+
+
+
+ ComparisonAdapter<T> extends ComparisonAdapter and
+ allows use of an IComparer<T> or Comparison<T>
+ to actually perform the comparison.
+
+
+
+
+ Construct a ComparisonAdapter for an IComparer<T>
+
+
+
+
+ Compare a Type T to an object
+
+
+
+
+ Construct a ComparisonAdapter for a Comparison<T>
+
+
+
+
+ Compare a Type T to an object
+
+
+
+
+ Abstract base class for constraints that compare values to
+ determine if one is greater than, equal to or less than
+ the other. This class supplies the Using modifiers.
+
+
+
+
+ ComparisonAdapter to be used in making the comparison
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Modifies the constraint to use an IComparer and returns self
+
+
+
+
+ Modifies the constraint to use an IComparer<T> and returns self
+
+
+
+
+ Modifies the constraint to use a Comparison<T> and returns self
+
+
+
+
+ Delegate used to delay evaluation of the actual value
+ to be used in evaluating a constraint
+
+
+
+
+ ConstraintBuilder maintains the stacks that are used in
+ processing a ConstraintExpression. An OperatorStack
+ is used to hold operators that are waiting for their
+ operands to be reognized. a ConstraintStack holds
+ input constraints as well as the results of each
+ operator applied.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Appends the specified operator to the expression by first
+ reducing the operator stack and then pushing the new
+ operator on the stack.
+
+ The operator to push.
+
+
+
+ Appends the specified constraint to the expresson by pushing
+ it on the constraint stack.
+
+ The constraint to push.
+
+
+
+ Sets the top operator right context.
+
+ The right context.
+
+
+
+ Reduces the operator stack until the topmost item
+ precedence is greater than or equal to the target precedence.
+
+ The target precedence.
+
+
+
+ Resolves this instance, returning a Constraint. If the builder
+ is not currently in a resolvable state, an exception is thrown.
+
+ The resolved constraint
+
+
+
+ Gets a value indicating whether this instance is resolvable.
+
+
+ true if this instance is resolvable; otherwise, false.
+
+
+
+
+ OperatorStack is a type-safe stack for holding ConstraintOperators
+
+
+
+
+ Initializes a new instance of the class.
+
+ The builder.
+
+
+
+ Pushes the specified operator onto the stack.
+
+ The op.
+
+
+
+ Pops the topmost operator from the stack.
+
+
+
+
+
+ Gets a value indicating whether this is empty.
+
+ true if empty; otherwise, false.
+
+
+
+ Gets the topmost operator without modifying the stack.
+
+ The top.
+
+
+
+ ConstraintStack is a type-safe stack for holding Constraints
+
+
+
+
+ Initializes a new instance of the class.
+
+ The builder.
+
+
+
+ Pushes the specified constraint. As a side effect,
+ the constraint's builder field is set to the
+ ConstraintBuilder owning this stack.
+
+ The constraint.
+
+
+
+ Pops this topmost constrait from the stack.
+ As a side effect, the constraint's builder
+ field is set to null.
+
+
+
+
+
+ Gets a value indicating whether this is empty.
+
+ true if empty; otherwise, false.
+
+
+
+ Gets the topmost constraint without modifying the stack.
+
+ The topmost constraint
+
+
+
+ ConstraintExpression represents a compound constraint in the
+ process of being constructed from a series of syntactic elements.
+
+ Individual elements are appended to the expression as they are
+ reognized. Once an actual Constraint is appended, the expression
+ returns a resolvable Constraint.
+
+
+
+
+ ConstraintExpressionBase is the abstract base class for the
+ ConstraintExpression class, which represents a
+ compound constraint in the process of being constructed
+ from a series of syntactic elements.
+
+ NOTE: ConstraintExpressionBase is separate because the
+ ConstraintExpression class was generated in earlier
+ versions of NUnit. The two classes may be combined
+ in a future version.
+
+
+
+
+ The ConstraintBuilder holding the elements recognized so far
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the
+ class passing in a ConstraintBuilder, which may be pre-populated.
+
+ The builder.
+
+
+
+ Returns a string representation of the expression as it
+ currently stands. This should only be used for testing,
+ since it has the side-effect of resolving the expression.
+
+
+
+
+
+ Appends an operator to the expression and returns the
+ resulting expression itself.
+
+
+
+
+ Appends a self-resolving operator to the expression and
+ returns a new ResolvableConstraintExpression.
+
+
+
+
+ Appends a constraint to the expression and returns that
+ constraint, which is associated with the current state
+ of the expression being built.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the
+ class passing in a ConstraintBuilder, which may be pre-populated.
+
+ The builder.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding only if a specified number of them succeed.
+
+
+
+
+ Returns a new PropertyConstraintExpression, which will either
+ test for the existence of the named property on the object
+ being tested or apply any following constraint to that property.
+
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+
+ Returns the constraint provided as an argument - used to allow custom
+ custom constraints to easily participate in the syntax.
+
+
+
+
+ Returns the constraint provided as an argument - used to allow custom
+ custom constraints to easily participate in the syntax.
+
+
+
+
+ Returns a constraint that tests two items for equality
+
+
+
+
+ Returns a constraint that tests that two references are the same object
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a collection containing the same elements as the
+ collection supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a subset of the collection supplied as an argument.
+
+
+
+
+ Returns a new CollectionContainsConstraint checking for the
+ presence of a particular object in the collection.
+
+
+
+
+ Returns a new CollectionContainsConstraint checking for the
+ presence of a particular object in the collection.
+
+
+
+
+ Returns a new ContainsConstraint. This constraint
+ will, in turn, make use of the appropriate second-level
+ constraint, depending on the type of the actual argument.
+ This overload is only used if the item sought is a string,
+ since any other type implies that we are looking for a
+ collection member.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the regular expression supplied as an argument.
+
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the regular expression supplied as an argument.
+
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same as an expected path after canonicalization.
+
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+
+ Returns a constraint that tests whether the actual value falls
+ within a specified range.
+
+
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them succeed.
+
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if at least one of them succeeds.
+
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them fail.
+
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Length property of the object being tested.
+
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Count property of the object being tested.
+
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Message property of the object being tested.
+
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the InnerException property of the object being tested.
+
+
+
+
+ With is currently a NOP - reserved for future use.
+
+
+
+
+ Returns a constraint that tests for null
+
+
+
+
+ Returns a constraint that tests for True
+
+
+
+
+ Returns a constraint that tests for False
+
+
+
+
+ Returns a constraint that tests for a positive value
+
+
+
+
+ Returns a constraint that tests for a negative value
+
+
+
+
+ Returns a constraint that tests for NaN
+
+
+
+
+ Returns a constraint that tests for empty
+
+
+
+
+ Returns a constraint that tests whether a collection
+ contains all unique items.
+
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in binary format.
+
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in xml format.
+
+
+
+
+ Returns a constraint that tests whether a collection is ordered
+
+
+
+
+ ContainsConstraint tests a whether a string contains a substring
+ or a collection contains an object. It postpones the decision of
+ which test to use until the type of the actual argument is known.
+ This allows testing whether a string is contained in a collection
+ or as a substring of another string using the same syntax.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The expected.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+
+ Flag the constraint to use the supplied Comparison object.
+
+ The IComparer object to use.
+ Self.
+
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+
+ Flag the constraint to ignore case and return self.
+
+
+
+
+ Applies a delay to the match so that a match can be evaluated in the future.
+
+
+
+
+ Creates a new DelayedConstraint
+
+ The inner constraint two decorate
+ The time interval after which the match is performed
+ If the value of is less than 0
+
+
+
+ Creates a new DelayedConstraint
+
+ The inner constraint two decorate
+ The time interval after which the match is performed
+ The time interval used for polling
+ If the value of is less than 0
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for if the base constraint fails, false if it succeeds
+
+
+
+ Test whether the constraint is satisfied by a delegate
+
+ The delegate whose value is to be tested
+ True for if the base constraint fails, false if it succeeds
+
+
+
+ Test whether the constraint is satisfied by a given reference.
+ Overridden to wait for the specified delay period before
+ calling the base constraint with the dereferenced value.
+
+ A reference to the value to be tested
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ Write the actual value for a failing constraint test to a MessageWriter.
+
+ The writer on which the actual value is displayed
+
+
+
+ Returns the string representation of the constraint.
+
+
+
+
+ EmptyCollectionConstraint tests whether a collection is empty.
+
+
+
+
+ Check that the collection is empty
+
+
+
+
+
+
+ Write the constraint description to a MessageWriter
+
+
+
+
+
+ EmptyConstraint tests a whether a string or collection is empty,
+ postponing the decision about which test is applied until the
+ type of the actual argument is known.
+
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ EmptyDirectoryConstraint is used to test that a directory is empty
+
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+
+ EmptyStringConstraint tests whether a string is empty.
+
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ EndsWithConstraint can test whether a string ends
+ with an expected substring.
+
+
+
+
+ StringConstraint is the abstract base for constraints
+ that operate on strings. It supports the IgnoreCase
+ modifier for string operations.
+
+
+
+
+ The expected value
+
+
+
+
+ Indicates whether tests should be case-insensitive
+
+
+
+
+ Constructs a StringConstraint given an expected value
+
+ The expected value
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Test whether the constraint is satisfied by a given string
+
+ The string to be tested
+ True for success, false for failure
+
+
+
+ Modify the constraint to ignore case in matching.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The expected string
+
+
+
+ Test whether the constraint is matched by the actual value.
+ This is a template method, which calls the IsMatch method
+ of the derived class.
+
+
+
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ EqualConstraint is able to compare an actual value with the
+ expected value provided in its constructor. Two objects are
+ considered equal if both are null, or if both have the same
+ value. NUnit has special semantics for some object types.
+
+
+
+
+ If true, strings in error messages will be clipped
+
+
+
+
+ NUnitEqualityComparer used to test equality.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The expected value.
+
+
+
+ Flag the constraint to use a tolerance when determining equality.
+
+ Tolerance value to be used
+ Self.
+
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+
+ Flag the constraint to use the supplied Comparison object.
+
+ The IComparer object to use.
+ Self.
+
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Write a failure message. Overridden to provide custom
+ failure messages for EqualConstraint.
+
+ The MessageWriter to write to
+
+
+
+ Write description of this constraint
+
+ The MessageWriter to write to
+
+
+
+ Display the failure information for two collections that did not match.
+
+ The MessageWriter on which to display
+ The expected collection.
+ The actual collection
+ The depth of this failure in a set of nested collections
+
+
+
+ Displays a single line showing the types and sizes of the expected
+ and actual enumerations, collections or arrays. If both are identical,
+ the value is only shown once.
+
+ The MessageWriter on which to display
+ The expected collection or array
+ The actual collection or array
+ The indentation level for the message line
+
+
+
+ Displays a single line showing the point in the expected and actual
+ arrays at which the comparison failed. If the arrays have different
+ structures or dimensions, both values are shown.
+
+ The MessageWriter on which to display
+ The expected array
+ The actual array
+ Index of the failure point in the underlying collections
+ The indentation level for the message line
+
+
+
+ Display the failure information for two IEnumerables that did not match.
+
+ The MessageWriter on which to display
+ The expected enumeration.
+ The actual enumeration
+ The depth of this failure in a set of nested collections
+
+
+
+ Flag the constraint to ignore case and return self.
+
+
+
+
+ Flag the constraint to suppress string clipping
+ and return self.
+
+
+
+
+ Flag the constraint to compare arrays as collections
+ and return self.
+
+
+
+
+ Switches the .Within() modifier to interpret its tolerance as
+ a distance in representable values (see remarks).
+
+ Self.
+
+ Ulp stands for "unit in the last place" and describes the minimum
+ amount a given value can change. For any integers, an ulp is 1 whole
+ digit. For floating point values, the accuracy of which is better
+ for smaller numbers and worse for larger numbers, an ulp depends
+ on the size of the number. Using ulps for comparison of floating
+ point results instead of fixed tolerances is safer because it will
+ automatically compensate for the added inaccuracy of larger numbers.
+
+
+
+
+ Switches the .Within() modifier to interpret its tolerance as
+ a percentage that the actual values is allowed to deviate from
+ the expected value.
+
+ Self
+
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in days.
+
+ Self
+
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in hours.
+
+ Self
+
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in minutes.
+
+ Self
+
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in seconds.
+
+ Self
+
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in milliseconds.
+
+ Self
+
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in clock ticks.
+
+ Self
+
+
+
+ EqualityAdapter class handles all equality comparisons
+ that use an IEqualityComparer, IEqualityComparer<T>
+ or a ComparisonAdapter.
+
+
+
+
+ Compares two objects, returning true if they are equal
+
+
+
+
+ Returns true if the two objects can be compared by this adapter.
+ The base adapter cannot handle IEnumerables except for strings.
+
+
+
+
+ Returns an EqualityAdapter that wraps an IComparer.
+
+
+
+
+ Returns an EqualityAdapter that wraps an IEqualityComparer.
+
+
+
+
+ Returns an EqualityAdapter that wraps an IEqualityComparer<T>.
+
+
+
+
+ Returns an EqualityAdapter that wraps an IComparer<T>.
+
+
+
+
+ Returns an EqualityAdapter that wraps a Comparison<T>.
+
+
+
+
+ EqualityAdapter that wraps an IComparer.
+
+
+
+
+ Returns true if the two objects can be compared by this adapter.
+ Generic adapter requires objects of the specified type.
+
+
+
+
+ EqualityAdapter that wraps an IComparer.
+
+
+
+
+ EqualityAdapterList represents a list of EqualityAdapters
+ in a common class across platforms.
+
+
+
+
+ ExactCountConstraint applies another constraint to each
+ item in a collection, succeeding only if a specified
+ number of items succeed.
+
+
+
+
+ Construct an ExactCountConstraint on top of an existing constraint
+
+
+
+
+
+
+ Apply the item constraint to each item in the collection,
+ succeeding only if the expected number of items pass.
+
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+
+ ExactTypeConstraint is used to test that an object
+ is of the exact type provided in the constructor
+
+
+
+
+ Construct an ExactTypeConstraint for a given Type
+
+ The expected Type.
+
+
+
+ Test that an object is of the exact type specified
+
+ The actual value.
+ True if the tested object is of the exact type provided, otherwise false.
+
+
+
+ Write the description of this constraint to a MessageWriter
+
+ The MessageWriter to use
+
+
+
+ ExceptionTypeConstraint is a special version of ExactTypeConstraint
+ used to provided detailed info about the exception thrown in
+ an error message.
+
+
+
+
+ Constructs an ExceptionTypeConstraint
+
+
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. Overriden to write additional information
+ in the case of an Exception.
+
+ The MessageWriter to use
+
+
+
+ FailurePoint class represents one point of failure
+ in an equality test.
+
+
+
+
+ The location of the failure
+
+
+
+
+ The expected value
+
+
+
+
+ The actual value
+
+
+
+
+ Indicates whether the expected value is valid
+
+
+
+
+ Indicates whether the actual value is valid
+
+
+
+
+ FailurePointList represents a set of FailurePoints
+ in a cross-platform way.
+
+
+
+
+ FalseConstraint tests that the actual value is false
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ Helper routines for working with floating point numbers
+
+
+ The floating point comparison code is based on this excellent article:
+ http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
+
+
+ "ULP" means Unit in the Last Place and in the context of this library refers to
+ the distance between two adjacent floating point numbers. IEEE floating point
+ numbers can only represent a finite subset of natural numbers, with greater
+ accuracy for smaller numbers and lower accuracy for very large numbers.
+
+
+ If a comparison is allowed "2 ulps" of deviation, that means the values are
+ allowed to deviate by up to 2 adjacent floating point values, which might be
+ as low as 0.0000001 for small numbers or as high as 10.0 for large numbers.
+
+
+
+
+ Compares two floating point values for equality
+ First floating point value to be compared
+ Second floating point value t be compared
+
+ Maximum number of representable floating point values that are allowed to
+ be between the left and the right floating point values
+
+ True if both numbers are equal or close to being equal
+
+
+ Floating point values can only represent a finite subset of natural numbers.
+ For example, the values 2.00000000 and 2.00000024 can be stored in a float,
+ but nothing inbetween them.
+
+
+ This comparison will count how many possible floating point values are between
+ the left and the right number. If the number of possible values between both
+ numbers is less than or equal to maxUlps, then the numbers are considered as
+ being equal.
+
+
+ Implementation partially follows the code outlined here:
+ http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/
+
+
+
+
+ Compares two double precision floating point values for equality
+ First double precision floating point value to be compared
+ Second double precision floating point value t be compared
+
+ Maximum number of representable double precision floating point values that are
+ allowed to be between the left and the right double precision floating point values
+
+ True if both numbers are equal or close to being equal
+
+
+ Double precision floating point values can only represent a limited series of
+ natural numbers. For example, the values 2.0000000000000000 and 2.0000000000000004
+ can be stored in a double, but nothing inbetween them.
+
+
+ This comparison will count how many possible double precision floating point
+ values are between the left and the right number. If the number of possible
+ values between both numbers is less than or equal to maxUlps, then the numbers
+ are considered as being equal.
+
+
+ Implementation partially follows the code outlined here:
+ http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/
+
+
+
+
+
+ Reinterprets the memory contents of a floating point value as an integer value
+
+
+ Floating point value whose memory contents to reinterpret
+
+
+ The memory contents of the floating point value interpreted as an integer
+
+
+
+
+ Reinterprets the memory contents of a double precision floating point
+ value as an integer value
+
+
+ Double precision floating point value whose memory contents to reinterpret
+
+
+ The memory contents of the double precision floating point value
+ interpreted as an integer
+
+
+
+
+ Reinterprets the memory contents of an integer as a floating point value
+
+ Integer value whose memory contents to reinterpret
+
+ The memory contents of the integer value interpreted as a floating point value
+
+
+
+
+ Reinterprets the memory contents of an integer value as a double precision
+ floating point value
+
+ Integer whose memory contents to reinterpret
+
+ The memory contents of the integer interpreted as a double precision
+ floating point value
+
+
+
+ Union of a floating point variable and an integer
+
+
+ The union's value as a floating point variable
+
+
+ The union's value as an integer
+
+
+ The union's value as an unsigned integer
+
+
+ Union of a double precision floating point variable and a long
+
+
+ The union's value as a double precision floating point variable
+
+
+ The union's value as a long
+
+
+ The union's value as an unsigned long
+
+
+
+ Tests whether a value is greater than the value supplied to its constructor
+
+
+
+
+ The value against which a comparison is to be made
+
+
+
+
+ Initializes a new instance of the class.
+
+ The expected value.
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Tests whether a value is greater than or equal to the value supplied to its constructor
+
+
+
+
+ The value against which a comparison is to be made
+
+
+
+
+ Initializes a new instance of the class.
+
+ The expected value.
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ InstanceOfTypeConstraint is used to test that an object
+ is of the same type provided or derived from it.
+
+
+
+
+ Construct an InstanceOfTypeConstraint for the type provided
+
+ The expected Type
+
+
+
+ Test whether an object is of the specified type or a derived type
+
+ The object to be tested
+ True if the object is of the provided type or derives from it, otherwise false.
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+ The MessageWriter to use
+
+
+
+ Tests whether a value is less than the value supplied to its constructor
+
+
+
+
+ The value against which a comparison is to be made
+
+
+
+
+ Initializes a new instance of the class.
+
+ The expected value.
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Tests whether a value is less than or equal to the value supplied to its constructor
+
+
+
+
+ The value against which a comparison is to be made
+
+
+
+
+ Initializes a new instance of the class.
+
+ The expected value.
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Static methods used in creating messages
+
+
+
+
+ Static string used when strings are clipped
+
+
+
+
+ Returns the representation of a type as used in NUnitLite.
+ This is the same as Type.ToString() except for arrays,
+ which are displayed with their declared sizes.
+
+
+
+
+
+
+ Converts any control characters in a string
+ to their escaped representation.
+
+ The string to be converted
+ The converted string
+
+
+
+ Return the a string representation for a set of indices into an array
+
+ Array of indices for which a string is needed
+
+
+
+ Get an array of indices representing the point in a enumerable,
+ collection or array corresponding to a single int index into the
+ collection.
+
+ The collection to which the indices apply
+ Index in the collection
+ Array of indices
+
+
+
+ Clip a string to a given length, starting at a particular offset, returning the clipped
+ string with ellipses representing the removed parts
+
+ The string to be clipped
+ The maximum permitted length of the result string
+ The point at which to start clipping
+ The clipped string
+
+
+
+ Clip the expected and actual strings in a coordinated fashion,
+ so that they may be displayed together.
+
+
+
+
+
+
+
+
+ Shows the position two strings start to differ. Comparison
+ starts at the start index.
+
+ The expected string
+ The actual string
+ The index in the strings at which comparison should start
+ Boolean indicating whether case should be ignored
+ -1 if no mismatch found, or the index where mismatch found
+
+
+
+ NaNConstraint tests that the actual value is a double or float NaN
+
+
+
+
+ Test that the actual value is an NaN
+
+
+
+
+
+
+ Write the constraint description to a specified writer
+
+
+
+
+
+ NoItemConstraint applies another constraint to each
+ item in a collection, failing if any of them succeeds.
+
+
+
+
+ Construct a NoItemConstraint on top of an existing constraint
+
+
+
+
+
+ Apply the item constraint to each item in the collection,
+ failing if any item fails.
+
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+
+ NotConstraint negates the effect of some other constraint
+
+
+
+
+ Initializes a new instance of the class.
+
+ The base constraint to be negated.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for if the base constraint fails, false if it succeeds
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ Write the actual value for a failing constraint test to a MessageWriter.
+
+ The writer on which the actual value is displayed
+
+
+
+ NullConstraint tests that the actual value is null
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ NullEmptyStringConstraint tests whether a string is either null or empty.
+
+
+
+
+ Constructs a new NullOrEmptyStringConstraint
+
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ The Numerics class contains common operations on numeric values.
+
+
+
+
+ Checks the type of the object, returning true if
+ the object is a numeric type.
+
+ The object to check
+ true if the object is a numeric type
+
+
+
+ Checks the type of the object, returning true if
+ the object is a floating point numeric type.
+
+ The object to check
+ true if the object is a floating point numeric type
+
+
+
+ Checks the type of the object, returning true if
+ the object is a fixed point numeric type.
+
+ The object to check
+ true if the object is a fixed point numeric type
+
+
+
+ Test two numeric values for equality, performing the usual numeric
+ conversions and using a provided or default tolerance. If the tolerance
+ provided is Empty, this method may set it to a default tolerance.
+
+ The expected value
+ The actual value
+ A reference to the tolerance in effect
+ True if the values are equal
+
+
+
+ Compare two numeric values, performing the usual numeric conversions.
+
+ The expected value
+ The actual value
+ The relationship of the values to each other
+
+
+
+ NUnitComparer encapsulates NUnit's default behavior
+ in comparing two objects.
+
+
+
+
+ Compares two objects
+
+
+
+
+
+
+
+ Returns the default NUnitComparer.
+
+
+
+
+ Generic version of NUnitComparer
+
+
+
+
+
+ Compare two objects of the same type
+
+
+
+
+ NUnitEqualityComparer encapsulates NUnit's handling of
+ equality tests between objects.
+
+
+
+
+
+
+
+
+
+ Compares two objects for equality within a tolerance
+
+ The first object to compare
+ The second object to compare
+ The tolerance to use in the comparison
+
+
+
+
+ If true, all string comparisons will ignore case
+
+
+
+
+ If true, arrays will be treated as collections, allowing
+ those of different dimensions to be compared
+
+
+
+
+ Comparison objects used in comparisons for some constraints.
+
+
+
+
+ List of points at which a failure occured.
+
+
+
+
+ RecursionDetector used to check for recursion when
+ evaluating self-referencing enumerables.
+
+
+
+
+ Compares two objects for equality within a tolerance, setting
+ the tolerance to the actual tolerance used if an empty
+ tolerance is supplied.
+
+
+
+
+ Helper method to compare two arrays
+
+
+
+
+ Method to compare two DirectoryInfo objects
+
+ first directory to compare
+ second directory to compare
+ true if equivalent, false if not
+
+
+
+ Returns the default NUnitEqualityComparer
+
+
+
+
+ Gets and sets a flag indicating whether case should
+ be ignored in determining equality.
+
+
+
+
+ Gets and sets a flag indicating that arrays should be
+ compared as collections, without regard to their shape.
+
+
+
+
+ Gets the list of external comparers to be used to
+ test for equality. They are applied to members of
+ collections, in place of NUnit's own logic.
+
+
+
+
+ Gets the list of failure points for the last Match performed.
+ The list consists of objects to be interpreted by the caller.
+ This generally means that the caller may only make use of
+ objects it has placed on the list at a particular depthy.
+
+
+
+
+ RecursionDetector detects when a comparison
+ between two enumerables has reached a point
+ where the same objects that were previously
+ compared are again being compared. This allows
+ the caller to stop the comparison if desired.
+
+
+
+
+ Check whether two objects have previously
+ been compared, returning true if they have.
+ The two objects are remembered, so that a
+ second call will always return true.
+
+
+
+
+ OrConstraint succeeds if either member succeeds
+
+
+
+
+ Create an OrConstraint from two other constraints
+
+ The first constraint
+ The second constraint
+
+
+
+ Apply the member constraints to an actual value, succeeding
+ succeeding as soon as one of them succeeds.
+
+ The actual value
+ True if either constraint succeeded
+
+
+
+ Write a description for this contraint to a MessageWriter
+
+ The MessageWriter to receive the description
+
+
+
+ PathConstraint serves as the abstract base of constraints
+ that operate on paths and provides several helper methods.
+
+
+
+
+ The expected path used in the constraint
+
+
+
+
+ Flag indicating whether a caseInsensitive comparison should be made
+
+
+
+
+ Construct a PathConstraint for a give expected path
+
+ The expected path
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Returns true if the expected path and actual path match
+
+
+
+
+ Returns the string representation of this constraint
+
+
+
+
+ Transform the provided path to its canonical form so that it
+ may be more easily be compared with other paths.
+
+ The original path
+ The path in canonical form
+
+
+
+ Test whether one path in canonical form is under another.
+
+ The first path - supposed to be the parent path
+ The second path - supposed to be the child path
+ Indicates whether case should be ignored
+
+
+
+
+ Modifies the current instance to be case-insensitve
+ and returns it.
+
+
+
+
+ Modifies the current instance to be case-sensitve
+ and returns it.
+
+
+
+
+ Predicate constraint wraps a Predicate in a constraint,
+ returning success if the predicate is true.
+
+
+
+
+ Construct a PredicateConstraint from a predicate
+
+
+
+
+ Determines whether the predicate succeeds when applied
+ to the actual value.
+
+
+
+
+ Writes the description to a MessageWriter
+
+
+
+
+ PropertyConstraint extracts a named property and uses
+ its value as the actual value for a chained constraint.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The name.
+ The constraint to apply to the property.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+
+ Returns the string representation of the constraint.
+
+
+
+
+
+ PropertyExistsConstraint tests that a named property
+ exists on the object provided through Match.
+
+ Originally, PropertyConstraint provided this feature
+ in addition to making optional tests on the vaue
+ of the property. The two constraints are now separate.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The name of the property.
+
+
+
+ Test whether the property exists for a given object
+
+ The object to be tested
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter.
+
+ The writer on which the actual value is displayed
+
+
+
+ Returns the string representation of the constraint.
+
+
+
+
+
+ RangeConstraint tests whether two values are within a
+ specified range.
+
+
+
+
+ Initializes a new instance of the class.
+
+ From.
+ To.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ RegexConstraint can test whether a string matches
+ the pattern provided.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The pattern.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ ResolvableConstraintExpression is used to represent a compound
+ constraint being constructed at a point where the last operator
+ may either terminate the expression or may have additional
+ qualifying constraints added to it.
+
+ It is used, for example, for a Property element or for
+ an Exception element, either of which may be optionally
+ followed by constraints that apply to the property or
+ exception.
+
+
+
+
+ Create a new instance of ResolvableConstraintExpression
+
+
+
+
+ Create a new instance of ResolvableConstraintExpression,
+ passing in a pre-populated ConstraintBuilder.
+
+
+
+
+ Resolve the current expression to a Constraint
+
+
+
+
+ This operator creates a constraint that is satisfied only if both
+ argument constraints are satisfied.
+
+
+
+
+ This operator creates a constraint that is satisfied only if both
+ argument constraints are satisfied.
+
+
+
+
+ This operator creates a constraint that is satisfied only if both
+ argument constraints are satisfied.
+
+
+
+
+ This operator creates a constraint that is satisfied if either
+ of the argument constraints is satisfied.
+
+
+
+
+ This operator creates a constraint that is satisfied if either
+ of the argument constraints is satisfied.
+
+
+
+
+ This operator creates a constraint that is satisfied if either
+ of the argument constraints is satisfied.
+
+
+
+
+ This operator creates a constraint that is satisfied if the
+ argument constraint is not satisfied.
+
+
+
+
+ Appends an And Operator to the expression
+
+
+
+
+ Appends an Or operator to the expression.
+
+
+
+
+ ReusableConstraint wraps a constraint expression after
+ resolving it so that it can be reused consistently.
+
+
+
+
+ Construct a ReusableConstraint from a constraint expression
+
+ The expression to be resolved and reused
+
+
+
+ Converts a constraint to a ReusableConstraint
+
+ The constraint to be converted
+ A ReusableConstraint
+
+
+
+ Returns the string representation of the constraint.
+
+ A string representing the constraint
+
+
+
+ Resolves the ReusableConstraint by returning the constraint
+ that it originally wrapped.
+
+ A resolved constraint
+
+
+
+ SameAsConstraint tests whether an object is identical to
+ the object passed to its constructor
+
+
+
+
+ Initializes a new instance of the class.
+
+ The expected object.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ Summary description for SamePathConstraint.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The expected path
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The expected path
+ The actual path
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ SamePathOrUnderConstraint tests that one path is under another
+
+
+
+
+ Initializes a new instance of the class.
+
+ The expected path
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The expected path
+ The actual path
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ SomeItemsConstraint applies another constraint to each
+ item in a collection, succeeding if any of them succeeds.
+
+
+
+
+ Construct a SomeItemsConstraint on top of an existing constraint
+
+
+
+
+
+ Apply the item constraint to each item in the collection,
+ succeeding if any item succeeds.
+
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+
+ StartsWithConstraint can test whether a string starts
+ with an expected substring.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The expected string
+
+
+
+ Test whether the constraint is matched by the actual value.
+ This is a template method, which calls the IsMatch method
+ of the derived class.
+
+
+
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ SubPathConstraint tests that the actual path is under the expected path
+
+
+
+
+ Initializes a new instance of the class.
+
+ The expected path
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The expected path
+ The actual path
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ SubstringConstraint can test whether a string contains
+ the expected substring.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The expected.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ ThrowsConstraint is used to test the exception thrown by
+ a delegate by applying a constraint to it.
+
+
+
+
+ Initializes a new instance of the class,
+ using a constraint to be applied to the exception.
+
+ A constraint to apply to the caught exception.
+
+
+
+ Executes the code of the delegate and captures any exception.
+ If a non-null base constraint was provided, it applies that
+ constraint to the exception.
+
+ A delegate representing the code to be tested
+ True if an exception is thrown and the constraint succeeds, otherwise false
+
+
+
+ Converts an ActualValueDelegate to a TestDelegate
+ before calling the primary overload.
+
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+
+ Returns the string representation of this constraint
+
+
+
+
+ Get the actual exception thrown - used by Assert.Throws.
+
+
+
+
+ ThrowsNothingConstraint tests that a delegate does not
+ throw an exception.
+
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True if no exception is thrown, otherwise false
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. Overridden in ThrowsNothingConstraint to write
+ information about the exception that was actually caught.
+
+ The writer on which the actual value is displayed
+
+
+
+ The Tolerance class generalizes the notion of a tolerance
+ within which an equality test succeeds. Normally, it is
+ used with numeric types, but it can be used with any
+ type that supports taking a difference between two
+ objects and comparing that difference to a value.
+
+
+
+
+ Constructs a linear tolerance of a specdified amount
+
+
+
+
+ Constructs a tolerance given an amount and ToleranceMode
+
+
+
+
+ Tests that the current Tolerance is linear with a
+ numeric value, throwing an exception if it is not.
+
+
+
+
+ Returns an empty Tolerance object, equivalent to
+ specifying no tolerance. In most cases, it results
+ in an exact match but for floats and doubles a
+ default tolerance may be used.
+
+
+
+
+ Returns a zero Tolerance object, equivalent to
+ specifying an exact match.
+
+
+
+
+ Gets the ToleranceMode for the current Tolerance
+
+
+
+
+ Gets the value of the current Tolerance instance.
+
+
+
+
+ Returns a new tolerance, using the current amount as a percentage.
+
+
+
+
+ Returns a new tolerance, using the current amount in Ulps.
+
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of days.
+
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of hours.
+
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of minutes.
+
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of seconds.
+
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of milliseconds.
+
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of clock ticks.
+
+
+
+
+ Returns true if the current tolerance is empty.
+
+
+
+
+ Modes in which the tolerance value for a comparison can be interpreted.
+
+
+
+
+ The tolerance was created with a value, without specifying
+ how the value would be used. This is used to prevent setting
+ the mode more than once and is generally changed to Linear
+ upon execution of the test.
+
+
+
+
+ The tolerance is used as a numeric range within which
+ two compared values are considered to be equal.
+
+
+
+
+ Interprets the tolerance as the percentage by which
+ the two compared values my deviate from each other.
+
+
+
+
+ Compares two values based in their distance in
+ representable numbers.
+
+
+
+
+ TrueConstraint tests that the actual value is true
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ UniqueItemsConstraint tests whether all the items in a
+ collection are unique.
+
+
+
+
+ Check that all items are unique.
+
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+
+ XmlSerializableConstraint tests whether
+ an object is serializable in XML format.
+
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+
+ Returns the string representation of this constraint
+
+
+
+
+ Represents a constraint that succeeds if all the
+ members of a collection match a base constraint.
+
+
+
+
+ Abstract base for operators that indicate how to
+ apply a constraint to items in a collection.
+
+
+
+
+ PrefixOperator takes a single constraint and modifies
+ it's action in some way.
+
+
+
+
+ The ConstraintOperator class is used internally by a
+ ConstraintBuilder to represent an operator that
+ modifies or combines constraints.
+
+ Constraint operators use left and right precedence
+ values to determine whether the top operator on the
+ stack should be reduced before pushing a new operator.
+
+
+
+
+ The precedence value used when the operator
+ is about to be pushed to the stack.
+
+
+
+
+ The precedence value used when the operator
+ is on the top of the stack.
+
+
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+
+
+ The syntax element preceding this operator
+
+
+
+
+ The syntax element folowing this operator
+
+
+
+
+ The precedence value used when the operator
+ is about to be pushed to the stack.
+
+
+
+
+ The precedence value used when the operator
+ is on the top of the stack.
+
+
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+
+
+ Returns the constraint created by applying this
+ prefix to another constraint.
+
+
+
+
+
+
+ Constructs a CollectionOperator
+
+
+
+
+ Returns a constraint that will apply the argument
+ to the members of a collection, succeeding if
+ they all succeed.
+
+
+
+
+ Operator that requires both it's arguments to succeed
+
+
+
+
+ Abstract base class for all binary operators
+
+
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+
+
+ Abstract method that produces a constraint by applying
+ the operator to its left and right constraint arguments.
+
+
+
+
+ Gets the left precedence of the operator
+
+
+
+
+ Gets the right precedence of the operator
+
+
+
+
+ Construct an AndOperator
+
+
+
+
+ Apply the operator to produce an AndConstraint
+
+
+
+
+ Operator that tests for the presence of a particular attribute
+ on a type and optionally applies further tests to the attribute.
+
+
+
+
+ Abstract base class for operators that are able to reduce to a
+ constraint whether or not another syntactic element follows.
+
+
+
+
+ Construct an AttributeOperator for a particular Type
+
+ The Type of attribute tested
+
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+
+ Represents a constraint that succeeds if the specified
+ count of members of a collection match a base constraint.
+
+
+
+
+ Construct an ExactCountOperator for a specified count
+
+ The expected count
+
+
+
+ Returns a constraint that will apply the argument
+ to the members of a collection, succeeding if
+ none of them succeed.
+
+
+
+
+ Represents a constraint that succeeds if none of the
+ members of a collection match a base constraint.
+
+
+
+
+ Returns a constraint that will apply the argument
+ to the members of a collection, succeeding if
+ none of them succeed.
+
+
+
+
+ Negates the test of the constraint it wraps.
+
+
+
+
+ Constructs a new NotOperator
+
+
+
+
+ Returns a NotConstraint applied to its argument.
+
+
+
+
+ Operator that requires at least one of it's arguments to succeed
+
+
+
+
+ Construct an OrOperator
+
+
+
+
+ Apply the operator to produce an OrConstraint
+
+
+
+
+ Operator used to test for the presence of a named Property
+ on an object and optionally apply further tests to the
+ value of that property.
+
+
+
+
+ Constructs a PropOperator for a particular named property
+
+
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+
+
+ Gets the name of the property to which the operator applies
+
+
+
+
+ Represents a constraint that succeeds if any of the
+ members of a collection match a base constraint.
+
+
+
+
+ Returns a constraint that will apply the argument
+ to the members of a collection, succeeding if
+ any of them succeed.
+
+
+
+
+ Operator that tests that an exception is thrown and
+ optionally applies further tests to the exception.
+
+
+
+
+ Construct a ThrowsOperator
+
+
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+
+ Represents a constraint that simply wraps the
+ constraint provided as an argument, without any
+ further functionality, but which modifes the
+ order of evaluation because of its precedence.
+
+
+
+
+ Constructor for the WithOperator
+
+
+
+
+ Returns a constraint that wraps its argument
+
+
+
+
+ Thrown when an assertion failed.
+
+
+
+ The error message that explains
+ the reason for the exception
+
+
+ The error message that explains
+ the reason for the exception
+ The exception that caused the
+ current exception
+
+
+
+ Serialization Constructor
+
+
+
+
+ Thrown when an assertion failed.
+
+
+
+
+
+
+ The error message that explains
+ the reason for the exception
+ The exception that caused the
+ current exception
+
+
+
+ Serialization Constructor
+
+
+
+
+ Thrown when a test executes inconclusively.
+
+
+
+ The error message that explains
+ the reason for the exception
+
+
+ The error message that explains
+ the reason for the exception
+ The exception that caused the
+ current exception
+
+
+
+ Serialization Constructor
+
+
+
+
+ Thrown when an assertion failed.
+
+
+
+
+
+
+ The error message that explains
+ the reason for the exception
+ The exception that caused the
+ current exception
+
+
+
+ Serialization Constructor
+
+
+
+
+
+
+
+
+
+
+ Compares two objects of a given Type for equality within a tolerance
+
+ The first object to compare
+ The second object to compare
+ The tolerance to use in the comparison
+
+
+
+
diff --git a/ext/NUnit/nunit.mocks.dll b/ext/NUnit/nunit.mocks.dll
new file mode 100644
index 00000000..50393b3f
Binary files /dev/null and b/ext/NUnit/nunit.mocks.dll differ
diff --git a/prune.bat b/prune.bat
new file mode 100644
index 00000000..f1be3899
--- /dev/null
+++ b/prune.bat
@@ -0,0 +1,35 @@
+@echo off
+
+SETLOCAL
+
+REM ######################################
+REM # Make sure git tools are accessible
+REM # (assume default installation dir)
+REM #
+
+set ProgFilesRoot=%ProgramFiles(x86)%
+if "%ProgFilesRoot%" == "" set ProgFilesRoot=%ProgramFiles%
+set PATH=%PATH%;%ProgFilesRoot%\Git\bin;
+
+echo Repository cleanup script
+echo.
+
+REM ######################################
+REM # Reading names from:
+REM # - 'prune.tags.txt'
+REM # and
+REM # removing all unnecessary tags
+REM #
+
+echo Removing tags...
+FOR /F "eol=; delims==" %%i in (prune.tags.txt) do (
+ echo Removing tag '%%i'...
+ git tag -d "%%i"
+)
+
+echo [DONE]
+
+REM #
+REM ######################################
+
+ENDLOCAL
diff --git a/prune.tags.txt b/prune.tags.txt
new file mode 100644
index 00000000..62a5d52f
--- /dev/null
+++ b/prune.tags.txt
@@ -0,0 +1,22 @@
+;
+; Put extra tag names here
+;
+v
+vv1.01.0036
+vv1.01.0041-2
+vv1.01.0042
+vv1.01.0043
+vv1.01.0045
+vv1.2.0001-4
+vv2.0.0001
+vv2.0.0002
+vv2.0.0002-1
+vv2.0.0003
+vv2.0.0004
+vv2.0.0005
+vv2.0.0005-2
+vv2.0.0005-3
+vv2.0.0006
+vv3.0.0.15
+vv3.0.0003
+vv3.0.0002
diff --git a/samples/FallingBlocks/FallingBlocks.sln b/samples/FallingBlocks/FallingBlocks.sln
index 9e6120b3..a2d27f9b 100644
--- a/samples/FallingBlocks/FallingBlocks.sln
+++ b/samples/FallingBlocks/FallingBlocks.sln
@@ -1,6 +1,6 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FallingBlocks", "FallingBlocks\FallingBlocks.vcxproj", "{90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}"
EndProject
Global
@@ -16,26 +16,16 @@ Global
Simulator-Debug|Win32 = Simulator-Debug|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Debug|BlackBerry.ActiveCfg = Debug|BlackBerry
- {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Debug|BlackBerry.Build.0 = Debug|BlackBerry
- {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Debug|BlackBerry.Deploy.0 = Debug|BlackBerry
- {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Debug|BlackBerrySimulator.ActiveCfg = Debug|BlackBerrySimulator
- {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Debug|BlackBerrySimulator.Build.0 = Debug|BlackBerrySimulator
- {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Debug|BlackBerrySimulator.Deploy.0 = Debug|BlackBerrySimulator
+ {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Debug|BlackBerry.ActiveCfg = Debug|Win32
+ {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Debug|BlackBerrySimulator.ActiveCfg = Debug|Win32
{90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Debug|Win32.ActiveCfg = Debug|Win32
{90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Debug|Win32.Build.0 = Debug|Win32
- {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Release|BlackBerry.ActiveCfg = Release|BlackBerry
- {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Release|BlackBerry.Build.0 = Release|BlackBerry
- {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Release|BlackBerrySimulator.ActiveCfg = Release|BlackBerrySimulator
- {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Release|BlackBerrySimulator.Build.0 = Release|BlackBerrySimulator
- {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Release|BlackBerrySimulator.Deploy.0 = Release|BlackBerrySimulator
+ {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Release|BlackBerry.ActiveCfg = Release|Win32
+ {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Release|BlackBerrySimulator.ActiveCfg = Release|Win32
{90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Release|Win32.ActiveCfg = Release|Win32
{90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Release|Win32.Build.0 = Release|Win32
- {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Simulator-Debug|BlackBerry.ActiveCfg = Simulator-Debug|BlackBerry
- {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Simulator-Debug|BlackBerry.Build.0 = Simulator-Debug|BlackBerry
- {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Simulator-Debug|BlackBerrySimulator.ActiveCfg = Simulator-Debug|BlackBerrySimulator
- {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Simulator-Debug|BlackBerrySimulator.Build.0 = Simulator-Debug|BlackBerrySimulator
- {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Simulator-Debug|BlackBerrySimulator.Deploy.0 = Simulator-Debug|BlackBerrySimulator
+ {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Simulator-Debug|BlackBerry.ActiveCfg = Simulator-Debug|Win32
+ {90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Simulator-Debug|BlackBerrySimulator.ActiveCfg = Simulator-Debug|Win32
{90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Simulator-Debug|Win32.ActiveCfg = Simulator-Debug|Win32
{90124CDE-5D40-4B1B-ADCD-4DCF309A4FC8}.Simulator-Debug|Win32.Build.0 = Simulator-Debug|Win32
EndGlobalSection
diff --git a/samples/FallingBlocks/FallingBlocks/FallingBlocks.vcxproj.user b/samples/FallingBlocks/FallingBlocks/FallingBlocks.vcxproj.user
deleted file mode 100644
index 695b5c78..00000000
--- a/samples/FallingBlocks/FallingBlocks/FallingBlocks.vcxproj.user
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/samples/HelloWorldDisplay/HelloWorldDisplay.sln b/samples/HelloWorldDisplay/HelloWorldDisplay.sln
index fadfcf17..b64fe081 100644
--- a/samples/HelloWorldDisplay/HelloWorldDisplay.sln
+++ b/samples/HelloWorldDisplay/HelloWorldDisplay.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+# Visual Studio 2013
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloWorldDisplay", "HelloWorldDisplay\HelloWorldDisplay.vcxproj", "{92A45A6C-CC44-42BF-895E-93C1FD0F1842}"
EndProject
Global
diff --git a/samples/HelloWorldDisplay/HelloWorldDisplay/HelloWorldDisplay.vcxproj.user b/samples/HelloWorldDisplay/HelloWorldDisplay/HelloWorldDisplay.vcxproj.user
deleted file mode 100644
index 695b5c78..00000000
--- a/samples/HelloWorldDisplay/HelloWorldDisplay/HelloWorldDisplay.vcxproj.user
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/samples/HelloWorldDisplay/HelloWorldDisplay/bbutil.c b/samples/HelloWorldDisplay/HelloWorldDisplay/bbutil.c
index 830d2c85..35ec1fd2 100644
--- a/samples/HelloWorldDisplay/HelloWorldDisplay/bbutil.c
+++ b/samples/HelloWorldDisplay/HelloWorldDisplay/bbutil.c
@@ -24,7 +24,7 @@
#include
#include "bbutil.h"
-#define USING_GL11;
+#define USING_GL11
//#include
//#include
diff --git a/setup.bat b/setup.bat
new file mode 100644
index 00000000..f1cec20b
--- /dev/null
+++ b/setup.bat
@@ -0,0 +1,289 @@
+@echo off
+setlocal EnableExtensions
+
+REM ********************************************************************************************
+REM Allow selective installation/uninstallation
+REM ********************************************************************************************
+
+:: Process parameters, to limit setup activities or directions
+if "%~1" == "" (
+ set ActionVS2010=1
+ set ActionVS2012=1
+ set ActionVS2013=1
+ set ActionUninstall=0
+ set ActionSkipTools=0
+ set ActionMSBuildOnly=0
+) else (
+ set ActionVS2010=0
+ set ActionVS2012=0
+ set ActionVS2013=0
+ set ActionUninstall=0
+ set ActionSkipTools=0
+ set ActionMSBuildOnly=0
+ for %%a in (%*) do (
+ if /i "%%a" == "/all" set ActionVS2010=1 && set ActionVS2012=1 && set ActionVS2013=1
+ if /i "%%a" == "/uninstall" set ActionUninstall=1
+ if /i "%%a" == "/u" set ActionUninstall=1
+ if /i "%%a" == "/delete" set ActionUninstall=1
+ if /i "%%a" == "/del" set ActionUninstall=1
+ if /i "%%a" == "/skip-tools" set ActionSkipTools=1
+ if /i "%%a" == "/no-tools" set ActionSkipTools=1
+ if /i "%%a" == "/notools" set ActionSkipTools=1
+ if /i "%%a" == "/msbuild" set ActionMSBuildOnly=1
+ if /i "%%a" == "/msbuild-only" set ActionMSBuildOnly=1
+ if /i "%%a" == "/msbuildonly" set ActionMSBuildOnly=1
+ if /i "%%a" == "/only-msbuild" set ActionMSBuildOnly=1
+ if /i "%%a" == "/onlymsbuild" set ActionMSBuildOnly=1
+ if /i "%%a" == "vs2010" set ActionVS2010=1
+ if /i "%%a" == "vs2012" set ActionVS2012=1
+ if /i "%%a" == "vs2013" set ActionVS2013=1
+ )
+)
+
+REM ********************************************************************************************
+REM Declare Constants
+REM ********************************************************************************************
+set /A actionNo=1
+set thisDir=%~dp0
+set thisDir=%thisDir:~0,-1%
+set BuildResults=%thisDir%\_BuildResults
+
+set ProgFilesRoot=%ProgramFiles(x86)%
+set SystemArch=x64
+if "%ProgFilesRoot%" == "" set "ProgFilesRoot=%ProgramFiles%" && set SystemArch=x86
+
+set AllUsersRoot=%ALLUSERSPROFILE%
+set PluginRoot=%ProgFilesRoot%\BlackBerry\VSPlugin-NDK
+
+if %ActionUninstall% neq 0 (echo Performing REMOVAL action...) else (echo Performing INSTALLATION action...)
+
+REM ********************************************************************************************
+REM Visual Studio 2010
+REM ********************************************************************************************
+if %ActionVS2010% equ 0 (goto skip_vs2010)
+
+echo %actionNo%: Processing Setup for Visual Studio 2010
+call :processSetup 2010 10.0
+if errorlevel 1 ( exit /b %errorlevel% )
+if %ActionUninstall% neq 0 (echo %actionNo%: Removal - DONE) else (echo %actionNo%: Installation - DONE)
+set /a actionNo += 1
+
+:skip_vs2010
+
+REM ********************************************************************************************
+REM Visual Studio 2012
+REM ********************************************************************************************
+if %ActionVS2012% equ 0 (goto skip_vs2012)
+
+echo %actionNo%: Processing Setup for Visual Studio 2012
+call :processSetup 2012 11.0 V110
+if errorlevel 1 ( exit /b %errorlevel% )
+if %ActionUninstall% neq 0 (echo %actionNo%: Removal - DONE) else (echo %actionNo%: Installation - DONE)
+set /a actionNo += 1
+
+:skip_vs2012
+
+REM ********************************************************************************************
+REM Visual Studio 2013
+REM ********************************************************************************************
+if %ActionVS2013% equ 0 (goto skip_vs2013)
+
+echo %actionNo%: Processing Setup for Visual Studio 2013
+call :processSetup 2013 12.0 V120
+if errorlevel 1 ( exit /b %errorlevel% )
+if %ActionUninstall% neq 0 (echo %actionNo%: Removal - DONE) else (echo %actionNo%: Installation - DONE)
+set /a actionNo += 1
+
+:skip_vs2013
+
+REM ********************************************************************************************
+REM Helper functions
+REM ********************************************************************************************
+goto EOF
+
+REM ********************************************************************************************
+REM Aggregate function to perform all actions needed to correctly deploy plugin
+REM $1 - Visual Studio number (2012)
+REM $2 - Visual Studio version (12.0)
+REM $3 - Visual Studio selector (V120) # optional
+:processSetup
+setlocal EnableDelayedExpansion
+
+set VSYear=%1
+set VSVersion=%~2
+set VSSelector=%~3
+set BuildPath=%BuildResults%\VS%VSYear%
+set VSPluginPath=%ProgFilesRoot%\Microsoft Visual Studio %VSVersion%\Common7\IDE\Extensions\NDK Plugin
+
+set MSBuildTargetPath=%ProgFilesRoot%\MSBuild\Microsoft.Cpp\v4.0\Platforms
+if not "%VSSelector%" == "" set MSBuildTargetPath=%ProgFilesRoot%\MSBuild\Microsoft.Cpp\v4.0\%VSSelector%\Platforms
+
+set /a actionNo += 1
+
+REM Skip tools&plugin, if only upgrading MSBuild (in case of debugger development)
+if %ActionMSBuildOnly% neq 0 goto msbuild_only
+
+REM Skip installation of custom tools (in case upgrading only plugin during development)
+if %ActionSkipTools% neq 0 goto skip_tools
+call :processTools "%thisDir%" "%PluginRoot%" "%SystemDrive%"
+set /a actionNo += 1
+:skip_tools
+
+call :processPlugin "%BuildPath%" "%PluginRoot%" "%VSPluginPath%"
+set /a actionNo += 1
+
+:msbuild_only
+call :processMSBuild "%BuildPath%" "%MSBuildTargetPath%"
+set /a actionNo += 1
+if %ActionMSBuildOnly% neq 0 goto processSetup_End
+
+:processSetup_End
+endlocal
+exit /b
+
+REM ********************************************************************************************
+REM MSBuild system upgrade
+REM ********************************************************************************************
+REM $1 - from
+REM $2 - MSBuild Targets path
+:processMSBuild
+setlocal
+
+set InputPath=%~1
+set OutputMsBuildTargetsPath=%~2
+
+if %ActionUninstall% neq 0 (goto uninstall_MSBuild)
+
+REM MSBuild Files
+echo %actionNo%: Installing build targets
+echo Copy BlackBerry MSBuild directory [%OutputMsBuildTargetsPath%]
+if exist "%OutputMsBuildTargetsPath%\BlackBerry" ( rd "%OutputMsBuildTargetsPath%\BlackBerry" /s /q )
+xcopy "%InputPath%\BlackBerry" "%OutputMsBuildTargetsPath%\BlackBerry" /e /i /y
+copy "%InputPath%\BlackBerry.BuildTasks.dll" "%OutputMsBuildTargetsPath%\BlackBerry\BlackBerry.BuildTasks.dll"
+
+goto processMSBuild_End
+
+:uninstall_MSBuild
+
+REM Remove MSBuild Files
+echo %actionNo%: Removing build targets
+echo Delete BlackBerry MSBuild directory
+rd "%OutputMsBuildTargetsPath%\BlackBerry" /s /q
+
+:processMSBuild_End
+endlocal
+exit /b
+
+REM ********************************************************************************************
+REM Copy GDBParser and DebugEngine Files
+REM ********************************************************************************************
+REM $1 - from
+REM $2 - to (plugin path)
+REM $3 - to (Visual Studio path)
+:processPlugin
+setlocal EnableDelayedExpansion
+
+set InputPath=%~1
+set OutputPluginPath=%~2
+set OutputVsPath=%~3
+
+if %ActionUninstall% neq 0 (goto uninstall_Plugin)
+
+REM Create folders
+echo %actionNo%: Installing plugin binaries
+echo Make Directory "%OutputPluginPath%"
+md "%OutputPluginPath%"
+echo Make Directory "%OutputVsPath%"
+md "%OutputVsPath%"
+
+REM Install Package Files
+echo "%InputPath%\extension.vsixmanifest" to "%OutputVsPath%\extension.vsixmanifest"
+copy "%InputPath%\extension.vsixmanifest" "%OutputVsPath%\extension.vsixmanifest"
+echo "%InputPath%\BlackBerry.GDBHost.exe" to "%OutputVsPath%\BlackBerry.GDBHost.exe"
+copy "%InputPath%\BlackBerry.GDBHost.exe" "%OutputVsPath%\BlackBerry.GDBHost.exe"
+echo "%InputPath%\BlackBerry.NativeCore.dll" to "%OutputVsPath%\BlackBerry.NativeCore.dll"
+copy "%InputPath%\BlackBerry.NativeCore.dll" "%OutputVsPath%\BlackBerry.NativeCore.dll"
+echo "%InputPath%\BlackBerry.Package.dll" to "%OutputVsPath%\BlackBerry.Package.dll"
+copy "%InputPath%\BlackBerry.Package.dll" "%OutputVsPath%\BlackBerry.Package.dll"
+echo "%InputPath%\BlackBerry.Package.pkgdef" to "%OutputVsPath%\BlackBerry.Package.pkgdef"
+copy "%InputPath%\BlackBerry.Package.pkgdef" "%OutputVsPath%\BlackBerry.Package.pkgdef"
+echo "%InputPath%\BlackBerry.DebugEngine.dll" to "%OutputVsPath%\BlackBerry.DebugEngine.dll"
+copy "%InputPath%\BlackBerry.DebugEngine.dll" "%OutputVsPath%\BlackBerry.DebugEngine.dll"
+
+goto processPlugin_End
+
+:uninstall_Plugin
+
+echo %actionNo%: Removing plugin binaries
+
+REM Uninstall Package Files
+
+echo Deleting "%OutputVsPath%\extension.vsixmanifest"
+del "%OutputVsPath%\extension.vsixmanifest"
+echo Deleting "%OutputVsPath%\BlackBerry.GDBHost.exe"
+del "%OutputVsPath%\BlackBerry.GDBHost.exe"
+echo Deleting "%OutputVsPath%\BlackBerry.NativeCore.dll"
+del "%OutputVsPath%\BlackBerry.NativeCore.dll"
+echo Deleting "%OutputVsPath%\BlackBerry.Package.dll"
+del "%OutputVsPath%\BlackBerry.Package.dll"
+echo Deleting "%OutputVsPath%\BlackBerry.Package.pkgdef"
+del "%OutputVsPath%\BlackBerry.Package.pkgdef"
+echo Deleting "%OutputVsPath%\BlackBerry.DebugEngine.dll"
+del "%OutputVsPath%\BlackBerry.DebugEngine.dll"
+
+REM Remove folders
+echo Remove Directory "%OutputPluginPath%"
+rd "%OutputPluginPath%"
+echo Remove Directory "%OutputVsPath%"
+rd "%OutputVsPath%"
+
+:processPlugin_End
+endlocal
+exit /b
+
+REM ********************************************************************************************
+REM NDK & QNX toolset
+REM ********************************************************************************************
+REM $1 - from
+REM $2 - to (plugin path)
+REM $3 - NDK path
+:processTools
+setlocal EnableDelayedExpansion
+
+set InputPath=%~1
+set OutputPath=%~2
+set OutputNdkPath=%~3
+
+if %ActionUninstall% neq 0 (goto uninstall_Tools)
+
+REM Install
+echo %actionNo%: Installing toolset
+echo xcopy "%InputPath%\bbndk_vs" "%OutputNdkPath%\bbndk_vs" /e /i /y
+md "%OutputNdkPath%\bbndk_vs"
+xcopy "%InputPath%\bbndk_vs" "%OutputNdkPath%\bbndk_vs" /e /i /y
+
+echo xcopy "%InputPath%\qnxtools" "%OutputPath%\qnxtools" /e /i /y
+md "%OutputPath%\qnxtools"
+xcopy "%InputPath%\qnxtools" "%OutputPath%\qnxtools" /e /i /y
+goto processTools_End
+
+:uninstall_Tools
+
+REM Remove
+echo %actionNo%: Removing toolset
+echo Delete "%OutputNdkPath%\bbndk_vs" directory
+rd "%OutputNdkPath%\bbndk_vs" /s /q
+echo Delete "%OutputPath%\qnxtools" directory
+rd "%OutputPath%\qnxtools" /s /q
+
+:processTools_End
+endlocal
+exit /b
+
+REM ********************************************************************************************
+REM END
+REM ********************************************************************************************
+
+:EOF
+endlocal
+echo [ALL DONE]
diff --git a/src/GDBParser.UnitTests/GDBParser_UnitTests.csproj b/src/GDBParser.UnitTests/GDBParser_UnitTests.csproj
deleted file mode 100644
index e5408b1d..00000000
--- a/src/GDBParser.UnitTests/GDBParser_UnitTests.csproj
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {6451DFCD-1CCD-4796-A832-A45FB95D994F}
- Library
- Properties
- GDBParser.UnitTests
- GDBParser.UnitTests
- v4.0
- 512
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {CC7B28E0-CB31-44F7-A380-E7072F670F38}
- GDBParser
-
-
-
-
-
\ No newline at end of file
diff --git a/src/GDBParser.UnitTests/Properties/AssemblyInfo.cs b/src/GDBParser.UnitTests/Properties/AssemblyInfo.cs
deleted file mode 100644
index 7dfe25ba..00000000
--- a/src/GDBParser.UnitTests/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("GDBParser.UnitTests")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("GDBParser.UnitTests")]
-[assembly: AssemblyCopyright("Copyright © 2013")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("80f98dd4-ce03-42f3-b852-346148df4493")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/src/GDBParser.UnitTests/UnitTest.cs b/src/GDBParser.UnitTests/UnitTest.cs
deleted file mode 100644
index 42cc7323..00000000
--- a/src/GDBParser.UnitTests/UnitTest.cs
+++ /dev/null
@@ -1,381 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using VSNDK.Parser;
-using NUnit.Framework;
-
-namespace GDBParser_UnitTests
-{
- public class UnitTests
- {
- [Test]
- public void GetNextChar()
- {
- Assert.AreEqual(0, GDBParserUnitTests.get_Next_Char(Convert.ToSByte('a'), "abcdefghij", 0), "Error: char 'a', string 'abcdefghij', int '0'");
- Assert.AreEqual(10, GDBParserUnitTests.get_Next_Char(Convert.ToSByte('a'), "abcdefghij", 1), "Error: char 'a', string 'abcdefghij', int '1'");
- Assert.AreEqual(3, GDBParserUnitTests.get_Next_Char(Convert.ToSByte('d'), "abcdefghij", 0), "Error: char 'd', string 'abcdefghij', int '0'");
- Assert.AreEqual(3, GDBParserUnitTests.get_Next_Char(Convert.ToSByte('d'), "abcdefghij", 1), "Error: char 'd', string 'abcdefghij', int '1'");
- Assert.AreEqual(10, GDBParserUnitTests.get_Next_Char(Convert.ToSByte('z'), "abcdefghij", 1), "Error: char 'z', string 'abcdefghij', int '1'");
- Assert.AreEqual(0, GDBParserUnitTests.get_Next_Char(Convert.ToSByte('d'), "", 1), "Error: char 'd', string '', int '1'");
- Assert.AreEqual(10, GDBParserUnitTests.get_Next_Char(Convert.ToSByte('d'), "abcdefghij", 12), "Error: char 'd', string 'abcdefghij', int '12'");
- Assert.AreEqual(10, GDBParserUnitTests.get_Next_Char(Convert.ToSByte(null), "abcdefghij", 1), "Error: char NULL, string 'abcdefghij', int '1'");
- }
-
- [Test]
- public void findClosing()
- {
- Assert.AreEqual(1, GDBParserUnitTests.find_Closing(Convert.ToSByte('('), Convert.ToSByte(')'), "()cdefghij", 0), "Error: char '(', char '), string '()cdefghij', int '0'");
- Assert.AreEqual(10, GDBParserUnitTests.find_Closing(Convert.ToSByte('('), Convert.ToSByte(')'), "(bcdefghij", 2), "Error: char '(', char '), string '(bcdefghij', int '2'");
- Assert.AreEqual(10, GDBParserUnitTests.find_Closing(Convert.ToSByte('('), Convert.ToSByte(')'), "(bcdefghij", 0), "Error: char '(', char '), string '(bcdefghij', int '0'");
- Assert.AreEqual(5, GDBParserUnitTests.find_Closing(Convert.ToSByte('('), Convert.ToSByte(')'), "(()())ghij", 0), "Error: char '(', char '), string '(()())ghij', int '0'");
- Assert.AreEqual(7, GDBParserUnitTests.find_Closing(Convert.ToSByte('('), Convert.ToSByte(')'), "((\\()())hij", 0), "Error: char '(', char '), string '((\\()())hij', int '0'");
- Assert.AreEqual(2, GDBParserUnitTests.find_Closing(Convert.ToSByte('('), Convert.ToSByte(')'), "(()())ghij", 1), "Error: char '(', char '), string '(()())ghij', int '1'");
- Assert.AreEqual(4, GDBParserUnitTests.find_Closing(Convert.ToSByte('('), Convert.ToSByte(')'), "((\\()())hij", 1), "Error: char '(', char '), string '((\\()())hij', int '1'");
- Assert.AreEqual(4, GDBParserUnitTests.find_Closing(Convert.ToSByte('('), Convert.ToSByte(')'), "(()())ghij", 3), "Error: char '(', char '), string '(()())ghij', int '3'");
- Assert.AreEqual(6, GDBParserUnitTests.find_Closing(Convert.ToSByte('('), Convert.ToSByte(')'), "(()(())hij", 3), "Error: char '(', char '), string '(()(())hij', int '3'");
- Assert.AreEqual(1, GDBParserUnitTests.find_Closing(Convert.ToSByte('('), Convert.ToSByte(')'), "()())fghij", 0), "Error: char '(', char '), string '()())fghij', int '0'");
- Assert.AreEqual(3, GDBParserUnitTests.find_Closing(Convert.ToSByte('('), Convert.ToSByte(')'), "()())fghij", 2), "Error: char '(', char '), string '()())fghij', int '2'");
- Assert.AreEqual(10, GDBParserUnitTests.find_Closing(Convert.ToSByte('('), Convert.ToSByte(')'), "((())fghij", 0), "Error: char '(', char '), string '(()())ghij', int '0'");
- Assert.AreEqual(4, GDBParserUnitTests.find_Closing(Convert.ToSByte('('), Convert.ToSByte(')'), "((())fghij", 1), "Error: char '(', char '), string '((())fghij', int '1'");
- }
-
- [Test]
- public void searchResponse()
- {
- // Add the values you want to test.
- Assert.AreEqual(3, GDBParserUnitTests.search_Response("aabbbcaabaccabcababaababc", "ab", 0, 1, true, Convert.ToSByte('?')), "Error: string 'aabbbcaabaccabcababaababc', string 'ab', int '0', int '1', bool 'TRUE', char '?'");
- Assert.AreEqual(1, GDBParserUnitTests.search_Response("aabbbcaabaccabcababaababc", "ab", 0, 1, true, Convert.ToSByte('@')), "Error: string 'aabbbcaabaccabcababaababc', string 'ab', int '0', int '1', bool 'TRUE', char '@'");
- Assert.AreEqual(14, GDBParserUnitTests.search_Response("aabbbcaabaccabcababaababc", "ab", 0, 3, true, Convert.ToSByte('?')), "Error: string 'aabbbcaabaccabcababaababc', string 'ab', int '0', int '3', bool 'TRUE', char '?'");
- Assert.AreEqual(12, GDBParserUnitTests.search_Response("aabbbcaabaccabcababaababc", "ab", 0, 3, true, Convert.ToSByte('@')), "Error: string 'aabbbcaabaccabcababaababc', string 'ab', int '0', int '3', bool 'TRUE', char '@'");
- Assert.AreEqual(19, GDBParserUnitTests.search_Response("aabbbcaabaccabcababaababc", "ab", 10, 3, true, Convert.ToSByte('?')), "Error: string 'aabbbcaabaccabcababaababc', string 'ab', int '10', int '3', bool 'TRUE', char '?'");
- Assert.AreEqual(17, GDBParserUnitTests.search_Response("aabbbcaabaccabcababaababc", "ab", 10, 3, true, Convert.ToSByte('@')), "Error: string 'aabbbcaabaccabcababaababc', string 'ab', int '10', int '3', bool 'TRUE', char '@'");
- Assert.AreEqual(24, GDBParserUnitTests.search_Response("aabbbcaabaccabcababaababc", "ab", 24, 1, false, Convert.ToSByte('?')), "Error: string 'aabbbcaabaccabcababaababc', string 'ab', int '24', int '1', bool 'TRUE', char '?'");
- Assert.AreEqual(24, GDBParserUnitTests.search_Response("aabbbcaabaccabcababaababc", "ab", 24, 1, false, Convert.ToSByte('@')), "Error: string 'aabbbcaabaccabcababaababc', string 'ab', int '24', int '1', bool 'TRUE', char '@'");
- Assert.AreEqual(19, GDBParserUnitTests.search_Response("aabbbcaabaccabcababaababc", "ab", 24, 3, false, Convert.ToSByte('?')), "Error: string 'aabbbcaabaccabcababaababc', string 'ab', int '24', int '3', bool 'TRUE', char '?'");
- Assert.AreEqual(19, GDBParserUnitTests.search_Response("aabbbcaabaccabcababaababc", "ab", 24, 3, false, Convert.ToSByte('@')), "Error: string 'aabbbcaabaccabcababaababc', string 'ab', int '24', int '3', bool 'TRUE', char '@'");
- }
-
- [Test]
- public void substituteVariables()
- {
- string[] v = new string[10];
- v[0] = "The";
- v[1] = "text";
- v[2] = "";
- v[3] = "";
- v[4] = "";
- v[5] = "the";
- v[6] = "";
- v[7] = "";
- v[8] = "";
- v[9] = "number";
- // Add the values you want to test.
- StringAssert.AreEqualIgnoringCase("The number of the words in the following text is smaller than the number of the letters in the same text\r\n", GDBParserUnitTests.substitute_Variables("$0$ $9$ of $5$ words in $5$ following $1$ is smaller $3$than $5$ $9$ of $5$ letters in $5$ same $1$$EOL$", v), "Error: string '', Variables array not printed.");
- }
-
- [Test]
- public void insertingCommandCodes()
- {
- string[,] map = new string[48, 2]; // The value for the first column of this array corresponds to the value of NumberOfInstructions constant, in gdb-connect.h.
- string[] v = new string[48]; // The size of this array corresponds to the value of NumberOfInstructions constant, in gdb-connect.h.
- bool result = GDBParserUnitTests.inserting_Command_Codes(map, v);
- Assert.AreEqual(true, result);
- Assert.IsNotEmpty(map, "Hash table could not be empty!");
- Assert.IsNotEmpty(v, "Parsing instructions array could not be empty!");
- }
-
- [Test]
- public void getInstructionCode()
- {
- // The instruction code returned from get_Instruction_Code() function depends on the position the associated parsing instruction
- // was stored in the respective data structure. That's why the following unit tests just compares the instruction code with -1
- // (-1 means that the instruction was not found).
- string param = "";
- // Add the values you want to test.
- Assert.AreEqual(-1, GDBParserUnitTests.get_Instruction_Code("", out param), "Error: string '', string ''");
- StringAssert.AreEqualIgnoringCase("", param, "Param should be empty.");
-
- param = "";
- Assert.AreNotEqual(-1, GDBParserUnitTests.get_Instruction_Code("-exec-continue --thread-group i1", out param), "Error: string '-exec-continue --thread-group i1', string ''");
- StringAssert.AreEqualIgnoringCase("", param, "Param should be empty for command '-exec-continue --thread-group i1'.");
-
- param = "";
- Assert.AreNotEqual(-1, GDBParserUnitTests.get_Instruction_Code("-break-delete 3", out param), "Error: string '-break-delete 3', string ''");
- StringAssert.AreEqualIgnoringCase(";3", param, "Param should not be empty for command '-break-delete 3'.");
-
- param = "";
- Assert.AreNotEqual(-1, GDBParserUnitTests.get_Instruction_Code("-break-after 4 10", out param), "Error: string '-break-after 4 10', string ''");
- StringAssert.AreEqualIgnoringCase(";4;10", param, "Param should not be empty for command '-break-after 4 10'.");
- }
-
- [Test]
- public void get_SeqID()
- {
- // Add the values you want to test.
- Assert.AreEqual(211, GDBParserUnitTests.get_Seq_ID("211^done,value=\"1\""), "Error: string '211^done,value=\"1\"'");
- Assert.AreEqual(111, GDBParserUnitTests.get_Seq_ID("111^running"), "Error: string '111^running'");
- Assert.AreEqual(-3, GDBParserUnitTests.get_Seq_ID("=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0xf7fd8502\",func=\"pendfunc1\",file=\"gdb/testsuite/gdb.mi/pendshr1.c\",fullname=\"/unsafegdb/testsuite/gdb.mi/pendshr1.c\",line=\"21\",times=\"0\",original-location=\"pendfunc1\"}"), "Error: string '=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0xf7fd8502\",func=\"pendfunc1\",file=\"gdb/testsuite/gdb.mi/pendshr1.c\",fullname=\"/unsafegdb/testsuite/gdb.mi/pendshr1.c\",line=\"21\",times=\"0\",original-location=\"pendfunc1\"}'");
- Assert.AreEqual(-2, GDBParserUnitTests.get_Seq_ID("*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"2\",frame={func=\"foo\",args=[],file=\"hello.c\",fullname=\"/home/foo/bar/hello.c\",line=\"13\"}"), "Error: string '*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"2\",frame={func=\"foo\",args=[],file=\"hello.c\",fullname=\"/home/foo/bar/hello.c\",line=\"13\"}'");
- Assert.AreEqual(-2, GDBParserUnitTests.get_Seq_ID("111*stopped,signal-name=\"SIGINT\",signal-meaning=\"Interrupt\",frame={addr=\"0x00010140\",func=\"foo\",args=[],file=\"try.c\",line=\"13\"}"), "Error: string '111*stopped,signal-name=\"SIGINT\",signal-meaning=\"Interrupt\",frame={addr=\"0x00010140\",func=\"foo\",args=[],file=\"try.c\",line=\"13\"}'");
- Assert.AreEqual(-1, GDBParserUnitTests.get_Seq_ID("abcde"), "Error: string 'abcde'");
- Assert.AreEqual(-1, GDBParserUnitTests.get_Seq_ID(""), "Error: string ''");
- }
-
- [Test]
- public void parseGDB1()
- {
- string asyncInst = "??=thread-exited,id;{#51\\;;??\";@@\";#$EOL$;};??thread-created,id;{#40\\;;??\";@@\";#\\;;??pid ;@@ ;#$EOL$;};0;??*running;{#41\\;;??thread-id=\"all;{#0;}{??thread-id=\";@@\";};#$EOL$;};0;??*stopped;{??breakpoint-hit;{#27\\;;??bkptno=\";@@\";#\\;;??file=\";@@\";#\\;;??line=\";@@\";}{??end-stepping-range;{#45;??file=\";{#\\;;@@\";0;#\\;;??line=\";@@\";};}{??function-finished;{#46;??file=;{#\\;;??\";@@\";#\\;;??line=\";@@\";};}{??exited-normally;{#42;}{??exit-code;{#43\\;;??\";@@\";}{??signal-received;{??signal-meaning=\"Killed\";{#47;}{??signal-meaning=\"Segmentation fault\";{#54\\;;??addr=\";@@\";#\\;;??func=\";@@\";0;??file=;{#\\;;??\";@@\";#\\;;??line=\";@@\";};}{#44\\;;??addr=\";@@\";#\\;;??func=\";@@\";0;??file=;{#\\;;??\";@@\";#\\;;??line=\";@@\";};};};}{??exited-signalled;{#55\\;??signal-name=\";@@\";#\\;;??signal-meaning=\";@@\";}{#44\\;;??addr=\";@@\";#\\;;??func=\";@@\";0;??file=;{#\\;;??\";@@\";#\\;;??line=\";@@\";};};};};};};};};#\\;;??thread-id=;{??\";@@\";};#$EOL$;};0;??=breakpoint-modified,bkpt=\\{number=\";{0;($EOR$;$1=?=breakpoint-modified,bkpt=\\{number=\";@@\";$$;$EOR$;?=breakpoint-modified,bkpt=\\{number=\"$1$;#21\\;$1$\\;;??enabled=\";@@\";#\\;;??addr=\";@@\";#\\;;??func=\";@@\";#\\;;??file=\";@@\";#\\;;??line=\";@@\";#\\;;??times=\";@@\";0;(??=breakpoint-modified,bkpt=\\{number=\"$1$;%?$EOL$;@@\"\\};);):$EOL$;};0;??=breakpoint-deleted,id=;{0;(??=breakpoint-deleted,id=\";#22\\;;@@\";):$EOL$;};0;??@\";{0;#81\\;\";(??@\";?@;@@$EOL$;):$EOL$;#\"!81$EOL$;};0;(??~\";#80\\;\";?~;@@$EOL$;#\"!80;):$EOL$;??Error in testing breakpoint condition;{#29\\;$EOL$;};??Quit (expect signal SIGINT when the program is resumed);{#50\\;$EOL$;};??2374: internal-error: frame_cleanup_after_sniffer: Assertion;{#52\\;$EOL$;};??^error,msg=\"Remote communication error: No error.;{#53\\;$EOL$;};??: internal-error: handle_inferior_event: Assertion;{#56\\;$EOL$;};0;(??&\";#80\\;\";?&;@@$EOL$;#\"!80;):$EOL$;(??$EOL$=;#80\\;\";?=;@@$EOL$;#\"!80;):$EOL$;";
- // Add the values you want to test.
- StringAssert.AreEqualIgnoringCase("23;1", GDBParserUnitTests.parse_GDB("12^done;1\r\n", "??^done;{#23;@@$EOL$};"), "Error: string '12^done;', string '??^done;{#23;@@$EOL$};'");
- StringAssert.AreEqualIgnoringCase("26;1;100", GDBParserUnitTests.parse_GDB("4^done;1;100\r\n", "??^done;{#26;@@$EOL$};"), "Error: string '4^done;1;100', string '??^done;{#26;@@$EOL$};'");
- StringAssert.AreEqualIgnoringCase("20;1;y;0x08048564;main;myprog.c;68;0", GDBParserUnitTests.parse_GDB("73^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x08048564\",func=\"main\",file=\"myprog.c\",fullname=\"/home/nickrob/myprog.c\",line=\"68\",thread-groups=[\"i1\"],times=\"0\"}", "??^done;{#20\\;;??number=\";{@@\";};#\\;;??enabled=\";{@@\";};#\\;;??addr=\";{@@\";};#\\;;??func=\";{@@\";};#\\;;??file=\";{@@\";};#\\;;??line=\";{@@\";};#\\;;??times=\";{@@\";};}{#Function not found!;};"), "Error: string '-break-insert', string ''");
- StringAssert.AreEqualIgnoringCase("27;1;myprog.c;68;\r\n", GDBParserUnitTests.parse_GDB("*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"1\",thread-id=\"0\",frame={addr=\"0x08048564\",func=\"main\",args=[{name=\"argc\",value=\"1\"},{name=\"argv\",value=\"0xbfc4d4d4\"}],file=\"myprog.c\",fullname=\"/home/nickrob/myprog.c\",line=\"68\"}", asyncInst), "Error: string 'breakpoint hit.', string 'Asynchronous instruction.'");
- StringAssert.AreEqualIgnoringCase("42;\r\n", GDBParserUnitTests.parse_GDB("*stopped,reason=\"exited-normally\"", asyncInst), "Error: string '*stopped,reason=\"exited-normally\"', string 'AsyncInstruction'");
- StringAssert.AreEqualIgnoringCase("45;../../../devo/gdb/testsuite/gdb.threads/linux-dp.c;187;\r\n", GDBParserUnitTests.parse_GDB("*stopped,reason=\"end-stepping-range\",thread-id=\"2\",line=\"187\",file=\"../../../devo/gdb/testsuite/gdb.threads/linux-dp.c\"", asyncInst), "Error: string 'end-stepping-range.', string 'AsyncInstruction'");
- StringAssert.AreEqualIgnoringCase("46;hello.c;7;\r\n", GDBParserUnitTests.parse_GDB("*stopped,reason=\"function-finished\",frame={func=\"main\",args=[],file=\"hello.c\",fullname=\"/home/foo/bar/hello.c\",line=\"7\"}", asyncInst), "Error: string 'Function finished.', string 'AsyncInstruction'");
- StringAssert.AreEqualIgnoringCase("44;0x00010140;foo;try.c;13;\r\n", GDBParserUnitTests.parse_GDB("111*stopped,signal-name=\"SIGINT\",signal-meaning=\"Interrupt\",frame={addr=\"0x00010140\",func=\"foo\",args=[],file=\"try.c\",fullname=\"/home/foo/bar/try.c\",line=\"13\"}", asyncInst), "Error: string '-exec-interrupt', string 'AsyncInstruction'");
- StringAssert.AreEqualIgnoringCase("", GDBParserUnitTests.parse_GDB("", ""), "Error: string '', string ''");
- }
-
- [Test]
- public void parseGDB2()
- {
- string[] v = new string[10];
- v[0] = "";
- v[1] = "";
- v[2] = "";
- v[3] = "";
- v[4] = "";
- v[5] = "";
- v[6] = "";
- v[7] = "";
- v[8] = "";
- v[9] = "";
- string sep = "#"; // default separator.
-
- string asyncInst = "??=thread-exited,id;{#51\\;;??\";@@\";#$EOL$;};??thread-created,id;{#40\\;;??\";@@\";#\\;;??pid ;@@ ;#$EOL$;};0;??*running;{#41\\;;??thread-id=\"all;{#0;}{??thread-id=\";@@\";};#$EOL$;};0;??*stopped;{??breakpoint-hit;{#27\\;;??bkptno=\";@@\";#\\;;??file=\";@@\";#\\;;??line=\";@@\";}{??end-stepping-range;{#45;??file=\";{#\\;;@@\";0;#\\;;??line=\";@@\";};}{??function-finished;{#46;??file=;{#\\;;??\";@@\";#\\;;??line=\";@@\";};}{??exited-normally;{#42;}{??exit-code;{#43\\;;??\";@@\";}{??signal-received;{??signal-meaning=\"Killed\";{#47;}{??signal-meaning=\"Segmentation fault\";{#54\\;;??addr=\";@@\";#\\;;??func=\";@@\";0;??file=;{#\\;;??\";@@\";#\\;;??line=\";@@\";};}{#44\\;;??addr=\";@@\";#\\;;??func=\";@@\";0;??file=;{#\\;;??\";@@\";#\\;;??line=\";@@\";};};};}{??exited-signalled;{#55\\;??signal-name=\";@@\";#\\;;??signal-meaning=\";@@\";}{#44\\;;??addr=\";@@\";#\\;;??func=\";@@\";0;??file=;{#\\;;??\";@@\";#\\;;??line=\";@@\";};};};};};};};};#\\;;??thread-id=;{??\";@@\";};#$EOL$;};0;??=breakpoint-modified,bkpt=\\{number=\";{0;($EOR$;$1=?=breakpoint-modified,bkpt=\\{number=\";@@\";$$;$EOR$;?=breakpoint-modified,bkpt=\\{number=\"$1$;#21\\;$1$\\;;??enabled=\";@@\";#\\;;??addr=\";@@\";#\\;;??func=\";@@\";#\\;;??file=\";@@\";#\\;;??line=\";@@\";#\\;;??times=\";@@\";0;(??=breakpoint-modified,bkpt=\\{number=\"$1$;%?$EOL$;@@\"\\};);):$EOL$;};0;??=breakpoint-deleted,id=;{0;(??=breakpoint-deleted,id=\";#22\\;;@@\";):$EOL$;};0;??@\";{0;#81\\;\";(??@\";?@;@@$EOL$;):$EOL$;#\"!81$EOL$;};0;(??~\";#80\\;\";?~;@@$EOL$;#\"!80;):$EOL$;??Error in testing breakpoint condition;{#29\\;$EOL$;};??Quit (expect signal SIGINT when the program is resumed);{#50\\;$EOL$;};??2374: internal-error: frame_cleanup_after_sniffer: Assertion;{#52\\;$EOL$;};??^error,msg=\"Remote communication error: No error.;{#53\\;$EOL$;};??: internal-error: handle_inferior_event: Assertion;{#56\\;$EOL$;};0;(??&\";#80\\;\";?&;@@$EOL$;#\"!80;):$EOL$;(??$EOL$=;#80\\;\";?=;@@$EOL$;#\"!80;):$EOL$;";
- // Add the values you want to test.
- StringAssert.AreEqualIgnoringCase("23;1", GDBParserUnitTests.parse_GDB("12^done;1\r\n", "??^done;{#23;@@$EOL$};", 0, false, v, sep), "Error: string '12^done;', string '??^done;{#23;@@$EOL$};'");
- StringAssert.AreEqualIgnoringCase("26;1;100", GDBParserUnitTests.parse_GDB("4^done;1;100\r\n", "??^done;{#26;@@$EOL$};", 0, false, v, sep), "Error: string '4^done;1;100', string '??^done;{#26;@@$EOL$};'");
- StringAssert.AreEqualIgnoringCase("20;1;y;0x08048564;main;myprog.c;68;0", GDBParserUnitTests.parse_GDB("73^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x08048564\",func=\"main\",file=\"myprog.c\",fullname=\"/home/nickrob/myprog.c\",line=\"68\",thread-groups=[\"i1\"],times=\"0\"}", "??^done;{#20\\;;??number=\";{@@\";};#\\;;??enabled=\";{@@\";};#\\;;??addr=\";{@@\";};#\\;;??func=\";{@@\";};#\\;;??file=\";{@@\";};#\\;;??line=\";{@@\";};#\\;;??times=\";{@@\";};}{#Function not found!;};", 0, false, v, sep), "Error: string '-break-insert', string ''");
- StringAssert.AreEqualIgnoringCase("27;1;myprog.c;68;\r\n", GDBParserUnitTests.parse_GDB("*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"1\",thread-id=\"0\",frame={addr=\"0x08048564\",func=\"main\",args=[{name=\"argc\",value=\"1\"},{name=\"argv\",value=\"0xbfc4d4d4\"}],file=\"myprog.c\",fullname=\"/home/nickrob/myprog.c\",line=\"68\"}", asyncInst, 0, false, v, sep), "Error: string 'breakpoint hit.', string 'Asynchronous instruction.'");
- StringAssert.AreEqualIgnoringCase("42;\r\n", GDBParserUnitTests.parse_GDB("*stopped,reason=\"exited-normally\"", asyncInst, 0, false, v, sep), "Error: string '*stopped,reason=\"exited-normally\"', string 'AsyncInstruction'");
- StringAssert.AreEqualIgnoringCase("45;../../../devo/gdb/testsuite/gdb.threads/linux-dp.c;187;\r\n", GDBParserUnitTests.parse_GDB("*stopped,reason=\"end-stepping-range\",thread-id=\"2\",line=\"187\",file=\"../../../devo/gdb/testsuite/gdb.threads/linux-dp.c\"", asyncInst, 0, false, v, sep), "Error: string 'end-stepping-range.', string 'AsyncInstruction'");
- StringAssert.AreEqualIgnoringCase("46;hello.c;7;\r\n", GDBParserUnitTests.parse_GDB("*stopped,reason=\"function-finished\",frame={func=\"main\",args=[],file=\"hello.c\",fullname=\"/home/foo/bar/hello.c\",line=\"7\"}", asyncInst, 0, false, v, sep), "Error: string 'Function finished.', string 'AsyncInstruction'");
- StringAssert.AreEqualIgnoringCase("44;0x00010140;foo;try.c;13;\r\n", GDBParserUnitTests.parse_GDB("111*stopped,signal-name=\"SIGINT\",signal-meaning=\"Interrupt\",frame={addr=\"0x00010140\",func=\"foo\",args=[],file=\"try.c\",fullname=\"/home/foo/bar/try.c\",line=\"13\"}", asyncInst, 0, false, v, sep), "Error: string '-exec-interrupt', string 'AsyncInstruction'");
- StringAssert.AreEqualIgnoringCase("", GDBParserUnitTests.parse_GDB("", "", 0, false, v, sep), "Error: string '', string ''");
- }
-
- [Test]
- public void testingInputBuffer()
- {
- GDBParserUnitTests.clean_Buffers();
-
- Assert.AreEqual(true, GDBParser.is_Input_Buffer_Empty(), "Input buffer should be empty.");
-
- for (int i = 0; i < 49; i++)
- Assert.AreEqual(true, GDBParserUnitTests.add_Into_Input_Buffer("cmd_" + i), "Could not add cmd_" + i + " in Input Buffer.");
-
- Assert.AreEqual(false, GDBParser.is_Input_Buffer_Empty(), "Input buffer should not be empty.");
-
- // to be sure that the Input buffer is circular, it is being deleted 20 elements and then adding them again.
-
- for (int i = 0; i < 20; i++)
- {
- string input = GDBParserUnitTests.remove_From_Input_Buffer();
- StringAssert.AreNotEqualIgnoringCase("", input, "" + i);
- }
-
- for (int i = 0; i < 20; i++)
- Assert.AreEqual(true, GDBParserUnitTests.add_Into_Input_Buffer("cmd_" + i), "Could not add cmd_" + i + " in Input Buffer.");
-
- for (int i = 0; i < 49; i++)
- {
- string input = GDBParserUnitTests.remove_From_Input_Buffer();
- StringAssert.AreNotEqualIgnoringCase("", input, "" + i);
- }
-
- Assert.AreEqual(true, GDBParser.is_Input_Buffer_Empty(), "Input buffer should be empty.");
-
- Assert.AreEqual(true, GDBParserUnitTests.add_Into_Input_Buffer("lastCmd"), "Could not add lastCmd in Input Buffer.");
-
- Assert.AreEqual(false, GDBParser.is_Input_Buffer_Empty(), "Input buffer should not be empty.");
-
- GDBParserUnitTests.clean_Buffers();
-
- Assert.AreEqual(true, GDBParser.is_Input_Buffer_Empty(), "Input buffer should be empty.");
- }
-
- [Test]
- public void testingGDBBuffer()
- {
- GDBParserUnitTests.clean_Buffers();
-
- Assert.AreEqual(false, GDBParserUnitTests.add_Into_GDB_Buffer(-1, -1, "resp_-1"), "It added resp_-1 in position -1 of Output Buffer! That should not be possible!");
- Assert.AreEqual(false, GDBParserUnitTests.add_Into_GDB_Buffer(-6, -6, "resp_-6"), "It added resp_-6 in position -6 of Output Buffer! That should not be possible!");
-
- Assert.AreEqual(true, GDBParserUnitTests.add_Into_GDB_Buffer(173, 173, "resp_" + 173), "Could not add resp_" + 173 + " in position " + 73 + " of Output Buffer.");
- Assert.AreEqual(true, GDBParserUnitTests.add_Into_GDB_Buffer(2314, 2314, "resp_" + 2314), "Could not add resp_" + 2314 + " in position " + 14 + " of Output Buffer.");
- Assert.AreEqual(false, GDBParserUnitTests.add_Into_GDB_Buffer(714, 714, "resp_" + 714), "Could not add resp_" + 714 + " in position " + 14 + " of Output Buffer.");
-
- string param = "";
- Assert.AreEqual(-7, GDBParserUnitTests.remove_From_GDB_Buffer(-7, out param));
- StringAssert.AreEqualIgnoringCase("", param, "-7");
- param = "";
- Assert.AreEqual(173, GDBParserUnitTests.remove_From_GDB_Buffer(73, out param));
- StringAssert.AreEqualIgnoringCase("resp_173", param, "73");
- param = "";
- Assert.AreEqual(2314, GDBParserUnitTests.remove_From_GDB_Buffer(14, out param));
- StringAssert.AreEqualIgnoringCase("resp_2314", param, "14");
-
- GDBParserUnitTests.clean_Buffers();
-
- Assert.AreEqual(true, GDBParserUnitTests.is_GDB_Buffer_Empty(), "GDB buffer should be empty. (1)");
-
- for (int i = 0; i < 100; i++)
- Assert.AreEqual(true, GDBParserUnitTests.add_Into_GDB_Buffer(i, i, "param_" + i), "Could not add seq_id=" + i + "; instruction code=" + i + "; param=param_" + i + " in GDB Buffer.");
-
- Assert.AreEqual(false, GDBParserUnitTests.add_Into_GDB_Buffer(16, 16, "param_" + 16), "Could not add seq_id=" + 16 + "; instruction code=" + 16 + "; param=param_" + 16 + " in GDB Buffer.");
-
- Assert.AreEqual(false, GDBParserUnitTests.is_GDB_Buffer_Empty(), "GDB buffer should not be empty.");
-
- for (int i = 0; i < 100; i++)
- {
- param = "";
- Assert.AreEqual(i, GDBParserUnitTests.remove_From_GDB_Buffer(i, out param));
- StringAssert.AreEqualIgnoringCase("param_" + i, param, "" + i);
- }
-
- Assert.AreEqual(true, GDBParserUnitTests.is_GDB_Buffer_Empty(), "GDB buffer should be empty. (2)");
-
- Assert.AreEqual(true, GDBParserUnitTests.add_Into_GDB_Buffer(21, 21, "param_21"), "Could not add lastCmd in GDB Buffer.");
-
- Assert.AreEqual(false, GDBParserUnitTests.is_GDB_Buffer_Empty(), "GDB buffer should not be empty. (3)");
-
- GDBParserUnitTests.clean_Buffers();
-
- Assert.AreEqual(true, GDBParserUnitTests.is_GDB_Buffer_Empty(), "GDB buffer should be empty. (4)");
- }
-
- [Test]
- public void testingOutputBuffer()
- {
- GDBParserUnitTests.clean_Buffers();
-
- Assert.AreEqual(false, GDBParserUnitTests.add_Into_Output_Buffer(-1, "resp_-1"), "It added resp_-1 in position -1 of Output Buffer! That should not be possible!");
- Assert.AreEqual(false, GDBParserUnitTests.add_Into_Output_Buffer(-6, "resp_-6"), "It added resp_-6 in position -6 of Output Buffer! That should not be possible!");
-
- Assert.AreEqual(true, GDBParserUnitTests.add_Into_Output_Buffer(173, "resp_" + 173), "Could not add resp_" + 173 + " in position " + 73 + " of Output Buffer.");
- Assert.AreEqual(true, GDBParserUnitTests.add_Into_Output_Buffer(2314, "resp_" + 2314), "Could not add resp_" + 2314 + " in position " + 14 + " of Output Buffer.");
- Assert.AreEqual(false, GDBParserUnitTests.add_Into_Output_Buffer(714, "resp_" + 714), "Could not add resp_" + 714 + " in position " + 14 + " of Output Buffer.");
-
- string output = GDBParserUnitTests.remove_Sync_From_Output_Buffer(-3);
- StringAssert.AreEqualIgnoringCase("", output, "-3");
- output = GDBParserUnitTests.remove_Sync_From_Output_Buffer(73);
- StringAssert.AreEqualIgnoringCase("", output, "73");
- output = GDBParserUnitTests.remove_Sync_From_Output_Buffer(14);
- StringAssert.AreNotEqualIgnoringCase("", output, "14");
-
- GDBParserUnitTests.clean_Buffers();
-
- for (int i = 0; i < 100; i++)
- Assert.AreEqual(true, GDBParserUnitTests.add_Into_Output_Buffer(i, "resp_" + i), "Could not add resp_" + i + " in position " + i + " of Output Buffer.");
-
- // testing the circular part of Output buffer, by deleting 20 elements and then adding them again.
- for (int i = 0; i < 20; i++)
- {
- output = GDBParserUnitTests.remove_From_Output_Buffer();
- StringAssert.AreNotEqualIgnoringCase("", output, "" + i);
- }
-
- // The circular part of Output buffer starts in position 50.
- for (int i = 50; i < 70; i++)
- Assert.AreEqual(true, GDBParserUnitTests.add_Into_Output_Buffer(i, "resp_" + i), "Could not add resp_" + i + " in position " + i + " of Output Buffer.");
-
- for (int i = 0; i < 50; i++)
- {
- output = GDBParserUnitTests.remove_From_Output_Buffer();
- StringAssert.AreNotEqualIgnoringCase("", output, "" + i);
- }
-
- // testing the first 50 positions of Output buffer, the "Synchronous" part. Deleting 20 elements and adding them again.
- for (int i = 0; i < 20; i++)
- {
- output = GDBParserUnitTests.remove_Sync_From_Output_Buffer(i);
- StringAssert.AreNotEqualIgnoringCase("", output, "" + i);
- }
-
- // The circular part of Output buffer starts in position 50.
- for (int i = 0; i < 20; i++)
- Assert.AreEqual(true, GDBParserUnitTests.add_Into_Output_Buffer(i, "resp_" + i), "Could not add resp_" + i + " in position " + i + " of Output Buffer.");
-
- for (int i = 0; i < 50; i++)
- {
- output = GDBParserUnitTests.remove_Sync_From_Output_Buffer(i);
- StringAssert.AreNotEqualIgnoringCase("", output, "" + i);
- }
-
- string asyncInst = "??=thread-exited,id;{#51\\;;??\";@@\";#$EOL$;};??thread-created,id;{#40\\;;??\";@@\";#\\;;??pid ;@@ ;#$EOL$;};0;??*running;{#41\\;;??thread-id=\"all;{#0;}{??thread-id=\";@@\";};#$EOL$;};0;??*stopped;{??breakpoint-hit;{#27\\;;??bkptno=\";@@\";#\\;;??file=\";@@\";#\\;;??line=\";@@\";}{??end-stepping-range;{#45;??file=\";{#\\;;@@\";0;#\\;;??line=\";@@\";};}{??function-finished;{#46;??file=;{#\\;;??\";@@\";#\\;;??line=\";@@\";};}{??exited-normally;{#42;}{??exit-code;{#43\\;;??\";@@\";}{??signal-received;{??signal-meaning=\"Killed\";{#47;}{??signal-meaning=\"Segmentation fault\";{#54\\;;??addr=\";@@\";#\\;;??func=\";@@\";0;??file=;{#\\;;??\";@@\";#\\;;??line=\";@@\";};}{#44\\;;??addr=\";@@\";#\\;;??func=\";@@\";0;??file=;{#\\;;??\";@@\";#\\;;??line=\";@@\";};};};}{??exited-signalled;{#55\\;??signal-name=\";@@\";#\\;;??signal-meaning=\";@@\";}{#44\\;;??addr=\";@@\";#\\;;??func=\";@@\";0;??file=;{#\\;;??\";@@\";#\\;;??line=\";@@\";};};};};};};};};#\\;;??thread-id=;{??\";@@\";};#$EOL$;};0;??=breakpoint-modified,bkpt=\\{number=\";{0;($EOR$;$1=?=breakpoint-modified,bkpt=\\{number=\";@@\";$$;$EOR$;?=breakpoint-modified,bkpt=\\{number=\"$1$;#21\\;$1$\\;;??enabled=\";@@\";#\\;;??addr=\";@@\";#\\;;??func=\";@@\";#\\;;??file=\";@@\";#\\;;??line=\";@@\";#\\;;??times=\";@@\";0;(??=breakpoint-modified,bkpt=\\{number=\"$1$;%?$EOL$;@@\"\\};);):$EOL$;};0;??=breakpoint-deleted,id=;{0;(??=breakpoint-deleted,id=\";#22\\;;@@\";):$EOL$;};0;??@\";{0;#81\\;\";(??@\";?@;@@$EOL$;):$EOL$;#\"!81$EOL$;};0;(??~\";#80\\;\";?~;@@$EOL$;#\"!80;):$EOL$;??Error in testing breakpoint condition;{#29\\;$EOL$;};??Quit (expect signal SIGINT when the program is resumed);{#50\\;$EOL$;};??2374: internal-error: frame_cleanup_after_sniffer: Assertion;{#52\\;$EOL$;};??^error,msg=\"Remote communication error: No error.;{#53\\;$EOL$;};??: internal-error: handle_inferior_event: Assertion;{#56\\;$EOL$;};0;(??&\";#80\\;\";?&;@@$EOL$;#\"!80;):$EOL$;(??$EOL$=;#80\\;\";?=;@@$EOL$;#\"!80;):$EOL$;";
- // Add the values you want to test.
- GDBParserUnitTests.parse_GDB("12^done;1\r\n", "??^done;{#23;@@$EOL$};", 5);
- output = GDBParserUnitTests.remove_Sync_From_Output_Buffer(5);
- StringAssert.AreEqualIgnoringCase("23;1", output, "23;1" + 5);
- output = GDBParserUnitTests.remove_Sync_From_Output_Buffer(5);
- StringAssert.AreEqualIgnoringCase("", output, "" + 5);
-
- GDBParserUnitTests.parse_GDB("4^done;1;100\r\n", "??^done;{#26;@@$EOL$};", 45);
- output = GDBParserUnitTests.remove_Sync_From_Output_Buffer(45);
- StringAssert.AreEqualIgnoringCase("26;1;100", output, "26;1;100" + 45);
-
- // to reset the out_OutputBuffer pointer, that points to the next position from the circular part of Output Buffer to be taken.
- GDBParserUnitTests.clean_Buffers();
-
- // Parsing some samples of GDB responses and adding the results in the Output Buffer.
- GDBParserUnitTests.parse_GDB("73^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x08048564\",func=\"main\",file=\"myprog.c\",fullname=\"/home/nickrob/myprog.c\",line=\"68\",thread-groups=[\"i1\"],times=\"0\"}", "??^done;{#20\\;;??number=\";{@@\";};#\\;;??enabled=\";{@@\";};#\\;;??addr=\";{@@\";};#\\;;??func=\";{@@\";};#\\;;??file=\";{@@\";};#\\;;??line=\";{@@\";};#\\;;??times=\";{@@\";};}{#Function not found!;};", 51);
- GDBParserUnitTests.parse_GDB("*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"1\",thread-id=\"0\",frame={addr=\"0x08048564\",func=\"main\",args=[{name=\"argc\",value=\"1\"},{name=\"argv\",value=\"0xbfc4d4d4\"}],file=\"myprog.c\",fullname=\"/home/nickrob/myprog.c\",line=\"68\"}", asyncInst, 53);
- GDBParserUnitTests.parse_GDB("*stopped,reason=\"exited-normally\"", asyncInst, 52);
- GDBParserUnitTests.parse_GDB("*stopped,reason=\"end-stepping-range\",thread-id=\"2\",line=\"187\",file=\"../../../devo/gdb/testsuite/gdb.threads/linux-dp.c\"", asyncInst, 36);
- GDBParserUnitTests.parse_GDB("*stopped,reason=\"function-finished\",frame={func=\"main\",args=[],file=\"hello.c\",fullname=\"/home/foo/bar/hello.c\",line=\"7\"}", asyncInst, 50);
- GDBParserUnitTests.parse_GDB("111*stopped,signal-name=\"SIGINT\",signal-meaning=\"Interrupt\",frame={addr=\"0x00010140\",func=\"foo\",args=[],file=\"try.c\",fullname=\"/home/foo/bar/try.c\",line=\"13\"}", asyncInst, 23);
-
- // Getting the parsed responses from the synchronous part of Output buffer
- output = GDBParserUnitTests.remove_Sync_From_Output_Buffer(23);
- StringAssert.AreEqualIgnoringCase("44;0x00010140;foo;try.c;13;\r\n", output, "44;0x00010140;foo;try.c;13;\r\n" + 23);
-
- output = GDBParserUnitTests.remove_Sync_From_Output_Buffer(36);
- StringAssert.AreEqualIgnoringCase("45;../../../devo/gdb/testsuite/gdb.threads/linux-dp.c;187;\r\n", output, "45;../../../devo/gdb/testsuite/gdb.threads/linux-dp.c;187;\r\n" + 86);
-
- // Getting the parsed responses from the circular part of Output Buffer
- for (int i = 50; i < 100; i++)
- {
- output = GDBParserUnitTests.remove_From_Output_Buffer();
- switch (i)
- {
- case 50:
- StringAssert.AreEqualIgnoringCase("46;hello.c;7;\r\n", output, "46;hello.c;7;\r\n" + 50);
- break;
- case 51:
- StringAssert.AreEqualIgnoringCase("20;1;y;0x08048564;main;myprog.c;68;0", output, "20;1;y;0x08048564;main;myprog.c;68;0" + 51);
- break;
- case 52:
- StringAssert.AreEqualIgnoringCase("42;\r\n", output, "42;\r\n" + 52);
- break;
- case 53:
- StringAssert.AreEqualIgnoringCase("27;1;myprog.c;68;\r\n", output, "27;1;myprog.c;68;\r\n" + 53);
- break;
- default:
- StringAssert.AreEqualIgnoringCase("", output, "" + i);
- break;
- }
- }
-
- GDBParserUnitTests.parse_GDB("", "", 5);
- output = GDBParserUnitTests.remove_Sync_From_Output_Buffer(5);
- // parse_GDB changes an empty parsed response from GDB to "$#@EMPTY@#$", so the method that is waiting for this parsed response
- // knows that the response was really parsed and returned an empty string.
- StringAssert.AreEqualIgnoringCase("$#@EMPTY@#$", output, "$#@EMPTY@#$" + 5);
- }
-
- }
-}
diff --git a/src/GDBParser/ComponentException.h b/src/GDBParser/ComponentException.h
deleted file mode 100644
index a11dd402..00000000
--- a/src/GDBParser/ComponentException.h
+++ /dev/null
@@ -1,36 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-#pragma once
-
-BEGIN_NAMESPACE
-
-public ref class ComponentException : public Exception
-{
-public:
- ComponentException(HRESULT hr) : Exception()
- {
- this->HResult = hr;
- }
-
- property HRESULT HResult
- {
- HRESULT get()
- {
- return Exception::HResult;
- }
- }
-};
-
-END_NAMESPACE
diff --git a/src/GDBParser/Constants.cpp b/src/GDBParser/Constants.cpp
deleted file mode 100644
index c21d40d8..00000000
--- a/src/GDBParser/Constants.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-#include "stdafx.h"
-
-#pragma managed(on)
-
-BEGIN_NAMESPACE
-
-public ref class Constants
-{
-public:
- #undef S_OK
- static const int S_OK = 0;
-
- #undef S_FALSE
- static const int S_FALSE = 1;
-
- #define __E_NOTIMPL E_NOTIMPL
- #undef E_NOTIMPL
- static const int E_NOTIMPL = __E_NOTIMPL;
-
- #define __E_FAIL E_FAIL
- #undef E_FAIL
- static const int E_FAIL = __E_FAIL;
-
- static const int E_WIN32_INVALID_NAME = HRESULT_FROM_WIN32(ERROR_INVALID_NAME);
-
- static const int E_WIN32_ALREADY_INITIALIZED = HRESULT_FROM_WIN32(ERROR_ALREADY_INITIALIZED);
-
- #define __RPC_E_SERVERFAULT RPC_E_SERVERFAULT
- #undef RPC_E_SERVERFAULT
- static const int RPC_E_SERVERFAULT = __RPC_E_SERVERFAULT;
-};
-
-END_NAMESPACE
\ No newline at end of file
diff --git a/src/GDBParser/GDBParser.def b/src/GDBParser/GDBParser.def
deleted file mode 100644
index dae61e7a..00000000
--- a/src/GDBParser/GDBParser.def
+++ /dev/null
@@ -1,5 +0,0 @@
-LIBRARY "GDBParser"
-
-EXPORTS
-DllRegisterServer PRIVATE
-DllUnregisterServer PRIVATE
\ No newline at end of file
diff --git a/src/GDBParser/GDBParser.rc b/src/GDBParser/GDBParser.rc
deleted file mode 100644
index 66dfd246..00000000
--- a/src/GDBParser/GDBParser.rc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-LANGUAGE 9, 1
-#pragma code_page(1252)
-
-#ifdef APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-IDR_GDBPARSER REGISTRY "GDBParser.rgs"
-
-#endif // APSTUDIO_INVOKED
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-IDR_GDBPARSER REGISTRY "GDBParser.rgs"
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/src/GDBParser/GDBParser.rgs b/src/GDBParser/GDBParser.rgs
deleted file mode 100644
index aa6344f9..00000000
--- a/src/GDBParser/GDBParser.rgs
+++ /dev/null
@@ -1,59 +0,0 @@
-HKLM
-{
- NoRemove SOFTWARE
- {
- NoRemove Microsoft
- {
- NoRemove VisualStudio
- {
- NoRemove 10.0
- {
- NoRemove AD7Metrics
- {
- NoRemove Engine
- {
- '{D951924A-4999-42a0-9217-1EB5233D1D5A}' = s 'guidDebuggingSampleEngine'
- {
- val 'CLSID' = s '{8355452D-6D2F-41b0-89B8-BB2AA2529E94}'
- val 'ProgramProvider' = s '{FF3E23A2-DA7E-4fa7-AF47-6EDEDE4E922E}'
- val 'Attach' = d '1'
- val 'AddressBP' = d '0'
- val 'AutoSelectPriority' = d '4'
- val 'CallstackBP' = d '1'
- val 'Name' = s 'Sample Debug Engine'
- val 'PortSupplier' = s '{708C1ECA-FF48-11D2-904F-00C04FA302A1}'
-
- 'IncompatibleList'
- {
- val 'guidCOMPlusNativeEng' = s '{92EF0900-2251-11D2-B72E-0000F87572EF}'
- val 'guidCOMPlusOnlyEng' = s '{449EC4CC-30D2-4032-9256-EE18EB41B62B}'
- val 'guidNativeOnlyEng' = s '{449EC4CC-30D2-4032-9256-EE18EB41B62B}'
- val 'guidScriptEng' = s '{F200A7E7-DEA5-11D0-B854-00A0244A1DE2}'
- }
- }
- }
- }
-
- NoRemove CLSID
- {
- '{8355452D-6D2F-41b0-89B8-BB2AA2529E94}'
- {
- val 'Assembly' = s 'Microsoft.VisualStudio.Debugger.SampleEngine'
- val 'Class' = s 'Microsoft.VisualStudio.Debugger.SampleEngine.AD7Engine'
- val 'InprocServer32' = s 'c:\windows\system32\mscoree.dll'
- val 'CodeBase' = s '%GDBPARSERPATH%\Microsoft.VisualStudio.Debugger.SampleEngine.dll'
- }
-
- '{FF3E23A2-DA7E-4fa7-AF47-6EDEDE4E922E}'
- {
- val 'Assembly' = s 'Microsoft.VisualStudio.Debugger.SampleEngine'
- val 'Class' = s 'Microsoft.VisualStudio.Debugger.SampleEngine.AD7ProgramProvider'
- val 'InprocServer32' = s 'c:\windows\system32\mscoree.dll'
- val 'CodeBase' = s '%GDBPARSERPATH%\Microsoft.VisualStudio.Debugger.SampleEngine.dll'
- }
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/GDBParser/GDBParser.vcxproj b/src/GDBParser/GDBParser.vcxproj
deleted file mode 100644
index 6a577dc1..00000000
--- a/src/GDBParser/GDBParser.vcxproj
+++ /dev/null
@@ -1,163 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
-
- {CC7B28E0-CB31-44F7-A380-E7072F670F38}
- GDBParser
- Win32Proj
- GDBParser
-
-
-
- DynamicLibrary
- Unicode
- true
- true
-
-
- DynamicLibrary
- Unicode
- true
-
-
-
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.30305.0
- $(SolutionDir)$(Configuration)\
- $(Configuration)\
- true
- $(SolutionDir)$(Configuration)\
- $(Configuration)\
- false
- AllRules.ruleset
-
-
- AllRules.ruleset
-
-
- C:\Users\guarnold.RIMNET\vsplugin-ndk\src\gdb-connect;$(SourcePath)
- C:\Users\guarnold.RIMNET\vsplugin-ndk\src\gdb-connect;$(IncludePath)
- $(ReferencePath)
- $(LibraryPath)
-
-
-
- Disabled
- C:\VSPlugin-Git\vsplugin-ndk\src\gdb-connect;$(ProgramFiles)\Microsoft Visual Studio 10.0\DIA SDK\include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_WINDOWS;_USRDLL;DEBUG;%(PreprocessorDefinitions)
- false
- Default
- MultiThreadedDebugDLL
- Use
- Level3
- ProgramDatabase
-
-
- $(IntDir);%(AdditionalIncludeDirectories)
- $(IntDir)GDBParser.res
-
-
- true
- psapi.lib;$(ProgramFiles)\Microsoft Visual Studio 10.0\DIA SDK\lib\diaguids.lib;%(AdditionalDependencies)
- GDBParser.def
- true
- true
- Windows
- false
-
-
- MachineX86
-
-
-
-
-
-
-
-
- $(VSInstallDir)\DIA SDK\include;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
- MultiThreadedDLL
- Use
- Level3
- ProgramDatabase
-
-
- true
- psapi.lib;$(VSInstallDir)\DIA SDK\lib\diaguids.lib;%(AdditionalDependencies)
- GDBParser.def
- true
- Windows
- true
- true
- false
-
-
- MachineX86
-
-
- xcopy "$(ProjectDir)Instructions.txt" "$(OutputPath)" /d /y
- Copying Instructions.txt to output directory.
-
-
-
-
- true
- true
-
-
-
-
-
-
-
- false
-
-
- false
-
-
-
- Create
- Create
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/GDBParser/GDBParser.vcxproj.filters b/src/GDBParser/GDBParser.vcxproj.filters
deleted file mode 100644
index 5c165339..00000000
--- a/src/GDBParser/GDBParser.vcxproj.filters
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav
-
-
- {3bb6314f-66c5-4c9f-b290-dfa7cf75aeea}
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
-
- Source Files
-
-
- Resource Files
-
-
-
-
-
- Internal Header files
-
-
- Internal Header files
-
-
- Internal Header files
-
-
- Internal Header files
-
-
- Internal Header files
-
-
- Internal Header files
-
-
- Source Files\GDBParser API Header files
-
-
-
-
- Resource Files
-
-
-
\ No newline at end of file
diff --git a/src/GDBParser/GDBParser.vcxproj.user b/src/GDBParser/GDBParser.vcxproj.user
deleted file mode 100644
index ace9a86a..00000000
--- a/src/GDBParser/GDBParser.vcxproj.user
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/src/GDBParser/GDBParserAPI.cpp b/src/GDBParser/GDBParserAPI.cpp
deleted file mode 100644
index eca44cd4..00000000
--- a/src/GDBParser/GDBParserAPI.cpp
+++ /dev/null
@@ -1,854 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-#include "stdafx.h"
-
-#pragma managed(on)
-
-#include
-#include < stdio.h >
-#include < stdlib.h >
-#include < vcclr.h >
-using namespace System;
-using namespace System::Text::RegularExpressions;
-using namespace Microsoft::Win32;
-
-#include "ProjInclude.h"
-
-// GDBParser API header files (in alphabetical order)
-#include "GDBParserAPI.h"
-
-#include "gdb-connect.h"
-
-using namespace std;
-
-
-///
-/// Set an auto pointer given a String^.
-///
-/// String.
-/// Auto pointer.
-CAutoPtr convertToAutoPtrFromString(String^ str) {
- CAutoPtr ap;
-
- pin_ptr pkwc = PtrToStringChars(str);
- char* pc = new char[(wcslen(pkwc) + 1) * sizeof(char)];
- ap.Attach(pc);
-
- // Convert wchar_t* to a char*
- size_t origsize = wcslen(pkwc) + 1;
- size_t convertedChars = 0;
- wcstombs_s(&convertedChars, ap, origsize, pkwc, _TRUNCATE);
-
- return ap;
-}
-
-
-///
-/// Gets a parsed asynchronous GDB response from Output Buffer. Also can get a parsed GDB response for a non-synchronous GDB
-/// COMMAND from Output buffer. This method is called by the Event Dispather of the Debug Engine.
-///
-/// Parsed GDB response.
-String^ GDBParser::removeGDBResponse()
-{
- char output[ParsedMessageSize] = "";
- removeFromOutputBuffer(output);
- String ^systemstring = gcnew String(output);
- return systemstring;
-}
-
-
-///
-/// Sends a non-synchronous GDB command by adding it into the Input Buffer. This method is called by the Debug Engine whenever
-/// it needs to send a GDB command without having to wait for the respective GDB response.
-///
-/// Command to be sent to GDB.
-/// True.
-bool GDBParser::addGDBCommand(String^ GDBCommand)
-{
- CAutoPtr apCmd = convertToAutoPtrFromString(GDBCommand);
- while (!addIntoInputBuffer(apCmd)); // Keep trying until it is added into Input buffer
- return(true);
-}
-
-
-///
-/// Exits GDB. This method is called to end the debug session by Event Dispatcher (Debug Engine) or directly by the debug engine
-/// when it fails to launch a new debug session.
-///
-void GDBParser::exitGDB()
-{
- // Sends the command that exits GDB immediately.
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Miscellaneous-Commands.html)
- addGDBCommand("-gdb-exit");
- GDBConsole::shutdown();
- s_running = false;
- if (m_BBConnectProcess)
- TerminateProcess(m_BBConnectProcess, 0);
-}
-
-
-///
-/// Verify if Input buffer is empty.
-///
-/// Returns TRUE if empty; FALSE if not.
-bool GDBParser::is_Input_Buffer_Empty()
-{
- return(isInputBufferEmpty());
-}
-
-
-///
-/// Sends a synchronous GDB command by adding it into the Input Buffer and waiting for the respective GDB response. This
-/// method is called by the Debug Engine whenever it needs a GDB response for a given GDB command.
-///
-/// Command to be sent to GDB.
-/// Instruction ID.
-/// Parsed GDB response.
-String^ GDBParser::parseCommand(String^ GDBCommand, int ID)
-{
- char output[ParsedMessageSize] = "";
- CAutoPtr apCmd;
- if (ID < 10)
- apCmd = convertToAutoPtrFromString("0" + ID + GDBCommand);
- else
- apCmd = convertToAutoPtrFromString(ID + GDBCommand);
-
- while (!addIntoInputBuffer(apCmd) && s_running)
- Sleep(0); // keep trying to add into buffer
-
- while (strcmp(output,"") == 0 && s_running)
- removeSyncFromOutputBuffer(output, ID);
- if (strcmp(output,"$#@EMPTY@#$") == 0) // This string means that both GDB and the parser worked well and returned an empty string.
- strcpy(output,"");
-
- String ^systemstring = gcnew String(output);
- return systemstring;
-}
-
-
-///
-/// Sets the NDK variables.
-///
-/// Boolean value that indicates which of the simulator/device is being used:
-/// True -> simulator;
-/// False -> Device.
-void GDBParser::setNDKVars(bool isSimulator) {
- String^ keyPath = "HKEY_CURRENT_USER\\Software\\BlackBerry\\BlackBerryVSPlugin";
- String^ ndkHostPath = (String^)Registry::GetValue(keyPath, "NDKHostPath", "");
- String^ ndkTargetPath = (String^)Registry::GetValue(keyPath, "NDKTargetPath", "");
- m_remotePath = (String^)Registry::GetValue(keyPath, "NDKRemotePath", "");
-
- if (isSimulator) {
- m_pcGDBCmd = ndkHostPath + "\\usr\\bin\\ntox86-gdb.exe --interpreter=mi2";
- m_libPaths[0] = ndkTargetPath + "\\x86\\lib";
- m_libPaths[1] = ndkTargetPath + "\\x86\\usr\\lib";
- } else {
- m_pcGDBCmd = ndkHostPath + "\\usr\\bin\\ntoarm-gdb.exe --interpreter=mi2";
- m_libPaths[0] = ndkTargetPath + "\\armle-v7\\lib";
- m_libPaths[1] = ndkTargetPath + "\\armle-v7\\usr\\lib";
- }
-
- // Escape backslashes for strings that will be sent to GDB
- String^ pattern = "\\\\"; // one backslash
- String^ replacement = "\\\\\\\\"; // two backslashes
- Regex^ r = gcnew Regex(pattern);
-
- String^ regexResult;
- for (int i = 0; i < NUM_LIB_PATHS; i++) {
- regexResult = r->Replace(m_libPaths[i], replacement);
- m_libPaths[i] = regexResult;
- }
-}
-
-
-///
-/// Run BlackBerryConnect to stablish a connection with the device/simulator.
-///
-/// Device/Simulator IP.
-/// NDK full path.
-/// Public key full path.
-/// Device/simulator password.
-void GDBParser::BlackBerryConnect(String^ IPAddrStr, String^ toolsPath, String^ publicKeyPath, String^ password)
-{
- CAutoPtr apDevice = convertToAutoPtrFromString(IPAddrStr);
- CAutoPtr apTools = convertToAutoPtrFromString(toolsPath);
- CAutoPtr apKey = convertToAutoPtrFromString(publicKeyPath);
-
- CAutoPtr apPass;
- if (!String::IsNullOrEmpty(password))
- apPass = convertToAutoPtrFromString(password);
-
- LPCTSTR lpApplicationName = NULL;
- PROCESS_INFORMATION pi;
- STARTUPINFOA si;
- DWORD flags = 0;
-
- memset(&pi, 0, sizeof(pi));
-
- // Set up the start up info struct.
- ZeroMemory(&si, sizeof(STARTUPINFO));
- si.cb = sizeof(STARTUPINFO);
-#if !defined (SHOW_BB_CONNECT_WINDOW)
- si.dwFlags = STARTF_USESHOWWINDOW;
- si.wShowWindow = SW_HIDE;
-#endif
-
- char args[256];
- if (!String::IsNullOrEmpty(password))
- sprintf(args, "java.exe -Xmx512M -jar \"%s\\..\\lib\\Connect.jar\" %s -password %s -sshPublicKey \"%s\"", apTools, apDevice, apPass, apKey);
- else
- sprintf(args, "java.exe -Xmx512M -jar \"%s\\..\\lib\\Connect.jar\" %s -sshPublicKey \"%s\"", apTools, apDevice, apKey);
-
- // Launch the process
- if (!CreateProcessA(NULL, args, NULL, NULL, TRUE,
- flags, NULL, NULL, &si, &pi))
- ErrorExit(_T("CreateProcess: BlackBerry-Connect"));
-
- m_BBConnectProcess = pi.hProcess;
-}
-
-
-///
-/// Execute GDB only to get the list of running processes in the Device/Simulator
-///
-/// Device/Simulator IP.
-/// Device/simulator password.
-/// TRUE when using the Simulator, FALSE when using the Device.
-/// NDK full path.
-/// Public key full path.
-/// How many seconds to wait for connecting to the device.
-/// A string with the list of running processes.
-String^ GDBParser::GetPIDsThroughGDB(String^ IP, String^ password, bool isSimulator, String^ toolsPath, String^ publicKeyPath, int timeout)
-{
- string response;
- string parsed;
- m_BBConnectProcess = NULL;
- char pcCmd[256];
-
- // Run BlackBerryConnect
- BlackBerryConnect(IP, toolsPath, publicKeyPath, password);
-
- // Get device (IP address)
- CAutoPtr ip = convertToAutoPtrFromString(IP);
-
- // Set NDK Variables
- setNDKVars(isSimulator);
-
- // Convert GDB command to wchar_t* since GDBWrapper.exe requires a Unicode argument
- pin_ptr pkwcGDBCmd = PtrToStringChars(m_pcGDBCmd);
- const size_t newsizew = (wcslen(pkwcGDBCmd) + 1) * sizeof(wchar_t);
- wchar_t* pwcGDBCmd = new wchar_t[newsizew];
- wcscpy_s(pwcGDBCmd, newsizew, pkwcGDBCmd);
- CAutoPtr apGDBCmd;
- apGDBCmd.Attach(pwcGDBCmd);
-
- // Get GDB Console
- GDBConsole::setGDBPath(apGDBCmd);
- GDBConsole* console = GDBConsole::getInstance();
-
- // Convert library paths
- CAutoPtr libPaths[NUM_LIB_PATHS];
- for (int i = 0; i < NUM_LIB_PATHS; i++) {
- libPaths[i] = convertToAutoPtrFromString(m_libPaths[i]);
- }
-
- /// Send intialization commands to GDB
- response = console->waitForPrompt(true);
- if ((response == "") || (response[0] == '!')) //found an error
- {
- // ??? load output console window with the parsed message.
- response = "";
- }
-
- if (response != "")
- {
-// sprintf(pcCmd, "set debug nto-debug 2\r\n");
-// console->sendCommand(pcCmd);
-// response = console->waitForPrompt(true);
-
- sprintf(pcCmd, "1-target-select qnx %s:8000\r\n", ip);
- console->sendCommand(pcCmd);
- response = console->waitForPromptWithTimeout(timeout);
- if ((response == "") || (response[0] == '!')) //found an error
- {
- // ??? load output console window with the parsed message.
- response = "";
- }
-
- if ((response != "") && (response != "TIMEOUT!") && (response.find("1^error,msg=",0) == -1)) //there is no error from previous response
- {
- sprintf(pcCmd, "info pidlist\r\n");
- console->sendCommand(pcCmd);
- response = console->waitForPrompt(true);
- if ((response == "") || (response[0] == '!')) //found an error
- {
- // ??? load output console window with the parsed message.
- response = "";
- }
- }
- }
- exitGDB();
- String ^systemString = gcnew String(response.c_str());
- return systemString;
-}
-
-
-///
-/// Launch the GDB Debug Process.
-///
-/// ID of the running process to be debugged.
-/// Full path of the executable file.
-/// Device/Simulator IP.
-/// TRUE when using the Simulator, FALSE when using the Device.
-/// NDK full path.
-/// Public key full path.
-/// Device/simulator password.
-/// True -> succeeded;
-/// False -> failed.
-bool GDBParser::LaunchProcess(String^ pidStr, String^ exeStr, String^ IPAddrStr, bool isSimulator, String^ toolsPath, String^ publicKeyPath, String^ password)
-{
- string response;
- string parsed;
- s_running = true;
- m_BBConnectProcess = NULL;
- char pcCmd[256];
-
- // Run BlackBerryConnect
- BlackBerryConnect(IPAddrStr, toolsPath, publicKeyPath, password);
-
- // Get PID
- CAutoPtr apPid = convertToAutoPtrFromString(pidStr);
- long int pid = strtol(apPid, NULL, 10);
- if (pid == 0) {
- return false;
- }
-
- // Get device (IP address)
- CAutoPtr apDevice = convertToAutoPtrFromString(IPAddrStr);
-
- // Get binary file path
- CAutoPtr apBinaryFile;
- if (exeStr == "CannotAttachToRunningProcess")
- apBinaryFile = convertToAutoPtrFromString("");
- else
- apBinaryFile = convertToAutoPtrFromString(exeStr);
-
- // Set NDK Variables
- setNDKVars(isSimulator);
-
- // Convert GDB command to wchar_t* since GDBWrapper.exe requires a Unicode argument
- pin_ptr pkwcGDBCmd = PtrToStringChars(m_pcGDBCmd);
- const size_t newsizew = (wcslen(pkwcGDBCmd) + 1) * sizeof(wchar_t);
- wchar_t* pwcGDBCmd = new wchar_t[newsizew];
- wcscpy_s(pwcGDBCmd, newsizew, pkwcGDBCmd);
- CAutoPtr apGDBCmd;
- apGDBCmd.Attach(pwcGDBCmd);
-
- // Get GDB Console
- GDBConsole::setGDBPath(apGDBCmd);
- GDBConsole* console = GDBConsole::getInstance();
-
- // Convert library paths
- CAutoPtr libPaths[NUM_LIB_PATHS];
- for (int i = 0; i < NUM_LIB_PATHS; i++) {
- libPaths[i] = convertToAutoPtrFromString(m_libPaths[i]);
- }
-
- // initializing the parsing data structures, buffers and thread
- HANDLE sendingThread;
- unsigned threadID;
- unordered_map commandCodesMap;
- string parsingInstructions[NumberOfInstructions];
-
- cleanBuffers();
- if(!insertingCommandCodes(&commandCodesMap, parsingInstructions))
- {
- printf("Error initializing parsing data structures");
- return false;
- }
-
- /// Send intialization commands to GDB
- response = console->waitForPrompt(true);
- parsed = parseGDB(response, parsingInstructions[2]);
- if ((parsed == "") || (parsed[0] == '!')) //found an error
- {
- // TODO: load output console window with the response.
- return false;
- }
-
-// sprintf(pcCmd, "set debug nto-debug 2\r\n");
-// console->sendCommand(pcCmd);
-// response = console->waitForPrompt(true);
-
- sprintf(pcCmd, "1-gdb-set breakpoint pending on\r\n");
- console->sendCommand(pcCmd);
- response = console->waitForPrompt(true);
- parsed = parseGDB(response, parsingInstructions[8]);
- if ((parsed == "") || (parsed[0] == '!')) //found an error
- {
- // TODO: load output console window with the response.
- return false;
- }
-
- sprintf(pcCmd, "4-target-select qnx %s:8000\r\n", apDevice);
- console->sendCommand(pcCmd);
- response = console->waitForPrompt(true);
- parsed = parseGDB(response, parsingInstructions[3]);
- if ((parsed == "") || (parsed[0] == '!')) //found an error
- {
- // TODO: load output console window with the response.
- return false;
- }
-
- sprintf(pcCmd, "5-file-exec-and-symbols %s\r\n", apBinaryFile);
- console->sendCommand(pcCmd);
- response = console->waitForPrompt(true);
- parsed = parseGDB(response, parsingInstructions[7]);
- if ((parsed == "") || (parsed[0] == '!')) //found an error
- {
- // TODO: load output console window with the response.
- return false;
- }
-
- if (m_remotePath != "")
- {
- m_remotePath = m_remotePath + "\\lib;" + m_remotePath + "\\usr\\lib;" + m_remotePath + "\\usr\\lib\\qt4";
- CAutoPtr apPath = convertToAutoPtrFromString(m_remotePath);
- sprintf(pcCmd, "6set solib-search-path %s\r\n", apPath );
- console->sendCommand(pcCmd);
- response = console->waitForPrompt(true);
- parsed = parseGDB(response, parsingInstructions[8]);
- if ((parsed == "") || (parsed[0] == '!')) //found an error
- {
- // TODO: load output console window with the response.
- return false;
- }
- }
-
- sprintf(pcCmd, "7-target-attach %d\r\n", pid);
- console->sendCommand(pcCmd);
- response = console->waitForPrompt(true);
- parsed = parseGDB(response, parsingInstructions[6]);
- if ((parsed == "") || (parsed[0] == '!')) //found an error
- {
- // TODO: load output console window with the response.
- return false;
- }
-
-// start thread responsible for reading InputBuffer and sending commands to GDB.
-// Thread must start after initializing GDB with the previous instructions because:
-// - this thread will start another one (listening GDB) that will start consuming GDB responses. So, the above waitForPrompt would
-// never get a result and this method would freeze.
-// - the previous commands don't use the GDB Buffer, so the results wouldn't be parsed correctly.
- sendingThread = (HANDLE)_beginthreadex( NULL, 0, &sendingCommands2GDB, (void *)console, 0, &threadID);
-
- return true;
-}
-
-
-
-
-// From this point on it is implemented the interface that allows creating unit tests for gdb-connect functions. Don't use these methods
-// for something else because they need some resources that are allocated correctly when launching GDB the right way, i.e., by using the
-// above GDBParser::LaunchProcess method. To be able to run the unit tests, it is needed to create mock resources or call
-// GDBParser::LaunchProcess method first, because it will allocate the needed resources and will start GDB.
-
-
-///
-/// Get the associated instruction ID from the command that would be sent to GDB.
-///
-/// Command that would be sent to GDB.
-/// When the instruction code stored in "map" is negative, it means that the commands parameters should be saved to
-/// be used by the listeningGDB thread. When that happens, update and return variable "param".
-/// Returns the instruction code for the command that would be sent to GDB or -1 in case of an error. It can also return the
-/// command parameters, as it was described above.
-int GDBParserUnitTests::get_Instruction_Code(String^ command, [Runtime::InteropServices::Out] String^ %param)
-{
- CAutoPtr apCmd = convertToAutoPtrFromString(command);
- string c = apCmd;
- string p = "";
-
- unordered_map map;
- string v[NumberOfInstructions];
-
- // First create the hash table map.
- bool result = insertingCommandCodes(&map, v);
-
- int code = -2;
-
- if (result == 1)
- {
- code = getInstructionCode(c, map, &p);
- param = gcnew String(p.c_str());
- }
- return code;
-}
-
-
-///
-/// Get the sequential ID of the supposed response.
-///
-/// The supposed GDB response.
-/// If the supposed response is synchronous, this ID corresponds to the sequential ID of the command that should be sent to GDB
-/// that generated such supposed response. If the supposed response is asynchronous, there is no sequential ID, so it returns:
-/// -3 - when it shows that a supposed breakpoint was modified;
-/// -2 - for any other supposed asynchronous response
-/// -1 - when the supposed response is not completed or in case of an error.
-int GDBParserUnitTests::get_Seq_ID(String^ response)
-{
- CAutoPtr apResp = convertToAutoPtrFromString(response);
- string r = apResp;
- return getSeqID(r);
-}
-
-
-///
-/// Initialize the hash map data structure "map" in which each entry contains a GDB command that is currently recognized by
-/// the parser with its respective instruction ID. It loads these information from Instructions.txt file, in where each line has the
-/// following format:
-/// {$}gdb-command:->:parsing-instruction;
-/// It must have the $ sign in front of the GDB command when it is needed to store the command parameters to be used later by the
-/// listeningGDB thread. This usually happens whenever the GDB response for a given command does not contains enough information, like
-/// only "^done" for example, when the parser needs something else. The ":->:" separates the GDB command from the parsing Instruction.
-///
-/// Array that contains all the data from the Hash map created by insertingCommandCodes() function, that are the GDB
-/// commands recognized by the parser and their respectives instructions IDs.
-/// A string array with all of the currently recognized parsing instructions. The index position
-/// correponds to the instruction ID used in "map" for the respective GDB command.
-/// 1 in case of sucess; 0 if there is an error when opening the Instructions.txt file.
-bool GDBParserUnitTests::inserting_Command_Codes(array^ map, array^ parsingInstructions)
-{
- unordered_map m;
- string v[NumberOfInstructions];
-
- bool result = insertingCommandCodes(&m, v);
-
- for (int i = 0; i < NumberOfInstructions; i++)
- {
- parsingInstructions[i] = gcnew String(v[i].c_str());
- }
-
- int i = 0;
- for (unordered_map::iterator it = m.begin(); it != m.end(); ++it)
- {
- map[i,0] = gcnew String(it->first.c_str());
- map[i,1] = Convert::ToString(it->second);
- i++;
- }
-
- return result;
-}
-
-
-///
-/// Function used to call the parser that will parse a supposed GDB response according to the supposed parsing instruction, returning
-/// this parsed response. This function is called when starting GDB (this one doesn't use the OutputBuffer because it returns the supposed
-/// parsed response).
-///
-/// Supposed GDB response.
-/// Instruction used to parse the supposed GDB response.
-/// Returns the parsed GDB response.
-String^ GDBParserUnitTests::parse_GDB(String^ response, String^ parsingInstruction)
-{
- CAutoPtr apResp = convertToAutoPtrFromString(response);
- string r = apResp;
- CAutoPtr apPars = convertToAutoPtrFromString(parsingInstruction);
- string p = apPars;
- string output = parseGDB(r, p);
- String ^systemstring = gcnew String(output.c_str());
- return systemstring;
-}
-
-
-///
-/// Function used to call the parser that will parse a supposed GDB response according to the supposed parsing instruction, storing
-/// the parsed response in the respective position in the Output Buffer. Must be used together with the functions that create and handle
-/// the Output Buffer. DON'T CALL THIS METHOD PASSING A POSITION OF OUTPUT BUFFER THAT IS ALREADY FILLED! parseGDB(string, string, int) is
-/// used in an environment that has a different thread consuming items from Output Buffer. In this initial unit tests environment only
-/// the current thread is running, which means that, if you try to add data to a non-empty position, this method will be busy-waiting till
-/// that entry is empty, causing, in this scenario, a DEADLOCK.
-///
-/// GDB response.
-/// Instruction used to parse the respective GDB response.
-/// Position in the Output Buffer in which the parsed response will be stored.
-void GDBParserUnitTests::parse_GDB(String^ response, String^ parsingInstruction, int position)
-{
- CAutoPtr apResp = convertToAutoPtrFromString(response);
- string r = apResp;
- CAutoPtr apPars = convertToAutoPtrFromString(parsingInstruction);
- string p = apPars;
- parseGDB(r, p, position);
-}
-
-
-///
-/// Reponsible for parsing a supposed GDB response. Depending on the parsing instruction, the parser can get the first occurrence
-/// from the supposed GDB response or get all of them that satisfies this parsing instruction.
-///
-/// Supposed GDB response.
-/// Instruction used to parse the supposed GDB response.
-/// Current character to be read in the supposed GDB response.
-/// If the parsing instruction specifies that it has to get all occurences from the supposed GDB response, this
-/// value must be true.
-/// A variable stores a string parsed from the supposed GDB response and can be used as many times as needed to
-/// created the parsed response. Up to 10 variables can be created for a given parsing instruction.
-/// If the parsing instruction allows the parser to get all occurrences from the supposed GDB response, this
-/// separator will be used at the end of each occurence. The default one is '#' but it can be specified in the parsing instruction.
-/// Returns the parsed GDB response.
-String^ GDBParserUnitTests::parse_GDB(String^ response, String^ parsingInstruction, int respBegin, bool repeat, array^ variables, String^ separator)
-{
- CAutoPtr apResp = convertToAutoPtrFromString(response);
- string r = apResp;
- CAutoPtr apPars = convertToAutoPtrFromString(parsingInstruction);
- string p = apPars;
- CAutoPtr apSep = convertToAutoPtrFromString(separator);
- string s = apSep;
-
- char v[10][128];
- for (int i = 0; i< 10; i++)
- {
- CAutoPtr apAux = convertToAutoPtrFromString(variables[i]);
- string aux = apAux;
-
- if (aux.length() > 128)
- aux[127] = '\0';
- strcpy(v[i], aux.c_str());
- }
-
- string output = parseGDB(&r, p, respBegin, repeat, v, s);
- String ^systemstring = gcnew String(output.c_str());
- return systemstring;
-}
-
-
-///
-/// Find the position of the associated closing bracket/parenthesis.
-///
-/// The associated opening character ("(", "{" or "[").
-/// The associated closing character (")", "}" or "]").
-/// The string where the search will be made.
-/// Start position in the parsingInstruction string. This position normally corresponds to the position of the opening
-/// character, but it could be smaller than that (never bigger!). However, if it is smaller, it cannot have the same character between
-/// the 'ini' position and the corresponding one for the opening one. If need to have another one, precede it by the character '\'.
-/// Returns the position of the associated closing bracket/parenthesis. If it is not found, returns the length of the string.
-int GDBParserUnitTests::find_Closing(char opening, char closing, String^ parsingInstruction, int ini)
-{
- CAutoPtr apPars = convertToAutoPtrFromString(parsingInstruction);
- string p = apPars;
- return findClosing(opening, closing, p, ini);
-}
-
-
-///
-/// Get the next position of a given character (token) in a string message (txt), starting from a given position (pos).
-///
-/// Character to search for.
-/// String message in which it will search for the given character.
-/// Starting position in the string message.
-/// An integer that corresponds to the next position of the character in the string. If the character is not found, returns
-/// the length of the string.
-int GDBParserUnitTests::get_Next_Char(char token, String^ txt, int pos)
-{
- CAutoPtr apTxt = convertToAutoPtrFromString(txt);
- string t = apTxt;
- return getNextChar(token, t, pos);
-}
-
-
-///
-/// Get the position of a given string (txt) in the string "response", starting from a given position (begin).
-///
-/// String response where the search will be performed.
-/// String to search for in the response.
-/// Starting position in the string response.
-/// Search for that string "times" times. Ex: I want to find the third occurrence of word "qaqa" in the
-/// response.
-/// Direction: if true, search forwards; if not, search backwards
-/// The kind of parsing instruction that called this method. '?', '@', or '~'. If searching forward and '?', the
-/// function will return the next position after the found string. If not, will return the first position of the found string.
-/// An integer that corresponds to the next position of the string txt in the response. -1 in case of an error.
-int GDBParserUnitTests::search_Response(String^ response, String^ txt, int begin, int times, bool forward, char instruction)
-{
- CAutoPtr apResp = convertToAutoPtrFromString(response);
- string r = apResp;
- CAutoPtr apTxt = convertToAutoPtrFromString(txt);
- string t = apTxt;
- return searchResponse(r, t, begin, times, forward, instruction);
-}
-
-
-///
-/// Substitute the existing variables in the string "txt" by their values, stored in the "variables" array. Each variable name
-/// has this format: $9$, where $ characters are used to identify the variable while the number corresponds to the variable ID, that also
-/// corresponds to the array index. There is a special variable "$EOL$" that is substituted by "\r\n".
-///
-/// String to search for variables.
-/// Array with the variable values.
-/// Returns the new modified string.
-String^ GDBParserUnitTests::substitute_Variables(String^ txt, array^ variables)
-{
- CAutoPtr apTxt = convertToAutoPtrFromString(txt);
- string t = apTxt;
- char v[10][128];
- for (int i = 0; i< 10; i++)
- {
- CAutoPtr apAux = convertToAutoPtrFromString(variables[i]);
- string aux = apAux;
-
- if (aux.length() > 128)
- aux[127] = '\0';
- strcpy(v[i], aux.c_str());
- }
- string output = substituteVariables(t, v);
- String ^systemstring = gcnew String(output.c_str());
- return systemstring;
-}
-
-
-///
-/// This method stores a command that should be sent to GDB. Input buffer is a circular one.
-///
-/// Command that should be sent to GDB.
-/// Returns TRUE - successfully added; or FALSE - failed to add.
-bool GDBParserUnitTests::add_Into_Input_Buffer(String^ command)
-{
- CAutoPtr apCmd = convertToAutoPtrFromString(command);
- char GDBCommand[GDBCommandSize];
- strcpy(GDBCommand, apCmd);
- return addIntoInputBuffer(GDBCommand);
-}
-
-
-///
-/// Gets the next command that would be sent to GDB. Input buffer is a circular one.
-///
-/// Returns the next command that would be sent to GDB.
-String^ GDBParserUnitTests::remove_From_Input_Buffer()
-{
- char command[GDBCommandSize] = "";
- removeFromInputBuffer(command);
- string basicstring(command);
- return(gcnew String(basicstring.c_str()));
-}
-
-
-///
-/// Verify if Input buffer is empty.
-///
-/// Returns TRUE if empty; FALSE if not.
-//bool GDBParserUnitTests::is_Input_Buffer_Empty()
-//{
-// return isInputBufferEmpty();
-//}
-
-
-///
-/// For every command that should be to GDB, the following parameters should be added into GDBBuffer.
-///
-/// Sequential ID of the command that would be sent to GDB. It is used to identify, when evaluating supposed GDB
-/// responses, which command generated that given response. This ID is also used to specify the location in which this entry will be
-/// stored in this buffer.
-/// Each command that should be sent to GDB has an associated instruction code, that corresponds to the
-/// parsing instruction that will be used to parse the supposed GDB response.
-/// Used to store the GDB command parameters, so they could be used during the parsing task. There are some GDB
-/// commands, like -break-delete for example, that results in a simple "^done" GDB response. The parser can identify which command
-/// caused that response but cannot know what was affected by it (considering the -break-delete command, the parser will know that some
-/// breakpoint was successfully deleted but won't know which of them was deleted). Using "param" helps the parser letting it knows
-/// which parameters were sent together with a given GDB command.
-/// Returns TRUE - successfully added; or FALSE - failed to add.
-bool GDBParserUnitTests::add_Into_GDB_Buffer(int seq_id, int instructionCode, String^ param)
-{
- CAutoPtr apParam = convertToAutoPtrFromString(param);
- string p = apParam;
- return addIntoGDBBuffer(seq_id, instructionCode, p);
-}
-
-
-///
-/// This method is called to find the right parsing instruction for the supposed GDB response.
-///
-/// Sequential ID of the GDB response.
-/// Returns the parameters sent together with the GDB command that generated this response, if there are some.
-/// Returns the instruction code associated to the sequential id (seq).
-int GDBParserUnitTests::remove_From_GDB_Buffer(int seq, [Runtime::InteropServices::Out] String^ %param)
-{
- string p = "";
- int code = removeFromGDBBuffer(seq, &p);
- param = gcnew String(p.c_str());
- return code;
-}
-
-
-///
-/// Verify if GDB buffer is empty.
-///
-/// Returns TRUE if empty; FALSE if not.
-bool GDBParserUnitTests::is_GDB_Buffer_Empty()
-{
- return isGDBBufferEmpty();
-}
-
-
-///
-/// Store the supposed parsed GDB response in the "seq_stamp" position of the Output buffer.
-///
-/// Position in the Output buffer to store the supposed parsed GDB response.
-/// Supposed parsed GDB response.
-/// Returns TRUE - successfully added; or FALSE - failed to add.
-bool GDBParserUnitTests::add_Into_Output_Buffer(int seq_stamp, String^ message)
-{
- CAutoPtr apResp = convertToAutoPtrFromString(message);
- char parsedMessage[GDBCommandSize];
- strcpy(parsedMessage, apResp);
- return addIntoOutputBuffer(seq_stamp, parsedMessage);
-}
-
-
-///
-/// This method returns the next supposed parsed GDB response (output) for a supposed asynchronous GDB RESPONSE or a supposed non
-/// synchronous GDB COMMAND. This managed part of Output buffer is circular.
-///
-/// Returns the supposed parsed GDB response.
-String^ GDBParserUnitTests::remove_From_Output_Buffer()
-{
- char response[GDBCommandSize] = "";
- removeFromOutputBuffer(response);
- string basicstring(response);
- return(gcnew String(basicstring.c_str()));
-}
-
-
-///
-/// This method returns the supposed parsed GDB response (output) for a supposed synchronous GDB COMMAND (ID). Each entry in this part
-/// of Output buffer was previously reserved for each GDB command.
-///
-/// Returns the supposed parsed GDB response.
-/// ID of the supposed GDB command.
-String^ GDBParserUnitTests::remove_Sync_From_Output_Buffer(int ID)
-{
- char response[GDBCommandSize] = "";
- removeSyncFromOutputBuffer(response, ID);
- string basicstring(response);
- return(gcnew String(basicstring.c_str()));
-}
-
-
-///
-/// Initialize / clean all the existing buffers: inputBuffer, GDBBuffer, outputBuffer.
-///
-void GDBParserUnitTests::clean_Buffers()
-{
- cleanBuffers();
-}
diff --git a/src/GDBParser/GDBParserAPI.h b/src/GDBParser/GDBParserAPI.h
deleted file mode 100644
index 87402c8b..00000000
--- a/src/GDBParser/GDBParserAPI.h
+++ /dev/null
@@ -1,83 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-#pragma once
-
-#include
-
-#define NumberOfInstructions 48
-#define GDBCommandSize 256
-
-using namespace std;
-
-BEGIN_NAMESPACE
-
-public ref class GDBParser abstract sealed
-{
-public:
- static String^ GetPIDsThroughGDB(String^, String^, bool, String^, String^, int);
- static bool LaunchProcess(String^, String^, String^, bool, String^, String^, String^);
- static void BlackBerryConnect(String^, String^, String^, String^);
-
- static String^ parseCommand(String^, int);
- static String^ removeGDBResponse();
- static bool addGDBCommand(String^);
- static bool is_Input_Buffer_Empty();
- static void exitGDB();
-
- static bool s_running = false;
-
-private:
- static void setNDKVars(bool);
-
- static DWORD s_mainThreadId;
- static String^ m_pcGDBCmd;
- static const int NUM_LIB_PATHS = 2;
- static array^ m_libPaths = gcnew array(NUM_LIB_PATHS);
- static HANDLE m_BBConnectProcess;
- static String^ m_remotePath;
-};
-
-END_NAMESPACE
-
-
-BEGIN_NAMESPACE
-
-public ref class GDBParserUnitTests abstract sealed
-{
-public:
- static int get_Instruction_Code(String^, [Runtime::InteropServices::Out] String^ %);
- static int get_Seq_ID(String^);
- static bool inserting_Command_Codes(array^, array^);
-
- static String^ parse_GDB(String^, String^);
- static void parse_GDB(String^, String^, int);
- static String^ parse_GDB(String^, String^, int, bool, array^, String^);
-
- static int find_Closing(char, char, String^, int);
- static int get_Next_Char(char, String^, int);
- static int search_Response(String^, String^, int, int, bool, char);
- static String^ substitute_Variables(String^, array^);
-
- static bool add_Into_Input_Buffer(String^);
- static String^ remove_From_Input_Buffer();
- static bool add_Into_GDB_Buffer(int, int, String^);
- static int remove_From_GDB_Buffer(int, [Runtime::InteropServices::Out] String^ %);
- static bool is_GDB_Buffer_Empty();
- static bool add_Into_Output_Buffer(int, String^);
- static String^ remove_From_Output_Buffer();
- static String^ remove_Sync_From_Output_Buffer(int);
- static void clean_Buffers();
-};
-END_NAMESPACE
\ No newline at end of file
diff --git a/src/GDBParser/Instructions.txt b/src/GDBParser/Instructions.txt
deleted file mode 100644
index 44c015c2..00000000
--- a/src/GDBParser/Instructions.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-asynchronous:->:??=thread-exited,id;{#51\;;??";@@";#$EOL$;};??thread-created,id;{#40\;;??";@@";#\;;??pid ;@@ ;#$EOL$;};0;??*running;{#41\;;??thread-id="all;{#0;}{??thread-id=";@@";};#$EOL$;};0;??*stopped;{??breakpoint-hit;{#27\;;??bkptno=";@@";#\;;??file=";@@";#\;;??line=";@@";}{??end-stepping-range;{#45;??file=";{#\;;@@";0;#\;;??line=";@@";};}{??function-finished;{#46;??file=;{#\;;??";@@";#\;;??line=";@@";};}{??exited-normally;{#42;}{??exit-code;{#43\;;??";@@";}{??signal-received;{??signal-meaning="Killed";{#47;}{??signal-meaning="Segmentation fault";{#54\;;??addr=";@@";#\;;??func=";@@";0;??file=;{#\;;??";@@";#\;;??line=";@@";};}{??signal-meaning="Aborted";{#55\;;0;??signal-name=";@@";#\;;??signal-meaning=";@@";}{#44\;;??addr=";@@";#\;;??func=";@@";0;??file=;{#\;;??";@@";#\;;??line=";@@";};};};};}{??exited-signalled;{#55\;;0;??signal-name=";@@";#\;;??signal-meaning=";@@";}{#44\;;??addr=";@@";#\;;??func=";@@";0;??file=;{#\;;??";@@";#\;;??line=";@@";};};};};};};};};#\;;??thread-id=;{??";@@";};#$EOL$;};0;??=breakpoint-modified,bkpt=\{number=";{0;($EOR$;$1=?=breakpoint-modified,bkpt=\{number=";@@";$$;$EOR$;?=breakpoint-modified,bkpt=\{number="$1$;#21\;$1$\;;??enabled=";@@";#\;;??addr=";@@";#\;;??func=";@@";#\;;??file=";@@";#\;;??line=";@@";#\;;??times=";@@";0;(??=breakpoint-modified,bkpt=\{number="$1$;%?$EOL$;@@"\};);):$EOL$;};0;??=breakpoint-deleted,id=;{0;(??=breakpoint-deleted,id=";#22\;;@@";):$EOL$;};0;??@";{0;#81\;";(??@";?@;@@$EOL$;):$EOL$;#"!81$EOL$;};0;(??~";#80\;";?~;@@$EOL$;#"!80;):$EOL$;??Error in testing breakpoint condition;{#29\;$EOL$;};??Quit (expect signal SIGINT when the program is resumed);{#50\;$EOL$;};??2374: internal-error: frame_cleanup_after_sniffer: Assertion;{#52\;$EOL$;};??^error,msg="Remote communication error: No error.;{#53\;$EOL$;};??: internal-error: handle_inferior_event: Assertion;{#56\;$EOL$;};0;(??&";#80\;";?&;@@$EOL$;#"!80;):$EOL$;(??$EOL$=;#80\;";?=;@@$EOL$;#"!80;):$EOL$;
-=breakpoint-modified:->:($EOR$;$1=?=breakpoint-modified,bkpt=\{number=";@@";$$;$EOR$;?=breakpoint-modified,bkpt=\{number="$1$;#21\;$1$\;;??enabled=";@@";#\;;??addr=";@@";#\;;??func=";@@";#\;;??file=";@@";#\;;??line=";@@";#\;;??times=";@@";0;(??=breakpoint-modified,bkpt=\{number="$1$;%?$EOL$;@@"\};);):$EOL$;
-starting:->:??(gdb);{0;#80\;";(??~";?~;@@$EOL$;):$EOL$;#"!80;}{#!console=ERROR: Could not load GDB!};
--target-select:->:??^connected;{0;#80\;";(??~";?~;@@$EOL$;):$EOL$;#"!80;}{#!console=ERROR: Could not set target IP:Port};
-file:->:??^done;{0;#80\;";(??~";?~;@@$EOL$;):$EOL$;#"!80;};
-upload:->:??^done;#File uploaded!;
--target-attach:->:??^done;{#state="stopped"\;processID=";0;??pid=";@@";#"\;thread-ID=";??thread-created,id=";@@";0;#"\;$EOL$80\;";(??~";?~;@@$EOL$;):$EOL$;#"!80;};
--file-exec-and-symbols:->:??^done;#File and symbols loaded.;
--gdb-set:->:??^done;{#done;};
-set:->:??^done;{#done;};
--exec-arguments:->:??^done;#Arguments loaded.;
--exec-run:->:??^running;{0;#40\;;??thread-created,id=";@@";0;??pid=";#\;;@@";0;#$EOL$;(??~";#80\;";?~;@@$EOL$;#"!80;):$EOL$;(??&";#80\;";?&;@@$EOL$;#"!80;):$EOL$;};
--exec-continue:->:??^running;{#41\;;??thread-id="all;{#0;}{??thread-id=";@@";};0;#$EOL$;(??~";#80\;";?~;@@$EOL$;#"!80;):$EOL$;(??&";#80\;";?&;@@$EOL$;#"!80;):$EOL$;};
--exec-step:->:??^running;{#41\;;??thread-id="all;{#0;}{??thread-id=";@@";};0;#$EOL$;(??~";#80\;";?~;@@$EOL$;;#"!80;):$EOL$;(??&";#80\;";?&;@@$EOL$;;#"!80;):$EOL$;};
--exec-next:->:??^running;{#41\;;??thread-id="all;{#0;}{??thread-id=";@@";};0;#$EOL$;(??~";#80\;";?~;@@$EOL$;;#"!80;):$EOL$;(??&";#80\;";?&;@@$EOL$;;#"!80;):$EOL$;}{??^error;{#49\;;??msg=";@@";};};
--exec-finish:->:??^running;{#41\;;??thread-id="all;{#0;}{??thread-id=";@@";};0;#$EOL$;(??~";#80\;";?~;@@$EOL$;;#"!80;):$EOL$;(??&";#80\;";?&;@@$EOL$;;#"!80;):$EOL$;};
-tbreak:->:??=breakpoint-created;{#20\;;??number=";{@@";};#\;;??enabled=";{@@";};#\;;??addr=";{@@";};#\;;??func=";{@@";};#\;;??file=";{@@";};#\;;??line=";{@@";};#\;;??times=";{@@";};}{??^error;{#ERROR: ;??msg=";@@";#$EOL$;(??&";#80\;";?&;@@$EOL$;#"!80;):$EOL$;$END$;};#tbreak: Function not found!;};
--break-insert:->:??^done;{#20\;;??number=";{@@";};#\;;??enabled=";{@@";};#\;;??addr=";{@@";};#\;;??func=";{@@";};#\;;??file=";{@@";};#\;;??line=";{@@";};#\;;??times=";{@@";};}{#Function not found!;};
--break-watch:->:??^done;{#20\;;??number=";{@@";};#\;;??enabled=";{@@";};#\;;??addr=";{@@";};#\;;??func=";{@@";};#\;;??file=";{@@";};#\;;??line=";{@@";};#\;;??times=";{@@";};}{#Function not found!;};
-$-break-delete:->:??^done;{#25;@@$EOL$};
-$-break-disable:->:??^done;{#24;@@$EOL$};
-$-break-enable:->:??^done;{#23;@@$EOL$};
-$-break-after:->:??^done;{#26;@@$EOL$};
-$-break-condition:->:??^done;{#28;@@$EOL$};
--break-list:->:??^done;{(??number=";#21\;;@@";#\;;??enabled=";@@";#\;;??addr=";@@";#\;;??func=";@@";#\;;??file=";@@";#\;;??line=";@@";#\;;??times=";@@";):$EOL$;};
-kill:->:??^done;{#done;};
-generate-core-file:->:#NOT CREATED!
-jump:->:#NOT CREATED!
-handle:->:#NOT CREATED!
-watch:->:#NOT CREATED!
-interrupt:->:#NOT CREATED!
-show:->:#NOT CREATED!
--stack-info-depth:->:??^done,depth=";@@";$EOL$
--stack-list-frames:->:??^done;{(??level=;{??";@@";};~"\};#\;;??addr=;{??";@@";};#\;;??func=;{??";@@";};#\;;??file=;{??";@@";};#\;;??line=;{??";@@";};);};
--stack-select-frame:->:??^done;{#done;};
--stack-list-variables:->:??^done;{#70\;;(??name=;{??";@@";};~"\};#\;;??arg=;{??";@@";};#\;;??type=;{??";@@";};#\;;??value=;{??";@@";};);}{#ERROR;};
--var-create:->:??^done;{??numchild=";@@";}{#ERROR;};
--var-delete:->:??^done;{#DONE;}{#ERROR;};
--var-list-children:->:??^done;{#71\;;(??name=;{??";@@";};~"\};#\;;??numchild=;{??";@@";};#\;;??value=;{??";@@";};#\;;??type=;{??";@@";};);}{#ERROR;};
--data-evaluate-expression:->:??^done;{??=;#60\;;@@$EOL$;}{??^error;{??-data-evaluate-expression: Usage: -data-evaluate-expression expression;{#61\;Error in expression.;}{??A syntax error in expression, near `'.;{#61\;A syntax error at the end of the expression.;}{??=;#61\;;@@$EOL$;};};};};
-ptype:->:??type = ;{@@\\n";}{# ;};
-whatis:->:??type = ;{@@\\n";}{# ;};
--exec-interrupt:->:??^done;{??signal-received;{??signal-meaning="Killed";{#47;}{#44\;;??addr=";@@";#\;;??func=";@@";0;??file=;{#\;;??";@@";#\;;??line=";@@";};};};};#\;;??thread-id=;{??";@@";};
--target-detach:->:#NOT CREATED!
--var-info-num-children:->:??numchild;{??";@@";}{#ERROR;};
-info:->:??Address;{??0x;? ;@@ ;}{??Line;{@@of;};};
--thread-info:->:??^done;{(??\{id=";@@";#\;;??state=;{??";@@";};#\;;~\};?:??^done;{#done;};
diff --git a/src/GDBParser/ProjInclude.h b/src/GDBParser/ProjInclude.h
deleted file mode 100644
index 047d620a..00000000
--- a/src/GDBParser/ProjInclude.h
+++ /dev/null
@@ -1,33 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-#pragma once
-
-using namespace System;
-using namespace System::Diagnostics;
-#include
-#pragma warning(push)
-#pragma warning(disable:4091)
-#include
-#pragma warning(pop)
-
-#define ASSERT(cond) _ASSERT(cond)
-#ifdef DEBUG
- #define VERIFY(statement) Debug::Assert((statement) != 0, #statement)
-#else
- #define VERIFY(statement) statement
-#endif
-
-#include "ComponentException.h"
-#include "WorkerUtil.h"
diff --git a/src/GDBParser/WorkerThreadObject.h b/src/GDBParser/WorkerThreadObject.h
deleted file mode 100644
index bd158897..00000000
--- a/src/GDBParser/WorkerThreadObject.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#pragma once
-
-BEGIN_NAMESPACE
-
-ref class WorkerThreadObject
-{
-public:
-#ifdef _DEBUG
- const DWORD ThreadId;
-#endif
-
- WorkerThreadObject()
-#ifdef _DEBUG
- : ThreadId(GetCurrentThreadId())
-#endif
- {
- }
-};
-
-END_NAMESPACE
\ No newline at end of file
diff --git a/src/GDBParser/WorkerUtil.h b/src/GDBParser/WorkerUtil.h
deleted file mode 100644
index c070eed0..00000000
--- a/src/GDBParser/WorkerUtil.h
+++ /dev/null
@@ -1,186 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-#pragma once
-
-BEGIN_NAMESPACE
-
-#include
-
-inline HRESULT HRFromWin32Error(LONG lError)
-{
- HRESULT hr = HRESULT_FROM_WIN32(lError);
- if (SUCCEEDED(hr))
- hr = E_FAIL;
- return hr;
-}
-
-inline HRESULT HRLastError()
-{
- return HRFromWin32Error(GetLastError());
-}
-
-inline HRESULT HRWin32BoolCall(BOOL rc)
-{
- if (!rc)
- return HRLastError();
- return S_OK;
-}
-
-inline HRESULT HRWin32ErrorCall(LONG lError)
-{
- if (lError != ERROR_SUCCESS)
- return HRFromWin32Error(lError);
- return S_OK;
-}
-
-inline void __declspec(noreturn) ThrowHR(HRESULT hr)
-{
- throw gcnew ComponentException(hr);
-}
-
-inline void __declspec(noreturn) ThrowLastError()
-{
- HRESULT hr = HRLastError();
-
- ThrowHR(hr);
-}
-
-inline void Win32BoolCall(BOOL fCondition)
-{
- if (!fCondition)
- {
- ThrowLastError();
- }
-}
-
-inline void Win32ErrorCall(DWORD err)
-{
- if (err != 0)
- {
- ThrowHR(HRESULT_FROM_WIN32(err));
- }
-}
-
-inline HANDLE Win32HandleCall(HANDLE h)
-{
- if (h == NULL || h == INVALID_HANDLE_VALUE)
- {
- ThrowLastError();
- }
-
- return h;
-}
-
-inline int StringLength(String^ s)
-{
- if (s == nullptr)
- {
- return 0;
- }
-
- return s->Length;
-}
-
-inline String^ GetProcessName(HANDLE hProcess)
-{
- WCHAR szProcessNameBuff[MAX_PATH+1];
- DWORD nChars = GetModuleFileNameEx(
- hProcess, // process
- NULL, // Module handle
- szProcessNameBuff,
- _countof(szProcessNameBuff)
- );
-
- Win32BoolCall(nChars > 0 && nChars <= _countof(szProcessNameBuff));
-
- return gcnew String(szProcessNameBuff);
-}
-
-inline LPWSTR wcsdup(String^ source)
-{
- pin_ptr pSource = PtrToStringChars( source );
- int cch = (( source->Length+1) * 2);
- LPWSTR pDest = new wchar_t[cch];
- memcpy(pDest, pSource, cch * sizeof(wchar_t));
-
- return pDest;
-}
-
-inline String^ StringPrefixReplace(int oldPrefixLen, String^ newPrefix, String^ s)
-{
- int lengthNeeded = s->Length + newPrefix->Length - oldPrefixLen;
- Text::StringBuilder^ sb = gcnew Text::StringBuilder(lengthNeeded, lengthNeeded);
-
- sb->Append(newPrefix);
- sb->Append(s, oldPrefixLen, s->Length-oldPrefixLen);
-
- return sb->ToString();
-}
-
-inline String^ StringPrefixReplace(String^ oldPrefix, String^ newPrefix, String^ s)
-{
- return StringPrefixReplace(oldPrefix->Length, newPrefix, s);
-}
-
-// Note: return value does not include a trailing slash
-inline int FindCommonPathSuffixLength(String^ path1, String^ path2)
-{
- const int len1 = path1->Length;
- const int len2 = path2->Length;
-
- int commonSuffixLength = 0;
-
- // scan backwards until we find a character that is different
- for (; true; commonSuffixLength++)
- {
- int index1 = len1 - commonSuffixLength - 1;
- int index2 = len2 - commonSuffixLength - 1;
-
- if (index2 < 0 || index1 < 0)
- break;
-
- wchar_t char1 = path1[index1];
- wchar_t char2 = path2[index2];
-
- // first compare the characters exsactly (fast).
- if (char1 == char2)
- continue;
-
- // if they aren't exsactly the same, see if they are canonicialy the same
- char1 = (char1 == '/') ? '\\' : System::Char::ToUpperInvariant(char1);
- char2 = (char2 == '/') ? '\\' : System::Char::ToUpperInvariant(char2);
-
- if (char1 == char2)
- continue;
-
- break;
- }
-
- // scan forward until we find a slash
- for (; commonSuffixLength > 0; commonSuffixLength--)
- {
- wchar_t char1 = path1[len1 - commonSuffixLength];
-
- if (char1 == '\\' || char1 == '/')
- {
- commonSuffixLength--;
- break;
- }
- }
-
- return commonSuffixLength;
-}
-
-END_NAMESPACE
\ No newline at end of file
diff --git a/src/GDBParser/dllmain.cpp b/src/GDBParser/dllmain.cpp
deleted file mode 100644
index 1e9eda05..00000000
--- a/src/GDBParser/dllmain.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-// dllmain.cpp : Defines the entry point for the DLL application.
-#include "stdafx.h"
-#include "resource.h"
-
-#pragma managed(off)
-
-
-///
-/// Use the ATL Registrar to register the engine.
-///
-class CGDBParserModule : public CAtlDllModuleT< CGDBParserModule >
-{
-
-};
-
-CGDBParserModule _GDBParserModule;
-HMODULE _hModThis;
-
-
-///
-/// Adds entries to the system registry.
-///
-/// HRESULT
-STDAPI DllRegisterServer(void)
-{
- // Get this binaries full-path
- WCHAR wszThisFile[MAX_PATH + 1];
- GetModuleFileName(_hModThis, wszThisFile, MAX_PATH + 1);
-
- // Cut off the FileName. GDBPARSERPATH should point to GDBParserAPI
- WCHAR wszPath[MAX_PATH + 1];
- WCHAR* wszFileName;
- GetFullPathName(wszThisFile, MAX_PATH + 1, wszPath, &wszFileName);
- *wszFileName = L'\0';
-
- // Register the sample engine in the Visual Studio registry hive. See GDBParser.rgs for what is added.
- _ATL_REGMAP_ENTRY rgMap[] =
- {
- {L"GDBPARSERPATH", wszPath},
- {NULL, NULL}
- };
-
- HRESULT hr = _GDBParserModule.UpdateRegistryFromResourceS(IDR_GDBPARSER, true, rgMap);
- return hr;
-}
-
-
-///
-/// Removes entries from the system registry.
-///
-/// HRESULT
-STDAPI DllUnregisterServer(void)
-{
- // Get this binaries full-path
- WCHAR wszThisFile[MAX_PATH + 1];
- GetModuleFileName(_hModThis, wszThisFile, MAX_PATH + 1);
-
- // Cut off the FileName. GDBPARSERPATH should point to GDBParserAPI
- WCHAR wszPath[MAX_PATH + 1];
- WCHAR* wszFileName;
- GetFullPathName(wszThisFile, MAX_PATH + 1, wszPath, &wszFileName);
- *wszFileName = L'\0';
-
- // Register the sample engine in the Visual Studio registry hive. See GDBParser.rgs for what is added.
- _ATL_REGMAP_ENTRY rgMap[] =
- {
- {L"GDBPARSERPATH", wszPath},
- {NULL, NULL}
- };
-
- HRESULT hr = _GDBParserModule.UpdateRegistryFromResourceS(IDR_GDBPARSER, false, rgMap);
- return hr;
-}
-
-
-///
-///
-///
-///
-/// TRUE.
-BOOL APIENTRY DllMain( HMODULE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- _hModThis = hModule;
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-
diff --git a/src/GDBParser/gdb-connect.cpp b/src/GDBParser/gdb-connect.cpp
deleted file mode 100644
index 42bf25d6..00000000
--- a/src/GDBParser/gdb-connect.cpp
+++ /dev/null
@@ -1,1973 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-// gdb-connect.cpp : Defines the entry point for the console application.
-//
-// Based on code sample from http://support.microsoft.com/kb/190351
-
-#include "stdafx.h"
-
-#include "gdb-connect.h"
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include < vcclr.h >
-
-using namespace std;
-using namespace System;
-
-
-///
-/// Used to send parameters for the listeningGDB thread (the one that is listening GDB responses).
-///
-typedef struct ListeningThreadDataStruct
-{
- GDBConsole *console; // Current instance of GDB debugger.
- string *parsingInstructions; // Parsing instruction.
-} ListeningThreadData;
-
-
-///
-/// Used to send parameters for the parsing threads, when using multi-threaded parsing.
-///
-typedef struct ParsingThreadDetailsStruct
-{
- char* response; // GDB response.
- char* parsingInstruction; // Parsing instruction.
- int* seqStamp; // Output buffer index where the parsed response will be stored.
-} ParsingThreadDetails;
-
-
-///
-/// Used by sendingCommands2GDB thread to store data that listeningGDB thread will need while parsing the GDB response.
-///
-typedef struct GDBBufferStruct
-{
- int seqId; // The sequencial number (seqID) of the instruction that was sent to GDB.
- int instructionCode; // The instruction ID.
- string param; // Parameter sent by sendingCommands2GDB thread to the listeningGDB one.
-} GDBBufferEntry;
-
-
-///
-/// Mutex / Event objects
-///
-HANDLE hInputBufferMutex; // Used to ensure that only one thread at a time will be manipulating the input buffer.
-HANDLE hGDBBufferMutex; // Used to ensure that only one thread at a time will be manipulating the GDB (intermediate) buffer.
-HANDLE hOutputBufferMutex; // Used to ensure that only one thread at a time will be manipulating the output buffer.
-HANDLE inputEvent; // Used to avoid sendingCommands2GDB thread to be pooling while the input buffer is empty.
-HANDLE asyncOutputEvent; // Used to avoid DebugEngine.EventDispatcher thread to be pooling while waiting for an asynchronous response from Output buffer
-
-extern HMODULE _hModThis;
-
-
-///
-/// Output buffer. Each entry has a parsed GDB response.
-///
-char outputBuffer[OutputBufferSize][ParsedMessageSize];
-int out_OutputBuffer = SyncInstructionsSize; // Remove element from this position (outputBuffer). Input depends on the
- // seqStamp, i.e., ordered according to GDB responses. Positions 0 to 49
- // are reserved for synchronous commands.
-
-
-///
-/// Input buffer (Circular). Each entry has a command to be sent to GDB.
-///
-char inputBuffer[InputBufferSize][GDBCommandSize];
-int in_InputBuffer = 0; // Add element in this position (inputBuffer).
-int out_InputBuffer = 0; // Remove element from this position (inputBuffer).
-
-
-///
-/// An instance of GDB debugger.
-///
-GDBConsole* GDBConsole::m_instance = NULL;
-TCHAR* GDBConsole::m_pcGDBCmd = NULL;
-
-
-///
-/// GDB buffer. Contains the GDBBufferEntries sent by sendingCommands2GDB therad to the listeningGDB one.
-///
-struct GDBBufferMainStruct
-{
- int quantity; // Contains the number of GDB entries currently filled.
- GDBBufferEntry GDBBufferData[GDBBufferSize]; // See GDBBufferEntry definition above.
-} GDBBuffer;
-
-
-///
-/// Shared variable between SendingCommands2GDB and listeningGDB threads used to let the listeningGDB one know that it has
-/// to terminate. SendingCommands2GDB thread sets this variable to true to terminate listeningGDB thread.
-///
-bool exitGDB = false;
-
-
-///
-/// Used to store the path to GDB output log, generated when GDB console is instantiated and needed in logPrint().
-///
-char path_log[_MAX_PATH];
-
-
-///
-/// Generic function to print to a log file.
-///
-/// Message to be printed to a log file.
-void GDBConsole::logPrint(char* buffer) {
- if (LOG_GDB_RAW_IO) {
- time_t tt = time(NULL);
- struct tm tm;
- char buf[32];
-
- tm = *localtime(&tt);
-
- strftime(buf, 31, "%H:%M:%S", &tm);
-
- FILE* file = fopen((char *)path_log, "a");
- fprintf(file, "%s - %s", buf, buffer);
- fclose(file);
- }
-}
-
-
-///
-/// Constructor.
-///
-GDBConsole::GDBConsole() :
- m_hInputRead(NULL), m_hInputWrite(NULL), m_hOutputRead(NULL),
- m_hOutputWrite(NULL), m_hErrorWrite(NULL), m_isClosed(FALSE),
- m_hCleanupMutex(NULL)
-{
- HANDLE hOutputReadTmp = NULL;
- HANDLE hInputWriteTmp = NULL;
- SECURITY_ATTRIBUTES sa;
-
- out_OutputBuffer = SyncInstructionsSize;
- in_InputBuffer = 0;
- out_InputBuffer = 0;
-
- m_hCleanupMutex = CreateMutex(NULL, FALSE, NULL);
-
- // Set up the security attributes struct used when creating the pipes.
- sa.nLength = sizeof(SECURITY_ATTRIBUTES);
- sa.lpSecurityDescriptor = NULL;
- sa.bInheritHandle = TRUE;
-
- // Create the child output pipe.
- if (!CreatePipe(&hOutputReadTmp, &m_hOutputWrite, &sa, 0))
- DisplayError(_T("CreatePipe"));
-
- // Create a duplicate of the output write handle for the std error
- // write handle. This is necessary in case the child application
- // closes one of its std output handles.
- if (!DuplicateHandle(GetCurrentProcess(), m_hOutputWrite,
- GetCurrentProcess(), &m_hErrorWrite, 0,
- TRUE, DUPLICATE_SAME_ACCESS))
- DisplayError(_T("DuplicateHandle"));
-
- // Create the child input pipe.
- if (!CreatePipe(&m_hInputRead, &hInputWriteTmp, &sa, 0))
- DisplayError(_T("CreatePipe"));
-
- // Create new output read handle and the input write handles. Set
- // the Properties to FALSE. Otherwise, the child inherits the
- // properties and, as a result, non-closeable handles to the pipes are created.
- if (!DuplicateHandle(GetCurrentProcess(), hOutputReadTmp,
- GetCurrentProcess(),
- &m_hOutputRead, // Address of new handle.
- 0, FALSE, // Make it uninheritable.
- DUPLICATE_SAME_ACCESS))
- DisplayError(_T("DuplicateHandle"));
-
- if (!DuplicateHandle(GetCurrentProcess(), hInputWriteTmp,
- GetCurrentProcess(),
- &m_hInputWrite, // Address of new handle.
- 0, FALSE, // Make it uninheritable.
- DUPLICATE_SAME_ACCESS))
- DisplayError(_T("DuplicateHandle"));
-
- // Close inheritable copies of the handles you do not want to be inherited.
- if (!CloseHandle(hOutputReadTmp)) DisplayError(_T("CloseHandle"));
- if (!CloseHandle(hInputWriteTmp)) DisplayError(_T("CloseHandle"));
-
- prepAndLaunchRedirectedChild();
-
- // Close pipe handles (do not continue to modify the parent).
- // You need to make sure that no handles to the write end of the
- // output pipe are maintained in this process or else the pipe will
- // not close when the child process exits and the ReadFile will hang.
- if (!CloseHandle(m_hOutputWrite)) DisplayError(_T("CloseHandle"));
- if (!CloseHandle(m_hInputRead )) DisplayError(_T("CloseHandle"));
- if (!CloseHandle(m_hErrorWrite)) DisplayError(_T("CloseHandle"));
-
- String^ tempPath = Environment::GetEnvironmentVariable("APPDATA");
- tempPath += "\\BlackBerry\\gdb-output.log";
- pin_ptr path_buffer = PtrToStringChars(tempPath);
-
- int ret = wcstombs ( path_log, path_buffer, _MAX_PATH );
-
- FILE* file = fopen(path_log, "w"); // Delete a possible existing file.
- fclose(file);
-}
-
-
-///
-/// Get the current instance of GDB debugger, creating a new one if needed.
-///
-/// Returns the current instance of GDB debugger.
-GDBConsole* GDBConsole::getInstance() {
- if (m_instance == NULL) {
- // Initialize it.
- m_instance = new GDBConsole;
- }
- return m_instance;
-}
-
-
-///
-/// Shut down GDB debugger. A command to exit GDB was already sent by GDBParser::exitGDB(): "-gdb-exit". However, still
-/// needs to "clean up": Update variables and terminate GDBWrapper process.
-///
-void GDBConsole::shutdown() {
- if (m_instance != NULL) {
- m_instance->cleanup();
- }
-}
-
-
-///
-/// Set m_pcGDBCmd variable with the path and command to initialize GDB/MI. It will be used to instantiate GDBConsole.
-/// For example: C:/bbndk/host_10_0_10_536/win32/x86\usr\bin\ntoarm-gdb.exe --interpreter=mi2.
-///
-/// String with full path and command to initialize GDB/MI.
-void GDBConsole::setGDBPath(const TCHAR* pcGDBCmd) {
- size_t numChars = _tcslen(pcGDBCmd) + 1;
-
- // The path length may have changed, so reallocate for this one.
- if (m_pcGDBCmd) {
- delete[] m_pcGDBCmd;
- }
- m_pcGDBCmd = new TCHAR[numChars * sizeof(TCHAR)];
-
- _tcscpy_s(m_pcGDBCmd, numChars, pcGDBCmd);
-}
-
-
-///
-/// Check if GDB is closed.
-///
-/// A boolean value: TRUE if GDB is closed; FALSE if not.
-BOOL GDBConsole::isClosed() {
- return m_isClosed;
-}
-
-
-///
-/// After exiting GDB, it is still needed to update some internal variables and terminate the GDBWrapper process.
-///
-void GDBConsole::cleanup() {
- WaitForSingleObject(m_hCleanupMutex, INFINITE);
- // Check if cleanup required.
- if (!m_isClosed) {
- m_isClosed = TRUE;
-
- if (m_pcGDBCmd != NULL) {
- delete[] m_pcGDBCmd;
- m_pcGDBCmd = NULL;
- }
-
- // Clean up and kill GDBWrapper process.
- if (!SetEvent(m_eventTerminate)) {
- // Force termination.
- TerminateProcess(m_hProcess, 0);
- }
-
- // Wait for process to terminate.
- WaitForSingleObject(m_hProcess, INFINITE);
-
- if (!CloseHandle(m_hProcess)) DisplayError(_T("CloseHandle"));
-
- if (!CloseHandle(m_hOutputRead)) DisplayError(_T("CloseHandle"));
- if (!CloseHandle(m_hInputWrite)) DisplayError(_T("CloseHandle"));
-
- m_instance = NULL;
- }
- ReleaseMutex(m_hCleanupMutex);
-}
-
-
-///
-/// Destructor.
-///
-GDBConsole::~GDBConsole() {
- cleanup();
-}
-
-
-///
-/// Sets up STARTUPINFO structure and launches redirected child.
-///
-void GDBConsole::prepAndLaunchRedirectedChild(void)
-{
- HANDLE stdHandles[3];
- LPCTSTR lpApplicationName = NULL;
- PROCESS_INFORMATION pi;
- STARTUPINFO si;
- DWORD flags = 0;
- DWORD pid = GetCurrentProcessId();
- TCHAR eventCtrlCName[MAX_EVENT_NAME_LENGTH];
- TCHAR eventTerminateName[MAX_EVENT_NAME_LENGTH];
-
- _stprintf(eventCtrlCName, _T("Ctrl-C-%i"), pid);
- _stprintf(eventTerminateName, _T("Terminate-%i"), pid);
-
- // Create event for wrapper process to wait on for CTRL-C.
- m_eventCtrlC = CreateEventW(NULL, FALSE, FALSE, eventCtrlCName);
-
- // Create event for wrapper process to wait on for termination.
- m_eventTerminate = CreateEventW(NULL, FALSE, FALSE, eventTerminateName);
-
- // Set process information.
- memset(&pi, 0, sizeof(pi));
-
- // Set up the start up info struct.
- ZeroMemory(&si, sizeof(STARTUPINFO));
- si.cb = sizeof(STARTUPINFO);
- si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
- si.hStdOutput = m_hOutputWrite;
- si.hStdInput = m_hInputRead;
- si.hStdError = m_hErrorWrite;
- si.wShowWindow = SW_HIDE;
-
- flags = CREATE_NEW_CONSOLE;
-
- String^ StringFilePath = Environment::GetFolderPath(Environment::SpecialFolder::ProgramFilesX86) + "\\BlackBerry\\VSPlugin-NDK\\GDBWrapper.exe";
- pin_ptr FilePath = PtrToStringChars(StringFilePath);
-
- if (!m_pcGDBCmd) {
- cleanup();
- ErrorExit(_T("m_pcGDBCmd is NULL"));
- }
-
- /* CreateProcess can modify pCmdLine thus we allocate memory */
- size_t numChars = _tcslen(m_pcGDBCmd) + MAX_EVENT_NAME_LENGTH * 2 + 1;
- TCHAR* pCmdLine = new TCHAR[numChars * sizeof(TCHAR)];
-
- if (pCmdLine == 0) {
- DisplayError(_T("prepAndLaunchRedirectedChild: failed to allocate memory for pCmdLine"));
- }
-
- _stprintf(pCmdLine, _T("\"%s\" \"%s\" \"%s\" \"%s\""), FilePath, m_pcGDBCmd, eventCtrlCName, eventTerminateName);
-
- // Launch the process (create a new console).
- if (!CreateProcess(NULL, /* executable name */
- pCmdLine, /* command line */
- NULL, /* process security attribute */
- NULL, /* thread security attribute */
- TRUE, /* inherits system handles */
- flags, /* normal attached process */
- NULL, /* environment block */
- NULL, /* change to the new current directory */
- &si, /* (in) startup information */
- &pi)) /* (out) process information */
- ErrorExit(_T("CreateProcess"));
-
- if(NULL != pCmdLine) {
- delete[] pCmdLine;
- pCmdLine = NULL;
- }
-
- m_hProcess = pi.hProcess;
-
- // Close unneeded handles.
- if (!CloseHandle(pi.hThread)) DisplayError(_T("CloseHandle"));
-}
-
-
-///
-/// Read the stdout of the GDB console process.
-///
-/// Buffer to store output.
-/// Size of buffer in bytes (leave space for the null char).
-/// Returns the number of characters that was read.
-/// One of these integer values: 0 - Error; 1 - Success; 2 - Read everything from buffer but the message was not written
-/// completed, maybe because the message is bigger than the buffer, maybe because GDB didn't finish writing the message. Call it
-/// again to keep reading.
-int GDBConsole::readOutput(CHAR* lpBuffer, int bufSize, int* nCharsRead)
-{
- DWORD nBytesRead;
-
- if (isClosed()) {
- DisplayError(_T("readOutput: GDBConsole is closed"));
- return 0;
- }
-
- if (lpBuffer == NULL) {
- DisplayError(_T("readOutput: null buffer pointer"));
- return 0;
- }
-
- if (bufSize < 1) {
- DisplayError(_T("readOutput: needs bufSize > 1"));
- return 0;
- }
-
- if (!ReadFile(m_hOutputRead, lpBuffer, bufSize,
- &nBytesRead, NULL) || !nBytesRead)
- {
- if (GetLastError() == ERROR_BROKEN_PIPE) {
- // Pipe done - normal exit path.
- cleanup();
- return 0;
- } else {
- ErrorExit(_T("ReadFile"));
- }
- }
-
- *nCharsRead = nBytesRead / sizeof(CHAR);
-
- const char* pLastChar = lpBuffer + nBytesRead;
- pLastChar -= 2;
-
- logPrint((char*) lpBuffer);
-
- if (strcmp("\r\n", pLastChar)) {
- // Didn't get end of line.
- return 2;
- }
-
- return 1;
-}
-
-
-///
-/// Send a GDB command to the stdin of the GDB console process.
-///
-/// null-terminated string ending in \r\n
-/// 0 - Error; 1 - Success
-int GDBConsole::sendCommand(const CHAR* lpCmd)
-{
- DWORD nBytesWrote;
- int nCmdChars = strlen(lpCmd);
-
- if (isClosed()) {
- DisplayError(_T("readOutput: GDBConsole is closed"));
- return 0;
- }
-
- // Input validation
- if (nCmdChars < 2) {
- DisplayError(_T("SendCommand: nCmdChars < 2"));
- } else {
- const char* pLastChar = strchr(lpCmd, '\0');
- pLastChar -= 2;
- if (strcmp("\r\n", pLastChar)) {
- DisplayError(_T("SendCommand: lpCmd doesn't end in \\r\\n"));
- }
- }
-
- if (!WriteFile(m_hInputWrite, lpCmd, nCmdChars * sizeof(CHAR), &nBytesWrote, NULL))
- {
- if (GetLastError() == ERROR_NO_DATA) {
- // Pipe was closed (normal exit path).
- cleanup();
- return 0;
- } else {
- DisplayError(_T("WriteFile"));
- return 0;
- }
- } else {
- printf("Sending [%s] (%d chars)\n", lpCmd, nBytesWrote / sizeof(CHAR));
- }
-
- logPrint((char*) lpCmd);
-
- return 1;
-}
-
-
-///
-/// Get handle m_hOutputRead.
-///
-/// Returns handle m_hOutputRead.
-HANDLE GDBConsole::getStdOutHandle() {
- return m_hOutputRead;
-}
-
-
-///
-/// Send a CtrlC event that will interrupt GDB execution.
-///
-void GDBConsole::sendCtrlC() {
- if (!SetEvent(m_eventCtrlC)) {
- DisplayError(_T("SetEvent"));
- }
-}
-
-
-///
-/// Check if there is more data to be read from GDB's stdout without removing it from the pipe's buffer.
-///
-/// Instance of GDB debugger.
-/// Returns TRUE (there is data to be read) or FALSE (there isn't).
-BOOL GDBConsole::isMoreOutputAvailable () {
- DWORD totalBytesAvail;
-
- if (!PeekNamedPipe(getStdOutHandle(), NULL, NULL, NULL, &totalBytesAvail, NULL)) {
- TCHAR lpError[256];
- _tprintf(lpError, _T("isMoreOutputAvailable: %s"), GetLastError());
- DisplayError(lpError);
- return false;
- }
-
- return (totalBytesAvail > 0);
-}
-
-
-///
-/// Waits and returns the output received from GDB, with a timeout. In case it finishes because of a timeout while waiting for a
-/// GDB response, be aware that this GDB response must be available in a later time and you must be able to handle it.
-///
-/// Timeout.
-/// Returns output received from GDB or "" if there is no GDB output.
-string GDBConsole::waitForPromptWithTimeout(int seconds) {
- char lpBuffer [1024];
- int nCharsRead = 0;
- int rc = 0;
- BOOL isPromptReady = FALSE;
- const char* promptString = "(gdb) \r\n";
- const char* lpTmp;
- clock_t start, current;
-
- start = clock();
-
- string message = "";
-
- do {
-
- current = clock();
- if ((message == "") && (((current - start) / CLOCKS_PER_SEC ) > seconds))
- {
- message = "TIMEOUT!";
- break;
- }
-
- memset(lpBuffer, 0, sizeof(lpBuffer));
-
- if (isClosed()) {
- break;
- }
-
- if (isMoreOutputAvailable())
- {
- rc = readOutput(lpBuffer, sizeof(lpBuffer) - 1, &nCharsRead);
- if (rc) {
- // Terminate the buffer.
-
- lpBuffer[nCharsRead] = '\0';
-
- message += lpBuffer;
-
- if (nCharsRead >= strlen(promptString)) {
- lpTmp = lpBuffer + nCharsRead - strlen(promptString);
- if (!strcmp(lpTmp, promptString)) {
- isPromptReady = TRUE;
- }
- }
- } else {
- DisplayError(_T("waitForPrompt: readOutput got error"));
- message += "\n\nwaitForPrompt: readOutput got error\n\n";
- break;
- }
- }
- } while (!isPromptReady && !isClosed());
-
- return message;
-}
-
-
-///
-/// Returns the output received from GDB.
-///
-/// If TRUE, this method waits for the entire GDB output, i.e., until the GDB prompt is ready. It is TRUE when
-/// initializing GDB. If FALSE, that is the default behavior, returns the current GDB output or "" if there is no GDB output.
-/// Returns output received from GDB or "" if there is no GDB output.
-string GDBConsole::waitForPrompt(bool sync) {
- char lpBuffer [1024];
- int nCharsRead = 0;
- int rc = 0;
- BOOL isPromptReady = FALSE;
- const char* promptString = "(gdb) \r\n";
- const char* lpTmp;
-
- string message = "";
-
- do {
- memset(lpBuffer, 0, sizeof(lpBuffer));
-
- if (isClosed()) {
- break;
- }
-
- if (isMoreOutputAvailable())
- {
- rc = readOutput(lpBuffer, sizeof(lpBuffer) - 1, &nCharsRead);
- if (rc) {
- // Terminate the buffer.
-
- lpBuffer[nCharsRead] = '\0';
-
- message += lpBuffer;
-
- if (nCharsRead >= strlen(promptString)) {
- lpTmp = lpBuffer + nCharsRead - strlen(promptString);
- if (!strcmp(lpTmp, promptString)) {
- isPromptReady = TRUE;
- }
- }
- } else {
- DisplayError(_T("waitForPrompt: readOutput got error"));
- message += "\n\nwaitForPrompt: readOutput got error\n\n";
- break;
- }
- }
- else if (!sync)
- break;
- } while (!isPromptReady && !isClosed());
-
- return message;
-}
-
-
-///
-/// Displays the error number and corresponding message.
-///
-/// Error message.
-void DisplayError(LPCTSTR pszAPI)
-{
- LPVOID lpvMessageBuffer;
- TCHAR szPrintBuffer[512];
- DWORD bufSize = 512 * sizeof(TCHAR);
- DWORD nCharsWritten;
-
- FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
- NULL, GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR)&lpvMessageBuffer, 0, NULL);
-
- StringCbPrintf(szPrintBuffer, bufSize,
- _T("ERROR: API = %s.\n error code = %d.\n message = %s.\n"),
- pszAPI, GetLastError(), (char *)lpvMessageBuffer);
-
- _tprintf(_T("%s\n"), szPrintBuffer);
-
- LocalFree(lpvMessageBuffer);
- ExitProcess(GetLastError());
-}
-
-
-///
-/// Retrieve the system error message for the last-error code.
-///
-/// Error message.
-void ErrorExit(LPTSTR lpszFunction)
-{
- LPVOID lpMsgBuf;
- LPVOID lpDisplayBuf;
- DWORD dw = GetLastError();
-
- FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- dw,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR) &lpMsgBuf,
- 0, NULL );
-
- // Display the error message and exit the process.
-
- lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT,
- (lstrlen((LPCTSTR)lpMsgBuf) + lstrlen((LPCTSTR)lpszFunction) + 40) * sizeof(TCHAR));
- StringCchPrintf((LPTSTR)lpDisplayBuf,
- LocalSize(lpDisplayBuf) / sizeof(TCHAR),
- TEXT("%s failed with error %d: %s"),
- lpszFunction, dw, lpMsgBuf);
- MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT("Error"), MB_OK);
-
- LocalFree(lpMsgBuf);
- LocalFree(lpDisplayBuf);
- ExitProcess(dw);
-}
-
-
-///
-/// Initialize / clean all the existing buffers: inputBuffer, GDBBuffer, outputBuffer.
-///
-void cleanBuffers()
-{
- for (int i = 0; i < InputBufferSize; i++)
- {
- strcpy(inputBuffer[i],"");
- }
- in_InputBuffer = 0;
- out_InputBuffer = 0;
- for (int i = 0; i < GDBBufferSize; i++)
- {
- GDBBuffer.GDBBufferData[i].seqId = -1;
- GDBBuffer.GDBBufferData[i].param = "";
- }
- GDBBuffer.quantity = 0;
- for (int i = 0; i < OutputBufferSize; i++)
- {
- strcpy(outputBuffer[i], "");
- }
- out_OutputBuffer = SyncInstructionsSize;
-}
-
-
-///
-/// Verify if GDB buffer is empty.
-///
-/// Returns TRUE if empty; FALSE if not.
-bool isGDBBufferEmpty()
-{
- bool empty = true;
- WaitForSingleObject( hGDBBufferMutex, INFINITE );
- if (GDBBuffer.quantity == 0)
- empty = true;
- else
- empty = false;
- ReleaseMutex( hGDBBufferMutex);
- return empty;
-}
-
-
-///
-/// For every command sent to GDB, the following parameters must be added into GDBBuffer.
-///
-/// Sequential ID of the command sent to GDB. It is used to identify, when evaluating GDB responses, which command
-/// generated a given response. This ID is also used to specify the location in which this entry will be stored in this buffer.
-/// Each command sent to GDB has an associated instruction code, that corresponds to the parsing
-/// instruction that will be used to parse the GDB response.
-/// Used to store the GDB command parameters, so they could be used during the parsing task. There are some GDB
-/// commands, like -break-delete for example, that results in a simple "^done" GDB response. The parser can identify which command
-/// caused that response but cannot know what was affected by it (considering the -break-delete command, the parser will know that some
-/// breakpoint was successfully deleted but won't know which of them was deleted). Using "param" helps the parser letting it knows
-/// which parameters were sent together with a given GDB command.
-/// Returns TRUE - successfully added; or FALSE - failed to add.
-bool addIntoGDBBuffer(int seq_id, int instructionCode, string param)
-{
- if (seq_id < 0)
- return false;
- bool got = false;
- int pos = seq_id % GDBBufferSize;
- WaitForSingleObject( hGDBBufferMutex, INFINITE );
- if (GDBBuffer.GDBBufferData[pos].seqId == -1) // -1 means that the [pos] entry is "empty" or "not used".
- {
- GDBBuffer.GDBBufferData[pos].seqId = seq_id;
- GDBBuffer.GDBBufferData[pos].instructionCode = instructionCode;
- GDBBuffer.GDBBufferData[pos].param = param;
- GDBBuffer.quantity += 1;
- got = true;
- }
- ReleaseMutex( hGDBBufferMutex);
- return (got);
-}
-
-
-///
-/// This method is called to find the right parsing instruction for a given GDB response.
-///
-/// Sequential ID of the GDB response.
-/// Returns the parameters sent together with the GDB command that generated this response, if there are some.
-/// Returns the instruction code associated to the sequential id (seq).
-int removeFromGDBBuffer(int seq, string *param)
-{
- int output = -1;
- if (seq < 0) // Means that: the GDB response is asynchronous or the response is not completed yet (GDB is still writing it)
- if (seq == -2) // Means the GDB response is asynchronous and is not related to a GDB command.
- return 0; // 0 is the instruction code for asynchronous responses.
- else if (seq == -3) // Means that a breakpoint was modified. It is one of the GDB asynchronous messages.
- return 1; // 1 is the instruction code for modified breakpoints responses.
- else
- return seq; // GDB response is incomplete.
-
- if (seq >= SyncInstructionsSize) // Means it was not a synchronous COMMAND. This number starts with SyncInstructionsSize
- // and is increased for each new non synchronous COMMAND that is sent to GDB.
- seq = (seq % SyncInstructionsSize) + SyncInstructionsSize; // seq must stay between SyncInstructionsSize and the buffer size.
-
- WaitForSingleObject( hGDBBufferMutex, INFINITE );
- if (GDBBuffer.GDBBufferData[seq].seqId != -1)
- {
- output = GDBBuffer.GDBBufferData[seq].instructionCode;
- *param = GDBBuffer.GDBBufferData[seq].param;
- GDBBuffer.GDBBufferData[seq].seqId = -1; // Marking this entry as "empty" or "not used".
- GDBBuffer.quantity -= 1;
- }
- ReleaseMutex( hGDBBufferMutex);
- return output;
-}
-
-
-///
-/// Store the parsed GDB response in the "seq_stamp" position of the Output buffer.
-///
-/// Position in the Output buffer to store the parsed GDB response.
-/// Parsed GDB response.
-/// Returns TRUE - successfully added; or FALSE - failed to add.
-bool addIntoOutputBuffer(int seq_stamp, char *parsedMessage)
-{
- if (seq_stamp < 0)
- return false;
- bool got = false;
- int pos = seq_stamp % OutputBufferSize;
- WaitForSingleObject( hOutputBufferMutex, INFINITE );
- if (strcmp(outputBuffer[pos], "") == 0) // "" means that the [pos] entry is "empty" or "not used".
- {
- strcpy(outputBuffer[pos], parsedMessage);
- got = true;
- if (pos >= SyncInstructionsSize)
- SetEvent(asyncOutputEvent); // Wake up "removeFromOutputBuffer", if needed.
- }
- ReleaseMutex( hOutputBufferMutex);
- return (got);
-}
-
-
-///
-/// This method is called to send back to the debug engine the next parsed GDB response (output) for an
-/// asynchronous GDB RESPONSE or a non synchronous GDB COMMAND. This managed part of Output buffer is circular.
-///
-/// Returns the parsed GDB response.
-void removeFromOutputBuffer(char * output)
-{
- WaitForSingleObject( hOutputBufferMutex, INFINITE );
- if (strcmp(outputBuffer[out_OutputBuffer], "") != 0)
- {
- strcpy(output, outputBuffer[out_OutputBuffer]);
- strcpy(outputBuffer[out_OutputBuffer], "");
- out_OutputBuffer += 1;
- if (out_OutputBuffer == OutputBufferSize)
- out_OutputBuffer = SyncInstructionsSize; // Positions 0 to "SyncInstructionsSize - 1" are reserved for synchronous commands.
- }
- ReleaseMutex( hOutputBufferMutex);
- if (strcmp(output, "") == 0) // Means that the asynchronous part of output buffer is empty.
- WaitForSingleObject(asyncOutputEvent, WAIT_TIME);
- if (strcmp(output, "$#@EMPTY@#$") == 0) // This string means that both GDB and the parser worked well and returned an empty string.
- output = "";
-}
-
-
-///
-/// This method is called to send back to the debug engine the expected parsed GDB response (output) for a given synchronous
-/// GDB COMMAND (ID). Each entry in this part of Output buffer was previously reserved for each GDB command. There are some free entries
-/// that can be used by other GDB commands in the future.
-///
-/// Returns the parsed GDB response.
-/// ID of the GDB command.
-void removeSyncFromOutputBuffer(char * output, int ID)
-{
- if ((ID < 0) || (ID >= SyncInstructionsSize))
- return;
- WaitForSingleObject( hOutputBufferMutex, INFINITE );
- if (strcmp(outputBuffer[ID], "") != 0)
- {
- strcpy(output, outputBuffer[ID]);
- strcpy(outputBuffer[ID], "");
- }
- ReleaseMutex( hOutputBufferMutex);
-}
-
-
-///
-/// Verify if Input buffer is empty.
-///
-/// Returns TRUE if empty; FALSE if not.
-bool isInputBufferEmpty()
-{
- bool empty;
- WaitForSingleObject( hInputBufferMutex, INFINITE );
- if (in_InputBuffer == out_InputBuffer)
- empty = true;
- else
- empty = false;
- ReleaseMutex( hInputBufferMutex);
- return empty;
-}
-
-
-///
-/// This method is called by the debug engine to store each command that must be sent to GDB. Input buffer is a circular one.
-///
-/// Command to be sent to GDB.
-/// Returns TRUE - successfully added; or FALSE - failed to add.
-bool addIntoInputBuffer(char GDBCommand[GDBCommandSize])
-{
- bool got = false;
- bool fireEvent = false;
- WaitForSingleObject( hInputBufferMutex, INFINITE );
- if (!((in_InputBuffer == (InputBufferSize - 1) && out_InputBuffer == 0) || ((in_InputBuffer + 1) == out_InputBuffer)))
- {
- if (in_InputBuffer == out_InputBuffer)
- fireEvent = true;
- strcpy(inputBuffer[in_InputBuffer], GDBCommand);
- in_InputBuffer += 1;
- if (in_InputBuffer == InputBufferSize)
- in_InputBuffer = 0;
- got = true;
- }
- if (fireEvent)
- SetEvent(inputEvent); // Wake up "sendingCommands2GDB", if needed.
- ReleaseMutex( hInputBufferMutex);
- return (got);
-}
-
-
-///
-/// Used by sendingCommands2GDB thread to get the next command to be sent to GDB. Input buffer is a circular one.
-///
-/// Returns the next command to be sent to GDB.
-void removeFromInputBuffer(char * input)
-{
- WaitForSingleObject( hInputBufferMutex, INFINITE );
- if (in_InputBuffer != out_InputBuffer)
- {
- strcpy(input, inputBuffer[out_InputBuffer]);
- strcpy(inputBuffer[out_InputBuffer],"");
- out_InputBuffer += 1;
- if (out_InputBuffer == InputBufferSize)
- out_InputBuffer = 0;
- }
- ReleaseMutex( hInputBufferMutex);
-}
-
-
-///
-/// Get the sequential ID of the response.
-///
-/// The GDB response.
-/// If the response is synchronous, this ID corresponds to the sequential ID of the command sent to GDB that generated such
-/// response. If the response is asynchronous, there is no sequential ID in the response, so it returns:
-/// -3 - when it shows that a breakpoint was modified;
-/// -2 - for any other asynchronous response
-/// -1 - when the response is not completed or in case of an error.
-int getSeqID(string response)
-{
- int end;
- int begin;
- char seqIDstr[11] = "";
- int seqID = -1;
-
- end = response.find("^done", 0);
- if (end == -1)
- {
- end = response.find("^running", 0);
- if (end == -1)
- {
- end = response.find("^error", 0);
- if (end == -1)
- {
- end = response.find("^connected", 0);
- if (end == -1)
- {
- end = response.find("*running", 0);
- if (end != -1)
- return -2; // Means the GDB response is asynchronous.
- else
- {
- end = response.find("*stopped", 0);
- if (end != -1)
- {
- return -2; // Means the GDB response is asynchronous.
- }
- else
- {
- if (response.substr(0, 20) == "=breakpoint-modified")
- {
- return -3; // Means that a breakpoint was modified.
- }
- else
- {
- return -1; // Error / message incomplete.
- }
- }
- }
- }
- }
- }
- }
- if (end < 15) // SeqID is the first data in the string
- begin = 0;
- else
- {
- begin = end - 1;
- while ((response[begin] != '"') && (response[begin] != '}'))
- begin--;
- begin++;
- }
- response.copy(seqIDstr, end - begin, begin);
- seqID = atoi(seqIDstr);
- return(seqID);
-}
-
-
-///
-/// Get the next position of a given character (token) in a string message (txt), starting from a given position (pos).
-///
-/// Character to search for.
-/// String message in which it will search for the given character.
-/// Starting position in the string message.
-/// An integer that corresponds to the next position of the character in the string. If the character is not found, returns
-/// the length of the string.
-int getNextChar(char token, string txt, int pos)
-{
- int end = pos;
- int slash, aux;
- do
- {
- slash = 0;
- end = txt.find(token, pos);
- if (end == -1)
- end = txt.length();
- aux = end - 1;
- while ((aux >= 0) && (txt[aux] == '\\'))
- {
- slash++;
- aux--;
- }
- pos = end + 1;
- } while ((slash % 2) != 0);
- return end;
-}
-
-
-///
-/// Get the position of a given string (txt) in the string GDB response (response), starting from a given position (begin).
-///
-/// GDB string response where the search will be performed.
-/// String to search for in the GDB response.
-/// Starting position in the GDB string response.
-/// Search for that string "times" times. Ex: I want to find the third occurrence of word "qaqa" in the GDB
-/// response.
-/// Direction: if true, search forwards; if not, search backwards. Only '?' instruction can search backwards.
-/// The kind of parsing instruction that called this method. '?', '@', or '~'. Only '?' instruction can
-/// search backwards.
-/// An integer that corresponds to the next position of the string in the GDB response. -1 in case of an error.
-int searchResponse(string response, string txt, int begin, int times, bool forward, char instruction)
-{
- for (; times > 0; times--)
- {
- if ((begin >= response.length()) || (begin == -1))
- break;
- if (forward)
- {
- if (begin == 0)
- {
- if ((txt[0] == '\r') && (txt[1] == '\n'))
- {
- string check = txt.substr(2, txt.length() - 2);
- if (response.substr(0, check.length()) == check)
- continue;
- }
- }
- begin = response.find(txt, begin);
- if ((begin != -1) && ((times != 1) || (instruction == '?')))
- begin += txt.length();
- }
- else
- {
- begin = response.rfind(txt, begin);
- if (begin != -1)
- {
- if (times == 1)
- begin += txt.length();
- else
- begin--;
- }
- if ((begin == -1) && ((txt[0] == '\r') && (txt[1] == '\n')))
- begin = 2; // 2 is the size of "\r\n".
- }
- }
- if (times == 0)
- return begin;
- return -1;
-}
-
-
-///
-/// Substitute the existing variables in the string "txt" by their values, stored in the "variables" array. Each variable name
-/// has this format: $9$, where $ characters are used to identify the variable while the number corresponds to the variable ID, that also
-/// corresponds to the array index. There is a special variable "$EOL$" that is substituted by "\r\n".
-///
-/// String to search for variables.
-/// Array with the variable values.
-/// Returns the new modified string.
-string substituteVariables(string txt, char variables[10][128])
-{
- do
- {
- int aux = getNextChar('$', txt, 0);
- if (aux < txt.length())
- {
- aux++;
- int aux2 = getNextChar('$', txt, aux);
- string index = txt.substr(aux, aux2 - aux);
- if (index == "EOL")
- {
- txt = txt.substr(0, aux - 1) + '\r' + '\n' + txt.substr(aux2 + 1, txt.length());
- }
- else
- txt = txt.substr(0, aux - 1) + variables[atoi(index.c_str())] + txt.substr(aux2 + 1, txt.length());
- }
- else
- break;
- } while (true);
- return txt;
-}
-
-
-///
-/// Find the position of the associated closing bracket/parenthesis.
-///
-/// The associated opening character ("(", "{" or "[").
-/// The associated closing character (")", "}" or "]").
-/// The string where the search will be made.
-/// Start position in the parsingInstruction string. This position normally corresponds to the position of the opening
-/// character, but it could be smaller than that (never bigger!). However, if it is smaller, it cannot have the same character between
-/// the 'ini' position and the corresponding one for the opening one. If need to have another one, precede it by the character '\'.
-/// Returns the position of the associated closing bracket/parenthesis. If it is not found, returns the length of the string.
-int findClosing(char opening, char closing, string parsingInstruction, int ini)
-{
- int end = getNextChar(closing, parsingInstruction, ini);
- int other = ini;
- bool found = true;
- do
- {
- other = getNextChar(opening, parsingInstruction, other + 1);
- if (other < end)
- {
- end = getNextChar(closing, parsingInstruction, end + 1);
- }
- else
- found = false;
- } while (found);
- return end;
-}
-
-
-///
-/// Reponsible for parsing each GDB response. Depending on the parsing instruction, the parser can get the first occurrence
-/// from GDB response or get all of them that satisfies this parsing instruction.
-///
-/// GDB response.
-/// Instruction used to parse the respective GDB response.
-/// Current character to be read in GDB response.
-/// If the parsing instruction specifies that it has to get all occurences from a GDB response, this value must
-/// be true.
-/// A variable stores a string parsed from GDB response and can be used as many times as needed to create the
-/// parsed response. Up to 10 variables can be created for a given parsing instruction.
-/// If the parsing instruction allows the parser to get all occurrences from GDB response, this separator will
-/// be used at the end of each occurence. The default one is '#' but it can be specified in the parsing instruction.
-/// Returns the parsed GDB response.
-string parseGDB(string *response, string parsingInstruction, int respBegin, bool repeat, char variables[10][128], string separator)
-{
- string result = ""; // This variable will be the parsed GDB response.
- string originalParsingInstruction = parsingInstruction; // Backup of parsing instruction.
- int parsePos = 0; // Current character to be read in parsing instruction.
- int home = respBegin; // Save the current position in GDB response.
- int respEnd = 0;
- int limit = (*response).length();
- bool found = false;
-
- bool removeSelection = false;
- int removeFromHere = -2; // -2 - not set; -1 - indicates that it will be set in the first '?' instruction; >=0 - already set.
-
- if (separator == "$EOL$")
- separator = "\r\n";
-
- while ((parsePos < parsingInstruction.length()) || repeat)
- {
- if ((repeat) && (parsePos >= parsingInstruction.length())) // repeat instructions till the end of the response
- {
- if (found)
- {
- if (result != "")
- result += separator;
- parsePos = 0;
- parsingInstruction = originalParsingInstruction;
- limit = (*response).length();
- found = false;
- }
- else
- repeat = false;
- continue;
- }
-
- if (parsingInstruction[parsePos] == '(') // repeat instructions till the end of the response
- {
- int end = parsePos;
- string repeatInstruction;
-
- end = findClosing('(', ')', parsingInstruction, parsePos);
-
- repeatInstruction = parsingInstruction.substr(parsePos + 1, end - (parsePos + 1));
-
- end++;
- if (parsingInstruction[end] == ':')
- {
- parsePos = end + 1;
- end = getNextChar(';', parsingInstruction, parsePos);
- separator = parsingInstruction.substr(parsePos, end - parsePos);
- int aux = separator.find("\\;");
- if (aux != -1)
- separator.erase(aux,1);
- }
- parsePos = end + 1;
-
- result += parseGDB(response, repeatInstruction, respBegin, true, variables, separator);
-
- continue;
- }
-
- if (parsingInstruction[parsePos] == '?') // search and set the beginning of the searched string.
- {
- int times = 1;
- bool forward = true;
- int end;
- int aux;
- string txt;
-
- parsePos++;
- if (parsingInstruction[parsePos] == '%') // consider this position to extract and use the data and them remove this
- // one from the GDB response string.
- {
- removeFromHere = -1;
- parsePos++;
- }
-
- if (parsingInstruction[parsePos] == '<') // means to search backwards.
- {
- forward = false;
- parsePos++;
- }
-
- if (parsingInstruction[parsePos] != '?') // the number of times to search for a given string.
- {
- end = getNextChar('?', parsingInstruction, parsePos);
- times = atoi(parsingInstruction.substr(parsePos, end - parsePos).c_str());
- parsePos = end;
- }
- parsePos++;
-
- end = getNextChar(';', parsingInstruction, parsePos);
-
- txt = substituteVariables(parsingInstruction.substr(parsePos, end - parsePos), variables);
-
- aux = txt.find('\\');
- while (aux != -1)
- { // if a '\' is found, it is eliminated because it is considered an escape character. However, if '\' is needed, add two, i.e. '\\', because only one of them will be removed
- txt = txt.substr(0, aux) + txt.substr(aux + 1, txt.length());
- aux = txt.find('\\', aux + 1);
- };
-
- int previousRespBegin = respBegin;
- respBegin = searchResponse(*response, txt, respBegin, times, forward, '?');
-
-// check if it was defined a set of instructions to be executed if the search is NOT valid, i.e., there is a '{' after the ';'.
-// If the search is not valid, go to the '}' and keep going. If there is no '{}' and the search is not valid, just end evaluating
-// these instructions. Normally, there is '{}' to allow handling gdb errors.
- if (parsingInstruction[end + 1] == '{')
- {
- parsePos = end + 1;
-
- end = findClosing('{', '}', parsingInstruction, parsePos);
-
- if ((respBegin != -1) && (respBegin <= limit))
- {
- found = true;
- // the following instructions to be evaluated are between '{' and '}'.
- if (((end + 1) < parsingInstruction.length()) && (parsingInstruction[end+1] != '{'))
- {
- parsingInstruction = parsingInstruction.substr(parsePos + 1, end - (parsePos + 1)) + parsingInstruction.substr(end + 2, parsingInstruction.length());
- }
- else
- {
- // if there is '{' after a '}', it means that there is an 'else' sentence.
- int else_end;
- else_end = findClosing('{', '}', parsingInstruction, end + 1);
- parsingInstruction = parsingInstruction.substr(parsePos + 1, end - (parsePos + 1)) + parsingInstruction.substr(else_end + 2, parsingInstruction.length());
- }
-
- parsePos = 0;
- if (removeFromHere == -1)
- removeFromHere = respBegin - txt.length();
- }
- else
- {
- respBegin = previousRespBegin;
- removeFromHere = -2;
- if (((end + 1) < parsingInstruction.length()) && (parsingInstruction[end+1] != '{'))
- {
- parsePos = end + 2; // move it to the next instruction, after the "};"
- }
- else
- {
- parsePos = end + 1;
- end = findClosing('{', '}', parsingInstruction, parsePos);
- parsingInstruction = parsingInstruction.substr(parsePos + 1, end - (parsePos + 1)) + parsingInstruction.substr(end + 2, parsingInstruction.length());
- parsePos = 0;
- }
- }
- }
- else
- {
- if ((respBegin == -1) || (respBegin > limit))
- {
- if (respBegin > limit)
- respBegin = previousRespBegin;
-
- parsePos = parsingInstruction.length();
- removeFromHere = -2;
- removeSelection = false;
- }
- else
- {
- found = true;
- parsePos = end + 1;
- if (removeFromHere == -1)
- removeFromHere = respBegin - txt.length();
- }
- }
-
- continue;
- }
-
- if (parsingInstruction[parsePos] == '@') // till here: search and set the end of the searched string. Return the string
- // between the last ? and this "till here" position
- {
- int times = 1;
- int end;
- string txt;
- int aux;
-
- parsePos++;
-
- if (parsingInstruction[parsePos] != '@') // get the number of times to search for a given string.
- {
- end = getNextChar('@', parsingInstruction, parsePos);
- times = atoi(parsingInstruction.substr(parsePos, end - parsePos).c_str());
- parsePos = end;
- }
- parsePos++;
-
- end = getNextChar(';', parsingInstruction, parsePos);
-
- txt = substituteVariables(parsingInstruction.substr(parsePos, end - parsePos), variables);
-
- aux = txt.find('\\');
- while (aux != -1)
- { // if a '\' is found, it is eliminated because it is considered an escape character. However, if '\' is needed, add two, i.e. '\\', because only one of them will be removed
- txt = txt.substr(0, aux) + txt.substr(aux + 1, txt.length());
- aux = txt.find('\\', aux + 1);
- };
-
- respEnd = searchResponse(*response, txt, respBegin, times, true, '@');
- if ((respEnd == -1) || (respEnd > limit))
- {
- result = "";
- break;
- }
- if (!removeSelection)
- result += (*response).substr(respBegin, respEnd - respBegin);
-
- respBegin = respEnd;
-
- if (removeFromHere >= 0)
- {
- (*response).erase(removeFromHere, respEnd + txt.length() - removeFromHere);
- respBegin = removeFromHere;
- removeFromHere = -2;
- removeSelection = false;
- }
-
- parsePos = end + 1;
- continue;
- }
-
- if (parsingInstruction[parsePos] == '#') // insert the following string into the result
- {
- int end = getNextChar(';', parsingInstruction, parsePos);
- parsePos++;
-
- string txt = parsingInstruction.substr(parsePos, end - parsePos);
- int aux = txt.find('\\');
- while (aux != -1)
- { // if a '\' is found, it is eliminated because it is considered an escape character. However, if '\' is needed, add two, i.e. '\\', because only one of them will be removed
- txt = txt.substr(0, aux) + txt.substr(aux + 1, txt.length());
- aux = txt.find('\\', aux + 1);
- };
-
- result += substituteVariables(txt, variables);
-
- parsePos = end + 1;
- continue;
- }
-
- if (parsingInstruction[parsePos] == '~') // specify a limit, so the search instructions will search till this position.
- {
- int end = getNextChar(';', parsingInstruction, parsePos);
- parsePos++;
-
- string txt = parsingInstruction.substr(parsePos, end - parsePos);
- int aux = txt.find('\\');
- while (aux != -1)
- { // if a '\' is found, it is eliminated because it is considered an escape character. However, if '\' is needed, add two, i.e. '\\', because only one of them will be removed
- txt = txt.substr(0, aux) + txt.substr(aux + 1, txt.length());
- aux = txt.find('\\', aux + 1);
- };
-
- limit = searchResponse(*response, txt, respBegin, 1, true, '~');
- if (limit == -1)
- {
- limit = (*response).length();
- }
-
- parsePos = end + 1;
- continue;
- }
-
- if (parsingInstruction[parsePos] == '0') // set the response cursor position to home_pos (normally 0, but '(' can set a different
- // value for home_pos)
- {
- respBegin = home;
- parsePos += 2; // jump the '0' and ';' characters
- continue;
- }
-
- if (parsingInstruction[parsePos] == '%') // delete the string (between ? and @) from response
- {
- removeSelection = true;
- removeFromHere = -1;
- parsePos++;
- continue;
- }
-
- if (parsingInstruction[parsePos] == '$') // create a variable to store a value from response string. This value is defined by
- // the instructions between the '=' and the @ symbol (till here)
- {
- int end, varNumber, aux;
-
- parsePos++;
- end = getNextChar('=', parsingInstruction, parsePos);
- aux = getNextChar('$', parsingInstruction, parsePos);
- if ((aux > 0) && (aux < end))
- end = parsingInstruction.length();
- if (end < parsingInstruction.length()) // variable assignment
- {
- varNumber = atoi(parsingInstruction.substr(parsePos, end - parsePos).c_str());
-
- parsePos = end + 1;
- end = parsingInstruction.find("$$", parsePos);
- string r = parseGDB(response, parsingInstruction.substr(parsePos, end - parsePos), respBegin, false, variables, "#");
- if (r == "")
- break;
- strcpy(variables[varNumber], r.c_str());
-
- parsePos = end + 3; // jump $$;
- }
- else // pre-defined variable: Finish the parsing task or move to the end of the GDB response.
- {
- end = parsingInstruction.find('$', parsePos);
- if (parsingInstruction.substr(parsePos, end - parsePos) == "END")
- break;
- if (parsingInstruction.substr(parsePos, end - parsePos) == "EOR") // move respBegin to the end of the response, probably
- // to start looking from the end to the begin.
- respBegin = response->length() - 1;
- parsePos = end + 2;
- }
- continue;
- }
-
- }
- return(result);
-}
-
-
-///
-/// Function used to call the parser that will parse a GDB response according to the parsing instruction, returning this parsed
-/// response. Call this function when starting GDB (this one doesn't use the OutputBuffer because it returns the parsed response).
-///
-/// GDB response.
-/// Instruction used to parse the respective GDB response.
-/// Returns the parsed GDB response.
-string parseGDB(string response, string parsingInstruction)
-{
- char variables[10][128];
- char result[ParsedMessageSize] = "";
-
- strcpy(result, parseGDB(&response, parsingInstruction, 0, false, variables, "#").substr(0, ParsedMessageSize - 1).c_str());
-
- return (result);
-}
-
-
-///
-/// Function used to call the parser that will parse a GDB response according to the parsing instruction, storing the parsed
-/// response in the Output Buffer. Call this function if NOT USING multithreaded parsing
-///
-/// GDB response.
-/// Instruction used to parse the respective GDB response.
-/// Position in the Output Buffer in which the parsed response will be stored.
-void parseGDB(string response, string parsingInstruction, int seqStamp)
-{
- char variables[10][128];
- char result[ParsedMessageSize] = "";
-
- strcpy(result, parseGDB(&response, parsingInstruction, 0, false, variables, "#").substr(0, ParsedMessageSize - 1).c_str());
-
- if (strcmp(result,"") == 0)
- {
- // TODO? Unexpected response. Must handle it.
- strcpy(result, "$#@EMPTY@#$"); // Sending this string to be sure that the parser worked well and returned an empty string.
- }
-
- while (!addIntoOutputBuffer(seqStamp, result))
- Sleep(0);
-}
-
-
-///
-/// Thread used to call the parser that will parse a GDB response according to the parsing instruction, storing the parsed
-/// response in the Output Buffer. Call this function if USING multithreaded parsing. One thread per each GDB response.
-///
-/// A ParsingThreadDetails data structure that stores the following data:
-/// - response (GDB response);
-/// - parsingInstruction (Parsing instruction); and
-/// - seqStamp (Output buffer index where the parsed response will be stored).
-/// 0
-unsigned __stdcall parseGDBResponseThread(void *arg)
-{
- ParsingThreadDetails *d = (ParsingThreadDetails *)arg;
- string response = d->response;
- string parsingInstruction = d->parsingInstruction;
- int seqStamp = *(d->seqStamp);
-
- char result[ParsedMessageSize] = "";
- char variables[10][128];
-
- strcpy(result, parseGDB(&response, parsingInstruction, 0, false, variables, "#").substr(0, ParsedMessageSize - 1).c_str());
-
- if (strcmp(result,"") == 0)
- {
- // TODO? Unexpected response. Must handle it.
- strcpy(result, "$#@EMPTY@#$"); // Sending this string to be sure that parsed worked well and returned an empty string.
- }
-
- while (!addIntoOutputBuffer(seqStamp, result))
- Sleep(0);
-
- return 0;
-}
-
-
-///
-/// Thread responsible for listening for GDB outputs. Thread sendingCommands2GDB start this one, that stays alive till the
-/// end of the debugging session.
-///
-/// A ListeningThreadData data structure that stores the following data:
-/// - console (Current instance of GDB debugger); and
-/// - parsingInstructions (Parsing instruction).
-/// 0
-unsigned __stdcall listeningGDB(void *arg)
-{
- ListeningThreadData *listen = (ListeningThreadData *)arg;
-
- int seqStamp = SyncInstructionsSize; // Positions 0 to 49 are reserved for synchronous commands
-
- string response = "";
- int getMoreData = 10; // used when the GDB output does not have a complete response.
-
- while(!exitGDB) // exitGDB is set to true by sendingCommands2GDB thread, when the debugging sessiong ends.
- {
- int instructionCode;
- int gdbPos;
-
- response += listen->console->waitForPrompt(false);
-
- gdbPos = response.find("(gdb)");
-
- while (gdbPos == 0)
- {
- response.erase(0,5);
- gdbPos = response.find("(gdb)");
- }
-
- if ((gdbPos == -1) && (response.length() > 3))
- gdbPos = response.length();
-
- while (gdbPos != -1) // Just in case gdb was faster than our debugger. If that happens, there will be two or more responses
- // in the buffer, so we have to parse each of them individually.
- {
- int asyncRunning = -1;
- int asyncStopped = -1;
- int seqId;
- string param = "";
- string oneResponse;
-
- oneResponse = response.substr(0, gdbPos);
-
- asyncRunning = oneResponse.find("*running");
- asyncStopped = oneResponse.find("*stopped");
- if ((asyncRunning != -1) && (asyncStopped != -1))
- {
- if (asyncRunning > asyncStopped)
- gdbPos = asyncRunning;
- else
- gdbPos = asyncStopped;
- oneResponse = oneResponse.substr(0, gdbPos);
- }
-
- seqId = getSeqID(oneResponse);
- instructionCode = removeFromGDBBuffer(seqId, ¶m);
-
- if (param != "")
- {
- oneResponse = oneResponse.erase(oneResponse.length() - 2, 2);
- oneResponse = oneResponse + param + '\r' + '\n';
- }
-
- if (instructionCode == -1)
- {
- getMoreData -= 1; // get more data from buffer to try to identify the type of the response
- if (getMoreData == 0)
- instructionCode = 0; // it was not possible to identify the type of the response after reading buffer 10 times.
- // Consider it an asynchronous one.
- else
- break; // don't erase the response... Trying to get more data.
- }
-
- getMoreData = 10;
-
- if (instructionCode != -1)
- {
- // Create a thread to parse the response with parsingInstructions[instructionCode]. Send also a sequencial number,
- // so VS can sort the results. Can use multiple parsing threads or not, depending on the const value MultipleThreads
- // defined in gdb-connect.h
- if (MultipleThreads)
- {
- HANDLE ParsingThread = new(HANDLE);
- unsigned ParsingThreadID;
-
- ParsingThreadDetails *details = new(ParsingThreadDetails);
-
- details->parsingInstruction = new(char[listen->parsingInstructions[instructionCode].length()]);
- strcpy(details->parsingInstruction, listen->parsingInstructions[instructionCode].c_str());
- details->response = new(char[oneResponse.length()]);
- strcpy(details->response, oneResponse.c_str());
- details->seqStamp = new(int);
- if ((seqId >= 0) && (seqId < SyncInstructionsSize))
- *(details->seqStamp) = seqId;
- else
- *(details->seqStamp) = seqStamp;
-
- ParsingThread = (HANDLE)_beginthreadex( NULL, 0, &parseGDBResponseThread, (void *)details, 0, &ParsingThreadID);
- }
- else // Without multiple parsing threads
- {
- if ((seqId >= 0) && (seqId < SyncInstructionsSize))
- parseGDB(oneResponse.c_str(), listen->parsingInstructions[instructionCode].c_str(), seqId);
- else
- parseGDB(oneResponse.c_str(), listen->parsingInstructions[instructionCode].c_str(), seqStamp);
- }
-
- if ((seqId < 0) || (seqId >= SyncInstructionsSize))
- {
- seqStamp++;
- seqStamp = (seqStamp % SyncInstructionsSize) + SyncInstructionsSize;
- }
- }
- if ((asyncRunning == -1) || (asyncStopped == -1))
- gdbPos += 5;
- response.erase(0, gdbPos);
- gdbPos = response.find("(gdb)");
-
- if (gdbPos == -1)
- if (response.length() > 3)
- gdbPos = response.length();
- else
- response = "";
- };
- }
-
- exitGDB = false;
-
- return 0;
-}
-
-
-///
-/// Get the associated instruction ID from the command to be sent to GDB.
-///
-/// Command to be sent to GDB.
-/// Hash map data structure that contains the GDB commands recognized by the parser and their respectives
-/// instructions IDs.
-/// When the instruction code stored in "map" is negative, it means that the commands parameters must be saved to
-/// be used by the listeningGDB thread. When that happens, update and return variable "param".
-/// Returns the instruction code for the command to be sent to GDB or -1 in case of an error. It can also return the command
-/// parameters, as it was described above.
-int getInstructionCode(string command, unordered_map map, string *param)
-{
- int pos = command.find(" ");
- if (pos != -1)
- {
- *param = command.substr(pos, (command.length() -pos));
- (*param)[0] = ';';
- int i = (*param).find(" ");
- while (i != -1)
- {
- (*param)[i] = ';';
- i = (*param).find(" ");
- }
- command = command.substr(0, pos);
- }
- unordered_map::iterator it = map.find(command);
- if (it != map.end())
- {
- if (it->second > 0)
- {
- *param = "";
- return (it->second);
- }
- else
- {
- return ((it->second) * -1);
- }
- }
- printf("Command code not found.");
- return -1;
-}
-
-
-///
-/// Initialize the hash map data structure "map" in which each entry contains a GDB command that is currently recognized by
-/// the parser with its respective instruction ID. It loads these information from Instructions.txt file, in where each line has the
-/// following format:
-/// {$}gdb-command:->:parsing-instruction;
-/// It must have the $ sign in front of the GDB command when it is needed to store the command parameters to be used later by the
-/// listeningGDB thread. This usually happens whenever the GDB response for a given command does not contains enough information, like
-/// only "^done" for example, when the parser needs something else. The ":->:" separates the GDB command from the parsing Instruction.
-///
-/// Hash map data structure that contains the GDB commands recognized by the parser and their respectives
-/// instructions IDs.
-/// A string array with all of the currently recognized parsing instructions. The index position
-/// correponds to the instruction ID used in "map" for the respective GDB command.
-/// 1 in case of sucess; 0 if there is an error when opening the Instructions.txt file.
-bool insertingCommandCodes(unordered_map *map, string parsingInstructions[NumberOfInstructions])
-{
- String^ StringFilePath = Environment::GetFolderPath(Environment::SpecialFolder::ProgramFilesX86) + "\\BlackBerry\\VSPlugin-NDK\\Instructions.txt";
- pin_ptr FilePath = PtrToStringChars(StringFilePath);
-
- ifstream inputs;
- inputs.open (FilePath);
-
- if (!inputs.is_open())
- {
- cout << "\nCouldn't open Instructions.txt.\n";
- return 0;
- }
- int count = 0;
- while(true)
- {
- string instruction;
- int pos;
- getline(inputs, instruction);
- if (inputs.eof())
- {
- break;
- }
-
- pos = instruction.find(":->:");
- if (instruction[0] != '$')
- {
- (*map).insert(unordered_map::value_type(instruction.substr(0, pos), count));
- }
- else // need to get the parameters from the GDB command and insert them into the GDB response. Count will be negative so sending and listening threads will know about that.
- {
- (*map).insert(unordered_map::value_type(instruction.substr(1, pos - 1), count * -1));
- }
- instruction.erase(0, pos + 4);
- parsingInstructions[count] = instruction;
- count++;
- }
-
- inputs.close();
- return (1);
-}
-
-
-///
-/// Thread responsible for sending commands to GDB. The GDBParserAPI LaunchProcess start this one, that stays alive until it receives
-/// a -gdb-exit instruction. This thread initializes the main data structures that are needed by teh parser and the listeningGDB thread.
-///
-/// A reference to the GDB console (Current instance of GDB debugger).
-/// 0
-unsigned __stdcall sendingCommands2GDB(void *arg)
-{
- GDBConsole *console = (GDBConsole *)arg;
-
- // Initializing listeningGDB thread data.
- HANDLE listeningThread;
- unsigned threadID;
- ListeningThreadData listeningThreadData;
- void *listen = &listeningThreadData;
-
- int seq_id = SyncInstructionsSize; // Positions 0 to 49 are reserved for synchronous commands.
- int countExecInterrupt = 0;
-
- // Initializing mutex and event objects.
- hGDBBufferMutex = CreateMutex (NULL, FALSE, NULL);
- hOutputBufferMutex = CreateMutex (NULL, FALSE, NULL);
- hInputBufferMutex = CreateMutex (NULL, FALSE, NULL);
- inputEvent = CreateEventW(NULL, FALSE, FALSE, _T("inputEvent"));
- asyncOutputEvent = CreateEventW(NULL, FALSE, FALSE, _T("asyncOutputEvent"));
-
- GDBBuffer.quantity = 0;
-
- unordered_map commandCodesMap;
- string parsingInstructions[NumberOfInstructions];
-
- if(!insertingCommandCodes(&commandCodesMap, parsingInstructions))
- {
- printf("Error initializing parsing data structures");
- }
-
- // Starting listeningGDB thread.
- listeningThreadData.console = console;
- listeningThreadData.parsingInstructions = parsingInstructions;
- listeningThread = (HANDLE)_beginthreadex( NULL, 0, &listeningGDB, (void *)listen, 0, &threadID);
-
- char lastCommandSend[GDBCommandSize] = "";
-
- while (true)
- {
- char inputCommandSend[GDBCommandSize] = "";
- char commandSend[GDBCommandSize] = "";
- int instructionCodeSend;
- string param = "";
- bool sync = false;
- int previousSeqId;
-
- removeFromInputBuffer(inputCommandSend);
- while (strcmp(inputCommandSend,"") == 0)
- {
- if (in_InputBuffer == out_InputBuffer) // if true, input buffer is empty.
- WaitForSingleObject(inputEvent, WAIT_TIME);
- removeFromInputBuffer(inputCommandSend);
- }
-
- if ((inputCommandSend[0] >= '0') && (inputCommandSend[0] <= '4')) // Means that it is a synchronous command and the instruction
- // already has the ID.
- {
- sync = true;
- previousSeqId = seq_id;
- seq_id = ((inputCommandSend[0] - '0') * 10) + (inputCommandSend[1] - '0');
- char *aux_str = inputCommandSend + 2;
- strcpy(inputCommandSend, aux_str);
- }
-
- if (strcmp(inputCommandSend, "-exec-interrupt") == 0)
- {
- if ((strcmp(lastCommandSend, "-exec-interrupt") == 0) && (countExecInterrupt < 5))
- {
- countExecInterrupt++;
- console->sendCtrlC();
- continue;
- }
- countExecInterrupt = 0;
- // Wait for existing commands to finish
- while (!isGDBBufferEmpty())
- Sleep(0);
-
- console->sendCtrlC();
- }
-
- if (strcmp(inputCommandSend, "-gdb-exit") == 0)
- {
- break;
- }
-
- if ((strcmp(inputCommandSend, "-exec-continue") == 0) || (strcmp(inputCommandSend, "-exec-continue --thread 1") == 0))
- // GDB some times lose the commands that were sent while it was running an -exec-continue, what can cause a deadlock. So,
- // waiting for the previous commands to finish.
- {
- while (!isGDBBufferEmpty())
- Sleep(0);
- }
-
- itoa(seq_id, commandSend, 10);
-
- strcat(commandSend, inputCommandSend);
- strcat(commandSend, "\r\n");
-
- instructionCodeSend = getInstructionCode(inputCommandSend, commandCodesMap, ¶m);
- if (instructionCodeSend == -1)
- break;
-
- int bufferPos = seq_id; // Calculate GDB buffer position. Had to do now because I know if the instruction is synchronous or not.
- if (bufferPos >= SyncInstructionsSize)
- { // Avoid writing in the first 50 positions that are reserved for synchronous instructions.
- bufferPos = (bufferPos % SyncInstructionsSize) + SyncInstructionsSize;
- }
-
- while (!addIntoGDBBuffer(bufferPos, instructionCodeSend, param))
- {
- printf("Position in GDB buffer is full!");
- Sleep(0);
- }
-
- console->sendCommand(commandSend);
-
- if ((strcmp(inputCommandSend, "-exec-continue") == 0) || (strcmp(inputCommandSend, "-exec-continue --thread 1") == 0))
- {
- while (!isGDBBufferEmpty())
- Sleep(0);
- }
- strcpy(lastCommandSend, inputCommandSend);
-
- if (!sync)
- seq_id++;
- else
- seq_id = previousSeqId;
- };
-
- exitGDB = true;
- WaitForSingleObject(listeningThread, INFINITE);
-
- // Once GDB exits, further attempts to read or write to the GDB console will result in errors
- if (console != NULL) {
- delete console;
- console = NULL;
- }
-
- return 0;
-}
\ No newline at end of file
diff --git a/src/GDBParser/gdb-connect.h b/src/GDBParser/gdb-connect.h
deleted file mode 100644
index 450faa46..00000000
--- a/src/GDBParser/gdb-connect.h
+++ /dev/null
@@ -1,110 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-#pragma once
-
-#include
-
-#include "stdafx.h"
-#include
-#include
-#include
-#include
-
-using namespace std;
-
-#define NumberOfInstructions 48 // Number of parsing instructions in Instructios.txt file.
-#define InputBufferSize 50 // Input buffer is used by the debug engine to send GDB commands.
-#define GDBBufferSize 100 // Intermediate buffer is used as a communication channel between
- // sendingCommands2GDB and listeningGDB threads.
-#define OutputBufferSize 100 // Output buffer is used to send the parsed GDB responses to the debug engine.
-#define SyncInstructionsSize 50 // This number is used to separate the Output buffer in two parts: first part
- // for synchronous commands; and second for asynchronous ones.
-#define GDBCommandSize 256 // Maximum size for a GDB command.
-#define ParsedMessageSize 8192 // Maximum size for a parsed GDB response.
-#define MultipleThreads 0 // 1 - use multiple parsing threads, 0 - single parsing thread.
-#define MAX_EVENT_NAME_LENGTH 256
-#define WAIT_TIME 1000L // max amount of time to wait for single events.
-
-#define LOG_GDB_RAW_IO 1 // 1 - generate GDB output log file; 0 - do not generate.
-
-class GDBConsole {
-
-private:
- static GDBConsole* m_instance; // represents an instance of GDB debugger.
- HANDLE m_hInputRead, m_hInputWrite, m_hOutputRead, m_hOutputWrite, m_hErrorWrite;
- BOOL m_isClosed;
- static TCHAR* m_pcGDBCmd;
- DWORD m_pid;
- HANDLE m_hProcess;
- HANDLE m_eventCtrlC;
- HANDLE m_eventTerminate;
- HANDLE m_hCleanupMutex;
-
- GDBConsole();
- void cleanup();
- HANDLE getStdOutHandle();
- BOOL isClosed();
- BOOL isMoreOutputAvailable ();
- void logPrint(char*);
- void prepAndLaunchRedirectedChild();
- int readOutput(CHAR*, int, int*);
-
-public:
- ~GDBConsole();
- static GDBConsole* getInstance();
- int sendCommand(const CHAR*);
- void sendCtrlC();
- static void setGDBPath(const TCHAR*);
- static void shutdown();
- string waitForPrompt(bool);
- string waitForPromptWithTimeout(int);
-};
-
-void DisplayError(LPCTSTR);
-void ErrorExit(LPTSTR);
-
-// Threads responsible for calling the right GDBConsole methods to send commands to GDB and to get responses from GDB. They are also
-// responsible for handling the messages that are sent to/received from GDB.
-unsigned __stdcall listeningGDB(void *);
-unsigned __stdcall sendingCommands2GDB(void *);
-
-// Functions that perform some specific tasks to the above threads responsible for sending GDB commands and receiving GDB responses.
-int getInstructionCode(string, unordered_map, string*);
-int getSeqID(string);
-bool insertingCommandCodes(unordered_map *, string [NumberOfInstructions]);
-
-// Functions/thread responsible for parsing GDB responses.
-unsigned __stdcall parseGDBResponseThread(void *); // Call this function if using multithreaded parsing or (see below).
-void parseGDB(string, string, int); // call this function if not using multithreaded parsing.
-string parseGDB(string, string); // Call this function when starting GDB (this one doesn't use the OutputBuffer).
-string parseGDB(string*, string, int, bool, char[10][128], string); // The above functions will call this one that is the one responsible for parsing the GDB response.
-
-// Functions that perform some specific tasks to the one responsible for parsing GDB responses.
-int findClosing(char, char, string, int);
-int getNextChar(char, string, int);
-int searchResponse(string, string, int, int, bool, char);
-string substituteVariables(string, char[10][128]);
-
-// The following methods are responsible for manipulating the buffers (Input, GDB and Output).
-void cleanBuffers();
-bool addIntoInputBuffer(char [GDBCommandSize]);
-void removeFromInputBuffer(char *);
-bool isInputBufferEmpty();
-bool addIntoGDBBuffer(int, int, string);
-int removeFromGDBBuffer(int, string*);
-bool isGDBBufferEmpty();
-bool addIntoOutputBuffer(int, char *);
-void removeFromOutputBuffer(char *);
-void removeSyncFromOutputBuffer(char *, int);
\ No newline at end of file
diff --git a/src/GDBParser/resource.h b/src/GDBParser/resource.h
deleted file mode 100644
index b5cbeb73..00000000
--- a/src/GDBParser/resource.h
+++ /dev/null
@@ -1,16 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-
-#define IDR_GDBPARSER 101
diff --git a/src/GDBParser/stdafx.cpp b/src/GDBParser/stdafx.cpp
deleted file mode 100644
index 94616139..00000000
--- a/src/GDBParser/stdafx.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-#include "stdafx.h"
-
diff --git a/src/GDBParser/stdafx.h b/src/GDBParser/stdafx.h
deleted file mode 100644
index 09d97b98..00000000
--- a/src/GDBParser/stdafx.h
+++ /dev/null
@@ -1,54 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-// Modify the following defines if you have to target a platform prior to the ones specified below.
-// Refer to MSDN for the latest info on corresponding values for different platforms.
-#ifndef WINVER // Allow use of features specific to Windows XP or later.
-#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
-#endif
-
-#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
-#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
-#endif
-
-#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
-#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
-#endif
-
-#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
-#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
-#endif
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include
-#include
-//#include
-
-#include
-
-#define BEGIN_NAMESPACE namespace VSNDK { namespace Parser {
-#define END_NAMESPACE }; };
-
-BEGIN_NAMESPACE
-END_NAMESPACE
-
-using namespace VSNDK::Parser;
diff --git a/src/GDBWrapper/GDBWrapper.cpp b/src/GDBWrapper/GDBWrapper.cpp
deleted file mode 100644
index 8acc8736..00000000
--- a/src/GDBWrapper/GDBWrapper.cpp
+++ /dev/null
@@ -1,324 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-
-// GDBWrapper.cpp : Utility to run GDB in console mode so that CTRL-C works.
-//
-
-#include "stdafx.h"
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-
-#include "GDBWrapper.h"
-#include < vcclr.h >
-
-// *******************************************************************
-// TODO: Put the following functions in a library that both GDBWrapper
-// and GDBConsole can use
-
-using namespace std;
-using namespace System;
-
-char path_log[_MAX_PATH]; // contains the path to the Wrapper output log, needed in logPrint()
-
-
-///
-/// Displays the error number and corresponding message.
-///
-/// Error message.
-void DisplayError(LPCTSTR pszAPI)
-{
- LPVOID lpvMessageBuffer;
- TCHAR szPrintBuffer[512];
- DWORD bufSize = 512 * sizeof(TCHAR);
- DWORD nCharsWritten;
-
- FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
- NULL, GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR)&lpvMessageBuffer, 0, NULL);
-
- StringCbPrintf(szPrintBuffer, bufSize,
- _T("ERROR: API = %s.\n error code = %d.\n message = %s.\n"),
- pszAPI, GetLastError(), (char *)lpvMessageBuffer);
-
- _tprintf(_T("%s\n"), szPrintBuffer);
-
- LocalFree(lpvMessageBuffer);
- ExitProcess(GetLastError());
-}
-
-
-///
-/// Retrieve the system error message for the last-error code.
-///
-/// Error message.
-void ErrorExit(LPTSTR lpszFunction)
-{
- LPVOID lpMsgBuf;
- LPVOID lpDisplayBuf;
- DWORD dw = GetLastError();
-
- FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- dw,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR) &lpMsgBuf,
- 0, NULL );
-
- // Display the error message and exit the process
-
- lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT,
- (lstrlen((LPCTSTR)lpMsgBuf) + lstrlen((LPCTSTR)lpszFunction) + 40) * sizeof(TCHAR));
- StringCchPrintf((LPTSTR)lpDisplayBuf,
- LocalSize(lpDisplayBuf) / sizeof(TCHAR),
- TEXT("%s failed with error %d: %s"),
- lpszFunction, dw, lpMsgBuf);
- MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT("Error"), MB_OK);
-
- LocalFree(lpMsgBuf);
- LocalFree(lpDisplayBuf);
- ExitProcess(dw);
-}
-
-
-///
-/// Generic function to print to a log file.
-///
-/// Message to be printed to a log file.
-void logPrint(TCHAR* buffer) {
- if (LOG_GDB_RAW_IO) {
- FILE* file = fopen(path_log, "a");
- _ftprintf(file, _T("%s\r\n"), buffer);
- fclose(file);
- }
-}
-
-// End region that needs to go into a library
-// *******************************************************************
-
-
-///
-/// CTRL-C handler.
-///
-/// CTRL type.
-/// True; False.
-BOOL WINAPI ctrlHandler(DWORD dwCtrlType)
-{
- logPrint(_T("ctrlHandler"));
- if (dwCtrlType == CTRL_C_EVENT) {
- logPrint(_T("ctrlHandler got CTRL_C_EVENT"));
- return true;
- }
- logPrint(_T("ctrlHandler returns false"));
- return false;
-}
-
-
-///
-/// Constructor.
-///
-/// String with full path and command to initialize GDB/MI.
-/// Ctrl-C handler;
-/// Terminate handler;
-GDBWrapper::GDBWrapper(TCHAR* pcGDBCmd, HANDLE eventCtrlC, HANDLE eventTerminate) :
- m_eventCtrlC(eventCtrlC), m_eventTerminate(eventTerminate), m_isClosed(FALSE)
-{
- SECURITY_ATTRIBUTES sa;
-
- // Copy path to GDB
- size_t numChars = _tcslen(pcGDBCmd) + 1;
- m_pcGDBCmd = new TCHAR[numChars * sizeof(TCHAR)];
- _tcscpy_s(m_pcGDBCmd, numChars, pcGDBCmd);
-
- // Register CTRL-C handler
- if (!SetConsoleCtrlHandler(ctrlHandler, TRUE)) {
- DisplayError(_T("SetConsoleCtrlHandler"));
- }
-
- // Set up the security attributes struct used when creating the pipes
- sa.nLength = sizeof(SECURITY_ATTRIBUTES);
- sa.lpSecurityDescriptor = NULL;
- sa.bInheritHandle = TRUE;
-
- prepAndLaunchRedirectedChild();
-}
-
-
-///
-/// Shut down GDB Wrapper: Update variables and terminate GDBWrapper process.
-///
-void GDBWrapper::shutdown() {
- logPrint(_T("+shutdown"));
- m_isClosed = TRUE;
-
- if (m_pcGDBCmd != NULL) {
- delete[] m_pcGDBCmd;
- m_pcGDBCmd = NULL;
- }
-
- // Kill GDB process
- TerminateProcess(m_hProcess, 0);
-
- if (!CloseHandle(m_hProcess)) DisplayError(_T("CloseHandle"));
- logPrint(_T("-shutdown"));
-}
-
-
-///
-/// Destructor.
-///
-GDBWrapper::~GDBWrapper() {
- logPrint(_T("+~GDBWrapper"));
- if (!m_isClosed) {
- shutdown();
- }
- logPrint(_T("-~GDBWrapper"));
-}
-
-
-///
-/// Sets up STARTUPINFO structure and launches redirected child.
-///
-void GDBWrapper::prepAndLaunchRedirectedChild(void)
-{
- LPCTSTR lpApplicationName = NULL;
- PROCESS_INFORMATION pi;
- STARTUPINFO si;
- DWORD flags = 0;
-
- memset(&pi, 0, sizeof(pi));
-
- // Set up the start up info struct.
- ZeroMemory(&si, sizeof(STARTUPINFO));
- si.cb = sizeof(STARTUPINFO);
- si.dwFlags = STARTF_USESTDHANDLES;
-
- // Pass the redirected handles
- si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
- si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
- si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
-
- // Use this if you want to hide the child:
- // si.wShowWindow = SW_HIDE;
- // Note that dwFlags must include STARTF_USESHOWWINDOW if you want to
- // use the wShowWindow flags.
-
- /* CreateProcessW can modify pCmdLine thus we allocate memory */
- int pCmdSz = _tcslen(m_pcGDBCmd) + 1;
- LPTSTR pCmdLine = new TCHAR[pCmdSz];
- if (pCmdLine == 0) {
- DisplayError(_T("GDBWrapper::launch: failed to allocate memory for pCmdLine"));
- }
- _tcscpy_s(pCmdLine, pCmdSz, m_pcGDBCmd);
-
- // Launch the process
- if (!CreateProcess(NULL, pCmdLine, NULL, NULL, TRUE,
- flags, NULL, NULL, &si, &pi))
- ErrorExit(_T("CreateProcess"));
-
- m_hProcess = pi.hProcess;
-
- if (!CloseHandle(pi.hThread)) DisplayError(_T("CloseHandle"));
-}
-
-
-///
-/// GDBWrapper Main function.
-///
-/// Not used.
-/// argv[0] -> Full path of the GDBWrapper executable file.
-/// argv[1] -> String with full path and command to initialize GDB/MI
-/// argv[2] -> Ctrl-C handler;
-/// argv[3] -> Terminate handler.
-/// 0
-int _tmain(int argc, _TCHAR* argv[])
-{
- TCHAR msg[1024];
- memset(msg, 0, 1024);
-
- WCHAR wszThisFile[MAX_PATH + 1];
- GetModuleFileName(NULL, wszThisFile, MAX_PATH + 1);
-
- String^ tempPath = Environment::GetEnvironmentVariable("APPDATA");
- tempPath += "\\BlackBerry\\wrapper.log";
- pin_ptr path_buffer = PtrToStringChars(tempPath);
-
- int ret = wcstombs ( path_log, path_buffer, _MAX_PATH );
-
- FILE* file = fopen(path_log, "w"); // just to delete a possible existing file
- fclose(file);
-
- logPrint(_T("Starting"));
-
- HANDLE handles[2];
- handles[0] = OpenEventW(EVENT_ALL_ACCESS, TRUE, argv[2]); // Ctrl-C signal
- handles[1] = OpenEventW(EVENT_ALL_ACCESS, TRUE, argv[3]); // Signal to terminate the wrapper process
-
- _stprintf(msg, _T("args: %s %s %s %s\r\n"), argv[0], argv[1], argv[2], argv[3]);
- _tprintf(msg);
- logPrint(msg);
-
- _stprintf(msg, _T("Ctrl-C handler: name: %s handle: %p\r\n"), argv[2], handles[0]);
- _tprintf(msg);
- logPrint(msg);
-
- _stprintf(msg, _T("Terminate handler: name: %s handle: %p\r\n"), argv[3], handles[1]);
- _tprintf(msg);
- logPrint(msg);
-
- GDBWrapper* g = new GDBWrapper(argv[1], handles[0], handles[1]);
-
- BOOL exitProc = FALSE;
- while(!exitProc)
- {
- // Wait for a CTRL-C event indicating GDB should be interrupted
- logPrint(_T("WaitForMultipleObjects"));
- DWORD event = WaitForMultipleObjects(2, handles, false, INFINITE);
- switch (event)
- {
- case WAIT_OBJECT_0:
- logPrint(_T("WAIT_OBJECT_0 (Ctrl-C)"));
- GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0);
- break;
- case WAIT_OBJECT_0 + 1:
- logPrint(_T("WAIT_OBJECT_0 + 1 (Terminate)"));
- exitProc = TRUE;
- break;
- case WAIT_FAILED:
- DisplayError(_T("WaitForSingleObject WAIT_FAILED"));
- exitProc = TRUE;
- break;
- default:
- exitProc = TRUE;
- break;
- }
- }
-
- g->shutdown();
-
- return 0;
-}
diff --git a/src/GDBWrapper/GDBWrapper.h b/src/GDBWrapper/GDBWrapper.h
deleted file mode 100644
index 6568e359..00000000
--- a/src/GDBWrapper/GDBWrapper.h
+++ /dev/null
@@ -1,47 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-#pragma once
-
-#include
-#include
-
-#include "stdafx.h"
-#include
-#include
-#include
-
-using namespace std;
-
-#define LOG_GDB_RAW_IO 1
-
-class GDBWrapper {
-
-private:
- BOOL m_isClosed;
- HANDLE m_hProcess;
- HANDLE m_eventCtrlC;
- HANDLE m_eventTerminate;
- TCHAR* m_pcGDBCmd;
-
- void prepAndLaunchRedirectedChild();
-
-public:
- GDBWrapper(TCHAR*, HANDLE, HANDLE);
- ~GDBWrapper();
- void shutdown();
-};
-
-void ErrorExit(LPTSTR);
-void DisplayError(LPCTSTR);
\ No newline at end of file
diff --git a/src/GDBWrapper/GDBWrapper.vcxproj b/src/GDBWrapper/GDBWrapper.vcxproj
deleted file mode 100644
index 86896fe8..00000000
--- a/src/GDBWrapper/GDBWrapper.vcxproj
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
-
- {9A560339-44DB-413F-868C-403962C2CF01}
- Win32Proj
- GDBWrapper
-
-
-
- Application
- true
- Unicode
- true
-
-
- Application
- false
- true
- Unicode
- true
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
- false
-
-
-
- Use
- Level3
- Disabled
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
-
-
- Console
- true
-
-
-
-
-
-
-
-
- Level3
- Use
- MaxSpeed
- true
- true
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
-
-
- Console
- true
- true
- true
- false
-
-
- xcopy "$(OutDir)GDBWrapper.*" "$(OutputPath)" /d /y
- Copying Executable to output directory.
-
-
-
-
-
-
-
-
-
-
- Create
- Create
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/GDBWrapper/GDBWrapper.vcxproj.filters b/src/GDBWrapper/GDBWrapper.vcxproj.filters
deleted file mode 100644
index 58ea2b2e..00000000
--- a/src/GDBWrapper/GDBWrapper.vcxproj.filters
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
-
-
- Source Files
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/src/GDBWrapper/GDBWrapper.vcxproj.user b/src/GDBWrapper/GDBWrapper.vcxproj.user
deleted file mode 100644
index 79ff5bc5..00000000
--- a/src/GDBWrapper/GDBWrapper.vcxproj.user
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
- WindowsLocalDebugger
-
-
\ No newline at end of file
diff --git a/src/GDBWrapper/ReadMe.txt b/src/GDBWrapper/ReadMe.txt
deleted file mode 100644
index 051b81d3..00000000
--- a/src/GDBWrapper/ReadMe.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-========================================================================
- CONSOLE APPLICATION : GDBWrapper Project Overview
-========================================================================
-
-AppWizard has created this GDBWrapper application for you.
-
-This file contains a summary of what you will find in each of the files that
-make up your GDBWrapper application.
-
-
-GDBWrapper.vcxproj
- This is the main project file for VC++ projects generated using an Application Wizard.
- It contains information about the version of Visual C++ that generated the file, and
- information about the platforms, configurations, and project features selected with the
- Application Wizard.
-
-GDBWrapper.vcxproj.filters
- This is the filters file for VC++ projects generated using an Application Wizard.
- It contains information about the association between the files in your project
- and the filters. This association is used in the IDE to show grouping of files with
- similar extensions under a specific node (for e.g. ".cpp" files are associated with the
- "Source Files" filter).
-
-GDBWrapper.cpp
- This is the main application source file.
-
-/////////////////////////////////////////////////////////////////////////////
-Other standard files:
-
-StdAfx.h, StdAfx.cpp
- These files are used to build a precompiled header (PCH) file
- named GDBWrapper.pch and a precompiled types file named StdAfx.obj.
-
-/////////////////////////////////////////////////////////////////////////////
-Other notes:
-
-AppWizard uses "TODO:" comments to indicate parts of the source code you
-should add to or customize.
-
-/////////////////////////////////////////////////////////////////////////////
diff --git a/src/GDBWrapper/stdafx.h b/src/GDBWrapper/stdafx.h
deleted file mode 100644
index ee239709..00000000
--- a/src/GDBWrapper/stdafx.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#include "targetver.h"
-
-#include
-#include
-
-
-
-// TODO: reference additional headers your program requires here
diff --git a/src/VSNDK.AddIn/AssemblyInfo.cs b/src/VSNDK.AddIn/AssemblyInfo.cs
deleted file mode 100644
index 12ea939e..00000000
Binary files a/src/VSNDK.AddIn/AssemblyInfo.cs and /dev/null differ
diff --git a/src/VSNDK.AddIn/Connect.cs b/src/VSNDK.AddIn/Connect.cs
deleted file mode 100644
index 86d6f067..00000000
Binary files a/src/VSNDK.AddIn/Connect.cs and /dev/null differ
diff --git a/src/VSNDK.AddIn/Guids.cs b/src/VSNDK.AddIn/Guids.cs
deleted file mode 100644
index 8ce421f7..00000000
--- a/src/VSNDK.AddIn/Guids.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace VSNDK.AddIn
-{
- static class GuidList
- {
- public const string guidVSStd97String = "{5efc7975-14bc-11cf-9b2b-00aa00573819}";
- public const string guidVSStd2KString = "{1496A755-94DE-11D0-8C3F-00C04FC2AAE2}";
- public const string guidVSDebugGroup = "{C9DD4A59-47FB-11D2-83E7-00C04F9902C1}";
- };
-}
diff --git a/src/VSNDK.AddIn/NameValueCollectionHelper.cs b/src/VSNDK.AddIn/NameValueCollectionHelper.cs
deleted file mode 100644
index 1fa05e9c..00000000
--- a/src/VSNDK.AddIn/NameValueCollectionHelper.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Collections.Specialized;
-
-namespace VSNDK.AddIn
-{
- ///
- ///
- ///
- public static class NameValueCollectionHelper
- {
-
- ///
- ///
- ///
- ///
- ///
- public static string DumpToString(NameValueCollection value)
- {
- var xSB = new StringBuilder();
- foreach (string xKey in value.Keys)
- {
- xSB.AppendFormat("{0}={1};", xKey, (string)value[xKey]);
- }
- return xSB.ToString();
- }
-
-
- ///
- ///
- ///
- ///
- ///
- public static void LoadFromString(NameValueCollection target, string value)
- {
- if (target.Count > 0)
- {
- throw new Exception("Target is not empty!");
- }
- if (String.IsNullOrEmpty(value))
- {
- return;
- }
-
- string[] xPairs = value.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
- foreach (var xPair in xPairs)
- {
- string[] xParts = xPair.Split('=');
- if (xParts.Length > 1)
- {
- target.Add(xParts[0], xParts[1]);
- }
- else
- {
- target.Add(xParts[0], "");
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/VSNDK.AddIn/NativeMethods.cs b/src/VSNDK.AddIn/NativeMethods.cs
deleted file mode 100644
index 4c2c5035..00000000
--- a/src/VSNDK.AddIn/NativeMethods.cs
+++ /dev/null
@@ -1,713 +0,0 @@
-/***************************************************************************
-
-Copyright (c) Microsoft Corporation. All rights reserved.
-This code is licensed under the Visual Studio SDK license terms.
-THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
-ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
-IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
-PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
-
-***************************************************************************/
-
-using System;
-using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Text;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.TextManager.Interop;
-using Microsoft.VisualStudio.OLE.Interop;
-
-namespace Microsoft.VisualStudio.Project
-{
- public static class NativeMethods
- {
- // IIDS
- public static readonly Guid IID_IUnknown = new Guid("{00000000-0000-0000-C000-000000000046}");
-
- public const int
- CLSCTX_INPROC_SERVER = 0x1;
-
- public const int
- S_FALSE = 0x00000001,
- S_OK = 0x00000000,
-
- IDOK = 1,
- IDCANCEL = 2,
- IDABORT = 3,
- IDRETRY = 4,
- IDIGNORE = 5,
- IDYES = 6,
- IDNO = 7,
- IDCLOSE = 8,
- IDHELP = 9,
- IDTRYAGAIN = 10,
- IDCONTINUE = 11,
-
- OLECMDERR_E_NOTSUPPORTED = unchecked((int)0x80040100),
- OLECMDERR_E_UNKNOWNGROUP = unchecked((int)0x80040104),
-
- UNDO_E_CLIENTABORT = unchecked((int)0x80044001),
- E_OUTOFMEMORY = unchecked((int)0x8007000E),
- E_INVALIDARG = unchecked((int)0x80070057),
- E_FAIL = unchecked((int)0x80004005),
- E_NOINTERFACE = unchecked((int)0x80004002),
- E_POINTER = unchecked((int)0x80004003),
- E_NOTIMPL = unchecked((int)0x80004001),
- E_UNEXPECTED = unchecked((int)0x8000FFFF),
- E_HANDLE = unchecked((int)0x80070006),
- E_ABORT = unchecked((int)0x80004004),
- E_ACCESSDENIED = unchecked((int)0x80070005),
- E_PENDING = unchecked((int)0x8000000A);
-
- public const int
- OLECLOSE_SAVEIFDIRTY = 0,
- OLECLOSE_NOSAVE = 1,
- OLECLOSE_PROMPTSAVE = 2;
-
- public const int
- OLEIVERB_PRIMARY = 0,
- OLEIVERB_SHOW = -1,
- OLEIVERB_OPEN = -2,
- OLEIVERB_HIDE = -3,
- OLEIVERB_UIACTIVATE = -4,
- OLEIVERB_INPLACEACTIVATE = -5,
- OLEIVERB_DISCARDUNDOSTATE = -6,
- OLEIVERB_PROPERTIES = -7;
-
- public const int
- OFN_READONLY = unchecked((int)0x00000001),
- OFN_OVERWRITEPROMPT = unchecked((int)0x00000002),
- OFN_HIDEREADONLY = unchecked((int)0x00000004),
- OFN_NOCHANGEDIR = unchecked((int)0x00000008),
- OFN_SHOWHELP = unchecked((int)0x00000010),
- OFN_ENABLEHOOK = unchecked((int)0x00000020),
- OFN_ENABLETEMPLATE = unchecked((int)0x00000040),
- OFN_ENABLETEMPLATEHANDLE = unchecked((int)0x00000080),
- OFN_NOVALIDATE = unchecked((int)0x00000100),
- OFN_ALLOWMULTISELECT = unchecked((int)0x00000200),
- OFN_EXTENSIONDIFFERENT = unchecked((int)0x00000400),
- OFN_PATHMUSTEXIST = unchecked((int)0x00000800),
- OFN_FILEMUSTEXIST = unchecked((int)0x00001000),
- OFN_CREATEPROMPT = unchecked((int)0x00002000),
- OFN_SHAREAWARE = unchecked((int)0x00004000),
- OFN_NOREADONLYRETURN = unchecked((int)0x00008000),
- OFN_NOTESTFILECREATE = unchecked((int)0x00010000),
- OFN_NONETWORKBUTTON = unchecked((int)0x00020000),
- OFN_NOLONGNAMES = unchecked((int)0x00040000),
- OFN_EXPLORER = unchecked((int)0x00080000),
- OFN_NODEREFERENCELINKS = unchecked((int)0x00100000),
- OFN_LONGNAMES = unchecked((int)0x00200000),
- OFN_ENABLEINCLUDENOTIFY = unchecked((int)0x00400000),
- OFN_ENABLESIZING = unchecked((int)0x00800000),
- OFN_USESHELLITEM = unchecked((int)0x01000000),
- OFN_DONTADDTORECENT = unchecked((int)0x02000000),
- OFN_FORCESHOWHIDDEN = unchecked((int)0x10000000);
-
- // for READONLYSTATUS
- public const int
- ROSTATUS_NotReadOnly = 0x0,
- ROSTATUS_ReadOnly = 0x1,
- ROSTATUS_Unknown = unchecked((int)0xFFFFFFFF);
-
- public const int
- IEI_DoNotLoadDocData = 0x10000000;
-
- public const int
- CB_SETDROPPEDWIDTH = 0x0160,
-
- GWL_STYLE = (-16),
- GWL_EXSTYLE = (-20),
-
- DWL_MSGRESULT = 0,
-
- SW_SHOWNORMAL = 1,
-
- HTMENU = 5,
-
- WS_POPUP = unchecked((int)0x80000000),
- WS_CHILD = 0x40000000,
- WS_MINIMIZE = 0x20000000,
- WS_VISIBLE = 0x10000000,
- WS_DISABLED = 0x08000000,
- WS_CLIPSIBLINGS = 0x04000000,
- WS_CLIPCHILDREN = 0x02000000,
- WS_MAXIMIZE = 0x01000000,
- WS_CAPTION = 0x00C00000,
- WS_BORDER = 0x00800000,
- WS_DLGFRAME = 0x00400000,
- WS_VSCROLL = 0x00200000,
- WS_HSCROLL = 0x00100000,
- WS_SYSMENU = 0x00080000,
- WS_THICKFRAME = 0x00040000,
- WS_TABSTOP = 0x00010000,
- WS_MINIMIZEBOX = 0x00020000,
- WS_MAXIMIZEBOX = 0x00010000,
- WS_EX_DLGMODALFRAME = 0x00000001,
- WS_EX_MDICHILD = 0x00000040,
- WS_EX_TOOLWINDOW = 0x00000080,
- WS_EX_CLIENTEDGE = 0x00000200,
- WS_EX_CONTEXTHELP = 0x00000400,
- WS_EX_RIGHT = 0x00001000,
- WS_EX_LEFT = 0x00000000,
- WS_EX_RTLREADING = 0x00002000,
- WS_EX_LEFTSCROLLBAR = 0x00004000,
- WS_EX_CONTROLPARENT = 0x00010000,
- WS_EX_STATICEDGE = 0x00020000,
- WS_EX_APPWINDOW = 0x00040000,
- WS_EX_LAYERED = 0x00080000,
- WS_EX_TOPMOST = 0x00000008,
- WS_EX_NOPARENTNOTIFY = 0x00000004,
-
- LVM_SETEXTENDEDLISTVIEWSTYLE = (0x1000 + 54),
-
- LVS_EX_LABELTIP = 0x00004000,
-
- // winuser.h
- WH_JOURNALPLAYBACK = 1,
- WH_GETMESSAGE = 3,
- WH_MOUSE = 7,
- WSF_VISIBLE = 0x0001,
- WM_NULL = 0x0000,
- WM_CREATE = 0x0001,
- WM_DELETEITEM = 0x002D,
- WM_DESTROY = 0x0002,
- WM_MOVE = 0x0003,
- WM_SIZE = 0x0005,
- WM_ACTIVATE = 0x0006,
- WA_INACTIVE = 0,
- WA_ACTIVE = 1,
- WA_CLICKACTIVE = 2,
- WM_SETFOCUS = 0x0007,
- WM_KILLFOCUS = 0x0008,
- WM_ENABLE = 0x000A,
- WM_SETREDRAW = 0x000B,
- WM_SETTEXT = 0x000C,
- WM_GETTEXT = 0x000D,
- WM_GETTEXTLENGTH = 0x000E,
- WM_PAINT = 0x000F,
- WM_CLOSE = 0x0010,
- WM_QUERYENDSESSION = 0x0011,
- WM_QUIT = 0x0012,
- WM_QUERYOPEN = 0x0013,
- WM_ERASEBKGND = 0x0014,
- WM_SYSCOLORCHANGE = 0x0015,
- WM_ENDSESSION = 0x0016,
- WM_SHOWWINDOW = 0x0018,
- WM_WININICHANGE = 0x001A,
- WM_SETTINGCHANGE = 0x001A,
- WM_DEVMODECHANGE = 0x001B,
- WM_ACTIVATEAPP = 0x001C,
- WM_FONTCHANGE = 0x001D,
- WM_TIMECHANGE = 0x001E,
- WM_CANCELMODE = 0x001F,
- WM_SETCURSOR = 0x0020,
- WM_MOUSEACTIVATE = 0x0021,
- WM_CHILDACTIVATE = 0x0022,
- WM_QUEUESYNC = 0x0023,
- WM_GETMINMAXINFO = 0x0024,
- WM_PAINTICON = 0x0026,
- WM_ICONERASEBKGND = 0x0027,
- WM_NEXTDLGCTL = 0x0028,
- WM_SPOOLERSTATUS = 0x002A,
- WM_DRAWITEM = 0x002B,
- WM_MEASUREITEM = 0x002C,
- WM_VKEYTOITEM = 0x002E,
- WM_CHARTOITEM = 0x002F,
- WM_SETFONT = 0x0030,
- WM_GETFONT = 0x0031,
- WM_SETHOTKEY = 0x0032,
- WM_GETHOTKEY = 0x0033,
- WM_QUERYDRAGICON = 0x0037,
- WM_COMPAREITEM = 0x0039,
- WM_GETOBJECT = 0x003D,
- WM_COMPACTING = 0x0041,
- WM_COMMNOTIFY = 0x0044,
- WM_WINDOWPOSCHANGING = 0x0046,
- WM_WINDOWPOSCHANGED = 0x0047,
- WM_POWER = 0x0048,
- WM_COPYDATA = 0x004A,
- WM_CANCELJOURNAL = 0x004B,
- WM_NOTIFY = 0x004E,
- WM_INPUTLANGCHANGEREQUEST = 0x0050,
- WM_INPUTLANGCHANGE = 0x0051,
- WM_TCARD = 0x0052,
- WM_HELP = 0x0053,
- WM_USERCHANGED = 0x0054,
- WM_NOTIFYFORMAT = 0x0055,
- WM_CONTEXTMENU = 0x007B,
- WM_STYLECHANGING = 0x007C,
- WM_STYLECHANGED = 0x007D,
- WM_DISPLAYCHANGE = 0x007E,
- WM_GETICON = 0x007F,
- WM_SETICON = 0x0080,
- WM_NCCREATE = 0x0081,
- WM_NCDESTROY = 0x0082,
- WM_NCCALCSIZE = 0x0083,
- WM_NCHITTEST = 0x0084,
- WM_NCPAINT = 0x0085,
- WM_NCACTIVATE = 0x0086,
- WM_GETDLGCODE = 0x0087,
- WM_NCMOUSEMOVE = 0x00A0,
- WM_NCLBUTTONDOWN = 0x00A1,
- WM_NCLBUTTONUP = 0x00A2,
- WM_NCLBUTTONDBLCLK = 0x00A3,
- WM_NCRBUTTONDOWN = 0x00A4,
- WM_NCRBUTTONUP = 0x00A5,
- WM_NCRBUTTONDBLCLK = 0x00A6,
- WM_NCMBUTTONDOWN = 0x00A7,
- WM_NCMBUTTONUP = 0x00A8,
- WM_NCMBUTTONDBLCLK = 0x00A9,
- WM_NCXBUTTONDOWN = 0x00AB,
- WM_NCXBUTTONUP = 0x00AC,
- WM_NCXBUTTONDBLCLK = 0x00AD,
- WM_KEYFIRST = 0x0100,
- WM_KEYDOWN = 0x0100,
- WM_KEYUP = 0x0101,
- WM_CHAR = 0x0102,
- WM_DEADCHAR = 0x0103,
- WM_CTLCOLOR = 0x0019,
- WM_SYSKEYDOWN = 0x0104,
- WM_SYSKEYUP = 0x0105,
- WM_SYSCHAR = 0x0106,
- WM_SYSDEADCHAR = 0x0107,
- WM_KEYLAST = 0x0108,
- WM_IME_STARTCOMPOSITION = 0x010D,
- WM_IME_ENDCOMPOSITION = 0x010E,
- WM_IME_COMPOSITION = 0x010F,
- WM_IME_KEYLAST = 0x010F,
- WM_INITDIALOG = 0x0110,
- WM_COMMAND = 0x0111,
- WM_SYSCOMMAND = 0x0112,
- WM_TIMER = 0x0113,
- WM_HSCROLL = 0x0114,
- WM_VSCROLL = 0x0115,
- WM_INITMENU = 0x0116,
- WM_INITMENUPOPUP = 0x0117,
- WM_MENUSELECT = 0x011F,
- WM_MENUCHAR = 0x0120,
- WM_ENTERIDLE = 0x0121,
- WM_CHANGEUISTATE = 0x0127,
- WM_UPDATEUISTATE = 0x0128,
- WM_QUERYUISTATE = 0x0129,
- WM_CTLCOLORMSGBOX = 0x0132,
- WM_CTLCOLOREDIT = 0x0133,
- WM_CTLCOLORLISTBOX = 0x0134,
- WM_CTLCOLORBTN = 0x0135,
- WM_CTLCOLORDLG = 0x0136,
- WM_CTLCOLORSCROLLBAR = 0x0137,
- WM_CTLCOLORSTATIC = 0x0138,
- WM_MOUSEFIRST = 0x0200,
- WM_MOUSEMOVE = 0x0200,
- WM_LBUTTONDOWN = 0x0201,
- WM_LBUTTONUP = 0x0202,
- WM_LBUTTONDBLCLK = 0x0203,
- WM_RBUTTONDOWN = 0x0204,
- WM_RBUTTONUP = 0x0205,
- WM_RBUTTONDBLCLK = 0x0206,
- WM_MBUTTONDOWN = 0x0207,
- WM_MBUTTONUP = 0x0208,
- WM_MBUTTONDBLCLK = 0x0209,
- WM_XBUTTONDOWN = 0x020B,
- WM_XBUTTONUP = 0x020C,
- WM_XBUTTONDBLCLK = 0x020D,
- WM_MOUSEWHEEL = 0x020A,
- WM_MOUSELAST = 0x020A,
- WM_PARENTNOTIFY = 0x0210,
- WM_ENTERMENULOOP = 0x0211,
- WM_EXITMENULOOP = 0x0212,
- WM_NEXTMENU = 0x0213,
- WM_SIZING = 0x0214,
- WM_CAPTURECHANGED = 0x0215,
- WM_MOVING = 0x0216,
- WM_POWERBROADCAST = 0x0218,
- WM_DEVICECHANGE = 0x0219,
- WM_IME_SETCONTEXT = 0x0281,
- WM_IME_NOTIFY = 0x0282,
- WM_IME_CONTROL = 0x0283,
- WM_IME_COMPOSITIONFULL = 0x0284,
- WM_IME_SELECT = 0x0285,
- WM_IME_CHAR = 0x0286,
- WM_IME_KEYDOWN = 0x0290,
- WM_IME_KEYUP = 0x0291,
- WM_MDICREATE = 0x0220,
- WM_MDIDESTROY = 0x0221,
- WM_MDIACTIVATE = 0x0222,
- WM_MDIRESTORE = 0x0223,
- WM_MDINEXT = 0x0224,
- WM_MDIMAXIMIZE = 0x0225,
- WM_MDITILE = 0x0226,
- WM_MDICASCADE = 0x0227,
- WM_MDIICONARRANGE = 0x0228,
- WM_MDIGETACTIVE = 0x0229,
- WM_MDISETMENU = 0x0230,
- WM_ENTERSIZEMOVE = 0x0231,
- WM_EXITSIZEMOVE = 0x0232,
- WM_DROPFILES = 0x0233,
- WM_MDIREFRESHMENU = 0x0234,
- WM_MOUSEHOVER = 0x02A1,
- WM_MOUSELEAVE = 0x02A3,
- WM_CUT = 0x0300,
- WM_COPY = 0x0301,
- WM_PASTE = 0x0302,
- WM_CLEAR = 0x0303,
- WM_UNDO = 0x0304,
- WM_RENDERFORMAT = 0x0305,
- WM_RENDERALLFORMATS = 0x0306,
- WM_DESTROYCLIPBOARD = 0x0307,
- WM_DRAWCLIPBOARD = 0x0308,
- WM_PAINTCLIPBOARD = 0x0309,
- WM_VSCROLLCLIPBOARD = 0x030A,
- WM_SIZECLIPBOARD = 0x030B,
- WM_ASKCBFORMATNAME = 0x030C,
- WM_CHANGECBCHAIN = 0x030D,
- WM_HSCROLLCLIPBOARD = 0x030E,
- WM_QUERYNEWPALETTE = 0x030F,
- WM_PALETTEISCHANGING = 0x0310,
- WM_PALETTECHANGED = 0x0311,
- WM_HOTKEY = 0x0312,
- WM_PRINT = 0x0317,
- WM_PRINTCLIENT = 0x0318,
- WM_HANDHELDFIRST = 0x0358,
- WM_HANDHELDLAST = 0x035F,
- WM_AFXFIRST = 0x0360,
- WM_AFXLAST = 0x037F,
- WM_PENWINFIRST = 0x0380,
- WM_PENWINLAST = 0x038F,
- WM_APP = unchecked((int)0x8000),
- WM_USER = 0x0400,
- WM_REFLECT =
- WM_USER + 0x1C00,
- WS_OVERLAPPED = 0x00000000,
- WPF_SETMINPOSITION = 0x0001,
- WM_CHOOSEFONT_GETLOGFONT = (0x0400 + 1),
-
- WHEEL_DELTA = 120,
- DWLP_MSGRESULT = 0,
- PSNRET_NOERROR = 0,
- PSNRET_INVALID = 1,
- PSNRET_INVALID_NOCHANGEPAGE = 2;
-
- public const int
- PSN_APPLY = ((0 - 200) - 2),
- PSN_KILLACTIVE = ((0 - 200) - 1),
- PSN_RESET = ((0 - 200) - 3),
- PSN_SETACTIVE = ((0 - 200) - 0);
-
- public const int
- GMEM_MOVEABLE = 0x0002,
- GMEM_ZEROINIT = 0x0040,
- GMEM_DDESHARE = 0x2000;
-
- public const int
- SWP_NOACTIVATE = 0x0010,
- SWP_NOZORDER = 0x0004,
- SWP_NOSIZE = 0x0001,
- SWP_NOMOVE = 0x0002,
- SWP_FRAMECHANGED = 0x0020;
-
- public const int
- TVM_SETINSERTMARK = (0x1100 + 26),
- TVM_GETEDITCONTROL = (0x1100 + 15);
-
- public const int
- FILE_ATTRIBUTE_READONLY = 0x00000001;
-
- public const int
- PSP_DEFAULT = 0x00000000,
- PSP_DLGINDIRECT = 0x00000001,
- PSP_USEHICON = 0x00000002,
- PSP_USEICONID = 0x00000004,
- PSP_USETITLE = 0x00000008,
- PSP_RTLREADING = 0x00000010,
- PSP_HASHELP = 0x00000020,
- PSP_USEREFPARENT = 0x00000040,
- PSP_USECALLBACK = 0x00000080,
- PSP_PREMATURE = 0x00000400,
- PSP_HIDEHEADER = 0x00000800,
- PSP_USEHEADERTITLE = 0x00001000,
- PSP_USEHEADERSUBTITLE = 0x00002000;
-
- public const int
- PSH_DEFAULT = 0x00000000,
- PSH_PROPTITLE = 0x00000001,
- PSH_USEHICON = 0x00000002,
- PSH_USEICONID = 0x00000004,
- PSH_PROPSHEETPAGE = 0x00000008,
- PSH_WIZARDHASFINISH = 0x00000010,
- PSH_WIZARD = 0x00000020,
- PSH_USEPSTARTPAGE = 0x00000040,
- PSH_NOAPPLYNOW = 0x00000080,
- PSH_USECALLBACK = 0x00000100,
- PSH_HASHELP = 0x00000200,
- PSH_MODELESS = 0x00000400,
- PSH_RTLREADING = 0x00000800,
- PSH_WIZARDCONTEXTHELP = 0x00001000,
- PSH_WATERMARK = 0x00008000,
- PSH_USEHBMWATERMARK = 0x00010000, // user pass in a hbmWatermark instead of pszbmWatermark
- PSH_USEHPLWATERMARK = 0x00020000, //
- PSH_STRETCHWATERMARK = 0x00040000, // stretchwatermark also applies for the header
- PSH_HEADER = 0x00080000,
- PSH_USEHBMHEADER = 0x00100000,
- PSH_USEPAGELANG = 0x00200000, // use frame dialog template matched to page
- PSH_WIZARD_LITE = 0x00400000,
- PSH_NOCONTEXTHELP = 0x02000000;
-
- public const int
- PSBTN_BACK = 0,
- PSBTN_NEXT = 1,
- PSBTN_FINISH = 2,
- PSBTN_OK = 3,
- PSBTN_APPLYNOW = 4,
- PSBTN_CANCEL = 5,
- PSBTN_HELP = 6,
- PSBTN_MAX = 6;
-
- public const int
- TRANSPARENT = 1,
- OPAQUE = 2,
- FW_BOLD = 700;
-
- [StructLayout(LayoutKind.Sequential)]
- public struct NMHDR
- {
- public IntPtr hwndFrom;
- public int idFrom;
- public int code;
- }
-
- ///
- /// Helper class for setting the text parameters to OLECMDTEXT structures.
- ///
- public static class OLECMDTEXT
- {
-
- ///
- /// Flags for the OLE command text
- ///
- public enum OLECMDTEXTF
- {
- /// No flag
- OLECMDTEXTF_NONE = 0,
- /// The name of the command is required.
- OLECMDTEXTF_NAME = 1,
- /// A description of the status is required.
- OLECMDTEXTF_STATUS = 2
- }
- }
-
- ///
- /// OLECMDF enums for IOleCommandTarget
- ///
- public enum tagOLECMDF
- {
- OLECMDF_SUPPORTED = 1,
- OLECMDF_ENABLED = 2,
- OLECMDF_LATCHED = 4,
- OLECMDF_NINCHED = 8,
- OLECMDF_INVISIBLE = 16
- }
-
- ///
- /// This method takes a file URL and converts it to an absolute path. The trick here is that
- /// if there is a '#' in the path, everything after this is treated as a fragment. So
- /// we need to append the fragment to the end of the path.
- ///
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- public static string GetAbsolutePath(string fileName)
- {
- System.Diagnostics.Debug.Assert(fileName != null && fileName.Length > 0, "Cannot get absolute path, fileName is not valid");
-
- Uri uri = new Uri(fileName);
- return uri.LocalPath + uri.Fragment;
- }
-
- ///
- /// Please use this "approved" method to compare file names.
- ///
- public static bool IsSamePath(string file1, string file2)
- {
- if(file1 == null || file1.Length == 0)
- {
- return (file2 == null || file2.Length == 0);
- }
-
- Uri uri1 = null;
- Uri uri2 = null;
-
- try
- {
- if(!Uri.TryCreate(file1, UriKind.Absolute, out uri1) || !Uri.TryCreate(file2, UriKind.Absolute, out uri2))
- {
- return false;
- }
-
- if(uri1 != null && uri1.IsFile && uri2 != null && uri2.IsFile)
- {
- return 0 == String.Compare(uri1.LocalPath, uri2.LocalPath, StringComparison.OrdinalIgnoreCase);
- }
-
- return file1 == file2;
- }
- catch(UriFormatException e)
- {
- Trace.WriteLine("Exception " + e.Message);
- }
-
- return false;
- }
-
- [ComImport(), Guid("9BDA66AE-CA28-4e22-AA27-8A7218A0E3FA"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- public interface IEventHandler
- {
-
- // converts the underlying codefunction into an event handler for the given event
- // if the given event is NULL, then the function will handle no events
- [PreserveSig]
- int AddHandler(string bstrEventName);
-
- [PreserveSig]
- int RemoveHandler(string bstrEventName);
-
- IVsEnumBSTR GetHandledEvents();
-
- bool HandlesEvent(string bstrEventName);
- }
-
- [ComImport(), Guid("A55CCBCC-7031-432d-B30A-A68DE7BDAD75"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- public interface IParameterKind
- {
-
- void SetParameterPassingMode(PARAMETER_PASSING_MODE ParamPassingMode);
- void SetParameterArrayDimensions(int uDimensions);
- int GetParameterArrayCount();
- int GetParameterArrayDimensions(int uIndex);
- int GetParameterPassingMode();
- }
-
- public enum PARAMETER_PASSING_MODE
- {
- cmParameterTypeIn = 1,
- cmParameterTypeOut = 2,
- cmParameterTypeInOut = 3
- }
-
- [
- ComImport, ComVisible(true), Guid("3E596484-D2E4-461a-A876-254C4F097EBB"),
- InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)
- ]
- public interface IMethodXML
- {
- // Generate XML describing the contents of this function's body.
- void GetXML(ref string pbstrXML);
-
- // Parse the incoming XML with respect to the CodeModel XML schema and
- // use the result to regenerate the body of the function.
- ///
- [PreserveSig]
- int SetXML(string pszXML);
-
- // This is really a textpoint
- [PreserveSig]
- int GetBodyPoint([MarshalAs(UnmanagedType.Interface)]out object bodyPoint);
- }
-
- [ComImport(), Guid("EA1A87AD-7BC5-4349-B3BE-CADC301F17A3"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- public interface IVBFileCodeModelEvents
- {
-
- [PreserveSig]
- int StartEdit();
-
- [PreserveSig]
- int EndEdit();
- }
-
- ///--------------------------------------------------------------------------
- /// ICodeClassBase:
- ///--------------------------------------------------------------------------
- [GuidAttribute("23BBD58A-7C59-449b-A93C-43E59EFC080C")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- [ComImport()]
- public interface ICodeClassBase
- {
- [PreserveSig()]
- int GetBaseName(out string pBaseName);
- }
-
- public const ushort CF_HDROP = 15; // winuser.h
- public const uint MK_CONTROL = 0x0008; //winuser.h
- public const uint MK_SHIFT = 0x0004;
- public const int MAX_PATH = 260; // windef.h
-
- public static bool Succeeded(int hr)
- {
- return (hr >= 0);
- }
-
-
- ///
- /// Specifies options for a bitmap image associated with a task item.
- ///
- public enum VSTASKBITMAP
- {
- BMP_COMPILE = -1,
- BMP_SQUIGGLE = -2,
- BMP_COMMENT = -3,
- BMP_SHORTCUT = -4,
- BMP_USER = -5
- };
-
- public const int ILD_NORMAL = 0x0000,
- ILD_TRANSPARENT = 0x0001,
- ILD_MASK = 0x0010,
- ILD_ROP = 0x0040;
-
- ///
- /// Defines the values that are not supported by the System.Environment.SpecialFolder enumeration
- ///
- [ComVisible(true)]
- public enum ExtendedSpecialFolder
- {
- ///
- /// Identical to CSIDL_COMMON_STARTUP
- ///
- CommonStartup = 0x0018,
-
- ///
- /// Identical to CSIDL_WINDOWS
- ///
- Windows = 0x0024,
- }
-
-
- // APIS
-
- ///
- /// Changes the parent window of the specified child window.
- ///
- /// Handle to the child window.
- /// Handle to the new parent window. If this parameter is NULL, the desktop window becomes the new parent window.
- /// A handle to the previous parent window indicates success. NULL indicates failure.
- [DllImport("User32", ExactSpelling = true, CharSet = CharSet.Auto)]
- public static extern IntPtr SetParent(IntPtr hWnd, IntPtr hWndParent);
-
- [DllImport("user32.dll", ExactSpelling = true, CharSet = CharSet.Auto)]
- public static extern bool DestroyIcon(IntPtr handle);
-
- [DllImport("user32.dll", EntryPoint = "IsDialogMessageA", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
- public static extern bool IsDialogMessageA(IntPtr hDlg, ref MSG msg);
-
- ///
- /// Indicates whether the file type is binary or not
- ///
- /// Full path to the file to check
- /// If file isbianry the bitness of the app is indicated by lpBinaryType value.
- /// True if the file is binary false otherwise
- [DllImport("kernel32.dll")]
- public static extern bool GetBinaryType([MarshalAs(UnmanagedType.LPWStr)]string lpApplicationName, out uint lpBinaryType);
-
- }
-}
-
diff --git a/src/VSNDK.AddIn/TokenProcessor.cs b/src/VSNDK.AddIn/TokenProcessor.cs
deleted file mode 100644
index 2855e18c..00000000
--- a/src/VSNDK.AddIn/TokenProcessor.cs
+++ /dev/null
@@ -1,461 +0,0 @@
-/***************************************************************************
-
-Copyright (c) Microsoft Corporation. All rights reserved.
-This code is licensed under the Visual Studio SDK license terms.
-THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
-ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
-IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
-PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
-
-***************************************************************************/
-
-using System;
-using System.Collections;
-using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
-using System.Globalization;
-using System.IO;
-using System.Text;
-
-namespace Microsoft.VisualStudio.Project
-{
- ///
- /// Replacement type
- ///
- public enum TokenReplaceType
- {
- ReplaceString,
- ReplaceNumber,
- ReplaceCode
- }
-
- ///
- /// Contain a number of functions that handle token replacement
- ///
- public class TokenProcessor
- {
- #region fields
- // Internal fields
- private ArrayList tokenlist;
-
-
- #endregion
-
- #region Initialization
- ///
- /// Constructor
- ///
- public TokenProcessor()
- {
- tokenlist = new ArrayList();
- }
-
- ///
- /// Reset list of TokenReplacer entries
- ///
- public virtual void Reset()
- {
- tokenlist.Clear();
- }
-
-
- ///
- /// Add a replacement type entry
- ///
- /// token to replace
- /// replacement string
- public virtual void AddReplace(string token, string replacement)
- {
- tokenlist.Add(new ReplacePairToken(token, replacement));
- }
-
- ///
- /// Add replace between entry
- ///
- /// Start token
- /// End token
- [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "tokenid")]
- public virtual void AddReplaceBetween(string tokenid, string tokenStart, string tokenEnd, string replacement)
- {
- tokenlist.Add(new ReplaceBetweenPairToken(tokenid, tokenStart, tokenEnd, replacement));
- }
-
- ///
- /// Add a deletion entry
- ///
- /// Token to delete
- public virtual void AddDelete(string tokenToDelete)
- {
- tokenlist.Add(new DeleteToken(tokenToDelete));
- }
- #endregion
-
- #region TokenProcessing
- ///
- /// For all known token, replace token with correct value
- ///
- /// File of the source file
- /// File of the destination file
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily"), SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Untoken")]
- public virtual void UntokenFile(string source, string destination)
- {
- if(string.IsNullOrEmpty(source))
- throw new ArgumentNullException("source");
-
- if(string.IsNullOrEmpty(destination))
- throw new ArgumentNullException("destination");
-
- // Make sure that the destination folder exists.
- string destinationFolder = Path.GetDirectoryName(destination);
- if(!Directory.Exists(destinationFolder))
- {
- Directory.CreateDirectory(destinationFolder);
- }
-
- //Open the file. Check to see if the File is binary or text.
- // NOTE: This is not correct because GetBinaryType will return true
- // only if the file is executable, not if it is a dll, a library or
- // any other type of binary file.
-
- uint binaryType;
- if(!NativeMethods.GetBinaryType(source, out binaryType))
- {
- Encoding encoding = Encoding.Default;
- string buffer = null;
- // Create the reader to get the text. Note that we will default to ASCII as
- // encoding if the file does not contains a different signature.
- using(StreamReader reader = new StreamReader(source, Encoding.ASCII, true))
- {
- // Get the content of the file.
- buffer = reader.ReadToEnd();
- // Detect the encoding of the source file. Note that we
- // can get the encoding only after a read operation is
- // performed on the file.
- encoding = reader.CurrentEncoding;
- }
- foreach(object pair in tokenlist)
- {
- if(pair is DeleteToken)
- DeleteTokens(ref buffer, (DeleteToken)pair);
- if(pair is ReplaceBetweenPairToken)
- ReplaceBetweenTokens(ref buffer, (ReplaceBetweenPairToken)pair);
- if(pair is ReplacePairToken)
- ReplaceTokens(ref buffer, (ReplacePairToken)pair);
- }
- File.WriteAllText(destination, buffer, encoding);
- }
- else
- File.Copy(source, destination);
-
- }
-
- ///
- /// Replaces the tokens in a buffer with the replacement string
- ///
- /// Buffer to update
- /// replacement data
- public virtual void ReplaceTokens(ref string buffer, ReplacePairToken tokenToReplace)
- {
- if (tokenToReplace == null)
- {
- throw new ArgumentNullException("tokenToReplace");
- }
-
- if (buffer == null)
- {
- throw new ArgumentNullException("buffer");
- }
-
- buffer = buffer.Replace(tokenToReplace.Token, tokenToReplace.Replacement);
- }
-
- ///
- /// Deletes the token from the buffer
- ///
- /// Buffer to update
- /// token to delete
- public virtual void DeleteTokens(ref string buffer, DeleteToken tokenToDelete)
- {
- if (tokenToDelete == null)
- {
- throw new ArgumentNullException("tokenToDelete");
- }
-
- if (buffer == null)
- {
- throw new ArgumentNullException("buffer");
- }
-
- buffer = buffer.Replace(tokenToDelete.StringToDelete, string.Empty);
- }
-
- ///
- /// Replaces the token from the buffer between the provided tokens
- ///
- /// Buffer to update
- /// replacement token
- public virtual void ReplaceBetweenTokens(ref string buffer, ReplaceBetweenPairToken rpBetweenToken)
- {
- if (rpBetweenToken == null)
- {
- throw new ArgumentNullException("rpBetweenToken");
- }
-
- if (buffer == null)
- {
- throw new ArgumentNullException("buffer");
- }
-
- string regularExp = rpBetweenToken.TokenStart + "[^" + rpBetweenToken.TokenIdentifier + "]*" + rpBetweenToken.TokenEnd;
- buffer = System.Text.RegularExpressions.Regex.Replace(buffer, regularExp, rpBetweenToken.TokenReplacement);
- }
-
- #endregion
-
- #region Guid generators
- ///
- /// Generates a string representation of a guid with the following format:
- /// 0x01020304, 0x0506, 0x0708, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10
- ///
- /// Guid to be generated
- /// The guid as string
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
- public string GuidToForm1(Guid value)
- {
- byte[] GuidBytes = value.ToByteArray();
- StringBuilder ResultingStr = new StringBuilder(80);
-
- // First 4 bytes
- int i = 0;
- int Number = 0;
- for(i = 0; i < 4; ++i)
- {
- int CurrentByte = GuidBytes[i];
- Number += CurrentByte << (8 * i);
- }
- UInt32 FourBytes = (UInt32)Number;
- ResultingStr.AppendFormat(CultureInfo.InvariantCulture, "0x{0}", FourBytes.ToString("X", CultureInfo.InvariantCulture));
-
- // 2 chunks of 2 bytes
- for(int j = 0; j < 2; ++j)
- {
- Number = 0;
- for(int k = 0; k < 2; ++k)
- {
- int CurrentByte = GuidBytes[i++];
- Number += CurrentByte << (8 * k);
- }
- UInt16 TwoBytes = (UInt16)Number;
- ResultingStr.AppendFormat(CultureInfo.InvariantCulture, ", 0x{0}", TwoBytes.ToString("X", CultureInfo.InvariantCulture));
- }
-
- // 8 chunks of 1 bytes
- for(int j = 0; j < 8; ++j)
- {
- ResultingStr.AppendFormat(CultureInfo.InvariantCulture, ", 0x{0}", GuidBytes[i++].ToString("X", CultureInfo.InvariantCulture));
- }
-
- return ResultingStr.ToString();
- }
- #endregion
-
- #region Helper Methods
- ///
- /// This function will accept a subset of the characters that can create an
- /// identifier name: there are other unicode char that can be inside the name, but
- /// this function will not allow. By now it can work this way, but when and if the
- /// VSIP package will handle also languages different from english, this function
- /// must be changed.
- ///
- /// Character to validate
- /// true if successful false otherwise
- [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "c")]
- protected static bool IsValidIdentifierChar(char c)
- {
- if((c >= 'a') && (c <= 'z'))
- {
- return true;
- }
- if((c >= 'A') && (c <= 'Z'))
- {
- return true;
- }
- if(c == '_')
- {
- return true;
- }
- if((c >= '0') && (c <= '9'))
- {
- return true;
- }
-
- return false;
- }
-
- ///
- /// Verifies if the start character is valid
- ///
- /// Start character
- /// true if successful false otherwise
- [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "c")]
- protected static bool IsValidIdentifierStartChar(char c)
- {
- if(!IsValidIdentifierChar(c))
- {
- return false;
- }
- if((c >= '0') && (c <= '9'))
- {
- return false;
- }
-
- return true;
- }
-
- #endregion
-
- }
-
- ///
- /// Storage classes for replacement tokens
- ///
- public class ReplacePairToken
- {
- ///
- /// token string
- ///
- private string token;
-
- ///
- /// Replacement string
- ///
- private string replacement;
-
- ///
- /// Constructor
- ///
- /// replaceable token
- /// replacement string
- public ReplacePairToken(string token, string replacement)
- {
- this.token = token;
- this.replacement = replacement;
- }
-
- ///
- /// Token that needs to be replaced
- ///
- public string Token
- {
- get { return token; }
- }
- ///
- /// String to replace the token with
- ///
- public string Replacement
- {
- get { return replacement; }
- }
- }
-
- ///
- /// Storage classes for token to be deleted
- ///
- public class DeleteToken
- {
- ///
- /// String to delete
- ///
- private string token;
-
- ///
- /// Constructor
- ///
- /// Deletable token.
- public DeleteToken(string token)
- {
- this.token = token;
- }
-
- ///
- /// Token marking the end of the block to delete
- ///
- public string StringToDelete
- {
- get { return token; }
- }
- }
-
- ///
- /// Storage classes for string to be deleted between tokens to be deleted
- ///
- public class ReplaceBetweenPairToken
- {
- ///
- /// Token start
- ///
- private string tokenStart;
-
- ///
- /// End token
- ///
- private string tokenEnd;
-
- ///
- /// Replacement string
- ///
- private string replacement;
-
- ///
- /// Token identifier string
- ///
- private string tokenidentifier;
-
- ///
- /// Constructor
- ///
- /// Start token
- /// End Token
- /// Replacement string.
- [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "tokenid")]
- public ReplaceBetweenPairToken(string tokenid, string blockStart, string blockEnd, string replacement)
- {
- tokenStart = blockStart;
- tokenEnd = blockEnd;
- this.replacement = replacement;
- tokenidentifier = tokenid;
- }
-
- ///
- /// Token marking the begining of the block to delete
- ///
- public string TokenStart
- {
- get { return tokenStart; }
- }
-
- ///
- /// Token marking the end of the block to delete
- ///
- public string TokenEnd
- {
- get { return tokenEnd; }
- }
-
- ///
- /// Token marking the end of the block to delete
- ///
- public string TokenReplacement
- {
- get { return replacement; }
- }
-
- ///
- /// Token Identifier
- ///
- public string TokenIdentifier
- {
- get { return tokenidentifier; }
- }
- }
-}
diff --git a/src/VSNDK.AddIn/VSNDK.AddIn.AddIn b/src/VSNDK.AddIn/VSNDK.AddIn.AddIn
deleted file mode 100644
index d5b57585..00000000
Binary files a/src/VSNDK.AddIn/VSNDK.AddIn.AddIn and /dev/null differ
diff --git a/src/VSNDK.AddIn/VSNDK.AddIn.csproj b/src/VSNDK.AddIn/VSNDK.AddIn.csproj
deleted file mode 100644
index 6aeabd70..00000000
--- a/src/VSNDK.AddIn/VSNDK.AddIn.csproj
+++ /dev/null
@@ -1,186 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 8.0.30424
- 2.0
- {D4644752-F6B1-47EE-A0FB-1197355A525E}
- Library
-
-
- false
- VSNDK.AddIn
- .\bin\
-
-
- true
- false
- .\bin\Debug\
- false
- DEBUG;TRACE
- 4
- false
-
-
- full
-
-
- true
- true
- .\bin\Release\
- false
- TRACE
- 4
- false
- VSNDK.AddIn.xml
- pdbonly
-
-
- VSNDK.AddIn
-
-
- OnBuildSuccess
-
-
- false
-
-
-
- False
-
-
-
-
-
-
-
- True
-
-
- False
- ..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio 2010 SDK\VisualStudioIntegration\Common\Assemblies\v2.0\Microsoft.VisualStudio.Debugger.Interop.10.0.dll
-
-
- False
- ..\..\..\..\..\Microsoft.VisualStudio.Debugger.InteropA.dll
-
-
- True
-
-
-
-
-
-
-
-
-
-
-
- Code
-
-
- Code
-
-
-
-
-
-
-
-
-
-
-
- {80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2}
- 8
- 0
- 0
- primary
- False
- False
-
-
- {26AD1324-4B7C-44BC-84F8-B86AED45729F}
- 10
- 0
- 0
- primary
- False
- False
-
-
- {1A31287A-4D7D-413E-8E32-3B374931BD89}
- 8
- 0
- 0
- primary
- False
- False
-
-
- {2CE2370E-D744-4936-A090-3FFFE667B0E1}
- 9
- 0
- 0
- primary
- False
- False
-
-
- {1CBA492E-7263-47BB-87FE-639000619B15}
- 8
- 0
- 0
- primary
- False
- False
-
-
- {00020430-0000-0000-C000-000000000046}
- 2
- 0
- 0
- primary
- False
- False
-
-
-
-
- Always
- Designer
-
-
-
-
-
-
-
-
-
-
-
-
- $(AssemblyName).dll
- $(AssemblyName).pdb
- $(AssemblyName).xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.AddIn/VSNDK.AddIn.csproj.user b/src/VSNDK.AddIn/VSNDK.AddIn.csproj.user
deleted file mode 100644
index ce8d3677..00000000
--- a/src/VSNDK.AddIn/VSNDK.AddIn.csproj.user
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
- Program
- C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
-
-
-
-
- Program
- C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.AddIn/VSNDK.AddIn.xml b/src/VSNDK.AddIn/VSNDK.AddIn.xml
deleted file mode 100644
index 007eb575..00000000
--- a/src/VSNDK.AddIn/VSNDK.AddIn.xml
+++ /dev/null
@@ -1,467 +0,0 @@
-
-
-
- VSNDK.AddIn
-
-
-
-
- The object for implementing an Add-in.
-
- 1. Disable the IntelliSense Error Reporting property
- 2. ...
- To register the addin, copy the VSNDK.AddIn.dll and VSNDK.Addin.AddIn files to
- the one of the folders specified by "Add-In File path" in Add-In Security option page.
-
-
-
-
- Implements the constructor for the Add-in object. Place your initialization code within this method.
-
-
-
-
- Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded.
-
- Root object of the host application.
- Describes how the Add-in is being loaded.
- Object representing this Add-in.
-
-
-
-
- Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is
- being unloaded.
-
- Describes how the Add-in is being unloaded.
- Array of parameters that are host application specific.
-
-
-
-
- Implements the OnAddInsUpdate method of the IDTExtensibility2 interface. Receives notification when the collection
- of Add-ins has changed.
-
- Array of parameters that are host application specific.
-
-
-
-
- Implements the OnStartupComplete method of the IDTExtensibility2 interface. Receives notification that the host
- application has completed loading.
-
- Array of parameters that are host application specific.
-
-
-
-
- Implements the OnBeginShutdown method of the IDTExtensibility2 interface. Receives notification that the host
- application is being unloaded.
-
- Array of parameters that are host application specific.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This method takes a file URL and converts it to an absolute path. The trick here is that
- if there is a '#' in the path, everything after this is treated as a fragment. So
- we need to append the fragment to the end of the path.
-
-
-
-
- Please use this "approved" method to compare file names.
-
-
-
-
- Changes the parent window of the specified child window.
-
- Handle to the child window.
- Handle to the new parent window. If this parameter is NULL, the desktop window becomes the new parent window.
- A handle to the previous parent window indicates success. NULL indicates failure.
-
-
-
- Indicates whether the file type is binary or not
-
- Full path to the file to check
- If file isbianry the bitness of the app is indicated by lpBinaryType value.
- True if the file is binary false otherwise
-
-
-
- Helper class for setting the text parameters to OLECMDTEXT structures.
-
-
-
-
- Flags for the OLE command text
-
-
-
- No flag
-
-
- The name of the command is required.
-
-
- A description of the status is required.
-
-
-
- OLECMDF enums for IOleCommandTarget
-
-
-
-
-
-
- --------------------------------------------------------------------------
- ICodeClassBase:
- --------------------------------------------------------------------------
-
-
-
- Specifies options for a bitmap image associated with a task item.
-
-
-
-
- Defines the values that are not supported by the System.Environment.SpecialFolder enumeration
-
-
-
-
- Identical to CSIDL_COMMON_STARTUP
-
-
-
-
- Identical to CSIDL_WINDOWS
-
-
-
-
- Replacement type
-
-
-
-
- Contain a number of functions that handle token replacement
-
-
-
-
- Constructor
-
-
-
-
- Reset list of TokenReplacer entries
-
-
-
-
- Add a replacement type entry
-
- token to replace
- replacement string
-
-
-
- Add replace between entry
-
- Start token
- End token
-
-
-
- Add a deletion entry
-
- Token to delete
-
-
-
- For all known token, replace token with correct value
-
- File of the source file
- File of the destination file
-
-
-
- Replaces the tokens in a buffer with the replacement string
-
- Buffer to update
- replacement data
-
-
-
- Deletes the token from the buffer
-
- Buffer to update
- token to delete
-
-
-
- Replaces the token from the buffer between the provided tokens
-
- Buffer to update
- replacement token
-
-
-
- Generates a string representation of a guid with the following format:
- 0x01020304, 0x0506, 0x0708, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10
-
- Guid to be generated
- The guid as string
-
-
-
- This function will accept a subset of the characters that can create an
- identifier name: there are other unicode char that can be inside the name, but
- this function will not allow. By now it can work this way, but when and if the
- VSIP package will handle also languages different from english, this function
- must be changed.
-
- Character to validate
- true if successful false otherwise
-
-
-
- Verifies if the start character is valid
-
- Start character
- true if successful false otherwise
-
-
-
- Storage classes for replacement tokens
-
-
-
-
- token string
-
-
-
-
- Replacement string
-
-
-
-
- Constructor
-
- replaceable token
- replacement string
-
-
-
- Token that needs to be replaced
-
-
-
-
- String to replace the token with
-
-
-
-
- Storage classes for token to be deleted
-
-
-
-
- String to delete
-
-
-
-
- Constructor
-
- Deletable token.
-
-
-
- Token marking the end of the block to delete
-
-
-
-
- Storage classes for string to be deleted between tokens to be deleted
-
-
-
-
- Token start
-
-
-
-
- End token
-
-
-
-
- Replacement string
-
-
-
-
- Token identifier string
-
-
-
-
- Constructor
-
- Start token
- End Token
- Replacement string.
-
-
-
- Token marking the begining of the block to delete
-
-
-
-
- Token marking the end of the block to delete
-
-
-
-
- Token marking the end of the block to delete
-
-
-
-
- Token Identifier
-
-
-
-
-
-
-
-
-
- Run initialization code on first connection of the AddIn.
-
- Application Object.
- Add In Object.
-
-
-
- Terminate the AddIn.
-
-
-
-
- Solution Platform command is shown in the Standard toolbar by default with Visual C++ settings. Add the
- command if not in the Standard toolbar.
-
-
-
-
- Set the DisableErrorReporting property value.
-
- The property value to set.
-
-
-
- New Platform Before Execution Event Handler.
-
- Command GUID.
- Command ID.
- Custom IN Object.
- Custom OUT Object.
- Cancel the default execution of the command.
-
-
-
- New Platform After Execution Event Handler.
-
- Command GUID.
- Command ID.
- Custom IN Object.
- Custom OUT Object.
-
-
-
- New Function Breakpoint Before Execution Event Handler.
-
- Command GUID.
- Command ID.
- Custom IN Object.
- Custom OUT Object.
- Cancel the default execution of the command.
-
-
-
- New Function Breakpoint After Execution Event Handler.
-
- Command GUID.
- Command ID.
- Custom IN Object.
- Custom OUT Object.
-
-
-
- Add Bar Descriptor to each project.
-
-
-
-
- Add BlackBerry configurations to the project.
-
- Represents a project in the integrated development environment.
-
-
-
- Responsible for customization of VSShell command events for VSNDK.
-
-
-
-
-
-
- Application Object.
-
-
-
-
-
-
-
-
-
-
-
-
- Command IDs exposed by VisualStudio.
-
-
-
-
diff --git a/src/VSNDK.AddIn/VSNDK.csproj b/src/VSNDK.AddIn/VSNDK.csproj
deleted file mode 100644
index de75af62..00000000
--- a/src/VSNDK.AddIn/VSNDK.csproj
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
- Debug
- AnyCPU
- {00000000-0000-0000-0000-000000000000}
- Library
- false
- ClassLibrary
- v4.0
- 512
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.AddIn/VSNDKAddIn.cs b/src/VSNDK.AddIn/VSNDKAddIn.cs
deleted file mode 100644
index 814c49d7..00000000
--- a/src/VSNDK.AddIn/VSNDKAddIn.cs
+++ /dev/null
@@ -1,328 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using EnvDTE80;
-using EnvDTE;
-using Microsoft.VisualStudio.VCProjectEngine;
-using System.Diagnostics;
-using System.Globalization;
-using Microsoft.VisualStudio.CommandBars;
-using Microsoft.VisualStudio.Project;
-using Microsoft.Build.Execution;
-using System.Xml;
-using Microsoft.Win32;
-using System.Security.Cryptography;
-using System.IO;
-
-using Extensibility;
-using System.Resources;
-using System.Reflection;
-using System.Text.RegularExpressions;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Shell;
-using Microsoft.VisualStudio.Shell.Interop;
-using Microsoft.VisualStudio.OLE.Interop;
-
-using NameValueCollection = System.Collections.Specialized.NameValueCollection;
-using NameValueCollectionHelper = VSNDK.AddIn.NameValueCollectionHelper;
-using System.Runtime.InteropServices;
-
-namespace VSNDK.AddIn
-{
-
- ///
- ///
- ///
- public class VSNDKAddIn
- {
- private VSNDKCommandEvents _commandEvents;
- private DTE2 _applicationObject;
- private EnvDTE.AddIn _addInInstance;
- private TokenProcessor tokenProcessor;
-
- private const string BLACKBERRY = "BlackBerry";
- private const string BLACKBERRYSIMULATOR = "BlackBerrySimulator";
- private const string STANDARD_TOOL_BAR = "Standard";
- private const string SOLUTION_CONFIGURATIONS = "Solution Configurations";
- private const string SOLUTION_PLATFORMS = "Solution Platforms";
- private const string BAR_DESCRIPTOR = "bar-descriptor.xml";
- private const string BAR_DESCRIPTOR_PATH = @"\..\VCWizards\CodeWiz\BlackBerry\BarDescriptor\Templates\1033\";
-
-// public static bool isDebugEngineRunning = false;
-
- public VSNDKAddIn()
- {
- }
-
-
- ///
- /// Run initialization code on first connection of the AddIn.
- ///
- /// Application Object.
- /// Add In Object.
- public void Connect(DTE2 appObj, EnvDTE.AddIn addin)
- {
- /// Initialize External and Internal Variables.
- _applicationObject = appObj;
- _addInInstance = addin;
-
- /// Register Command Events
- _commandEvents = new VSNDKCommandEvents(appObj);
- _commandEvents.RegisterCommand(GuidList.guidVSStd2KString, CommandConstants.cmdidSolutionPlatform, cmdNewPlatform_afterExec, cmdNewPlatform_beforeExec);
- _commandEvents.RegisterCommand(GuidList.guidVSStd2KString, CommandConstants.cmdidSolutionCfg, cmdNewPlatform_afterExec, cmdNewPlatform_beforeExec);
- _commandEvents.RegisterCommand(GuidList.guidVSDebugGroup, CommandConstants.cmdidDebugBreakatFunction, cmdNewFunctionBreakpoint_afterExec, cmdNewFunctionBreakpoint_beforeExec);
-
- DisableIntelliSenseErrorReport(true);
- CheckSolutionPlatformCommand();
- }
-
-
- ///
- /// Terminate the AddIn.
- ///
- public void Disconnect()
- {
- DisableIntelliSenseErrorReport(false);
- }
-
-
- ///
- /// Solution Platform command is shown in the Standard toolbar by default with Visual C++ settings. Add the
- /// command if not in the Standard toolbar.
- ///
- private void CheckSolutionPlatformCommand()
- {
- DTE dte = (DTE)_applicationObject;
- CommandBars commandBars = (CommandBars)dte.CommandBars;
- CommandBar standardCommandBar = commandBars[STANDARD_TOOL_BAR];
- int pos = 0;
- foreach (CommandBarControl cmd in standardCommandBar.Controls)
- {
- if (cmd.Caption == SOLUTION_CONFIGURATIONS)
- pos = cmd.Index;
- if (cmd.Caption == SOLUTION_PLATFORMS)
- return;
- }
-
- Command sp = null;
- foreach (Command c in dte.Commands)
- {
- if (c.Guid == GuidList.guidVSStd2KString && c.ID == CommandConstants.cmdidSolutionPlatform)
- {
- sp = c;
- break;
- }
- }
- if (sp != null)
- sp.AddControl(standardCommandBar, pos + 1);
- }
-
-
- ///
- /// Set the DisableErrorReporting property value.
- ///
- /// The property value to set.
- private void DisableIntelliSenseErrorReport(bool disable)
- {
- DTE dte = _applicationObject as DTE;
- EnvDTE.Properties txtEdCpp = dte.get_Properties("TextEditor", "C/C++ Specific");
- EnvDTE.Property prop = txtEdCpp.Item("DisableErrorReporting");
- if (prop != null)
- prop.Value = disable;
- }
-
-
- ///
- /// New Platform Before Execution Event Handler.
- ///
- /// Command GUID.
- /// Command ID.
- /// Custom IN Object.
- /// Custom OUT Object.
- /// Cancel the default execution of the command.
- private void cmdNewPlatform_beforeExec(string Guid, int ID, object CustomIn, object CustomOut, ref bool CancelDefault)
- {
- /// Add Code Here
- }
-
-
- ///
- /// New Platform After Execution Event Handler.
- ///
- /// Command GUID.
- /// Command ID.
- /// Custom IN Object.
- /// Custom OUT Object.
- private void cmdNewPlatform_afterExec(string Guid, int ID, object CustomIn, object CustomOut)
- {
- AddBarDescriptor();
- }
-
-
- ///
- /// New Function Breakpoint Before Execution Event Handler.
- ///
- /// Command GUID.
- /// Command ID.
- /// Custom IN Object.
- /// Custom OUT Object.
- /// Cancel the default execution of the command.
- private void cmdNewFunctionBreakpoint_beforeExec(string Guid, int ID, object CustomIn, object CustomOut, ref bool CancelDefault)
- {
- /// Add Code Here
- }
-
-
- ///
- /// New Function Breakpoint After Execution Event Handler.
- ///
- /// Command GUID.
- /// Command ID.
- /// Custom IN Object.
- /// Custom OUT Object.
- private void cmdNewFunctionBreakpoint_afterExec(string Guid, int ID, object CustomIn, object CustomOut)
- {
- Breakpoint functionBP = _applicationObject.Debugger.Breakpoints.Item(_applicationObject.Debugger.Breakpoints.Count);
-
- if (functionBP != null)
- {
- if ((functionBP.FunctionColumnOffset != 1) || (functionBP.FunctionLineOffset != 1))
- {
- System.Windows.Forms.MessageBox.Show("The breakpoint cannot be set. Function breakpoints are only supported on the first line.", "Microsoft Visual Studio", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
- functionBP.Delete();
- }
- }
- }
-
-
- ///
- /// Add Bar Descriptor to each project.
- ///
- private void AddBarDescriptor()
- {
- try
- {
- DTE dte = _applicationObject as DTE;
- Projects projs = dte.Solution.Projects;
-
- List projList = new List();
- foreach (Project proj in projs)
- {
- projList.Add(proj);
- }
-
- while (projList.Count > 0)
- {
- Project proj = projList.ElementAt(0);
- projList.RemoveAt(0);
-
- Configuration config;
- Property prop;
- try
- {
- config = proj.ConfigurationManager.ActiveConfiguration;
- prop = config.Properties.Item("ConfigurationType");
- }
- catch
- {
- config = null;
- prop = null;
- }
-
- if (prop == null)
- {
- if (proj.ProjectItems != null)
- {
- foreach (ProjectItem projItem in proj.ProjectItems)
- {
- if (projItem.SubProject != null)
- projList.Add(projItem.SubProject);
- }
- }
- continue;
- }
-
- if (Convert.ToInt16(prop.Value) != Convert.ToInt16(ConfigurationTypes.typeApplication))
- continue;
-
- if (config.PlatformName != BLACKBERRY && config.PlatformName != BLACKBERRYSIMULATOR)
- continue;
-
- ProjectItem baritem = proj.ProjectItems.Item(BAR_DESCRIPTOR);
- string n = proj.Name;
- if (baritem == null)
- {
- tokenProcessor = new TokenProcessor();
- Debug.WriteLine("Add bar descriptor file to the project");
- string templatePath = dte.Solution.ProjectItemsTemplatePath(proj.Kind);
- templatePath += BAR_DESCRIPTOR_PATH + BAR_DESCRIPTOR;
- tokenProcessor.AddReplace(@"[!output PROJECT_NAME]", proj.Name);
- string destination = System.IO.Path.GetFileName(templatePath);
-
- // Remove directory used in previous versions of this plug-in.
- string folder = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(proj.FullName), proj.Name + "_barDescriptor");
- if (Directory.Exists(folder))
- {
- try
- {
- Directory.Delete(folder);
- }
- catch (Exception e)
- {
- }
- }
-
- folder = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(proj.FullName), "BlackBerry-" + proj.Name);
- System.IO.Directory.CreateDirectory(folder);
- destination = System.IO.Path.Combine(folder, destination);
- tokenProcessor.UntokenFile(templatePath, destination);
- ProjectItem projectitem = proj.ProjectItems.AddFromFile(destination);
- }
- }
- }
- catch (Exception e)
- {
- Debug.WriteLine(e.Message);
- }
- }
-
-
- ///
- /// Add BlackBerry configurations to the project.
- ///
- /// Represents a project in the integrated development environment.
- private void AddBlackBerryConfigurations(Project proj)
- {
- try
- {
- ConfigurationManager mgr = proj.ConfigurationManager;
- Configurations cfgs = mgr.AddPlatform(BLACKBERRY, "Win32", true);
- mgr.DeletePlatform("Win32");
- mgr.AddConfigurationRow("Device-Debug", "Debug", true);
- mgr.AddConfigurationRow("Simulator", "Debug", true);
- mgr.DeleteConfigurationRow("Debug");
- mgr.AddConfigurationRow("Device-Release", "Release", true);
- mgr.DeleteConfigurationRow("Release");
- }
- catch (Exception e)
- {
- Debug.WriteLine(e.Message);
- }
- }
- }
-}
diff --git a/src/VSNDK.AddIn/VSNDKCommandEvents.cs b/src/VSNDK.AddIn/VSNDKCommandEvents.cs
deleted file mode 100644
index 66e15d4c..00000000
--- a/src/VSNDK.AddIn/VSNDKCommandEvents.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using EnvDTE;
-using Microsoft.VisualStudio.Shell;
-using EnvDTE80;
-
-namespace VSNDK.AddIn
-{
-
- ///
- /// Responsible for customization of VSShell command events for VSNDK.
- ///
- public class VSNDKCommandEvents
- {
- private DTE2 dte;
- private Dictionary cmdEvents;
-
-
- ///
- ///
- ///
- /// Application Object.
- public VSNDKCommandEvents(DTE2 dte)
- {
- this.dte = dte;
- cmdEvents = new Dictionary();
- }
-
-
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public void RegisterCommand( string guid, int cmdId, _dispCommandEvents_AfterExecuteEventHandler afterHandler, _dispCommandEvents_BeforeExecuteEventHandler beforeHandler)
- {
- cmdEvents[cmdId] = dte.Events.get_CommandEvents(guid, cmdId);
- CommandEvents e = cmdEvents[cmdId];
- if ( e != null)
- {
- e.AfterExecute += afterHandler;
- e.BeforeExecute += beforeHandler;
- }
- }
- }
-}
diff --git a/src/VSNDK.AddIn/VSNDKConstants.cs b/src/VSNDK.AddIn/VSNDKConstants.cs
deleted file mode 100644
index c27674dd..00000000
--- a/src/VSNDK.AddIn/VSNDKConstants.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace VSNDK.AddIn
-{
- ///
- /// Command IDs exposed by VisualStudio.
- ///
- public static class CommandConstants
- {
- public const int cmdidAddSolutionSCC = 21016;
- public const int cmdidUndoCheckoutSCC = 21009;
- public const int cmdidGetLatestVersionSCC = 21011;
- public const int cmdidGetSCC = 21501;
- public const int cmdidViewHistorySCC = 21508;
- public const int cmdidStartDebug = 295;
- public const int cmdidStartDebugContext = 356;
- public const int cmdidRestartDebug = 296;
- public const int cmdidStopDebug = 179;
- public const int cmdidPreviewInBrowser = 334;
- public const int cmdidBrowseWith = 336;
- public const int cmdidStartNoDebug = 368;
- public const int cmdidSolutionCfg = 684;
- public const int cmdidSolutionPlatform = 1990;
- public const int cmdidSolutionPlatformGetList = 1991;
- public const int cmdidDebugBreakatFunction = 311;
- }
-}
diff --git a/src/VSNDK.DebugEngine/AD7.Definitions/AD7Enums.cs b/src/VSNDK.DebugEngine/AD7.Definitions/AD7Enums.cs
deleted file mode 100644
index c92f031b..00000000
--- a/src/VSNDK.DebugEngine/AD7.Definitions/AD7Enums.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// Flags passed by the debugger to the engine to describe the desired format and execution options for properties
- /// (locals, arguments, etc...)
- ///
- public enum DEBUGPROP_INFO_FLAGS
- {
- DEBUGPROP_INFO_FULLNAME = 0x00000001,
- DEBUGPROP_INFO_NAME = 0x00000002,
- DEBUGPROP_INFO_TYPE = 0x00000004,
- DEBUGPROP_INFO_VALUE = 0x00000008,
- DEBUGPROP_INFO_ATTRIB = 0x00000010,
- DEBUGPROP_INFO_PROP = 0x00000020,
-
- DEBUGPROP_INFO_VALUE_AUTOEXPAND = 0x00010000,
- DEBUGPROP_INFO_NOFUNCEVAL = 0x00020000, // Tell EE not to perform ANY type of func-eval.
- DEBUGPROP_INFO_VALUE_RAW = 0x00040000, // Tell EE not to return any beautified values or members.
- DEBUGPROP_INFO_VALUE_NO_TOSTRING = 0x00080000, // Tell EE not to return any special synthesized values (ToString() for instance).
- DEBUGPROP_INFO_NO_NONPUBLIC_MEMBERS = 0x00100000, // Tell EE to return non-public members for non-user objects.
-
- DEBUGPROP_INFO_NONE = 0x00000000,
- DEBUGPROP_INFO_STANDARD = DEBUGPROP_INFO_ATTRIB | DEBUGPROP_INFO_NAME | DEBUGPROP_INFO_TYPE | DEBUGPROP_INFO_VALUE,
- }
-
- public static class DBG_ATTRIB_FLAGS
- {
- public static readonly ulong DBG_ATTRIB_NONE = 0x0000000000000000;
- public static readonly ulong DBG_ATTRIB_ALL = 0x00000000ffffffff;
-
- // Attributes about the object itself
- public static readonly ulong DBG_ATTRIB_OBJ_IS_EXPANDABLE = 0x0000000000000001;
- public static readonly ulong DBG_ATTRIB_OBJ_HAS_ID = 0x0000000000000002;
- public static readonly ulong DBG_ATTRIB_OBJ_CAN_HAVE_ID = 0x0000000000000004;
-
- // Attributes about the value of the object
- public static readonly ulong DBG_ATTRIB_VALUE_READONLY = 0x0000000000000010;
- public static readonly ulong DBG_ATTRIB_VALUE_ERROR = 0x0000000000000020;
- public static readonly ulong DBG_ATTRIB_VALUE_SIDE_EFFECT= 0x0000000000000040;
- public static readonly ulong DBG_ATTRIB_OVERLOADED_CONTAINER = 0x0000000000000080;
- public static readonly ulong DBG_ATTRIB_VALUE_BOOLEAN = 0x0000000000000100;
- public static readonly ulong DBG_ATTRIB_VALUE_BOOLEAN_TRUE = 0x0000000000000200;
- public static readonly ulong DBG_ATTRIB_VALUE_INVALID = 0x0000000000000400;
- public static readonly ulong DBG_ATTRIB_VALUE_NAT = 0x0000000000000800;
- public static readonly ulong DBG_ATTRIB_VALUE_AUTOEXPANDED = 0x0000000000001000;
- public static readonly ulong DBG_ATTRIB_VALUE_TIMEOUT = 0x0000000000002000;
- public static readonly ulong DBG_ATTRIB_VALUE_RAW_STRING = 0x0000000000004000;
- public static readonly ulong DBG_ATTRIB_VALUE_CUSTOM_VIEWER = 0x0000000000008000;
-
- // Attributes about field access types for the object
- public static readonly ulong DBG_ATTRIB_ACCESS_NONE = 0x0000000000010000;
- public static readonly ulong DBG_ATTRIB_ACCESS_PUBLIC = 0x0000000000020000;
- public static readonly ulong DBG_ATTRIB_ACCESS_PRIVATE = 0x0000000000040000;
- public static readonly ulong DBG_ATTRIB_ACCESS_PROTECTED = 0x0000000000080000;
- public static readonly ulong DBG_ATTRIB_ACCESS_FINAL = 0x0000000000100000;
- public static readonly ulong DBG_ATTRIB_ACCESS_ALL = 0x00000000001f0000;
-
- // Attributes for the storage types of the object
- public static readonly ulong DBG_ATTRIB_STORAGE_NONE = 0x0000000001000000;
- public static readonly ulong DBG_ATTRIB_STORAGE_GLOBAL = 0x0000000002000000;
- public static readonly ulong DBG_ATTRIB_STORAGE_STATIC = 0x0000000004000000;
- public static readonly ulong DBG_ATTRIB_STORAGE_REGISTER = 0x0000000008000000;
- public static readonly ulong DBG_ATTRIB_STORAGE_ALL= 0x000000000f000000;
-
- // Attributes for the type modifiers on the object
- public static readonly ulong DBG_ATTRIB_TYPE_NONE = 0x0000000100000000;
- public static readonly ulong DBG_ATTRIB_TYPE_VIRTUAL = 0x0000000200000000;
- public static readonly ulong DBG_ATTRIB_TYPE_CONSTANT = 0x0000000400000000;
- public static readonly ulong DBG_ATTRIB_TYPE_SYNCHRONIZED = 0x0000000800000000;
- public static readonly ulong DBG_ATTRIB_TYPE_VOLATILE = 0x0000001000000000;
- public static readonly ulong DBG_ATTRIB_TYPE_ALL = 0x0000001f00000000;
-
- // Attributes that describe the type of object
- public static readonly ulong DBG_ATTRIB_DATA = 0x0000010000000000;
- public static readonly ulong DBG_ATTRIB_METHOD = 0x0000020000000000;
- public static readonly ulong DBG_ATTRIB_PROPERTY = 0x0000040000000000;
- public static readonly ulong DBG_ATTRIB_CLASS = 0x0000080000000000;
- public static readonly ulong DBG_ATTRIB_BASECLASS = 0x0000100000000000;
- public static readonly ulong DBG_ATTRIB_INTERFACE = 0x0000200000000000;
- public static readonly ulong DBG_ATTRIB_INNERCLASS = 0x0000400000000000;
- public static readonly ulong DBG_ATTRIB_MOSTDERIVED = 0x0000800000000000;
- public static readonly ulong DBG_ATTRIB_CHILD_ALL = 0x0000ff0000000000;
-
- }
-}
\ No newline at end of file
diff --git a/src/VSNDK.DebugEngine/AD7.Definitions/AD7Guids.cs b/src/VSNDK.DebugEngine/AD7.Definitions/AD7Guids.cs
deleted file mode 100644
index ffea3fbe..00000000
--- a/src/VSNDK.DebugEngine/AD7.Definitions/AD7Guids.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// These are well-known guids in AD7. Most of these are used to specify filters in what the debugger UI is requesting.
- /// For instance, guidFilterLocals can be passed to IDebugStackFrame2::EnumProperties to specify only locals are requested.
- ///
- static class AD7Guids
- {
- static private Guid _guidFilterRegisters = new Guid("223ae797-bd09-4f28-8241-2763bdc5f713");
- static public Guid guidFilterRegisters
- {
- get { return _guidFilterRegisters; }
- }
-
- static private Guid _guidFilterLocals = new Guid("b200f725-e725-4c53-b36a-1ec27aef12ef");
- static public Guid guidFilterLocals
- {
- get { return _guidFilterLocals; }
- }
-
- static private Guid _guidFilterAllLocals = new Guid("196db21f-5f22-45a9-b5a3-32cddb30db06");
- static public Guid guidFilterAllLocals
- {
- get { return _guidFilterAllLocals; }
- }
-
- static private Guid _guidFilterArgs = new Guid("804bccea-0475-4ae7-8a46-1862688ab863");
- static public Guid guidFilterArgs
- {
- get { return _guidFilterArgs; }
- }
-
- static private Guid _guidFilterLocalsPlusArgs = new Guid("e74721bb-10c0-40f5-807f-920d37f95419");
- static public Guid guidFilterLocalsPlusArgs
- {
- get { return _guidFilterLocalsPlusArgs; }
- }
-
- static private Guid _guidFilterAllLocalsPlusArgs = new Guid("939729a8-4cb0-4647-9831-7ff465240d5f");
- static public Guid guidFilterAllLocalsPlusArgs
- {
- get { return _guidFilterAllLocalsPlusArgs; }
- }
-
- // Language guid for C++. Used when the language for a document context or a stack frame is requested.
- static private Guid _guidLanguageCpp = new Guid("3a12d0b7-c26c-11d0-b442-00a0244a1dd2");
- static public Guid guidLanguageCpp
- {
- get { return _guidLanguageCpp; }
- }
- }
-}
diff --git a/src/VSNDK.DebugEngine/AD7.Definitions/AD7Hresult.cs b/src/VSNDK.DebugEngine/AD7.Definitions/AD7Hresult.cs
deleted file mode 100644
index 316b5488..00000000
--- a/src/VSNDK.DebugEngine/AD7.Definitions/AD7Hresult.cs
+++ /dev/null
@@ -1,254 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// These are managed definitions of the well-known AD7 HRESULTS. Defined in msdbg.idl.
- ///
- static public class AD7_HRESULT
- {
- public const int S_ATTACH_DEFERRED=unchecked((int)0x40004);
- public const int S_ATTACH_IGNORED=unchecked((int)0x40005);
- public const int S_JIT_USERCANCELLED=unchecked((int)0x400B0);
- public const int S_JIT_NOT_REG_FOR_ENGINE=unchecked((int)0x400B5);
- public const int S_TERMINATE_PROCESSES_STILL_DETACHING=unchecked((int)0x400C0);
- public const int S_TERMINATE_PROCESSES_STILL_TERMINATING=unchecked((int)0x400C1);
- public const int S_ENC_SETIP_REQUIRES_CONTINUE=unchecked((int)0x40106);
- public const int S_WEBDBG_UNABLE_TO_DIAGNOSE=unchecked((int)0x40120);
- public const int S_WEBDBG_DEBUG_VERB_BLOCKED=unchecked((int)0x40121);
- public const int S_ASP_USER_ACCESS_DENIED=unchecked((int)0x40125);
- public const int S_JMC_LIMITED_SUPPORT=unchecked((int)0x40146);
- public const int S_CANNOT_REMAP_IN_EXCEPTION=unchecked((int)0x40150);
- public const int S_CANNOT_REMAP_NOT_AT_SEQUENCE_POINT=unchecked((int)0x40151);
- public const int S_GETPARENT_NO_PARENT=unchecked((int)0x40531);
- public const int S_GETDERIVEDMOST_NO_DERIVED_MOST=unchecked((int)0x40541);
- public const int S_GETMEMORYBYTES_NO_MEMORY_BYTES=unchecked((int)0x40551);
- public const int S_GETMEMORYCONTEXT_NO_MEMORY_CONTEXT=unchecked((int)0x40561);
- public const int S_GETSIZE_NO_SIZE=unchecked((int)0x40571);
- public const int S_GETEXTENDEDINFO_NO_EXTENDEDINFO=unchecked((int)0x40591);
- public const int S_ASYNC_STOP=unchecked((int)0x40B02);
- public const int E_ATTACH_DEBUGGER_ALREADY_ATTACHED=unchecked((int)0x80040001);
- public const int E_ATTACH_DEBUGGEE_PROCESS_SECURITY_VIOLATION=unchecked((int)0x80040002);
- public const int E_ATTACH_CANNOT_ATTACH_TO_DESKTOP=unchecked((int)0x80040003);
- public const int E_LAUNCH_NO_INTEROP=unchecked((int)0x80040005);
- public const int E_LAUNCH_DEBUGGING_NOT_POSSIBLE=unchecked((int)0x80040006);
- public const int E_LAUNCH_KERNEL_DEBUGGER_ENABLED=unchecked((int)0x80040007);
- public const int E_LAUNCH_KERNEL_DEBUGGER_PRESENT=unchecked((int)0x80040008);
- public const int E_INTEROP_NOT_SUPPORTED=unchecked((int)0x80040009);
- public const int E_TOO_MANY_PROCESSES=unchecked((int)0x8004000A);
- public const int E_MSHTML_SCRIPT_DEBUGGING_DISABLED=unchecked((int)0x8004000B);
- public const int E_SCRIPT_PDM_NOT_REGISTERED=unchecked((int)0x8004000C);
- public const int E_DE_CLR_DBG_SERVICES_NOT_INSTALLED=unchecked((int)0x8004000D);
- public const int E_ATTACH_NO_CLR_PROGRAMS=unchecked((int)0x8004000E);
- public const int E_REMOTE_SERVER_CLOSED=unchecked((int)0x80040010);
- public const int E_CLR_NOT_SUPPORTED=unchecked((int)0x80040016);
- public const int E_64BIT_CLR_NOT_SUPPORTED=unchecked((int)0x80040017);
- public const int E_CANNOT_MIX_MINDUMP_DEBUGGING=unchecked((int)0x80040018);
- public const int E_DEBUG_ENGINE_NOT_REGISTERED=unchecked((int)0x80040019);
- public const int E_LAUNCH_SXS_ERROR=unchecked((int)0x8004001A);
- public const int E_REMOTE_SERVER_DOES_NOT_EXIST=unchecked((int)0x80040020);
- public const int E_REMOTE_SERVER_ACCESS_DENIED=unchecked((int)0x80040021);
- public const int E_REMOTE_SERVER_MACHINE_DOES_NOT_EXIST=unchecked((int)0x80040022);
- public const int E_DEBUGGER_NOT_REGISTERED_PROPERLY=unchecked((int)0x80040023);
- public const int E_FORCE_GUEST_MODE_ENABLED=unchecked((int)0x80040024);
- public const int E_GET_IWAM_USER_FAILURE=unchecked((int)0x80040025);
- public const int E_REMOTE_SERVER_INVALID_NAME=unchecked((int)0x80040026);
- public const int E_REMOTE_SERVER_MACHINE_NO_DEFAULT=unchecked((int)0x80040027);
- public const int E_AUTO_LAUNCH_EXEC_FAILURE=unchecked((int)0x80040028);
- public const int E_SERVICE_ACCESS_DENIED=unchecked((int)0x80040029);
- public const int E_SERVICE_ACCESS_DENIED_ON_CALLBACK=unchecked((int)0x8004002A);
- public const int E_REMOTE_COMPONENTS_NOT_REGISTERED=unchecked((int)0x8004002B);
- public const int E_DCOM_ACCESS_DENIED=unchecked((int)0x8004002C);
- public const int E_SHARE_LEVEL_ACCESS_CONTROL_ENABLED=unchecked((int)0x8004002D);
- public const int E_WORKGROUP_REMOTE_LOGON_FAILURE=unchecked((int)0x8004002E);
- public const int E_WINAUTH_CONNECT_NOT_SUPPORTED=unchecked((int)0x8004002F);
- public const int E_EVALUATE_BUSY_WITH_EVALUATION=unchecked((int)0x80040030);
- public const int E_EVALUATE_TIMEOUT=unchecked((int)0x80040031);
- public const int E_INTEROP_NOT_SUPPORTED_FOR_THIS_CLR=unchecked((int)0x80040032);
- public const int E_CLR_INCOMPATIBLE_PROTOCOL=unchecked((int)0x80040033);
- public const int E_CLR_CANNOT_DEBUG_FIBER_PROCESS=unchecked((int)0x80040034);
- public const int E_PROCESS_OBJECT_ACCESS_DENIED=unchecked((int)0x80040035);
- public const int E_PROCESS_TOKEN_ACCESS_DENIED=unchecked((int)0x80040036);
- public const int E_PROCESS_TOKEN_ACCESS_DENIED_NO_TS=unchecked((int)0x80040037);
- public const int E_OPERATION_REQUIRES_ELEVATION=unchecked((int)0x80040038);
- public const int E_ATTACH_REQUIRES_ELEVATION=unchecked((int)0x80040039);
- public const int E_MEMORY_NOTSUPPORTED=unchecked((int)0x80040040);
- public const int E_DISASM_NOTSUPPORTED=unchecked((int)0x80040041);
- public const int E_DISASM_BADADDRESS=unchecked((int)0x80040042);
- public const int E_DISASM_NOTAVAILABLE=unchecked((int)0x80040043);
- public const int E_BP_DELETED=unchecked((int)0x80040060);
- public const int E_PROCESS_DESTROYED=unchecked((int)0x80040070);
- public const int E_PROCESS_DEBUGGER_IS_DEBUGGEE=unchecked((int)0x80040071);
- public const int E_TERMINATE_FORBIDDEN=unchecked((int)0x80040072);
- public const int E_THREAD_DESTROYED=unchecked((int)0x80040075);
- public const int E_PORTSUPPLIER_NO_PORT=unchecked((int)0x80040080);
- public const int E_PORT_NO_REQUEST=unchecked((int)0x80040090);
- public const int E_COMPARE_CANNOT_COMPARE=unchecked((int)0x800400A0);
- public const int E_JIT_INVALID_PID=unchecked((int)0x800400B1);
- public const int E_JIT_VSJITDEBUGGER_NOT_REGISTERED=unchecked((int)0x800400B3);
- public const int E_JIT_APPID_NOT_REGISTERED=unchecked((int)0x800400B4);
- public const int E_SESSION_TERMINATE_DETACH_FAILED=unchecked((int)0x800400C2);
- public const int E_SESSION_TERMINATE_FAILED=unchecked((int)0x800400C3);
- public const int E_DETACH_NO_PROXY=unchecked((int)0x800400D0);
- public const int E_DETACH_TS_UNSUPPORTED=unchecked((int)0x800400E0);
- public const int E_DETACH_IMPERSONATE_FAILURE=unchecked((int)0x800400F0);
- public const int E_CANNOT_SET_NEXT_STATEMENT_ON_NONLEAF_FRAME=unchecked((int)0x80040100);
- public const int E_TARGET_FILE_MISMATCH=unchecked((int)0x80040101);
- public const int E_IMAGE_NOT_LOADED=unchecked((int)0x80040102);
- public const int E_FIBER_NOT_SUPPORTED=unchecked((int)0x80040103);
- public const int E_CANNOT_SETIP_TO_DIFFERENT_FUNCTION=unchecked((int)0x80040104);
- public const int E_CANNOT_SET_NEXT_STATEMENT_ON_EXCEPTION=unchecked((int)0x80040105);
- public const int E_ENC_SETIP_REQUIRES_CONTINUE=unchecked((int)0x80040107);
- public const int E_CANNOT_SET_NEXT_STATEMENT_INTO_FINALLY=unchecked((int)0x80040108);
- public const int E_CANNOT_SET_NEXT_STATEMENT_OUT_OF_FINALLY=unchecked((int)0x80040109);
- public const int E_CANNOT_SET_NEXT_STATEMENT_INTO_CATCH=unchecked((int)0x8004010A);
- public const int E_CANNOT_SET_NEXT_STATEMENT_GENERAL=unchecked((int)0x8004010B);
- public const int E_CANNOT_SET_NEXT_STATEMENT_INTO_OR_OUT_OF_FILTER=unchecked((int)0x8004010C);
- public const int E_ASYNCBREAK_NO_PROGRAMS=unchecked((int)0x80040110);
- public const int E_ASYNCBREAK_DEBUGGEE_NOT_INITIALIZED=unchecked((int)0x80040111);
- public const int E_WEBDBG_DEBUG_VERB_BLOCKED=unchecked((int)0x80040121);
- public const int E_ASP_USER_ACCESS_DENIED=unchecked((int)0x80040125);
- public const int E_AUTO_ATTACH_NOT_REGISTERED=unchecked((int)0x80040126);
- public const int E_AUTO_ATTACH_DCOM_ERROR=unchecked((int)0x80040127);
- public const int E_AUTO_ATTACH_NOT_SUPPORTED=unchecked((int)0x80040128);
- public const int E_AUTO_ATTACH_CLASSNOTREG=unchecked((int)0x80040129);
- public const int E_CANNOT_CONTINUE_DURING_PENDING_EXPR_EVAL=unchecked((int)0x80040130);
- public const int E_REMOTE_REDIRECTION_UNSUPPORTED=unchecked((int)0x80040135);
- public const int E_INVALID_WORKING_DIRECTORY=unchecked((int)0x80040136);
- public const int E_LAUNCH_FAILED_WITH_ELEVATION=unchecked((int)0x80040137);
- public const int E_LAUNCH_ELEVATION_REQUIRED=unchecked((int)0x80040138);
- public const int E_CANNOT_FIND_INTERNET_EXPLORER=unchecked((int)0x80040139);
- public const int E_EXCEPTION_CANNOT_BE_INTERCEPTED=unchecked((int)0x80040140);
- public const int E_EXCEPTION_CANNOT_UNWIND_ABOVE_CALLBACK=unchecked((int)0x80040141);
- public const int E_INTERCEPT_CURRENT_EXCEPTION_NOT_SUPPORTED=unchecked((int)0x80040142);
- public const int E_INTERCEPT_CANNOT_UNWIND_LASTCHANCE_INTEROP=unchecked((int)0x80040143);
- public const int E_JMC_CANNOT_SET_STATUS=unchecked((int)0x80040145);
- public const int E_DESTROYED=unchecked((int)0x80040201);
- public const int E_REMOTE_NOMSVCMON=unchecked((int)0x80040202);
- public const int E_REMOTE_BADIPADDRESS=unchecked((int)0x80040203);
- public const int E_REMOTE_MACHINEDOWN=unchecked((int)0x80040204);
- public const int E_REMOTE_MACHINEUNSPECIFIED=unchecked((int)0x80040205);
- public const int E_CRASHDUMP_ACTIVE=unchecked((int)0x80040206);
- public const int E_ALL_THREADS_SUSPENDED=unchecked((int)0x80040207);
- public const int E_LOAD_DLL_TL=unchecked((int)0x80040208);
- public const int E_LOAD_DLL_SH=unchecked((int)0x80040209);
- public const int E_LOAD_DLL_EM=unchecked((int)0x8004020A);
- public const int E_LOAD_DLL_EE=unchecked((int)0x8004020B);
- public const int E_LOAD_DLL_DM=unchecked((int)0x8004020C);
- public const int E_LOAD_DLL_MD=unchecked((int)0x8004020D);
- public const int E_IOREDIR_BADFILE=unchecked((int)0x8004020E);
- public const int E_IOREDIR_BADSYNTAX=unchecked((int)0x8004020F);
- public const int E_REMOTE_BADVERSION=unchecked((int)0x80040210);
- public const int E_CRASHDUMP_UNSUPPORTED=unchecked((int)0x80040211);
- public const int E_REMOTE_BAD_CLR_VERSION=unchecked((int)0x80040212);
- public const int E_UNSUPPORTED_BINARY=unchecked((int)0x80040215);
- public const int E_DEBUGGEE_BLOCKED=unchecked((int)0x80040216);
- public const int E_REMOTE_NOUSERMSVCMON=unchecked((int)0x80040217);
- public const int E_STEP_WIN9xSYSCODE=unchecked((int)0x80040218);
- public const int E_INTEROP_ORPC_INIT=unchecked((int)0x80040219);
- public const int E_CANNOT_DEBUG_WIN32=unchecked((int)0x8004021B);
- public const int E_CANNOT_DEBUG_WIN64=unchecked((int)0x8004021C);
- public const int E_MINIDUMP_READ_WIN9X=unchecked((int)0x8004021D);
- public const int E_CROSS_TSSESSION_ATTACH=unchecked((int)0x8004021E);
- public const int E_STEP_BP_SET_FAILED=unchecked((int)0x8004021F);
- public const int E_LOAD_DLL_TL_INCORRECT_VERSION=unchecked((int)0x80040220);
- public const int E_LOAD_DLL_DM_INCORRECT_VERSION=unchecked((int)0x80040221);
- public const int E_REMOTE_NOMSVCMON_PIPE=unchecked((int)0x80040222);
- public const int E_LOAD_DLL_DIA=unchecked((int)0x80040223);
- public const int E_DUMP_CORRUPTED=unchecked((int)0x80040224);
- public const int E_INTEROP_WIN64=unchecked((int)0x80040225);
- public const int E_CRASHDUMP_DEPRECATED=unchecked((int)0x80040227);
- public const int E_DEVICEBITS_NOT_SIGNED=unchecked((int)0x80040401);
- public const int E_ATTACH_NOT_ENABLED=unchecked((int)0x80040402);
- public const int E_REMOTE_DISCONNECT=unchecked((int)0x80040403);
- public const int E_BREAK_ALL_FAILED=unchecked((int)0x80040404);
- public const int E_DEVICE_ACCESS_DENIED_SELECT_YES=unchecked((int)0x80040405);
- public const int E_DEVICE_ACCESS_DENIED=unchecked((int)0x80040406);
- public const int E_DEVICE_CONNRESET=unchecked((int)0x80040407);
- public const int E_BAD_NETCF_VERSION=unchecked((int)0x80040408);
- public const int E_REFERENCE_NOT_VALID=unchecked((int)0x80040501);
- public const int E_PROPERTY_NOT_VALID=unchecked((int)0x80040511);
- public const int E_SETVALUE_VALUE_CANNOT_BE_SET=unchecked((int)0x80040521);
- public const int E_SETVALUE_VALUE_IS_READONLY=unchecked((int)0x80040522);
- public const int E_SETVALUEASREFERENCE_NOTSUPPORTED=unchecked((int)0x80040523);
- public const int E_CANNOT_GET_UNMANAGED_MEMORY_CONTEXT=unchecked((int)0x80040561);
- public const int E_GETREFERENCE_NO_REFERENCE=unchecked((int)0x80040581);
- public const int E_CODE_CONTEXT_OUT_OF_SCOPE=unchecked((int)0x800405A1);
- public const int E_INVALID_SESSIONID=unchecked((int)0x800405A2);
- public const int E_SERVER_UNAVAILABLE_ON_CALLBACK=unchecked((int)0x800405A3);
- public const int E_ACCESS_DENIED_ON_CALLBACK=unchecked((int)0x800405A4);
- public const int E_UNKNOWN_AUTHN_SERVICE_ON_CALLBACK=unchecked((int)0x800405A5);
- public const int E_NO_SESSION_AVAILABLE=unchecked((int)0x800405A6);
- public const int E_CLIENT_NOT_LOGGED_ON=unchecked((int)0x800405A7);
- public const int E_OTHER_USERS_SESSION=unchecked((int)0x800405A8);
- public const int E_USER_LEVEL_ACCESS_CONTROL_REQUIRED=unchecked((int)0x800405A9);
- public const int E_SCRIPT_CLR_EE_DISABLED=unchecked((int)0x800405B0);
- public const int E_HTTP_SERVERERROR=unchecked((int)0x80040700);
- public const int E_HTTP_UNAUTHORIZED=unchecked((int)0x80040701);
- public const int E_HTTP_SENDREQUEST_FAILED=unchecked((int)0x80040702);
- public const int E_HTTP_FORBIDDEN=unchecked((int)0x80040703);
- public const int E_HTTP_NOT_SUPPORTED=unchecked((int)0x80040704);
- public const int E_HTTP_NO_CONTENT=unchecked((int)0x80040705);
- public const int E_HTTP_NOT_FOUND=unchecked((int)0x80040706);
- public const int E_HTTP_BAD_REQUEST=unchecked((int)0x80040707);
- public const int E_HTTP_ACCESS_DENIED=unchecked((int)0x80040708);
- public const int E_HTTP_CONNECT_FAILED=unchecked((int)0x80040709);
- public const int E_HTTP_EXCEPTION=unchecked((int)0x8004070A);
- public const int E_HTTP_TIMEOUT=unchecked((int)0x8004070B);
- public const int E_64BIT_COMPONENTS_NOT_INSTALLED=unchecked((int)0x80040750);
- public const int E_UNMARSHAL_SERVER_FAILED=unchecked((int)0x80040751);
- public const int E_UNMARSHAL_CALLBACK_FAILED=unchecked((int)0x80040752);
- public const int E_RPC_REQUIRES_AUTHENTICATION=unchecked((int)0x80040755);
- public const int E_LOGON_FAILURE_ON_CALLBACK=unchecked((int)0x80040756);
- public const int E_REMOTE_SERVER_UNAVAILABLE=unchecked((int)0x80040757);
- public const int E_FIREWALL_USER_CANCELED=unchecked((int)0x80040758);
- public const int E_REMOTE_CREDENTIALS_PROHIBITED=unchecked((int)0x80040759);
- public const int E_FIREWALL_NO_EXCEPTIONS=unchecked((int)0x8004075A);
- public const int E_FIREWALL_CANNOT_OPEN_APPLICATION=unchecked((int)0x8004075B);
- public const int E_FIREWALL_CANNOT_OPEN_PORT=unchecked((int)0x8004075C);
- public const int E_FIREWALL_CANNOT_OPEN_FILE_SHARING=unchecked((int)0x8004075D);
- public const int E_REMOTE_DEBUGGING_UNSUPPORTED=unchecked((int)0x8004075E);
- public const int E_REMOTE_BAD_MSDBG2=unchecked((int)0x8004075F);
- public const int E_ATTACH_USER_CANCELED=unchecked((int)0x80040760);
- public const int E_FUNCTION_NOT_JITTED=unchecked((int)0x80040800);
- public const int E_NO_CODE_CONTEXT=unchecked((int)0x80040801);
- public const int E_BAD_CLR_DIASYMREADER=unchecked((int)0x80040802);
- public const int E_CLR_SHIM_ERROR=unchecked((int)0x80040803);
- public const int E_AUTOATTACH_ACCESS_DENIED=unchecked((int)0x80040900);
- public const int E_AUTOATTACH_WEBSERVER_NOT_FOUND=unchecked((int)0x80040901);
- public const int E_DBGEXTENSION_NOT_FOUND=unchecked((int)0x80040910);
- public const int E_DBGEXTENSION_FUNCTION_NOT_FOUND=unchecked((int)0x80040911);
- public const int E_DBGEXTENSION_FAULTED=unchecked((int)0x80040912);
- public const int E_DBGEXTENSION_RESULT_INVALID=unchecked((int)0x80040913);
- public const int E_PROGRAM_IN_RUNMODE=unchecked((int)0x80040914);
- public const int E_CAUSALITY_NO_SERVER_RESPONSE=unchecked((int)0x80040920);
- public const int E_CAUSALITY_REMOTE_NOT_REGISTERED=unchecked((int)0x80040921);
- public const int E_CAUSALITY_BREAKPOINT_NOT_HIT=unchecked((int)0x80040922);
- public const int E_CAUSALITY_BREAKPOINT_BIND_ERROR=unchecked((int)0x80040923);
- public const int E_CAUSALITY_PROJECT_DISABLED=unchecked((int)0x80040924);
- public const int E_NO_ATTACH_WHILE_DDD=unchecked((int)0x80040A00);
- public const int E_SQLLE_ACCESSDENIED=unchecked((int)0x80040A01);
- public const int E_SQL_SP_ENABLE_PERMISSION_DENIED=unchecked((int)0x80040A02);
- public const int E_SQL_DEBUGGING_NOT_ENABLED_ON_SERVER=unchecked((int)0x80040A03);
- public const int E_SQL_CANT_FIND_SSDEBUGPS_ON_CLIENT=unchecked((int)0x80040A04);
- public const int E_SQL_EXECUTED_BUT_NOT_DEBUGGED=unchecked((int)0x80040A05);
- public const int E_SQL_VDT_INIT_RETURNED_SQL_ERROR=unchecked((int)0x80040A06);
- public const int E_ATTACH_FAILED_ABORT_SILENTLY=unchecked((int)0x80040A07);
- public const int E_SQL_REGISTER_FAILED=unchecked((int)0x80040A08);
- public const int E_DE_NOT_SUPPORTED_PRE_8_0=unchecked((int)0x80040B00);
- public const int E_PROGRAM_DESTROY_PENDING=unchecked((int)0x80040B01);
- public const int E_MANAGED_FEATURE_NOTSUPPORTED=unchecked((int)0x80040BAD);
- }
-}
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7BoundBreakpoint.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7BoundBreakpoint.cs
deleted file mode 100644
index 43d4d4ac..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7BoundBreakpoint.cs
+++ /dev/null
@@ -1,584 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-using System.Threading;
-using System.IO;
-
-namespace VSNDK.DebugEngine
-{
-
- ///
- /// This class represents a breakpoint that has been bound to a location in the debuggee. It is a child of the pending
- /// breakpoint that creates it. Unless the pending breakpoint only has one bound breakpoint, each bound breakpoint is displayed as
- /// a child of the pending breakpoint in the breakpoints window. Otherwise, only one is displayed.
- /// (http://msdn.microsoft.com/en-us/library/bb161979.aspx)
- ///
- public class AD7BoundBreakpoint : IDebugBoundBreakpoint2
- {
- private AD7PendingBreakpoint m_pendingBreakpoint;
- private AD7BreakpointResolution m_breakpointResolution;
- private AD7Engine m_engine;
-
- private bool m_enabled;
- private bool m_deleted;
- public uint m_hitCount;
-
- public uint m_bpLocationType;
- public string m_filename = "";
- public string m_fullPath = "";
- public uint m_line = 0;
- public string m_func = "";
-
- ///
- /// This breakpoint's index in the list of active bound breakpoints.
- ///
- protected int m_remoteID = -1;
- public int RemoteID
- {
- get { return m_remoteID; }
- }
-
- public BP_PASSCOUNT m_bpPassCount;
- public BP_CONDITION m_bpCondition;
-
- ///
- /// TRUE if the program has to stop when the hit count is equal to a given value.
- ///
- public bool m_isHitCountEqual = false;
-
- ///
- /// Different than 0 if the program has to stop whenever the hit count is multiple of a given value
- ///
- public uint m_hitCountMultiple = 0;
- public bool m_breakWhenCondChanged = false;
- public string m_previousCondEvaluation = "";
-
- ///
- /// Indicates if a given breakpoint is being manipulated in one of these 2 methods: SetPassCount and BreakpointHit.
- ///
- public bool m_blockedPassCount = false;
-
- ///
- /// Indicates if a given breakpoint is being manipulated in one of these 2 methods: SetCondition and BreakpointHit.
- ///
- public bool m_blockedConditional = false;
-
- ///
- /// GDB member variables.
- ///
- protected uint m_GDB_ID = 0;
- protected string m_GDB_filename = "";
- protected uint m_GDB_linePos = 0;
- protected string m_GDB_Address = "";
-
-
- ///
- /// GDB_ID Property.
- ///
- public uint GDB_ID
- {
- get { return m_GDB_ID; }
- set { m_GDB_ID = value; }
- }
-
-
- ///
- /// GDB_FileName Property.
- ///
- public string GDB_FileName
- {
- get { return m_GDB_filename; }
- set { m_GDB_filename = value; }
- }
-
-
- ///
- /// GDB_LinePos Property.
- ///
- public uint GDB_LinePos
- {
- get { return m_GDB_linePos; }
- set { m_GDB_linePos = value; }
- }
-
-
- ///
- /// GDB_Address Property.
- ///
- public string GDB_Address
- {
- get { return m_GDB_Address; }
- set { m_GDB_Address = value; }
- }
-
-
- ///
- /// GDB works with short path names only, which requires converting the path names to/from long ones. This function
- /// returns the short path name for a given long one.
- ///
- /// Long path name.
- /// Returns this short path name.
- /// Lenght of this short path name.
- ///
- [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
- public static extern int GetShortPathName(
- [MarshalAs(UnmanagedType.LPTStr)]
- string path,
- [MarshalAs(UnmanagedType.LPTStr)]
- StringBuilder shortPath,
- int shortPathLength
- );
-
-
- ///
- /// AD7BoundBreakpoint constructor for file/line breaks.
- ///
- /// AD7 Engine.
- /// Contains the information required to implement a breakpoint.
- /// Associated pending breakpoint.
- public AD7BoundBreakpoint(AD7Engine engine, BP_REQUEST_INFO bpReqInfo, AD7PendingBreakpoint pendingBreakpoint)
- {
- if (bpReqInfo.bpLocation.bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FILE_LINE)
- {
- string documentName;
-
- // Get Decument Position and File Name
- IDebugDocumentPosition2 docPosition = (IDebugDocumentPosition2)(Marshal.GetObjectForIUnknown(bpReqInfo.bpLocation.unionmember2));
- docPosition.GetFileName(out documentName);
-
- // Need to shorten the path we send to GDB.
- StringBuilder shortPath = new StringBuilder(1024);
- GetShortPathName(documentName, shortPath, shortPath.Capacity);
-
- // Get the location in the document that the breakpoint is in.
- TEXT_POSITION[] startPosition = new TEXT_POSITION[1];
- TEXT_POSITION[] endPosition = new TEXT_POSITION[1];
- docPosition.GetRange(startPosition, endPosition);
-
- m_engine = engine;
- m_bpLocationType = (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FILE_LINE;
- m_filename = shortPath.ToString();
- m_line = startPosition[0].dwLine + 1;
-
- m_pendingBreakpoint = pendingBreakpoint;
- m_enabled = true;
- m_deleted = false;
- m_hitCount = 0;
- m_remoteID = m_engine.BPMgr.RemoteAdd(this);
- }
- else if (bpReqInfo.bpLocation.bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FUNC_OFFSET)
- {
- string func;
-
- IDebugFunctionPosition2 funcPosition = (IDebugFunctionPosition2)(Marshal.GetObjectForIUnknown(bpReqInfo.bpLocation.unionmember2));
- funcPosition.GetFunctionName(out func);
-
- m_engine = engine;
- m_func = func;
- m_enabled = true;
- m_deleted = false;
- m_hitCount = 0;
- m_bpLocationType = (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FUNC_OFFSET;
- m_pendingBreakpoint = pendingBreakpoint;
- m_remoteID = m_engine.BPMgr.RemoteAdd(this);
- }
-
-// if ((m_remoteID == 0) && (VSNDK.AddIn.VSNDKAddIn.isDebugEngineRunning == false))
- if (m_remoteID == 0)
- {
- return;
- }
-
- // Set the hit count and condition
- if (bpReqInfo.bpPassCount.stylePassCount != enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE)
- SetPassCount(bpReqInfo.bpPassCount);
- if (bpReqInfo.bpCondition.styleCondition != enum_BP_COND_STYLE.BP_COND_NONE)
- SetCondition(bpReqInfo.bpCondition);
-
- // Get the Line Position sent back from GDB
- TEXT_POSITION tpos = new TEXT_POSITION();
- tpos.dwLine = m_GDB_linePos - 1;
-
- uint xAddress = UInt32.Parse(m_GDB_Address.Substring(2), System.Globalization.NumberStyles.HexNumber);
-
- AD7MemoryAddress codeContext = new AD7MemoryAddress(m_engine, xAddress);
- AD7DocumentContext documentContext = new AD7DocumentContext(m_GDB_filename, tpos, tpos, codeContext);
-
- m_breakpointResolution = new AD7BreakpointResolution(m_engine, xAddress, documentContext);
-
- m_engine.Callback.OnBreakpointBound(this, 0);
- }
-
-
- ///
- /// Sets the count and conditions upon which a breakpoint is fired.
- /// (http://msdn.microsoft.com/en-us/library/bb161364.aspx)
- ///
- /// Describes the count and conditions upon which a conditional breakpoint is fired.
- /// VSConstants.S_OK if successful, VSConstants.S_FALSE if not.
- public int SetPassCount(BP_PASSCOUNT bpPassCount)
- {
- bool isRunning = false;
- int result = VSConstants.S_FALSE;
- while (!m_engine.eDispatcher.lockedBreakpoint(this, true, false))
- {
- Thread.Sleep(0);
- }
- while (!m_engine.eDispatcher.enterCriticalRegion())
- {
- Thread.Sleep(0);
- }
- if ((m_engine.m_state == AD7Engine.DE_STATE.RUN_MODE) && (EventDispatcher.m_GDBRunMode == true))
- {
- isRunning = true;
- m_engine.eDispatcher.prepareToModifyBreakpoint();
- }
- m_bpPassCount = bpPassCount;
- if (bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER)
- {
- m_isHitCountEqual = false;
- m_hitCountMultiple = 0;
- if (!m_breakWhenCondChanged)
- {
- if ((int)((bpPassCount.dwPassCount - m_hitCount)) >= 0)
- {
- if (m_engine.eDispatcher.ignoreHitCount(GDB_ID, (int)(bpPassCount.dwPassCount - m_hitCount)))
- result = VSConstants.S_OK;
- }
- else
- {
- if (m_engine.eDispatcher.ignoreHitCount(GDB_ID, 1))
- result = VSConstants.S_OK;
- }
-
- }
- else
- result = VSConstants.S_OK;
- }
- else if (bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL)
- {
- m_hitCountMultiple = 0;
- m_isHitCountEqual = true;
- if (!m_breakWhenCondChanged)
- {
- if (m_engine.eDispatcher.ignoreHitCount(GDB_ID, (int)(bpPassCount.dwPassCount - m_hitCount)))
- result = VSConstants.S_OK;
- }
- else
- result = VSConstants.S_OK;
- }
- else if (bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_MOD)
- {
- m_isHitCountEqual = false;
- m_hitCountMultiple = bpPassCount.dwPassCount;
- if (!m_breakWhenCondChanged)
- {
- if (m_engine.eDispatcher.ignoreHitCount(GDB_ID, (int)(m_hitCountMultiple - (m_hitCount % m_hitCountMultiple))))
- result = VSConstants.S_OK;
- }
- else
- result = VSConstants.S_OK;
- }
- else if (bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE)
- {
- m_isHitCountEqual = false;
- m_hitCountMultiple = 0;
- if (!m_breakWhenCondChanged)
- {
- if (m_engine.eDispatcher.ignoreHitCount(GDB_ID, 1)) // ignoreHitCount decrement by 1 automatically, so sending 1 means to stop ignoring (or ignore 0)
- result = VSConstants.S_OK;
- }
- else
- result = VSConstants.S_OK;
- }
-
- if (isRunning)
- {
- isRunning = false;
- m_engine.eDispatcher.resumeFromInterrupt();
- }
-
- m_engine.eDispatcher.leaveCriticalRegion();
- m_engine.eDispatcher.unlockBreakpoint(this, true, false);
- return result;
- }
-
-
- ///
- /// Sets the conditions under which a conditional breakpoint fires. (http://msdn.microsoft.com/en-us/library/bb146215.aspx)
- ///
- /// Describes the conditions under which a breakpoint fires.
- /// VSConstants.S_OK if successful, VSConstants.S_FALSE if not.
- public int SetCondition(BP_CONDITION bpCondition)
- {
- bool updatingCondBreak = this.m_engine.m_updatingConditionalBreakpoint.WaitOne(0);
- bool isRunning = false;
- bool verifyCondition = false;
- int result = VSConstants.S_FALSE;
- while (!m_engine.eDispatcher.lockedBreakpoint(this, false, true))
- {
- Thread.Sleep(0);
- }
-
- if (m_hitCount != 0)
- {
- m_engine.eDispatcher.resetHitCount(this, false);
- }
-
- while (!m_engine.eDispatcher.enterCriticalRegion())
- {
- Thread.Sleep(0);
- }
-
- if ((m_engine.m_state == AD7Engine.DE_STATE.RUN_MODE) && (EventDispatcher.m_GDBRunMode == true))
- {
- isRunning = true;
- m_engine.eDispatcher.prepareToModifyBreakpoint();
- m_engine.m_state = AD7Engine.DE_STATE.BREAK_MODE;
- }
-
- m_bpCondition = bpCondition;
-
- if (bpCondition.styleCondition == enum_BP_COND_STYLE.BP_COND_WHEN_TRUE)
- {
- if (m_breakWhenCondChanged)
- {
- m_breakWhenCondChanged = false;
- verifyCondition = true;
- }
- else
- m_breakWhenCondChanged = false;
-
- m_previousCondEvaluation = "";
- if (m_engine.eDispatcher.setBreakpointCondition(GDB_ID, bpCondition.bstrCondition))
- result = VSConstants.S_OK;
- }
- else if (bpCondition.styleCondition == enum_BP_COND_STYLE.BP_COND_WHEN_CHANGED)
- {
- m_breakWhenCondChanged = true;
- m_previousCondEvaluation = bpCondition.bstrCondition; // just to initialize this variable
- m_engine.eDispatcher.ignoreHitCount(GDB_ID, 1); // have to break always to evaluate this option because GDB doesn't support it.
- m_engine.eDispatcher.setBreakpointCondition(GDB_ID, "");
-
- result = VSConstants.S_OK;
- }
- else if (bpCondition.styleCondition == enum_BP_COND_STYLE.BP_COND_NONE)
- {
- if (m_breakWhenCondChanged)
- {
- m_breakWhenCondChanged = false;
- verifyCondition = true;
- }
- else
- m_breakWhenCondChanged = false;
-
- m_previousCondEvaluation = "";
- if (m_engine.eDispatcher.setBreakpointCondition(GDB_ID, ""))
- result = VSConstants.S_OK;
- }
-
- m_engine.eDispatcher.leaveCriticalRegion();
- m_engine.eDispatcher.unlockBreakpoint(this, false, true);
-
- if (verifyCondition)
- {
- SetPassCount(m_bpPassCount);
- verifyCondition = false;
- }
-
- if (isRunning)
- {
- isRunning = false;
- m_engine.m_state = AD7Engine.DE_STATE.RUN_MODE;
- m_engine.eDispatcher.resumeFromInterrupt();
- }
-
- this.m_engine.m_updatingConditionalBreakpoint.Set();
-
- return result;
- }
-
- #region IDebugBoundBreakpoint2 Members
-
-
- ///
- /// Called when the breakpoint is being deleted by the user. (http://msdn.microsoft.com/en-us/library/bb146595.aspx)
- ///
- /// VSConstants.S_OK
- int IDebugBoundBreakpoint2.Delete()
- {
- if (!m_deleted)
- {
- m_enabled = false;
- m_deleted = true;
- m_pendingBreakpoint.OnBoundBreakpointDeleted(this);
- m_engine.BPMgr.RemoteDelete(this);
- m_remoteID = -1;
- }
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Called by the debugger UI when the user is enabling or disabling a breakpoint.
- /// (http://msdn.microsoft.com/en-us/library/bb145150.aspx)
- ///
- /// Equal to 0 if disabling; different than 0 if enabling.
- /// VSConstants.S_OK
- int IDebugBoundBreakpoint2.Enable(int fEnable)
- {
- bool xEnabled = fEnable != 0;
- if (m_enabled != xEnabled)
- {
- if (xEnabled)
- {
- m_engine.BPMgr.RemoteEnable(this);
- }
- else
- {
- m_engine.BPMgr.RemoteDisable(this);
- }
- m_enabled = xEnabled;
- }
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Return the breakpoint resolution which describes how the breakpoint bound in the debuggee.
- /// (http://msdn.microsoft.com/en-us/library/bb145891.aspx)
- ///
- /// Contains the information that describes a bound breakpoint.
- /// VSConstants.S_OK
- int IDebugBoundBreakpoint2.GetBreakpointResolution(out IDebugBreakpointResolution2 ppBPResolution)
- {
- ppBPResolution = m_breakpointResolution;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Return the pending breakpoint for this bound breakpoint. (http://msdn.microsoft.com/en-us/library/bb145337.aspx)
- ///
- /// Contains a breakpoint that is ready to bind to a code location.
- /// VSConstants.S_OK
- int IDebugBoundBreakpoint2.GetPendingBreakpoint(out IDebugPendingBreakpoint2 ppPendingBreakpoint)
- {
- ppPendingBreakpoint = m_pendingBreakpoint;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the state of this bound breakpoint. (http://msdn.microsoft.com/en-us/library/bb161276.aspx)
- ///
- /// Describes the state of the breakpoint.
- /// VSConstants.S_OK
- int IDebugBoundBreakpoint2.GetState(enum_BP_STATE[] pState)
- {
- pState[0] = 0;
-
- if (m_deleted)
- {
- pState[0] = enum_BP_STATE.BPS_DELETED;
- }
- else if (m_enabled)
- {
- pState[0] = enum_BP_STATE.BPS_ENABLED;
- }
- else if (!m_enabled)
- {
- pState[0] = enum_BP_STATE.BPS_DISABLED;
- }
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the current hit count for this bound breakpoint. (http://msdn.microsoft.com/en-us/library/bb145340.aspx)
- ///
- /// Returns the hit count.
- /// AD7_HRESULT.E_BP_DELETED if the breakpoint was deleted; or VSConstants.S_OK if not.
- int IDebugBoundBreakpoint2.GetHitCount(out uint pdwHitCount)
- {
- if (m_deleted)
- {
- pdwHitCount = 0;
- return AD7_HRESULT.E_BP_DELETED;
- }
- else
- {
- pdwHitCount = m_hitCount;
- return VSConstants.S_OK;
- }
- }
-
-
- ///
- /// Sets or changes the condition associated with this bound breakpoint. (http://msdn.microsoft.com/en-us/library/bb146215.aspx)
- ///
- /// Describes the condition.
- /// VSConstants.S_OK if successful, VSConstants.S_FALSE if not.
- int IDebugBoundBreakpoint2.SetCondition(BP_CONDITION bpCondition)
- {
- return SetCondition(bpCondition);
- }
-
-
- ///
- /// Sets the hit count for the bound breakpoint. (http://msdn.microsoft.com/en-us/library/bb146736.aspx)
- ///
- /// The hit count to set.
- /// AD7_HRESULT.E_BP_DELETED if the breakpoint was deleted; or VSConstants.S_OK if not.
- int IDebugBoundBreakpoint2.SetHitCount(uint dwHitCount)
- {
- if (m_deleted)
- {
- return AD7_HRESULT.E_BP_DELETED;
- }
- else
- {
- if ((dwHitCount == 0) && (m_hitCount != 0))
- {
- m_hitCount = dwHitCount;
- m_engine.eDispatcher.resetHitCount(this, true);
- }
- else
- m_hitCount = dwHitCount;
- return VSConstants.S_OK;
- }
- }
-
-
- ///
- /// Sets or changes the pass count associated with this bound breakpoint. (http://msdn.microsoft.com/en-us/library/bb161364.aspx)
- ///
- /// Specifies the pass count.
- /// VSConstants.S_OK if successful, VSConstants.S_FALSE if not.
- int IDebugBoundBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
- {
- return SetPassCount(bpPassCount);
- }
-
- #endregion
- }
-}
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7BreakpointResolution.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7BreakpointResolution.cs
deleted file mode 100644
index c4fc50d5..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7BreakpointResolution.cs
+++ /dev/null
@@ -1,155 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-using System.Runtime.InteropServices;
-
-// TODO: Change to take filename and line number instead of an address?
-
-namespace VSNDK.DebugEngine
-{
-
- ///
- /// This class represents the information that describes a bound breakpoint. (http://msdn.microsoft.com/en-us/library/bb145894.aspx)
- ///
- public class AD7BreakpointResolution : IDebugBreakpointResolution2
- {
- ///
- /// AD7 Engine.
- ///
- private AD7Engine m_engine;
-
- ///
- /// GDB Address
- ///
- private uint m_address;
-
- ///
- /// The document context to the debugger. A document context represents a location within a source file.
- ///
- private AD7DocumentContext m_documentContext;
-
-
- ///
- /// Constructor.
- ///
- /// AD7 Engine.
- /// GDB Address.
- /// The document context to the debugger. A document context represents a location within a
- /// source file.
- public AD7BreakpointResolution(AD7Engine engine, uint address, AD7DocumentContext documentContext)
- {
- m_engine = engine;
- m_address = address;
- m_documentContext = documentContext;
- }
-
- #region IDebugBreakpointResolution2 Members
-
-
- ///
- /// Gets the type of the breakpoint represented by this resolution. (http://msdn.microsoft.com/en-us/library/bb145576.aspx)
- ///
- /// The type of this breakpoint.
- /// VSConstants.S_OK.
- int IDebugBreakpointResolution2.GetBreakpointType(enum_BP_TYPE[] pBPType)
- {
- // The VSNDK debug engine only supports code breakpoints.
- pBPType[0] = enum_BP_TYPE.BPT_CODE;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the breakpoint resolution information that describes this breakpoint.
- /// (http://msdn.microsoft.com/en-us/library/bb146743.aspx)
- ///
- /// A combination of flags that determine which fields of the pBPResolutionInfo parameter are to be filled out.
- /// The BP_RESOLUTION_INFO structure to be filled in with information about this breakpoint.
- /// VSConstants.S_OK.
- int IDebugBreakpointResolution2.GetResolutionInfo(enum_BPRESI_FIELDS dwFields, BP_RESOLUTION_INFO[] pBPResolutionInfo)
- {
- if ((dwFields & enum_BPRESI_FIELDS.BPRESI_BPRESLOCATION) != 0)
- {
- // The sample engine only supports code breakpoints.
- BP_RESOLUTION_LOCATION location = new BP_RESOLUTION_LOCATION();
- location.bpType = (uint)enum_BP_TYPE.BPT_CODE;
-
- // The debugger will not QI the IDebugCodeContex2 interface returned here. We must pass the pointer
- // to IDebugCodeContex2 and not IUnknown.
- AD7MemoryAddress codeContext = new AD7MemoryAddress(m_engine, m_address);
- codeContext.SetDocumentContext(m_documentContext);
- location.unionmember1 = Marshal.GetComInterfaceForObject(codeContext, typeof(IDebugCodeContext2));
- pBPResolutionInfo[0].bpResLocation = location;
- pBPResolutionInfo[0].dwFields |= enum_BPRESI_FIELDS.BPRESI_BPRESLOCATION;
-
- }
-
- if ((dwFields & enum_BPRESI_FIELDS.BPRESI_PROGRAM) != 0)
- {
- pBPResolutionInfo[0].pProgram = (IDebugProgram2)m_engine;
- pBPResolutionInfo[0].dwFields |= enum_BPRESI_FIELDS.BPRESI_PROGRAM;
- }
-
- return VSConstants.S_OK;
- }
-
- #endregion
- }
-
- ///
- /// Represents the resolution of a breakpoint error. (http://msdn.microsoft.com/en-us/library/bb161341.aspx)
- ///
- class AD7ErrorBreakpointResolution : IDebugErrorBreakpointResolution2
- {
- #region IDebugErrorBreakpointResolution2 Members
-
-
- ///
- /// Gets the breakpoint type. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145065.aspx)
- ///
- /// The type of this breakpoint.
- /// Not implemented.
- int IDebugErrorBreakpointResolution2.GetBreakpointType(enum_BP_TYPE[] pBPType)
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Gets the breakpoint error resolution information. Not implemented. (http://msdn.microsoft.com/en-us/library/bb161960.aspx)
- ///
- /// A combination of flags that determine which fields of pErrorResolutionInfo are to be filled out.
- /// The BP_ERROR_RESOLUTION_INFO structure that is filled in with the description of the
- /// breakpoint resolution.
- /// Not implemented.
- int IDebugErrorBreakpointResolution2.GetResolutionInfo(enum_BPERESI_FIELDS dwFields, BP_ERROR_RESOLUTION_INFO[] pErrorResolutionInfo)
- {
- if (((uint)dwFields & (uint)enum_BPERESI_FIELDS.BPERESI_BPRESLOCATION) != 0) { }
- if (((uint)dwFields & (uint)enum_BPERESI_FIELDS.BPERESI_PROGRAM) != 0) { }
- if (((uint)dwFields & (uint)enum_BPERESI_FIELDS.BPERESI_THREAD) != 0) { }
- if (((uint)dwFields & (uint)enum_BPERESI_FIELDS.BPERESI_MESSAGE) != 0) { }
- if (((uint)dwFields & (uint)enum_BPERESI_FIELDS.BPERESI_TYPE) != 0) { }
-
- throw new Exception("The method or operation is not implemented.");
- }
-
- #endregion
- }
-
-}
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7DocumentContext.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7DocumentContext.cs
deleted file mode 100644
index aa78213a..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7DocumentContext.cs
+++ /dev/null
@@ -1,231 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// This class represents a document context to the debugger. A document context represents a location within a source file.
- /// (http://msdn.microsoft.com/en-us/library/bb145572.aspx)
- ///
- public class AD7DocumentContext : IDebugDocumentContext2
- {
- ///
- /// Long path file name
- ///
- string m_fileName;
-
- ///
- /// Start position. In VSNDK debug engine, both begPos and endPos have the same value.
- ///
- TEXT_POSITION m_begPos;
-
- ///
- /// End position. In VSNDK debug engine, both begPos and endPos have the same value.
- ///
- TEXT_POSITION m_endPos;
-
- ///
- /// An address in a program's execution stream.
- ///
- AD7MemoryAddress m_codeContext;
-
-
- /// GDB works with short path names only, which requires converting the path names to/from long ones. This function
- /// returns the long path name for a given short one.
- /// Short path name.
- /// Returns this long path name.
- /// Lenght of this long path name.
- ///
- [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
- public static extern int GetLongPathName(
- [MarshalAs(UnmanagedType.LPTStr)]
- string path,
- [MarshalAs(UnmanagedType.LPTStr)]
- StringBuilder longPath,
- int longPathLength
- );
-
-
- ///
- /// Constructor.
- ///
- /// Short path file name.
- /// Start position.
- /// End position. In VSNDK debug engine, both begPos and endPos have the same value.
- /// An address in a program's execution stream.
- public AD7DocumentContext(string fileName, TEXT_POSITION begPos, TEXT_POSITION endPos, AD7MemoryAddress codeContext)
- {
- // Need to lengthen the path used by Visual Studio.
- StringBuilder documentNameSB = new StringBuilder(1024);
- GetLongPathName(fileName, documentNameSB, documentNameSB.Capacity);
- m_fileName = documentNameSB.ToString();
-
- m_begPos = begPos;
- m_endPos = endPos;
- m_codeContext = codeContext;
- }
-
-
- #region IDebugDocumentContext2 Members
-
-
- ///
- /// Compares this document context to a given array of document contexts. (http://msdn.microsoft.com/en-us/library/bb145338.aspx)
- ///
- /// A value from the DOCCONTEXT_COMPARE enumeration that specifies the type of comparison.
- /// An array of IDebugDocumentContext2 objects that represent the document contexts being compared to.
- /// The length of the array of document contexts to compare.
- /// Returns the index into the rgpDocContextSet array of the first document context that satisfies the comparison.
- /// VSConstants.E_NOTIMPL.
- int IDebugDocumentContext2.Compare(enum_DOCCONTEXT_COMPARE Compare, IDebugDocumentContext2[] rgpDocContextSet, uint dwDocContextSetLen, out uint pdwDocContext)
- {
- dwDocContextSetLen = 0;
- pdwDocContext = 0;
-
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// Retrieves a list of all code contexts associated with this document context. The VSNDK Debug Engine only supports one code context per document
- /// context and the code contexts are always memory addresses. (http://msdn.microsoft.com/en-us/library/bb146273.aspx)
- ///
- /// Returns an IEnumDebugCodeContexts2 object that contains a list of code contexts.
- /// If successful, returns S_OK; otherwise, returns an error code.
- int IDebugDocumentContext2.EnumCodeContexts(out IEnumDebugCodeContexts2 ppEnumCodeCxts)
- {
- ppEnumCodeCxts = null;
- try
- {
- AD7MemoryAddress[] codeContexts = new AD7MemoryAddress[1];
- codeContexts[0] = m_codeContext;
- ppEnumCodeCxts = new AD7CodeContextEnum(codeContexts);
- return VSConstants.S_OK;
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
- }
-
-
- ///
- /// Gets the document that contains this document context. This method is for those debug engines that supply documents directly
- /// to the IDE. Since the VSNDK Debug Engine does not do this, this method returns E_FAIL.
- /// (http://msdn.microsoft.com/en-us/library/bb161759.aspx)
- ///
- /// Returns an IDebugDocument2 object that represents the document that contains this document context.
- /// E_FAIL.
- int IDebugDocumentContext2.GetDocument(out IDebugDocument2 ppDocument)
- {
- ppDocument = null;
- return VSConstants.E_FAIL;
- }
-
-
- ///
- /// Gets the language associated with this document context. The language for this sample is always C++.
- /// (http://msdn.microsoft.com/en-us/library/bb146340.aspx)
- ///
- /// Returns the name of the language that implements the code at this document context.
- /// Returns the GUID of the language that implements the code at this document context.
- /// VSConstants.S_OK.
- int IDebugDocumentContext2.GetLanguageInfo(ref string pbstrLanguage, ref Guid pguidLanguage)
- {
- pbstrLanguage = "C++";
- pguidLanguage = AD7Guids.guidLanguageCpp;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the displayable name of the document that contains this document context.
- /// (http://msdn.microsoft.com/en-us/library/bb146162.aspx)
- ///
- /// A value from the GETNAME_TYPE enumeration that specifies the type of name to return.
- /// Returns the name of the file.
- /// VSConstants.S_OK.
- int IDebugDocumentContext2.GetName(enum_GETNAME_TYPE gnType, out string pbstrFileName)
- {
- pbstrFileName = m_fileName;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the source code range of this document context. A source range is the entire range of source code, from the current
- /// statement back to just after the previous statement that contributed code. The source range is typically used for mixing
- /// source statements, including comments, with code in the disassembly window. Since this engine does not support the
- /// disassembly window, this is not implemented. (http://msdn.microsoft.com/en-us/library/bb146190.aspx)
- ///
- /// A TEXT_POSITION structure that is filled in with the starting position. Set to a null value if it is not needed.
- /// A TEXT_POSITION structure that is filled in with the ending position. Set to a null value if it is not needed.
- /// Not implemented.
- int IDebugDocumentContext2.GetSourceRange(TEXT_POSITION[] pBegPosition, TEXT_POSITION[] pEndPosition)
- {
- throw new NotImplementedException("This method is not implemented");
- }
-
-
- ///
- /// Gets the file statement range of the document context. A statement range is the range of the lines that contributed the code
- /// to which this document context refers. (http://msdn.microsoft.com/en-us/library/bb161669.aspx)
- ///
- /// A TEXT_POSITION structure that is filled in with the starting position. Set to a null value if it is not needed.
- /// A TEXT_POSITION structure that is filled in with the ending position. Set to a null value if it is not needed.
- /// If successful, returns S_OK; otherwise, returns an error code.
- int IDebugDocumentContext2.GetStatementRange(TEXT_POSITION[] pBegPosition, TEXT_POSITION[] pEndPosition)
- {
- try
- {
- pBegPosition[0].dwColumn = m_begPos.dwColumn;
- pBegPosition[0].dwLine = m_begPos.dwLine;
-
- pEndPosition[0].dwColumn = m_endPos.dwColumn;
- pEndPosition[0].dwLine = m_endPos.dwLine;
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Moves the document context by a given number of statements or lines. This is used primarily to support the Autos window in
- /// discovering the proximity statements around this document context. Not implemented.
- /// (http://msdn.microsoft.com/en-us/library/bb146603.aspx)
- ///
- /// The number of statements or lines to move ahead, depending on the document context.
- /// Returns a new IDebugDocumentContext2 object with the new position.
- /// Not implemented.
- int IDebugDocumentContext2.Seek(int nCount, out IDebugDocumentContext2 ppDocContext)
- {
- ppDocContext = null;
- return VSConstants.E_NOTIMPL;
- }
-
- #endregion
- }
-}
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7Engine.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7Engine.cs
deleted file mode 100644
index 457c4248..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7Engine.cs
+++ /dev/null
@@ -1,1455 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Runtime.InteropServices;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-using System.Diagnostics;
-using System.Threading;
-using VSNDK.Parser;
-//using VSNDK.AddIn;
-using VSNDK.Package;
-
-using NameValueCollection = System.Collections.Specialized.NameValueCollection;
-using NameValueCollectionHelper = VSNDK.Package.NameValueCollectionHelper;
-using System.Collections;
-using System.Windows.Forms;
-
-namespace VSNDK.DebugEngine
-{
-
- ///
- /// AD7Engine is the primary entrypoint object for the sample engine.
- ///
- /// It implements:
- ///
- /// IDebugEngine2: This interface represents a debug engine (DE). It is used to manage various aspects of a debugging session,
- /// from creating breakpoints to setting and clearing exceptions. (http://msdn.microsoft.com/en-us/library/bb145310.aspx).
- ///
- /// IDebugEngineLaunch2: Used by a debug engine (DE) to launch and terminate programs.
- /// (http://msdn.microsoft.com/en-us/library/bb146230.aspx).
- ///
- /// IDebugProgram3: This interface represents a program that is running in a process. Since this engine only debugs one process at a time and each
- /// process only contains one program, it is implemented on the engine. (http://msdn.microsoft.com/en-us/library/bb145884.aspx).
- ///
- /// IDebugEngineProgram2: This interface provides simultanious debugging of multiple threads in a debuggee.
- /// (http://msdn.microsoft.com/en-us/library/bb145128.aspx).
- ///
- /// IDebugSymbolSettings100: (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugsymbolsettings100.aspx).
- ///
- /// Comments:
- /// Process "Is a container for a set of programs".
- /// "A debug engine (DE) attaches to a program, and not to a process or a thread".
- /// Program "Is a container for both a set of threads and a set of modules.".
- ///
- [ComVisible(true)]
- [Guid("904AA6E0-942C-4D11-9094-7BAAEB3EE4B9")]
- public class AD7Engine : IDebugEngine2, IDebugEngineLaunch2, IDebugProgram3, IDebugEngineProgram2, IDebugSymbolSettings100
- {
-
- ///
- /// Used to send events to the debugger. Some examples of these events are thread create, exception thrown, module load.
- ///
- EngineCallback m_engineCallback = null;
- internal EngineCallback Callback
- {
- get { return m_engineCallback; }
- }
-
-
- ///
- /// This object manages breakpoints in the sample engine.
- ///
- protected BreakpointManager m_breakpointManager = null;
- public BreakpointManager BPMgr
- {
- get { return m_breakpointManager; }
- }
-
-
- ///
- /// This object manages debug events in the engine.
- ///
- protected EventDispatcher m_eventDispatcher = null;
- public EventDispatcher eDispatcher
- {
- get { return m_eventDispatcher; }
- }
-
-
- ///
- /// A unique identifier for the program being debugged.
- ///
- Guid m_programGUID;
-
- ///
- /// A module loaded in the debuggee process to the debugger. It is always null because the AD7Module class is
- /// not implemented yet.
- ///
- internal AD7Module m_module = null;
-
- ///
- /// A process running on a port. A process "Is a container for a set of programs".
- ///
- public AD7Process m_process = null;
-
- ///
- /// A program that can be debugged.
- ///
- public AD7ProgramNode m_progNode = null;
-
- ///
- /// A program that is running in a process.
- ///
- internal IDebugProgram2 m_program = null;
-
- ///
- /// TRUE whenever a thread is created/ended, so the debug engine can update the m_threads data structure.
- ///
- public bool _updateThreads = false;
-
- ///
- /// Array of threads of the program that is being debugged.
- ///
- private AD7Thread[] m_threads = null;
- public AD7Thread[] thread
- {
- get { return m_threads; }
- }
-
- ///
- /// The position in the m_threads array that corresponds to the current thread.
- ///
- public int _currentThreadIndex = -1;
-
-
- ///
- /// Allows IDE to show current position in a source file
- ///
- public AD7DocumentContext m_docContext = null;
-
-
- ///
- /// Used to avoid race condition when there are conditional breakpoints and the user hit break all. Both events will pause
- /// the Debug Engine, but the one related to conditional breakpoint can resume execution. If both events happens at the same
- /// time, the Debug Engine could resume the execution instead of pausing it.
- ///
- public ManualResetEvent m_running = new ManualResetEvent(true);
-
-
- ///
- /// Used to avoid race condition when there are conditional breakpoints and a breakpoint is hit. This situation is similar to the above one.
- ///
- public ManualResetEvent m_updatingConditionalBreakpoint = new ManualResetEvent(true);
-
-
- ///
- /// This is the engine GUID of the VSNDK debug engine. It needs to be changed here and in the registration when creating a
- /// new engine.
- ///
- public const string Id = "{E5A37609-2F43-4830-AA85-D94CFA035DD2}";
-
-
- ///
- /// Keeps track of debug engine states
- ///
- public enum DE_STATE
- {
- DESIGN_MODE = 0,
- RUN_MODE,
- BREAK_MODE,
- STEP_MODE,
- DONE
- }
- public DE_STATE m_state = 0;
-
-
- ///
- /// Constructor.
- ///
- public AD7Engine()
- {
- m_breakpointManager = new BreakpointManager(this);
- m_state = DE_STATE.DESIGN_MODE;
- }
-
-
- ///
- /// Destructor.
- ///
- ~AD7Engine()
- {
- // Transition DE state
- m_state = AD7Engine.DE_STATE.DONE;
- }
-
- #region IDebugEngine2 Members
-
-
- ///
- /// Attach the debug engine to a program. (http://msdn.microsoft.com/en-us/library/bb145136.aspx)
- ///
- /// Represent programs to be attached to. These are port programs.
- /// Represent program nodes, one for each program. The program nodes in this array represent
- /// the same programs as in pProgram. The program nodes are given so that the DE can identify the programs to attach to.
- /// Number of programs and/or program nodes in the pProgram and rgpProgramNodes arrays.
- /// The IDebugEventCallback2 object to be used to send debug events to the SDM.
- /// A value from the ATTACH_REASON enumeration that specifies the reason for attaching these programs.
- /// If successful, returns S_OK; otherwise, returns an error code.
- int IDebugEngine2.Attach(IDebugProgram2[] rgpPrograms, IDebugProgramNode2[] rgpProgramNodes, uint aCeltPrograms, IDebugEventCallback2 ad7Callback, enum_ATTACH_REASON dwReason)
- {
-
- if (aCeltPrograms != 1)
- {
- System.Diagnostics.Debug.Fail("VSNDK Debugger only supports one debug target at a time.");
- throw new ArgumentException();
- }
-
- try
- {
- EngineUtils.RequireOk(rgpPrograms[0].GetProgramId(out m_programGUID));
-
- m_program = rgpPrograms[0];
-
- // It is NULL when the user attached the debugger to a running process (by using Attach to Process UI). When that
- // happens, some objects must be instantiated, as well as GDB must be launched. Those ones are instantiated/launched
- // by LaunchSuspended and ResumeProcess methods when debugging an open project.
- if (this.m_engineCallback == null)
- {
- VSNDK.Package.ControlDebugEngine.isDebugEngineRunning = true;
- m_engineCallback = new EngineCallback(this, ad7Callback);
-
- AD7ProgramNodeAttach pnt = (AD7ProgramNodeAttach)m_program;
- m_process = pnt.m_process;
- AD7Port port = pnt.m_process._portAttach;
- string publicKeyPath = Environment.GetEnvironmentVariable("AppData") + @"\BlackBerry\bbt_id_rsa.pub";
- string progName = pnt.m_programName.Substring(pnt.m_programName.LastIndexOf('/') + 1);
-
- string exePath = "";
- string processesPaths = "";
- System.IO.StreamReader readProcessesPathsFile = null;
- // Read the file ProcessesPath.txt to try to get the file location of the executable file.
- try
- {
- readProcessesPathsFile = new System.IO.StreamReader(System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\ProcessesPath.txt");
- processesPaths = readProcessesPathsFile.ReadToEnd();
- readProcessesPathsFile.Close();
- }
- catch (Exception e)
- {
- processesPaths = "";
- }
-
- string searchProgName = progName + "_" + port.m_isSimulator;
- int begin = processesPaths.IndexOf(searchProgName + ":>");
-
- if (begin != -1)
- {
- begin += searchProgName.Length + 2;
- int end = processesPaths.IndexOf("\r\n", begin);
-
- exePath = processesPaths.Substring(begin, end - begin) + progName;
- }
- else
- {
- exePath = "CannotAttachToRunningProcess";
- }
-
- exePath = exePath.Replace("\\", "\\\\\\\\");
-
- if (GDBParser.LaunchProcess(pnt.m_programID, exePath, port.m_IP, port.m_isSimulator, port.m_toolsPath, publicKeyPath, port.m_password))
- {
- if (exePath == "CannotAttachToRunningProcess")
- {
- MessageBox.Show(progName + " is attached to the debugger. However, to be able to debug your application, you must build and deploy it from this computer first.", "No executable file with symbols found.", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- m_eventDispatcher = new EventDispatcher(this);
- m_module = new AD7Module();
- m_progNode = new AD7ProgramNode(m_process._processGUID, m_process._processID, exePath, new Guid(AD7Engine.Id));
- AddThreadsToProgram();
- }
- else
- {
- GDBParser.exitGDB();
- VSNDK.Package.ControlDebugEngine.isDebugEngineRunning = false;
- return VSConstants.E_FAIL;
- }
- }
- AD7EngineCreateEvent.Send(this);
- AD7ProgramCreateEvent.Send(this);
- AD7ModuleLoadEvent.Send(this, m_module, true);
- AD7LoadCompleteEvent.Send(this, currentThread());
-
- // If the reason for attaching is ATTACH_REASON_LAUNCH, the DE needs to send the IDebugEntryPointEvent2 event.
- // See http://msdn.microsoft.com/en-us/library/bb145136%28v=vs.100%29.aspx
- if (dwReason == enum_ATTACH_REASON.ATTACH_REASON_LAUNCH)
- {
- AD7EntryPointEvent ad7Event = new AD7EntryPointEvent();
- Guid riidEvent = new Guid(AD7EntryPointEvent.IID);
- uint attributes = (uint)enum_EVENTATTRIBUTES.EVENT_STOPPING | (uint)enum_EVENTATTRIBUTES.EVENT_SYNCHRONOUS;
- int rc = ad7Callback.Event(this, null, m_program, currentThread(), ad7Event, ref riidEvent, attributes);
- Debug.Assert(rc == VSConstants.S_OK);
- }
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Requests that all programs being debugged by this DE stop execution the next time one of their threads attempts to run.
- /// This is normally called in response to the user clicking on the pause button in the debugger. When the break is complete,
- /// an AsyncBreakComplete event will be sent back to the debugger. (http://msdn.microsoft.com/en-us/library/bb145141.aspx)
- ///
- /// VSConstants.S_OK.
- int IDebugEngine2.CauseBreak()
- {
- // If not already broken, send the interrupt
- if (m_state != DE_STATE.DESIGN_MODE && m_state != DE_STATE.BREAK_MODE && m_state != DE_STATE.STEP_MODE)
- {
- bool signalReceived;
- bool hitBreakAll;
- if (EventDispatcher.m_GDBRunMode == true)
- {
- HandleProcessExecution.m_mre.Reset();
- hitBreakAll = m_running.WaitOne();
-
- // Sends the GDB command that interrupts the background execution of the target.
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
- GDBParser.addGDBCommand(@"-exec-interrupt");
-
- // Ensure the process is interrupted before returning
- signalReceived = HandleProcessExecution.m_mre.WaitOne(1000);
-
- m_running.Set();
-
- if (VSNDK.Package.ControlDebugEngine.isDebugEngineRunning)
- HandleProcessExecution.m_mre.Reset();
- }
- }
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Called by the SDM to indicate that a synchronous debug event, previously sent by the DE to the SDM,
- /// was received and processed. The only event the VSNDK Debug Engine sends in this fashion is Program Destroy.
- /// It responds to that event by shutting down the engine. (http://msdn.microsoft.com/en-us/library/bb160915.aspx)
- ///
- /// Represents the previously sent synchronous event from which the debugger should now continue.
- /// If successful, returns S_OK; otherwise, returns an error code.
- int IDebugEngine2.ContinueFromSynchronousEvent(IDebugEvent2 eventObject)
- {
- try
- {
- if (eventObject is AD7ProgramDestroyEvent)
- {
- resetStackFrames();
- m_process.Detach();
- m_process = null;
-
- m_program.Detach();
- m_program = null;
-
- m_engineCallback = null;
- m_breakpointManager = null;
- m_docContext = null;
- m_eventDispatcher = null;
- m_module = null;
- m_progNode = null;
- m_programGUID = Guid.Empty;
-
- m_threads = null;
- GC.Collect();
- }
- else
- {
- Debug.Fail("Unknown synchronous event");
- }
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
-
- if (m_eventDispatcher != null)
- m_eventDispatcher.continueExecution();
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Creates a pending breakpoint in the Debug Engine. A pending breakpoint is essentially a collection of all the information
- /// needed to bind a breakpoint to code. (http://msdn.microsoft.com/en-us/library/bb147033.aspx)
- ///
- /// An IDebugBreakpointRequest2 object that describes the pending breakpoint to create.
- /// Returns an IDebugPendingBreakpoint2 object that represents the pending breakpoint.
- /// If successful, returns S_OK; otherwise, returns an error code.
- int IDebugEngine2.CreatePendingBreakpoint(IDebugBreakpointRequest2 pBPRequest, out IDebugPendingBreakpoint2 ppPendingBP)
- {
- Debug.Assert(m_breakpointManager != null);
- ppPendingBP = null;
-
- try
- {
- m_breakpointManager.CreatePendingBreakpoint(pBPRequest, out ppPendingBP);
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Informs a DE that the program specified has been atypically terminated and that the DE should clean up all references
- /// to the program and send a program destroy event. (http://msdn.microsoft.com/en-us/library/bb145073.aspx)
- ///
- /// An IDebugProgram2 object that represents the program that has been atypically terminated.
- /// AD7_HRESULT.E_PROGRAM_DESTROY_PENDING.
- int IDebugEngine2.DestroyProgram(IDebugProgram2 pProgram)
- {
- // Tell the SDM that the engine knows that the program is exiting, and that the
- // engine will send a program destroy. We do this because the Win32 debug api will always
- // tell us that the process exited, and otherwise we have a race condition.
-
- return (AD7_HRESULT.E_PROGRAM_DESTROY_PENDING);
- }
-
-
- ///
- /// Gets the GUID of the DE. (http://msdn.microsoft.com/en-us/library/bb145079.aspx)
- ///
- /// Returns the GUID of the DE.
- /// VSConstants.S_OK.
- int IDebugEngine2.GetEngineId(out Guid guidEngine)
- {
- guidEngine = new Guid(Id);
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Removes the list of exceptions the IDE has set for a particular run-time architecture or language. The VSNDK debug engine
- /// does not support exceptions in the debuggee so this method is not actually implemented.
- /// (http://msdn.microsoft.com/en-us/library/bb145134.aspx)
- ///
- /// Either the GUID for the language or the GUID for the debug engine that is specific to a run-time
- /// architecture.
- /// VSConstants.S_OK.
- int IDebugEngine2.RemoveAllSetExceptions(ref Guid guidType)
- {
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Removes the specified exception so it is no longer handled by the debug engine. The VSNDK debug engine does not support
- /// exceptions in the debuggee so this method is not actually implemented. (http://msdn.microsoft.com/en-us/library/bb161697.aspx)
- ///
- /// An EXCEPTION_INFO structure that describes the exception to be removed.
- /// VSConstants.S_OK.
- int IDebugEngine2.RemoveSetException(EXCEPTION_INFO[] pException)
- {
- // The VSNDK debug engine will always stop on all exceptions.
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Specifies how the DE should handle a given exception. The VSNDK debug engine does not support exceptions in the debuggee
- /// so this method is not actually implemented. (http://msdn.microsoft.com/en-us/library/bb162170.aspx)
- ///
- /// An EXCEPTION_INFO structure that describes the exception and how to debug it.
- /// VSConstants.S_OK.
- int IDebugEngine2.SetException(EXCEPTION_INFO[] pException)
- {
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Sets the locale of the DE. This method is called by the session debug manager (SDM) to propagate the locale settings
- /// of the IDE so that strings returned by the DE are properly localized. The sample engine is not localized so this is
- /// not implemented. (http://msdn.microsoft.com/en-us/library/bb161784.aspx)
- ///
- /// Specifies the language locale.
- /// VSConstants.S_OK.
- int IDebugEngine2.SetLocale(ushort wLangID)
- {
- return VSConstants.S_OK;
- }
-
-
- ///
- /// A metric is a registry value used to change a debug engine's behavior or to advertise supported functionality.
- /// This method can forward the call to the appropriate form of the Debugging SDK Helpers function, SetMetric.
- /// (http://msdn.microsoft.com/en-us/library/bb161968.aspx)
- ///
- /// The metric name.
- /// Specifies the metric value.
- /// VSConstants.S_OK.
- int IDebugEngine2.SetMetric(string pszMetric, object varValue)
- {
- // The VSNDK debug engine does not need to understand any metric settings.
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Sets the registry root currently in use by the DE. Different installations of Visual Studio can change where their
- /// registry information is stored. This allows the debugger to tell the engine where that location is.
- /// (http://msdn.microsoft.com/en-us/library/bb161800.aspx)
- ///
- /// The registry root to use.
- /// VSConstants.S_OK.
- int IDebugEngine2.SetRegistryRoot(string pszRegistryRoot)
- {
- // The VSNDK debug engine does not read settings from the registry.
- return VSConstants.S_OK;
- }
-
- #endregion
-
- #region IDebugEngineLaunch2 Members
-
-
- ///
- /// Determines if a process can be terminated. (http://msdn.microsoft.com/en-us/library/bb146673.aspx)
- ///
- /// An IDebugProcess2 object that represents the process to be terminated.
- /// VSConstants.S_OK.
- int IDebugEngineLaunch2.CanTerminateProcess(IDebugProcess2 process)
- {
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Launches a process by means of the debug engine. (http://msdn.microsoft.com/en-us/library/bb146223.aspx)
- ///
- /// The name of the machine in which to launch the process. Use a null value to specify the local
- /// machine. Or it should be the name of the server?
- /// The IDebugPort2 interface representing the port that the program will run in.
- /// The name of the executable to be launched.
- /// The arguments to pass to the executable. May be a null value if there are no arguments.
- /// The name of the working directory used by the executable. May be a null value if no working directory is
- /// required.
- /// Environment block of NULL-terminated strings, followed by an additional NULL terminator.
- /// The options for the executable.
- /// Specifies the LAUNCH_FLAGS for a session.
- /// Handle to an alternate input stream. May be 0 if redirection is not required.
- /// Handle to an alternate output stream. May be 0 if redirection is not required.
- /// Handle to an alternate error output stream. May be 0 if redirection is not required.
- /// The IDebugEventCallback2 object that receives debugger events.
- /// Returns the resulting IDebugProcess2 object that represents the launched process.
- /// If successful, returns S_OK; otherwise, returns an error code.
- int IDebugEngineLaunch2.LaunchSuspended(string pszServer, IDebugPort2 port, string exe, string args, string dir, string env, string options, enum_LAUNCH_FLAGS launchFlags, uint hStdInput, uint hStdOutput, uint hStdError, IDebugEventCallback2 ad7Callback, out IDebugProcess2 process)
- {
- Debug.Assert(m_programGUID == Guid.Empty);
-
- process = null;
-
- try
- {
- VSNDK.Package.ControlDebugEngine.isDebugEngineRunning = true;
- m_engineCallback = new EngineCallback(this, ad7Callback);
-
- // Read arguments back from the args string
- var nvc = new NameValueCollection();
- NameValueCollectionHelper.LoadFromString(nvc, args);
-
- string pid = nvc.GetValues("pid")[0];
- string exePath = exe;
- string targetIP = nvc.GetValues("targetIP")[0];
- bool isSimulator = Convert.ToBoolean(nvc.GetValues("isSimulator")[0]);
- string toolsPath = nvc.GetValues("ToolsPath")[0];
- string publicKeyPath = nvc.GetValues("PublicKeyPath")[0];
-
- string password = null;
- string[] passwordArray = nvc.GetValues("Password");
- if (passwordArray != null)
- password = passwordArray[0];
-
- if (GDBParser.LaunchProcess(pid, exePath, targetIP, isSimulator, toolsPath, publicKeyPath, password))
- {
- process = m_process = new AD7Process(this, port);
- m_eventDispatcher = new EventDispatcher(this);
- m_programGUID = m_process._processGUID;
- m_module = new AD7Module();
-// m_progNode = new AD7ProgramNode(m_process.PhysID, pid, exePath, new Guid(AD7Engine.Id));
- m_progNode = new AD7ProgramNode(m_process._processGUID, pid, exePath, new Guid(AD7Engine.Id));
- AddThreadsToProgram();
-
- AD7EngineCreateEvent.Send(this);
-
- return VSConstants.S_OK;
- }
- else
- {
- GDBParser.exitGDB();
- VSNDK.Package.ControlDebugEngine.isDebugEngineRunning = false;
- return VSConstants.E_FAIL;
- }
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
- }
-
-
- ///
- /// Resume a process launched by IDebugEngineLaunch2.LaunchSuspended. (http://msdn.microsoft.com/en-us/library/bb146261.aspx)
- ///
- /// An IDebugProcess2 object that represents the process to be resumed.
- /// An IDebugProcess2 object that represents the process to be resumed.
- int IDebugEngineLaunch2.ResumeProcess(IDebugProcess2 process)
- {
- Debug.Assert(m_engineCallback != null);
-
- try
- {
- var xProcess = process as AD7Process;
- if (xProcess == null)
- {
- return VSConstants.E_INVALIDARG;
- }
-
- // Send a program node to the SDM. This will cause the SDM to turn around and call IDebugEngine2.Attach
- // which will complete the hookup with AD7
- IDebugPort2 port = null;
- EngineUtils.RequireOk(process.GetPort(out port));
-
- IDebugDefaultPort2 defaultPort = (IDebugDefaultPort2)port;
-
- IDebugPortNotify2 portNotify = null;
- EngineUtils.RequireOk(defaultPort.GetPortNotify(out portNotify));
-
- EngineUtils.RequireOk(portNotify.AddProgramNode(m_progNode));
-
- Callback.OnModuleLoad(m_module);
-
- Callback.OnThreadStart(currentThread());
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
- return VSConstants.S_OK;
- }
-
-
- ///
- /// This function is used to terminate a process. (http://msdn.microsoft.com/en-us/library/bb162314.aspx)
- /// The debugger will call IDebugEngineLaunch2::CanTerminateProcess before calling this method.
- ///
- /// An IDebugProcess2 object that represents the process to be terminated.
- /// VSConstants.S_OK.
- int IDebugEngineLaunch2.TerminateProcess(IDebugProcess2 process)
- {
- CauseBreak();
- if (eDispatcher != null)
- {
- eDispatcher.killProcess();
- eDispatcher.endDebugSession(0);
- }
-
- return VSConstants.S_OK;
- }
-
- #endregion
-
- #region IDebugProgram2 Members
-
-
- ///
- /// Determines if a debug engine (DE) can detach from the program. (http://msdn.microsoft.com/en-us/library/bb161967.aspx)
- ///
- /// VSConstants.S_OK.
- public int CanDetach()
- {
- // The VSNDK debug engine always supports detach
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Requests that the program stop execution the next time one of its threads attempts to run. The debugger calls CauseBreak
- /// when the user clicks on the pause button in VS. The debugger should respond by entering breakmode.
- /// (http://msdn.microsoft.com/en-us/library/bb145018.aspx)
- ///
- /// VSConstants.S_OK.
- public int CauseBreak()
- {
- return ((IDebugEngine2)this).CauseBreak();
- }
-
-
- ///
- /// Continues running this program from a stopped state. Any previous execution state (such as a step) is preserved, and
- /// the program starts executing again. (http://msdn.microsoft.com/en-us/library/bb162148.aspx)
- ///
- /// An IDebugThread2 object that represents the thread.
- /// VSConstants.S_OK.
- public int Continue(IDebugThread2 pThread)
- {
- m_eventDispatcher.continueExecution();
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Detaches a debug engine from the program. (http://msdn.microsoft.com/en-us/library/bb146228.aspx)
- ///
- /// VSConstants.S_OK.
- public int Detach()
- {
- CauseBreak();
- if (m_breakpointManager != null)
- m_breakpointManager.ClearBoundBreakpoints(); // TODO: Check if active bound BP list needs to be updated too?
-
- if (eDispatcher != null)
- eDispatcher.endDebugSession(0);
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Retrieves a list of the code contexts for a given position in a source file. Not implemented.
- /// (http://msdn.microsoft.com/en-us/library/bb145902.aspx)
- ///
- /// An object representing an abstract position in a source file known to the IDE.
- /// Returns an IEnumDebugCodeContexts2 object that contains a list of the code contexts.
- /// Not implemented.
- public int EnumCodeContexts(IDebugDocumentPosition2 pDocPos, out IEnumDebugCodeContexts2 ppEnum)
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Retrieves a list of the code paths for a given position in a source file. EnumCodePaths is used for the step-into specific
- /// feature -- right click on the current statement and decide which function to step into. This is not something that the
- /// VSNDK debug engine supports. (http://msdn.microsoft.com/en-us/library/bb162326.aspx)
- ///
- /// The word under the cursor in the Source or Disassembly view in the IDE.
- /// An IDebugCodeContext2 object representing the current code context.
- /// An IDebugStackFrame2 object representing the stack frame associated with the current breakpoint.
- /// Nonzero (TRUE) if in the Source view, or zero (FALSE) if in the Disassembly view.
- /// Returns an IEnumCodePaths2 object containing a list of the code paths.
- /// Returns an IDebugCodeContext2 object representing an additional code context to be set as a
- /// breakpoint in case the chosen code path is skipped. This can happen in the case of a short-circuited Boolean expression,
- /// for example.
- /// VSConstants.E_NOTIMPL.
- public int EnumCodePaths(string hint, IDebugCodeContext2 start, IDebugStackFrame2 frame, int fSource, out IEnumCodePaths2 pathEnum, out IDebugCodeContext2 safetyContext)
- {
- pathEnum = null;
- safetyContext = null;
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// Retrieves a list of the modules that this program has loaded and is executing.
- /// (http://msdn.microsoft.com/en-us/library/bb146980.aspx)
- ///
- /// Returns an IEnumDebugModules2 object that contains a list of the modules.
- /// VSConstants.S_OK.
- public int EnumModules(out IEnumDebugModules2 ppEnum)
- {
- ppEnum = new AD7ModuleEnum(new[] { m_module });
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Retrieves a list of the threads that are running in the program. (http://msdn.microsoft.com/en-us/library/bb145110.aspx)
- ///
- /// Returns an IEnumDebugThreads2 object that contains a list of the threads.
- /// If successful, returns S_OK; otherwise, returns an error code.
- public int EnumThreads(out IEnumDebugThreads2 ppEnum)
- {
- AD7Thread[] listThreads = null;
- int currentThread = GetListOfThreads(out listThreads);
-
- // the following code seems to be weird but I had to update each field of this.m_process._threads because, when using
- // "this.m_process._threads = listThreads;" without having a new thread, VS starts to duplicate the existing threads
- // and, as a consequence, the call stack entries too.
-
- if ((currentThread == -1) || (listThreads == null))
- {
- ppEnum = null;
- return VSConstants.S_FALSE;
- }
-
- if (listThreads.Length != this.m_threads.Length)
- {
- foreach (AD7Thread t in this.m_threads)
- {
- AD7ThreadDestroyEvent.Send(this, 0, t);
- }
- this.m_threads = null;
- this.m_threads = new AD7Thread[listThreads.Length];
- this.m_threads = listThreads;
- this._currentThreadIndex = currentThread;
- foreach (AD7Thread t in this.m_threads)
- {
- m_engineCallback.OnThreadStart(t);
- }
- ppEnum = new AD7ThreadEnum(this.m_threads);
- }
- else
- {
- if (this._currentThreadIndex != currentThread)
- {
- this._currentThreadIndex = currentThread;
- }
-
- for (int i = 0; i < listThreads.Length; i++)
- {
- if (this.m_threads[i]._engine != listThreads[i]._engine)
- {
- this.m_threads[i]._engine = listThreads[i]._engine;
- }
- if (this.m_threads[i]._threadDisplayName != listThreads[i]._threadDisplayName)
- {
- this.m_threads[i]._threadDisplayName = listThreads[i]._threadDisplayName;
- }
- if (this.m_threads[i]._id != listThreads[i]._id)
- {
- this.m_threads[i]._id = listThreads[i]._id;
- }
- if (this.m_threads[i]._state != listThreads[i]._state)
- {
- this.m_threads[i]._state = listThreads[i]._state;
- }
- if (this.m_threads[i]._targetID != listThreads[i]._targetID)
- {
- this.m_threads[i]._targetID = listThreads[i]._targetID;
- }
- if (this.m_threads[i]._priority != listThreads[i]._priority)
- {
- this.m_threads[i]._priority = listThreads[i]._priority;
- }
- if (this.m_threads[i]._line != listThreads[i]._line)
- {
- this.m_threads[i]._line = listThreads[i]._line;
- }
- if (this.m_threads[i]._filename != listThreads[i]._filename)
- {
- if (listThreads[i]._filename == "")
- this.m_threads[i]._filename = "";
- else
- this.m_threads[i]._filename = listThreads[i]._filename;
- }
- }
-
- ppEnum = new AD7ThreadEnum(this.m_threads);
- }
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the program's properties. The VSNDK debug engine does not support this.
- /// (http://msdn.microsoft.com/en-us/library/bb161801.aspx)
- ///
- /// Returns an IDebugProperty2 object that represents the program's properties.
- /// Not implemented.
- public int GetDebugProperty(out IDebugProperty2 ppProperty)
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Gets the disassembly stream for this program or a part of this program.
- /// The sample engine does not support dissassembly so it returns E_NOTIMPL
- ///
- /// Specifies a value from the DISASSEMBLY_STREAM_SCOPE enumeration that defines the scope of the
- /// disassembly stream.
- /// An object that represents the position of where to start the disassembly stream.
- /// Returns an IDebugDisassemblyStream2 object that represents the disassembly stream.
- /// VSConstants.E_NOTIMPL.
- public int GetDisassemblyStream(enum_DISASSEMBLY_STREAM_SCOPE dwScope, IDebugCodeContext2 codeContext, out IDebugDisassemblyStream2 disassemblyStream)
- {
- disassemblyStream = null;
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// This method gets the Edit and Continue (ENC) update for this program. A custom debug engine always returns E_NOTIMPL
- ///
- /// Returns an internal interface that can be used to update this program.
- /// VSConstants.S_OK.
- public int GetENCUpdate(out object update)
- {
- // The VSNDK debug engine does not participate in managed edit & continue.
- update = null;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the name and GUID of the debug engine running this program. (http://msdn.microsoft.com/en-us/library/bb145854.aspx)
- ///
- /// Returns the name of the DE running this program.
- /// Returns the GUID of the DE running this program.
- /// VSConstants.S_OK.
- public int GetEngineInfo(out string engineName, out Guid engineGuid)
- {
- engineName = "VSNDK Debug Engine";
- engineGuid = new Guid(AD7Engine.Id);
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Retrieves the memory bytes occupied by the program. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145291.aspx)
- ///
- /// Returns an IDebugMemoryBytes2 object that represents the memory bytes of the program.
- /// Not implemented.
- public int GetMemoryBytes(out IDebugMemoryBytes2 ppMemoryBytes)
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Gets the name of the program. The name returned by this method is always a friendly, user-displayable name that describes
- /// the program. (http://msdn.microsoft.com/en-us/library/bb161279.aspx)
- ///
- /// Returns the name of the program.
- /// VSConstants.S_OK.
- public int GetName(out string programName)
- {
- if (this.m_progNode != null)
- programName = this.m_progNode.m_programName;
- else
- programName = null;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets a GUID for this program. A debug engine (DE) must return the program identifier originally passed to the
- /// IDebugProgramNodeAttach2::OnAttach or IDebugEngine2::Attach methods. This allows identification of the program
- /// across debugger components. (http://msdn.microsoft.com/en-us/library/bb145581.aspx)
- ///
- /// Returns the GUID for this program.
- /// VSConstants.S_OK.
- public int GetProgramId(out Guid guidProgramId)
- {
- if (m_programGUID != null)
- guidProgramId = m_programGUID;
- else
- guidProgramId = m_process._processGUID;
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Performs a step. This method is deprecated. Use the IDebugProcess3::Step method instead.
- /// (http://msdn.microsoft.com/en-us/library/bb162134.aspx)
- ///
- /// An IDebugThread2 object that represents the thread being stepped.
- /// A value from the STEPKIND enumeration that specifies the kind of step.
- /// A value from the STEPUNIT enumeration that specifies the unit of step.
- /// If successful, returns S_OK; otherwise, returns an error code.
- public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
- {
- // Don't allow stepping through unknown code because it can lead to future problems with stepping and break-all.
- if (VSNDK.DebugEngine.EventDispatcher.m_unknownCode)
- {
- m_state = AD7Engine.DE_STATE.STEP_MODE;
- m_eventDispatcher.continueExecution();
-
- return VSConstants.S_OK;
- }
-
- if (sk == enum_STEPKIND.STEP_INTO)
- {
- // Equivalent to F11 hotkey.
- // Sends the GDB command that resumes the execution of the inferior program, stopping at the next instruction, diving
- // into function if it is a function call. (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
- GDBParser.addGDBCommand("-exec-step --thread " + this.m_threads[this._currentThreadIndex]._id);
- }
- else if (sk == enum_STEPKIND.STEP_OVER)
- {
- // Equivalent to F10 hotkey.
- // Sends the GDB command that resumes the execution of the inferior program, stopping at the next instruction, but
- // without diving into functions. (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
- GDBParser.addGDBCommand("-exec-next --thread " + this.m_threads[this._currentThreadIndex]._id);
- }
- else if (sk == enum_STEPKIND.STEP_OUT)
- {
- // Equivalent to Shift-F11 hotkey.
- if (eDispatcher.getStackDepth(this.m_threads[this._currentThreadIndex]._id) > 1)
- {
- // Sends the GDB command that resumes the execution of the inferior program until the current function is exited.
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
- GDBParser.addGDBCommand("-exec-finish --thread " + this.m_threads[this._currentThreadIndex]._id + " --frame 0");
- }
- else
- {
- // If this the only frame left, do a step-over.
- // Sends the GDB command that resumes the execution of the inferior program, stopping at the next instruction, but
- // without diving into functions. (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
- GDBParser.addGDBCommand("-exec-next --thread " + this.m_threads[this._currentThreadIndex]._id);
- }
- }
- else if (sk == enum_STEPKIND.STEP_BACKWARDS)
- {
- return VSConstants.E_NOTIMPL;
- }
- else
- {
- m_engineCallback.OnStepComplete(); // Have to call this otherwise VS gets "stuck"
- }
-
- // Transition DE state
- m_state = AD7Engine.DE_STATE.STEP_MODE;
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Terminates the program. (http://msdn.microsoft.com/en-us/library/bb145919.aspx)
- ///
- /// VSConstants.S_OK.
- public int Terminate()
- {
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Writes a dump to a file. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145827.aspx)
- ///
- /// A value from the DUMPTYPE enumeration that specifies the type of dump, for example, short or
- /// long.
- /// The URL to write the dump to. Typically, this is in the form of file://c:\path\filename.ext,
- /// but may be any valid URL.
- /// VSConstants.E_NOTIMPL.
- public int WriteDump(enum_DUMPTYPE DUMPTYPE, string pszDumpUrl)
- {
- // The VSNDK debugger does not support creating or reading mini-dumps.
- return VSConstants.E_NOTIMPL;
- }
-
- #endregion
-
- #region IDebugProgram3 Members
-
-
- ///
- /// Executes the debugger program. The thread is returned to give the debugger information on which thread the user is
- /// viewing when executing the program. ExecuteOnThread is called when the SDM wants execution to continue and have
- /// stepping state cleared. (http://msdn.microsoft.com/en-us/library/bb145596.aspx)
- ///
- /// An IDebugThread2 object.
- /// VSConstants.S_OK.
- public int ExecuteOnThread(IDebugThread2 pThread)
- {
- m_eventDispatcher.continueExecution();
-
- return VSConstants.S_OK;
- }
-
- #endregion
-
- #region IDebugEngineProgram2 Members
-
-
- ///
- /// Stops all threads running in this program. This method is called when this program is being debugged in a multi-program
- /// environment. When a stopping event from some other program is received, this method is called on this program. The
- /// implementation of this method should be asynchronous; that is, not all threads should be required to be stopped before
- /// this method returns. The implementation of this method may be as simple as calling the IDebugProgram2::CauseBreak method
- /// on this program. Not implemented. (http://msdn.microsoft.com/en-us/library/bb146567.aspx)
- ///
- /// The VSNDK debug engine only supports debugging native applications and therefore only has one program per-process
- ///
- /// VSConstants.E_NOTIMPL.
- public int Stop()
- {
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// Allows (or disallows) expression evaluation to occur on the given thread, even if the program has stopped.
- /// WatchForExpressionEvaluationOnThread is used to cooperate between two different engines debugging the same process.
- /// The VSNDK debug engine doesn't cooperate with other engines, so it has nothing to do here.
- /// (http://msdn.microsoft.com/en-us/library/bb144913.aspx)
- ///
- /// An IDebugProgram2 object representing the program that is evaluating an expression.
- /// Specifies the identifier of the thread.
- /// A combination of flags from the EVALFLAGS enumeration that specify how the evaluation is to be
- /// performed.
- /// An IDebugEventCallback2 object to be used to send debug events that occur during expression
- /// evaluation.
- /// If non-zero (TRUE), allows expression evaluation on the thread identified by dwTid; otherwise, zero
- /// (FALSE) disallows expression evaluation on that thread.
- /// VSConstants.S_OK.
- public int WatchForExpressionEvaluationOnThread(IDebugProgram2 pOriginatingProgram, uint dwTid, uint dwEvalFlags, IDebugEventCallback2 pExprCallback, int fWatch)
- {
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Watches for execution (or stops watching for execution) to occur on the given thread. WatchForThreadStep is used to
- /// cooperate between two different engines debugging the same process. The VSNDK debug engine doesn't cooperate with other
- /// engines, so it has nothing to do here. (http://msdn.microsoft.com/en-us/library/bb161406.aspx)
- ///
- /// An IDebugProgram2 object representing the program being stepped.
- /// Specifies the identifier of the thread to watch.
- /// Non-zero (TRUE) means start watching for execution on the thread identified by dwTid; otherwise,
- /// zero (FALSE) means stop watching for execution on dwTid.
- /// Specifies a frame index that controls the step type.
- /// VSConstants.S_OK.
- public int WatchForThreadStep(IDebugProgram2 pOriginatingProgram, uint dwTid, int fWatch, uint dwFrame)
- {
- return VSConstants.S_OK;
- }
-
- #endregion
-
- #region IDebugSymbolSettings100 members
-
-
- ///
- /// The SDM will call this method on the debug engine when it is created, to notify it of the user's
- /// symbol settings in Tools->Options->Debugging->Symbols. (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugsymbolsettings100.setsymbolloadstate.aspx)
- ///
- /// true if 'Automatically load symbols: Only for specified modules' is checked.
- /// true if 'Specify modules'->'Always load symbols next to the modules' is checked.
- /// semicolon-delimited list of modules when automatically loading 'Only specified modules'
- /// semicolon-delimited list of modules when automatically loading 'All modules, unless excluded'
- /// VSConstants.S_OK.
- public int SetSymbolLoadState(int bIsManual, int bLoadAdjacent, string strIncludeList, string strExcludeList)
- {
- return VSConstants.S_OK;
- }
- #endregion
-
- #region Thread methods
-
-
- ///
- /// Verify if the stack frame information specified by "flags" were already evaluated.
- ///
- /// Thread ID.
- /// Specifies the information to verify about a stack frame object.
- /// If successful, returns TRUE; otherwise, returns FALSE.
- public bool evaluatedTheseFlags(string threadId, enum_FRAMEINFO_FLAGS flags)
- {
- if (this.thread != null)
- {
- int currentFlags = Convert.ToInt32(flags);
- int i = 0;
- // looking for the "threadId" thread.
- for (; i < this.thread.Length; i++)
- {
- if (this.thread[i]._id == threadId)
- break;
- }
- if (i < this.thread.Length)
- {
- if (this.thread[i]._alreadyEvaluated == currentFlags)
- {
- // This stack frame information were already evaluated.
- return true;
- }
- else
- {
- // This stack frame information were not evaluated before. Modifying the _alreadyEvaluated flag.
- this.thread[i]._alreadyEvaluated = currentFlags;
- }
- }
- }
- return false;
- }
-
-
- ///
- /// Clean the "flags" data (_alreadyEvaluated) that are stored in each thread without resetting the stack frames. This operation
- /// must be done whenever the stack frames for a given thread have to be evaluated, like when the user changes the current frame
- /// or when he wants to investigate different threads in break mode, for example.
- ///
- public void cleanEvaluatedThreads()
- {
- if (this.thread != null)
- {
- for (int i = 0; i < this.thread.Length; i++)
- {
- this.thread[i]._alreadyEvaluated = 0;
- }
- }
- }
-
-
- ///
- /// Reset stack frames for each thread. This operation must be performed before changing the state to break mode, like when a
- /// breakpoint is hit, for example.
- ///
- public void resetStackFrames()
- {
- foreach (AD7Thread t in m_threads)
- {
- if (t.__stackFrames != null)
- {
- t.__stackFrames.Clear();
- t.__stackFrames = null;
- }
- }
- }
-
-
- ///
- /// Update the list of threads. This operation must be performed whenever the list of threads changes (a thread exits or is
- /// created) and before entering in break mode.
- ///
- public void UpdateListOfThreads()
- {
- foreach (AD7Thread t in this.m_threads)
- {
- // Send events to VS to destroy its current debugged threads.
- AD7ThreadDestroyEvent.Send(this, 0, t);
- }
-
- this.m_threads = null;
- // Get the current list of threads and store them into a temporary variable listThreads.
- this._currentThreadIndex = GetListOfThreads(out this.m_threads);
-
- if ((this._currentThreadIndex == -1) || (this.m_threads == null))
- return;
-
- // Send events to VS to add this list of debugged threads.
- foreach (AD7Thread t in this.m_threads)
- {
- m_engineCallback.OnThreadStart(t);
- }
-
- this._updateThreads = false;
- }
-
-
- ///
- /// Get the list of threads being debugged, also returning the index of the current thread (or -1 in case of error)
- ///
- /// Returns the current list of threads that are being debugged.
- /// Returns the index of the current thread in the list of threads (or -1 in case of error)
- public int GetListOfThreads(out AD7Thread[] threadObjects)
- {
- // Gets the parsed response for the GDB/MI command that ask for information about all threads.
- // (http://www.sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Thread-Commands.html)
- string threadResponse = GDBParser.parseCommand(@"-thread-info", 22);
- string[] threadStrings = threadResponse.Split('#');
- cleanEvaluatedThreads();
-
- // Query the threads depth without inquiring GDB.
- int numThreads = threadStrings.Length - 1; // the last item in threadStrings is not a thread but the current thread ID.
- string currentThread = threadStrings[threadStrings.Length - 1];
- if (numThreads < 1)
- {
- threadObjects = null;
- return -1;
- }
-
- try
- {
- threadObjects = new AD7Thread[numThreads];
- int currentThreadIndex = -1;
-
- for (int i = 0; i < numThreads; i++)
- {
- string[] threadInfo = threadStrings[i].Split(';');
-
- // Setting the current thread index.
- if (currentThread == threadInfo[0])
- {
- currentThreadIndex = i;
- }
-
- // Each threadInfo has one of these two formats:
- // with 5 elements: ID; State; targetID; details (not used); name -> this format is normally used for external code.
- // with 7 elements: ID; State; targetID; details (not used); full short-path filename; line; name
- if (threadInfo.Length > 5)
- threadObjects[i] = new AD7Thread(this, threadInfo[0], threadInfo[2], threadInfo[1], "Normal", threadInfo[6], threadInfo[4], threadInfo[5]);
- else
- threadObjects[i] = new AD7Thread(this, threadInfo[0], threadInfo[2], threadInfo[1], "Normal", threadInfo[4], "", "");
- }
- return currentThreadIndex;
- }
- catch (ComponentException e)
- {
- threadObjects = null;
- return -1;
- }
- catch (Exception e)
- {
- threadObjects = null;
- return -1;
- }
- }
-
-
- ///
- /// Returns the current thread.
- ///
- /// If successful, returns the current thread; otherwise, returns NULL.
- public AD7Thread currentThread()
- {
- if (_currentThreadIndex != -1)
- return m_threads[_currentThreadIndex];
- return null;
- }
-
-
- ///
- /// Returns the thread data structure with a given ID.
- ///
- /// The ID of the thread to search for.
- /// If successful, returns the selected thread; otherwise, returns NULL.
- public AD7Thread selectThread(string id)
- {
- for (int i = 0; i < this.m_threads.Length; i++)
- {
- if (this.m_threads[i]._id == id)
- return (m_threads[i]);
- }
- return null;
- }
-
-
- ///
- /// Set a given thread as the current one.
- ///
- /// The ID of the thread.
- public void setAsCurrentThread(string id)
- {
- for (int i = 0; i < this.m_threads.Length; i++)
- {
- if (this.m_threads[i]._id == id)
- {
- this._currentThreadIndex = i;
- break;
- }
- }
- }
-
-
- ///
- /// Add threads for a program when lauching it and the debugger (IDebugEngineLaunch2.LaunchSuspended).
- ///
- /// VSConstants.S_OK.
- public int AddThreadsToProgram()
- {
- m_threads = null;
- _currentThreadIndex = GetListOfThreads(out m_threads);
- if (_currentThreadIndex != -1)
- {
- foreach (AD7Thread t in m_threads)
- {
- m_engineCallback.OnThreadStart(t);
- }
- }
- else
- m_engineCallback.OnThreadStart(null);
- return VSConstants.S_OK;
- }
-
- #endregion
-
- #region Deprecated interface methods
- // These methods are not called by the Visual Studio debugger, so they don't need to be implemented
-
-
- ///
- /// Retrieves a list of all programs being debugged by a debug engine (DE). Not implemented.
- /// (http://msdn.microsoft.com/en-us/library/bb146175.aspx)
- ///
- /// Returns an object that contains a list of all programs being debugged by a DE.
- /// VSConstants.E_NOTIMPL.
- int IDebugEngine2.EnumPrograms(out IEnumDebugPrograms2 programs)
- {
- Debug.Fail("This function is not called by the debugger");
-
- programs = null;
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// Attaches to the program. Not implemented. (http://msdn.microsoft.com/en-us/library/bb161973.aspx)
- ///
- /// An IDebugEventCallback2 object to be used for debug event notification.
- /// VSConstants.E_NOTIMPL.
- public int Attach(IDebugEventCallback2 pCallback)
- {
- Debug.Fail("This function is not called by the debugger");
-
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// Get the process that this program is running in. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145293.aspx)
- ///
- /// Returns the IDebugProcess2 interface that represents the process.
- /// VSConstants.E_NOTIMPL.
- public int GetProcess(out IDebugProcess2 process)
- {
- Debug.Fail("This function is not called by the debugger");
-
- process = null;
- return VSConstants.E_NOTIMPL;
- }
-
-
- /// TODO: Verify if this method is called or not by VS.
- /// Continues running this program from a stopped state. Any previous execution state (such as a step) is cleared, and the
- /// program starts executing again. (http://msdn.microsoft.com/en-us/library/bb162315.aspx)
- ///
- /// VSConstants.S_OK.
- public int Execute()
- {
- m_eventDispatcher.continueExecution();
- return VSConstants.S_OK;
- }
-
- #endregion
- }
-}
-
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7Enums.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7Enums.cs
deleted file mode 100644
index c41da31b..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7Enums.cs
+++ /dev/null
@@ -1,438 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-
-
-namespace VSNDK.DebugEngine
-{
- #region Base Class
-
-
- ///
- /// These classes use a generic enumerator implementation to create the various enumerators required by the engine.
- /// They allow the enumeration of everything from programs to breakpoints.
- ///
- /// Array of T elements.
- /// Enumerator interface.
- class AD7Enum where I: class
- {
- readonly T[] m_data;
- uint m_position;
-
-
- ///
- /// Constructor.
- ///
- /// Array of T elements.
- public AD7Enum(T[] data)
- {
- m_data = data;
- m_position = 0;
- }
-
-
- ///
- /// Returns a copy of the current enumeration as a separate object. Not implemented.
- ///
- /// Returns a copy of this enumeration as a separate object.
- /// Not implemented.
- public int Clone(out I ppEnum)
- {
- ppEnum = null;
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// Returns the number of elements in the enumeration.
- ///
- /// Returns the number of elements in the enumeration.
- /// VSConstants.S_OK.
- public int GetCount(out uint pcelt)
- {
- pcelt = (uint)m_data.Length;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Returns the next set of elements from the enumeration.
- ///
- /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
- /// Array of T elements to be filled in.
- /// Returns the number of elements actually returned in rgelt.
- /// If successful, returns S_OK. If not, returns S_FALSE.
- public int Next(uint celt, T[] rgelt, out uint celtFetched)
- {
- return Move(celt, rgelt, out celtFetched);
- }
-
-
- ///
- /// Resets the enumeration to the first element.
- ///
- /// VSConstants.S_OK.
- public int Reset()
- {
- lock (this)
- {
- m_position = 0;
-
- return VSConstants.S_OK;
- }
- }
-
-
- ///
- /// Skips over the specified number of elements.
- ///
- /// Number of elements to skip.
- /// If successful, returns S_OK. If not, returns S_FALSE.
- public int Skip(uint celt)
- {
- uint celtFetched;
-
- return Move(celt, null, out celtFetched);
- }
-
-
- ///
- /// Returns/Skips over the specified number of elements.
- ///
- /// Number of elements to retrieve/skip.
- /// Array of T elements to be filled in.
- /// Returns the number of elements actually returned/skipped in rgelt.
- /// If successful, returns S_OK. If not, returns S_FALSE.
- private int Move(uint celt, T[] rgelt, out uint celtFetched)
- {
- lock (this)
- {
- int hr = VSConstants.S_OK;
- celtFetched = (uint)m_data.Length - m_position;
-
- if (celt > celtFetched)
- {
- hr = VSConstants.S_FALSE;
- }
- else if (celt < celtFetched)
- {
- celtFetched = celt;
- }
-
- if (rgelt != null)
- {
- for (int c = 0; c < celtFetched; c++)
- {
- rgelt[c] = m_data[m_position + c];
- }
- }
-
- m_position += celtFetched;
-
- return hr;
- }
- }
- }
- #endregion Base Class
-
-
-
-
- ///
- /// This class enumerates the processes running on a debug port. (http://msdn.microsoft.com/en-ca/library/bb145005.aspx)
- ///
- class AD7ProcessEnum : AD7Enum, IEnumDebugProcesses2
- {
-
- ///
- /// Constructor.
- ///
- /// Array of IDebugProcess2 elements.
- public AD7ProcessEnum(IDebugProcess2[] data)
- : base(data)
- {
- }
-
-
- ///
- /// Returns the next set of elements from the enumeration. (http://msdn.microsoft.com/en-ca/library/bb147027.aspx)
- ///
- /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
- /// Array of IDebugProcess2 elements to be filled in.
- /// Returns the number of elements actually returned in rgelt.
- /// If successful, returns S_OK. If not, returns S_FALSE.
- public int Next(uint celt, IDebugProcess2[] rgelt, ref uint celtFetched)
- {
- return Next(celt, rgelt, out celtFetched);
- }
- }
-
-
- ///
- /// This class enumerates the ports of a machine or port supplier. (http://msdn.microsoft.com/en-ca/library/bb145137.aspx)
- ///
- class AD7PortEnum : AD7Enum, IEnumDebugPorts2
- {
-
- ///
- /// Constructor.
- ///
- /// Array of IDebugPort2 elements.
- public AD7PortEnum(IDebugPort2[] data)
- : base(data)
- {
- }
-
-
- ///
- /// Returns the next set of elements from the enumeration. (http://msdn.microsoft.com/en-ca/library/bb147027.aspx)
- ///
- /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
- /// Array of IDebugPort2 elements to be filled in.
- /// Returns the number of elements actually returned in rgelt.
- /// If successful, returns S_OK. If not, returns S_FALSE.
- public int Next(uint celt, IDebugPort2[] rgelt, ref uint celtFetched)
- {
- return Next(celt, rgelt, out celtFetched);
- }
- }
-
-
-
-
- ///
- /// This class enumerates the programs running in the current debug session. (http://msdn.microsoft.com/en-ca/library/bb146727.aspx)
- ///
- class AD7ProgramEnum : AD7Enum, IEnumDebugPrograms2
- {
-
- ///
- /// Constructor.
- ///
- /// Array of IDebugProgram2 elements.
- public AD7ProgramEnum(IDebugProgram2[] data) : base(data)
- {
- }
-
-
- ///
- /// Returns the next set of elements from the enumeration. (http://msdn.microsoft.com/en-ca/library/bb147027.aspx)
- ///
- /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
- /// Array of IDebugProgram2 elements to be filled in.
- /// Returns the number of elements actually returned in rgelt.
- /// If successful, returns S_OK. If not, returns S_FALSE.
- public int Next(uint celt, IDebugProgram2[] rgelt, ref uint celtFetched)
- {
- return Next(celt, rgelt, out celtFetched);
- }
- }
-
-
- ///
- /// This class enumerates FRAMEINFO structures. (http://msdn.microsoft.com/en-us/library/bb147119.aspx)
- ///
- class AD7FrameInfoEnum : AD7Enum, IEnumDebugFrameInfo2
- {
-
- ///
- /// Constructor.
- ///
- /// Array of FRAMEINFO elements.
- public AD7FrameInfoEnum(FRAMEINFO[] data)
- : base(data)
- {
- }
-
-
- ///
- /// Returns the next set of elements from the enumeration. (http://msdn.microsoft.com/en-us/library/bb146293.aspx)
- ///
- /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
- /// Array of FRAMEINFO elements to be filled in.
- /// Returns the number of elements actually returned in rgelt.
- /// If successful, returns S_OK. If not, returns S_FALSE.
- public int Next(uint celt, FRAMEINFO[] rgelt, ref uint celtFetched)
- {
- return Next(celt, rgelt, out celtFetched);
- }
- }
-
-
- ///
- /// This class enumerates DEBUG_PROPERTY_INFO structures. (http://msdn.microsoft.com/en-ca/library/bb162336.aspx)
- ///
- class AD7PropertyInfoEnum : AD7Enum, IEnumDebugPropertyInfo2
- {
-
- ///
- /// Constructor.
- ///
- /// Array of DEBUG_PROPERTY_INFO elements.
- public AD7PropertyInfoEnum(DEBUG_PROPERTY_INFO[] data)
- : base(data)
- {
- }
- }
-
-
- ///
- /// This class enumerates the threads running in the current debug session. (http://msdn.microsoft.com/en-ca/library/bb145142.aspx)
- ///
- class AD7ThreadEnum : AD7Enum, IEnumDebugThreads2
- {
-
- ///
- /// Constructor.
- ///
- /// Array of IDebugThread2 elements.
- public AD7ThreadEnum(IDebugThread2[] threads)
- : base(threads)
- {
-
- }
-
-
- ///
- /// Returns the next set of elements from the enumeration. (http://msdn.microsoft.com/en-ca/library/bb161679.aspx)
- ///
- /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
- /// Array of IDebugThread2 elements to be filled in.
- /// Returns the number of elements actually returned in rgelt.
- /// If successful, returns S_OK. If not, returns S_FALSE.
- public int Next(uint celt, IDebugThread2[] rgelt, ref uint celtFetched)
- {
- return Next(celt, rgelt, out celtFetched);
- }
- }
-
-
- ///
- /// This class enumerates a list of modules. (http://msdn.microsoft.com/en-ca/library/bb145925.aspx)
- ///
- class AD7ModuleEnum : AD7Enum, IEnumDebugModules2
- {
-
- ///
- /// Constructor.
- ///
- /// Array of IDebugModule2 elements.
- public AD7ModuleEnum(IDebugModule2[] modules)
- : base(modules)
- {
-
- }
-
-
- ///
- /// Returns the next set of elements from the enumeration. (http://msdn.microsoft.com/en-ca/library/bb145898.aspx)
- ///
- /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
- /// Array of IDebugModule2 elements to be filled in.
- /// Returns the number of elements actually returned in rgelt.
- /// If successful, returns S_OK. If not, returns S_FALSE.
- public int Next(uint celt, IDebugModule2[] rgelt, ref uint celtFetched)
- {
- return Next(celt, rgelt, out celtFetched);
- }
- }
-
-
- ///
- /// This class enumerates DEBUG_PROPERTY_INFO structures. (http://msdn.microsoft.com/en-ca/library/bb162336.aspx)
- ///
- class AD7PropertyEnum : AD7Enum, IEnumDebugPropertyInfo2
- {
-
- ///
- /// Constructor.
- ///
- /// Array of DEBUG_PROPERTY_INFO elements.
- public AD7PropertyEnum(DEBUG_PROPERTY_INFO[] properties)
- : base(properties)
- {
-
- }
- }
-
-
- ///
- /// This class enumerates the code contexts associated with the debug session, or with a particular program or document.
- /// (http://msdn.microsoft.com/en-us/library/bb146612.aspx)
- ///
- class AD7CodeContextEnum : AD7Enum, IEnumDebugCodeContexts2
- {
-
- ///
- /// Constructor.
- ///
- /// Array of IDebugCodeContext2 elements.
- public AD7CodeContextEnum(IDebugCodeContext2[] codeContexts)
- : base(codeContexts)
- {
-
- }
-
-
- ///
- /// Returns the next set of elements from the enumeration. ()http://msdn.microsoft.com/en-us/library/bb145085.aspx
- ///
- /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
- /// Array of IDebugCodeContext2 elements to be filled in.
- /// Returns the number of elements actually returned in rgelt.
- /// If successful, returns S_OK. If not, returns S_FALSE.
- public int Next(uint celt, IDebugCodeContext2[] rgelt, ref uint celtFetched)
- {
- return Next(celt, rgelt, out celtFetched);
- }
- }
-
-
- ///
- /// This class enumerates the bound breakpoints associated with a pending breakpoint or breakpoint bound event.
- /// (http://msdn.microsoft.com/en-ca/library/bb162182.aspx)
- ///
- class AD7BoundBreakpointsEnum : AD7Enum, IEnumDebugBoundBreakpoints2
- {
-
- ///
- /// Constructor.
- ///
- /// Array of IDebugBoundBreakpoint2 elements.
- public AD7BoundBreakpointsEnum(IDebugBoundBreakpoint2[] breakpoints)
- : base(breakpoints)
- {
-
- }
-
-
- ///
- /// Returns the next set of elements from the enumeration. (http://msdn.microsoft.com/en-ca/library/bb161772.aspx)
- ///
- /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
- /// Array of IDebugBoundBreakpoint2 elements to be filled in.
- /// Returns the number of elements actually returned in rgelt.
- /// If successful, returns S_OK. If not, returns S_FALSE.
- public int Next(uint celt, IDebugBoundBreakpoint2[] rgelt, ref uint celtFetched)
- {
- return Next(celt, rgelt, out celtFetched);
- }
- }
-
-}
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7Events.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7Events.cs
deleted file mode 100644
index 7588337b..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7Events.cs
+++ /dev/null
@@ -1,767 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-
-// This file contains the various event objects that are sent to the debugger from the VSNDK debug engine via IDebugEventCallback2::Event.
-// These are used in EngineCallback.cs.
-// The events are how the engine tells the debugger about what is happening in the debuggee process.
-// There are four base classes the other events derive from: AD7AsynchronousEvent, AD7StoppingEvent, AD7SynchronousEvent and
-// AD7SynchronousStoppingEvent. Each of them implements the IDebugEvent2.GetAttributes method for the type of event they represent.
-// Most events sent by the debugger are asynchronous ones.
-
-namespace VSNDK.DebugEngine
-{
- #region Event base classes
-
-
- ///
- /// Used to communicate both critical debug information and non-critical information.
- /// (http://msdn.microsoft.com/en-us/library/bb161977.aspx)
- ///
- class AD7AsynchronousEvent : IDebugEvent2
- {
- public const uint Attributes = (uint)enum_EVENTATTRIBUTES.EVENT_ASYNCHRONOUS;
-
-
- ///
- /// Gets the attributes for this debug event. (http://msdn.microsoft.com/en-us/library/bb145575.aspx)
- ///
- /// A combination of flags from the enum_EVENTATTRIBUTES enumeration.
- /// VSConstants.S_OK.
- int IDebugEvent2.GetAttributes(out uint eventAttributes)
- {
- eventAttributes = Attributes;
- return VSConstants.S_OK;
- }
- }
-
-
- ///
- /// Used to communicate both critical debug information and non-critical information.
- /// (http://msdn.microsoft.com/en-us/library/bb161977.aspx)
- ///
- class AD7StoppingEvent : IDebugEvent2
- {
- public const uint Attributes = (uint)enum_EVENTATTRIBUTES.EVENT_ASYNC_STOP;
-
-
- ///
- /// Gets the attributes for this debug event. (http://msdn.microsoft.com/en-us/library/bb145575.aspx)
- ///
- /// A combination of flags from the enum_EVENTATTRIBUTES enumeration.
- /// VSConstants.S_OK.
- int IDebugEvent2.GetAttributes(out uint eventAttributes)
- {
- eventAttributes = Attributes;
- return VSConstants.S_OK;
- }
- }
-
-
- ///
- /// Used to communicate both critical debug information and non-critical information.
- /// (http://msdn.microsoft.com/en-us/library/bb161977.aspx)
- ///
- class AD7SynchronousEvent : IDebugEvent2
- {
- public const uint Attributes = (uint)enum_EVENTATTRIBUTES.EVENT_SYNCHRONOUS;
-
-
- ///
- /// Gets the attributes for this debug event. (http://msdn.microsoft.com/en-us/library/bb145575.aspx)
- ///
- /// A combination of flags from the enum_EVENTATTRIBUTES enumeration.
- /// VSConstants.S_OK.
- int IDebugEvent2.GetAttributes(out uint eventAttributes)
- {
- eventAttributes = Attributes;
- return VSConstants.S_OK;
- }
- }
-
-
- ///
- /// Used to communicate both critical debug information and non-critical information.
- /// (http://msdn.microsoft.com/en-us/library/bb161977.aspx)
- ///
- class AD7SynchronousStoppingEvent : IDebugEvent2
- {
- public const uint Attributes = (uint)enum_EVENTATTRIBUTES.EVENT_STOPPING | (uint)enum_EVENTATTRIBUTES.EVENT_SYNCHRONOUS;
-
-
- ///
- /// Gets the attributes for this debug event. (http://msdn.microsoft.com/en-us/library/bb145575.aspx)
- ///
- /// A combination of flags from the enum_EVENTATTRIBUTES enumeration.
- /// VSConstants.S_OK.
- int IDebugEvent2.GetAttributes(out uint eventAttributes)
- {
- eventAttributes = Attributes;
- return VSConstants.S_OK;
- }
- }
-
- #endregion
-
-
- ///
- /// The debug engine (DE) sends this interface to the session debug manager (SDM) when an instance of the DE is created.
- /// (http://msdn.microsoft.com/en-us/library/bb145830.aspx)
- ///
- sealed class AD7EngineCreateEvent : AD7AsynchronousEvent, IDebugEngineCreateEvent2
- {
- public const string IID = "FE5B734C-759D-4E59-AB04-F103343BDD06";
- private IDebugEngine2 m_engine;
-
-
- ///
- /// Constructor.
- ///
- /// The AD7Engine object that represents the DE.
- AD7EngineCreateEvent(AD7Engine engine)
- {
- m_engine = engine;
- }
-
-
- ///
- /// Sends the event.
- ///
- /// The AD7Engine object that represents the DE.
- public static void Send(AD7Engine engine)
- {
- AD7EngineCreateEvent eventObject = new AD7EngineCreateEvent(engine);
- engine.Callback.Send(eventObject, IID, null, null);
- }
-
-
- ///
- /// Retrieves the object that represents the newly created debug engine (DE).
- /// (http://msdn.microsoft.com/en-us/library/bb145143.aspx)
- ///
- /// Returns an AD7Engine object that represents the newly created DE.
- /// VSConstants.S_OK.
- int IDebugEngineCreateEvent2.GetEngine(out IDebugEngine2 engine)
- {
- engine = m_engine;
-
- return VSConstants.S_OK;
- }
- }
-
-
- ///
- /// This interface is sent when a process is launched. (http://msdn.microsoft.com/en-ca/library/bb161755.aspx)
- ///
- class AD7ProcessCreateEvent : IDebugEvent2, IDebugProcessCreateEvent2
- {
- private Guid IID = new Guid("9020DEE3-362D-4FF2-8CA9-8F6791F0EC85");
- public const uint Attributes = (uint)enum_EVENTATTRIBUTES.EVENT_IMMEDIATE;
-
- ///
- /// Gets the GUID of this event.
- ///
- /// Returns the GUID of this event.
- public Guid getGuid()
- {
- return IID;
- }
-
- ///
- /// Gets the attributes for this debug event. (http://msdn.microsoft.com/en-us/library/bb145575.aspx)
- ///
- /// A combination of flags from the enum_EVENTATTRIBUTES enumeration.
- /// VSConstants.S_OK.
- int IDebugEvent2.GetAttributes(out uint eventAttributes)
- {
- eventAttributes = Attributes;
- return VSConstants.S_OK;
- }
- }
-
-
- ///
- /// This interface is sent when a process is terminated, exits atypically, or is detached from.
- /// (http://msdn.microsoft.com/en-us/library/bb145152.aspx)
- ///
- class AD7ProcessDestroyEvent : IDebugEvent2, IDebugProcessDestroyEvent2
- {
- private Guid IID = new Guid("29DAA0AC-C718-4F93-A11E-6D15681476C7");
- public const uint Attributes = (uint)enum_EVENTATTRIBUTES.EVENT_IMMEDIATE;
-
- ///
- /// Gets the GUID of this event.
- ///
- /// Returns the GUID of this event.
- public Guid getGuid()
- {
- return IID;
- }
-
- ///
- /// Gets the attributes for this debug event. (http://msdn.microsoft.com/en-us/library/bb145575.aspx)
- ///
- /// A combination of flags from the enum_EVENTATTRIBUTES enumeration.
- /// VSConstants.S_OK.
- int IDebugEvent2.GetAttributes(out uint eventAttributes)
- {
- eventAttributes = Attributes;
- return VSConstants.S_OK;
- }
- }
-
-
- ///
- /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a program is attached to.
- /// (http://msdn.microsoft.com/en-ca/library/bb161345.aspx)
- ///
- sealed class AD7ProgramCreateEvent : AD7AsynchronousEvent, IDebugProgramCreateEvent2
- {
- public const string IID = "96CD11EE-ECD4-4E89-957E-B5D496FC4139";
-
-
- ///
- /// Sends the event.
- ///
- /// The AD7Engine object that represents the DE.
- internal static void Send(AD7Engine engine)
- {
- AD7ProgramCreateEvent eventObject = new AD7ProgramCreateEvent();
- engine.Callback.Send(eventObject, IID, null);
- }
- }
-
-
- ///
- /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when asynchronous expression evaluation
- /// is complete. (http://msdn.microsoft.com/en-ca/library/bb161810.aspx)
- ///
- sealed class AD7ExpressionEvaluationCompleteEvent : AD7AsynchronousEvent, IDebugExpressionEvaluationCompleteEvent2
- {
- public const string IID = "C0E13A85-238A-4800-8315-D947C960A843";
- private readonly IDebugExpression2 m_expression;
- private readonly IDebugProperty2 m_property;
-
-
- ///
- /// Constructor.
- ///
- /// The IDebugExpression2 object that represents the expression.
- /// The IDebugProperty2 object that represents the result of the expression evaluation.
- public AD7ExpressionEvaluationCompleteEvent(IDebugExpression2 expression, IDebugProperty2 property)
- {
- this.m_expression = expression;
- this.m_property = property;
- }
-
-
- ///
- /// Gets the original expression. (http://msdn.microsoft.com/en-ca/library/bb162323.aspx)
- ///
- /// Returns an IDebugExpression2 object that represents the expression that was parsed.
- /// VSConstants.S_OK.
- public int GetExpression(out IDebugExpression2 ppExpr)
- {
- ppExpr = m_expression;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the result of expression evaluation. (http://msdn.microsoft.com/en-ca/library/bb161962.aspx)
- ///
- /// Returns an IDebugProperty2 object that represents the result of the expression evaluation.
- /// VSConstants.S_OK.
- public int GetResult(out IDebugProperty2 ppResult)
- {
- ppResult = m_property;
- return VSConstants.S_OK;
- }
- }
-
-
- ///
- /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a module is loaded or unloaded.
- /// (http://msdn.microsoft.com/en-ca/library/bb146706.aspx)
- ///
- sealed class AD7ModuleLoadEvent : AD7AsynchronousEvent, IDebugModuleLoadEvent2
- {
- public const string IID = "989DB083-0D7C-40D1-A9D9-921BF611A4B2";
-
- readonly AD7Module m_module;
- readonly bool m_fLoad;
-
-
- ///
- /// Constructor.
- ///
- /// The IDebugModule2 object that represents the module which is loading or unloading.
- /// onzero (TRUE) if the module is loading and zero (FALSE) if the module is unloading.
- public AD7ModuleLoadEvent(AD7Module module, bool fLoad)
- {
- m_module = module;
- m_fLoad = fLoad;
- }
-
-
- ///
- /// Gets the module that is being loaded or unloaded. (http://msdn.microsoft.com/en-ca/library/bb161763.aspx)
- ///
- /// Returns an IDebugModule2 object that represents the module which is loading or unloading.
- /// Returns an optional message describing this event. If this parameter is a null value, no message
- /// is requested.
- /// Nonzero (TRUE) if the module is loading and zero (FALSE) if the module is unloading. If this
- /// parameter is a null value, no status is requested.
- /// VSConstants.S_OK.
- int IDebugModuleLoadEvent2.GetModule(out IDebugModule2 module, ref string debugMessage, ref int fIsLoad)
- {
- module = m_module;
-
- if (m_fLoad)
- {
- fIsLoad = 1;
- }
- else
- {
- fIsLoad = 0;
- }
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Sends the event.
- ///
- /// The AD7Engine object that represents the DE.
- /// The IDebugModule2 object that represents the module which is loading or unloading.
- /// onzero (TRUE) if the module is loading and zero (FALSE) if the module is unloading.
- internal static void Send(AD7Engine engine, AD7Module aModule, bool fLoad)
- {
- var eventObject = new AD7ModuleLoadEvent(aModule, fLoad);
- engine.Callback.Send(eventObject, IID, null);
- }
- }
-
-
- ///
- /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a program has run to completion
- /// or is otherwise destroyed. (http://msdn.microsoft.com/en-ca/library/bb161972.aspx)
- ///
- sealed class AD7ProgramDestroyEvent : AD7SynchronousEvent, IDebugProgramDestroyEvent2
- {
- public const string IID = "E147E9E3-6440-4073-A7B7-A65592C714B5";
-
- readonly uint m_exitCode;
-
-
- ///
- /// Constructor.
- ///
- /// The program's exit code.
- public AD7ProgramDestroyEvent(uint exitCode)
- {
- m_exitCode = exitCode;
- }
-
- #region IDebugProgramDestroyEvent2 Members
-
-
- ///
- /// Gets the program's exit code. (http://msdn.microsoft.com/en-ca/library/bb146724.aspx)
- ///
- /// Returns the program's exit code.
- /// VSConstants.S_OK.
- int IDebugProgramDestroyEvent2.GetExitCode(out uint exitCode)
- {
- exitCode = m_exitCode;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Sends the event.
- ///
- /// The AD7Engine object that represents the DE.
- /// The program's exit code.
- internal static void Send(AD7Engine engine, uint exitCode)
- {
- var eventObject = new AD7ProgramDestroyEvent(exitCode);
- engine.Callback.Send(eventObject, IID, null);
- }
-
- #endregion
- }
-
-
- ///
- /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a thread is created in a program
- /// being debugged. (http://msdn.microsoft.com/en-ca/library/bb161327.aspx)
- ///
- sealed class AD7ThreadCreateEvent : AD7AsynchronousEvent, IDebugThreadCreateEvent2
- {
- public const string IID = "2090CCFC-70C5-491D-A5E8-BAD2DD9EE3EA";
- }
-
-
- ///
- /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a thread has run to completion.
- /// (http://msdn.microsoft.com/en-ca/library/bb162330.aspx)
- ///
- sealed class AD7ThreadDestroyEvent : AD7AsynchronousEvent, IDebugThreadDestroyEvent2
- {
- public const string IID = "2C3B7532-A36F-4A6E-9072-49BE649B8541";
-
- readonly uint m_exitCode;
-
-
- ///
- /// Constructor.
- ///
- /// The thread's exit code.
- public AD7ThreadDestroyEvent(uint exitCode)
- {
- m_exitCode = exitCode;
- }
-
- #region IDebugThreadDestroyEvent2 Members
-
-
- ///
- /// Gets the exit code for a thread. (http://msdn.microsoft.com/en-ca/library/bb146996.aspx)
- ///
- /// Returns the thread's exit code.
- /// VSConstants.S_OK.
- int IDebugThreadDestroyEvent2.GetExitCode(out uint exitCode)
- {
- exitCode = m_exitCode;
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Sends the event.
- ///
- /// The AD7Engine object that represents the DE.
- /// The thread's exit code.
- /// The AD7Thread object that represents the thread.
- internal static void Send(AD7Engine engine, uint exitCode, AD7Thread thread)
- {
- var eventObject = new AD7ThreadDestroyEvent(exitCode);
- if (thread == null)
- {
- foreach (AD7Thread t in engine.thread)
- {
- engine.Callback.Send(eventObject, IID, t);
- }
- engine._currentThreadIndex = -1;
- }
- else
- {
- engine.Callback.Send(eventObject, IID, thread);
- }
- }
-
- #endregion
- }
-
-
- ///
- /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a program is loaded, but before
- /// any code is executed. (http://msdn.microsoft.com/en-ca/library/bb145834.aspx)
- ///
- sealed class AD7LoadCompleteEvent : AD7StoppingEvent, IDebugLoadCompleteEvent2
- {
- public const string IID = "B1844850-1349-45D4-9F12-495212F5EB0B";
-
-
- ///
- /// Constructor.
- ///
- public AD7LoadCompleteEvent()
- {
- }
-
-
- ///
- /// Sends the event.
- ///
- /// The AD7Engine object that represents the DE.
- /// The AD7Thread object that represents the thread.
- internal static void Send(AD7Engine aEngine, AD7Thread aThread)
- {
- var xMessage = new AD7LoadCompleteEvent();
- aEngine.Callback.Send(xMessage, IID, aThread);
- }
- }
-
-
- ///
- /// This interface tells the session debug manager (SDM) that an asynchronous break has been successfully completed.
- /// (http://msdn.microsoft.com/en-ca/library/bb146180.aspx)
- ///
- sealed class AD7AsyncBreakCompleteEvent : AD7StoppingEvent, IDebugBreakEvent2
- {
- public const string IID = "c7405d1d-e24b-44e0-b707-d8a5a4e1641b";
- }
-
-
- ///
- /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) to output a string.
- /// (http://msdn.microsoft.com/en-ca/library/bb146756.aspx)
- ///
- sealed class AD7OutputDebugStringEvent : AD7AsynchronousEvent, IDebugOutputStringEvent2
- {
- public const string IID = "569c4bb1-7b82-46fc-ae28-4536ddad753e";
-
- private string m_str;
-
-
- ///
- /// Constructor.
- ///
- /// The displayable message.
- public AD7OutputDebugStringEvent(string str)
- {
- m_str = str;
- }
-
- #region IDebugOutputStringEvent2 Members
-
- ///
- /// Gets the displayable message. (http://msdn.microsoft.com/en-ca/library/bb162293.aspx)
- ///
- /// Returns the displayable message.
- /// VSConstants.S_OK.
- int IDebugOutputStringEvent2.GetString(out string pbstrString)
- {
- pbstrString = m_str;
- return VSConstants.S_OK;
- }
-
- #endregion
- }
-
-
- ///
- /// This interface is sent by the debug engine (DE) to indicate that the debugging symbols for a module being debugged have
- /// been loaded. (http://msdn.microsoft.com/en-ca/library/bb160924.aspx)
- ///
- sealed class AD7SymbolSearchEvent : AD7AsynchronousEvent, IDebugSymbolSearchEvent2
- {
- public const string IID = "638F7C54-C160-4c7b-B2D0-E0337BC61F8C";
-
- private AD7Module m_module;
- private string m_searchInfo;
- private uint m_symbolFlags;
-
-
- ///
- /// Constructor.
- ///
- /// The AD7Module object representing the module for which the symbols were loaded.
- /// The string containing any error messages from the module.
- /// A combination of flags from the MODULE_INFO_FLAGS enumeration indicating whether any
- /// symbols were loaded.
- public AD7SymbolSearchEvent(AD7Module module, string searchInfo, uint symbolFlags)
- {
- m_module = module;
- m_searchInfo = searchInfo;
- m_symbolFlags = symbolFlags;
- }
-
- #region IDebugSymbolSearchEvent2 Members
-
- ///
- /// Called by an event handler to retrieve results about a symbol load process.
- /// (http://msdn.microsoft.com/en-ca/library/bb161324.aspx)
- ///
- /// An IDebugModule3 object representing the module for which the symbols were loaded.
- /// Returns a string containing any error messages from the module. If there is no error,
- /// then this string will just contain the module's name but it is never empty.
- /// A combination of flags from the MODULE_INFO_FLAGS enumeration indicating whether any
- /// symbols were loaded.
- /// VSConstants.S_OK.
- int IDebugSymbolSearchEvent2.GetSymbolSearchInfo(out IDebugModule3 pModule, ref string pbstrDebugMessage, enum_MODULE_INFO_FLAGS[] pdwModuleInfoFlags)
- {
- pModule = m_module;
- pbstrDebugMessage = m_searchInfo;
- pdwModuleInfoFlags[0] = (enum_MODULE_INFO_FLAGS)m_symbolFlags;
-
- return VSConstants.S_OK;
- }
-
- #endregion
- }
-
-
- ///
- /// This interface tells the session debug manager (SDM) that a pending breakpoint has been successfully bound to a loaded program.
- /// (http://msdn.microsoft.com/en-us/library/bb145356.aspx)
- ///
- sealed class AD7BreakpointBoundEvent : AD7AsynchronousEvent, IDebugBreakpointBoundEvent2
- {
- public const string IID = "1dddb704-cf99-4b8a-b746-dabb01dd13a0";
-
- private AD7PendingBreakpoint m_pendingBreakpoint;
- private AD7BoundBreakpoint m_boundBreakpoint;
-
-
- ///
- /// Constructor.
- ///
- /// The AD7PendingBreakpoint object that represents the pending breakpoint being bound.
- /// The AD7BoundBreakpoint object that represents the breakpoint being bound.
- public AD7BreakpointBoundEvent(AD7PendingBreakpoint pendingBreakpoint, AD7BoundBreakpoint boundBreakpoint)
- {
- m_pendingBreakpoint = pendingBreakpoint;
- m_boundBreakpoint = boundBreakpoint;
- }
-
- #region IDebugBreakpointBoundEvent2 Members
-
- ///
- /// Creates an enumerator of breakpoints that were bound on this event. (http://msdn.microsoft.com/en-us/library/bb145322.aspx)
- ///
- /// Returns an IEnumDebugBoundBreakpoints2 object that enumerates all the breakpoints bound from
- /// this event.
- /// VSConstants.S_OK.
- int IDebugBreakpointBoundEvent2.EnumBoundBreakpoints(out IEnumDebugBoundBreakpoints2 ppEnum)
- {
- IDebugBoundBreakpoint2[] boundBreakpoints = new IDebugBoundBreakpoint2[1];
- boundBreakpoints[0] = m_boundBreakpoint;
- ppEnum = new AD7BoundBreakpointsEnum(boundBreakpoints);
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the pending breakpoint that is being bound. (http://msdn.microsoft.com/en-us/library/bb146558.aspx)
- ///
- /// Returns the IDebugPendingBreakpoint2 object that represents the pending breakpoint being
- /// bound.
- /// VSConstants.S_OK.
- int IDebugBreakpointBoundEvent2.GetPendingBreakpoint(out IDebugPendingBreakpoint2 ppPendingBP)
- {
- ppPendingBP = m_pendingBreakpoint;
- return VSConstants.S_OK;
- }
-
- #endregion
- }
-
-
- ///
- /// The debug engine (DE) sends this interface to the session debug manager (SDM) when a program stops at a breakpoint.
- /// (http://msdn.microsoft.com/en-us/library/bb145927.aspx)
- ///
- sealed class AD7BreakpointEvent : AD7StoppingEvent, IDebugBreakpointEvent2
- {
- public const string IID = "501C1E21-C557-48B8-BA30-A1EAB0BC4A74";
-
- IEnumDebugBoundBreakpoints2 m_boundBreakpoints;
-
-
- ///
- /// Constructor.
- ///
- /// The IEnumDebugBoundBreakpoints2 object that enumerates all the breakpoints associated with
- /// the current code location.
- public AD7BreakpointEvent(IEnumDebugBoundBreakpoints2 boundBreakpoints)
- {
- m_boundBreakpoints = boundBreakpoints;
- }
-
- #region IDebugBreakpointEvent2 Members
-
- ///
- /// Creates an enumerator for all the breakpoints that fired at the current code location.
- /// (http://msdn.microsoft.com/en-us/library/bb146247.aspx)
- ///
- /// Returns an IEnumDebugBoundBreakpoints2 object that enumerates all the breakpoints associated with
- /// the current code location.
- /// VSConstants.S_OK.
- int IDebugBreakpointEvent2.EnumBreakpoints(out IEnumDebugBoundBreakpoints2 ppEnum)
- {
- ppEnum = m_boundBreakpoints;
- return VSConstants.S_OK;
- }
-
- #endregion
- }
-
-
- ///
- /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when the program being debugged completes
- /// a step into, a step over, or a step out of a line of source code or statement or instruction.
- /// (http://msdn.microsoft.com/en-us/library/bb162189.aspx)
- ///
- sealed class AD7StepCompletedEvent : IDebugEvent2, IDebugStepCompleteEvent2
- {
- public const string IID = "0F7F24C1-74D9-4EA6-A3EA-7EDB2D81441D";
-
-
- ///
- /// Sends the event.
- ///
- /// The AD7Engine object that represents the DE.
- public static void Send(AD7Engine engine)
- {
- var xEvent = new AD7StepCompletedEvent();
- engine.Callback.Send(xEvent, IID, engine.currentThread());
- }
-
- #region IDebugEvent2 Members
-
- ///
- /// Gets the attributes for this debug event. (http://msdn.microsoft.com/en-us/library/bb145575.aspx)
- ///
- /// A combination of flags from the enum_EVENTATTRIBUTES enumeration.
- /// VSConstants.S_OK.
- public int GetAttributes(out uint pdwAttrib)
- {
- pdwAttrib = (uint)(enum_EVENTATTRIBUTES.EVENT_ASYNC_STOP);
- return VSConstants.S_OK;
- }
-
- #endregion
- }
-
-
- ///
- /// The debug engine (DE) sends this interface to the session debug manager (SDM) when the program is about to execute its
- /// first instruction of user code. (http://msdn.microsoft.com/en-us/library/bb161265.aspx)
- ///
- sealed class AD7EntryPointEvent : AD7SynchronousStoppingEvent, IDebugEntryPointEvent2
- {
- public const string IID = "86D5A99E-C721-4625-A401-4D052DF38475";
-
-
- ///
- /// Sends the event.
- ///
- /// The AD7Engine object that represents the DE.
- public static void Send(AD7Engine engine)
- {
- var xEvent = new AD7EntryPointEvent();
- engine.Callback.Send(xEvent, IID, engine.currentThread());
- }
- }
-}
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7Expression.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7Expression.cs
deleted file mode 100644
index d7357909..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7Expression.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using VSNDK.Parser;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-using System.Collections;
-using System.Threading;
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// This class represents a parsed expression ready for binding and evaluating.
- /// It is returned as a result of a successful call to IDebugExpressionContext2.ParseText
- /// It allows the debugger to obtain the values of an expression in the debuggee.
- /// (http://msdn.microsoft.com/en-ca/library/bb162308.aspx)
- ///
- public class AD7Expression : IDebugExpression2
- {
- ///
- /// The expression to be evaluated.
- ///
- private string exp;
-
- ///
- /// The class that manages debug events for the debug engine.
- ///
- private EventDispatcher m_eventDispatcher;
-
- ///
- /// Current stack frame.
- ///
- private AD7StackFrame m_frame;
-
-
- ///
- /// Constructor.
- ///
- /// The expression to be evaluated.
- /// Current stack frame.
- /// Represents the class that manages debug events for the debug engine.
- public AD7Expression(string exp, AD7StackFrame frame, EventDispatcher dispatcher)
- {
- this.exp = exp;
- this.m_eventDispatcher = dispatcher;
- this.m_frame = frame;
- }
-
- #region IDebugExpression2 Members
-
-
- ///
- /// This method cancels asynchronous expression evaluation as started by a call to the IDebugExpression2::EvaluateAsync method.
- /// Not implemented yet because it was not needed till now. (http://msdn.microsoft.com/en-ca/library/bb145924.aspx)
- ///
- /// Not implemented.
- int IDebugExpression2.Abort()
- {
- throw new NotImplementedException();
- }
-
-
- ///
- /// Thread responsible for evaluating expressions asynchronously.
- ///
- public void evaluatingAsync()
- {
- VariableInfo vi = VariableInfo.get(exp, m_eventDispatcher, m_frame);
- AD7Property ppResult = new AD7Property(vi);
-
- m_frame.m_engine.Callback.Send(new AD7ExpressionEvaluationCompleteEvent(this, ppResult), AD7ExpressionEvaluationCompleteEvent.IID, m_frame.m_engine, m_frame.m_thread);
- }
-
-
- ///
- /// This method evaluates the expression asynchronously.
- /// This is primarily used for the immediate window. (http://msdn.microsoft.com/en-ca/library/bb146752.aspx)
- ///
- /// A combination of flags from the EVALFLAGS enumeration that control expression evaluation.
- /// This parameter is always a null value.
- /// VSConstants.S_OK.
- int IDebugExpression2.EvaluateAsync(enum_EVALFLAGS dwFlags, IDebugEventCallback2 pExprCallback)
- {
- // Creating a thread to evaluate the expression asynchronously.
- Thread m_processingThread;
- m_processingThread = new Thread(evaluatingAsync);
- m_processingThread.Start();
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// This method evaluates the expression synchronously. (http://msdn.microsoft.com/en-ca/library/bb146982.aspx)
- ///
- /// A combination of flags from the EVALFLAGS enumeration that control expression evaluation.
- /// Maximum time, in milliseconds, to wait before returning from this method. Use INFINITE to wait
- /// indefinitely.
- /// This parameter is always a null value.
- /// Returns the IDebugProperty2 object that contains the result of the expression evaluation.
- /// VSConstants.S_OK.
- int IDebugExpression2.EvaluateSync(enum_EVALFLAGS dwFlags, uint dwTimeout, IDebugEventCallback2 pExprCallback, out IDebugProperty2 ppResult)
- {
- VariableInfo vi = VariableInfo.get(exp, m_eventDispatcher, m_frame);
- ppResult = new AD7Property(vi);
- m_frame._lastEvaluatedExpression = vi;
- return VSConstants.S_OK;
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7MemoryAddress.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7MemoryAddress.cs
deleted file mode 100644
index c572ed54..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7MemoryAddress.cs
+++ /dev/null
@@ -1,269 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// And implementation of IDebugCodeContext2 and IDebugMemoryContext2.
- /// IDebugMemoryContext2 represents a position in the address space of the machine running the program being debugged.
- /// IDebugCodeContext2 represents the starting position of a code instruction. For most run-time architectures today, a code
- /// context can be thought of as an address in a program's execution stream.
- ///
- public class AD7MemoryAddress : IDebugCodeContext2, IDebugCodeContext100
- {
- ///
- /// The AD7Engine object that represents the DE.
- ///
- readonly AD7Engine m_engine;
-
- ///
- /// The current context's address.
- ///
- readonly uint m_address;
-
- ///
- /// The IDebugDocumentContext2 object that corresponds to the code context.
- ///
- IDebugDocumentContext2 m_documentContext;
-
-
- ///
- /// Constructor.
- ///
- /// The AD7Engine object that represents the DE.
- /// The current context's address.
- public AD7MemoryAddress(AD7Engine engine, uint address)
- {
- m_engine = engine;
- m_address = address;
- }
-
-
- ///
- /// Sets the document context.
- ///
- /// The IDebugDocumentContext2 object that corresponds to the code context.
- public void SetDocumentContext(IDebugDocumentContext2 docContext)
- {
- m_documentContext = docContext;
- }
-
- #region IDebugMemoryContext2 Members
-
-
- ///
- /// Adds a specified value to the current context's address to create a new context.
- /// (http://msdn.microsoft.com/en-ca/library/bb145861.aspx)
- ///
- /// The value to add to the current context.
- /// Returns a new IDebugMemoryContext2 object.
- /// VSConstants.S_OK.
- public int Add(ulong dwCount, out IDebugMemoryContext2 newAddress)
- {
- newAddress = new AD7MemoryAddress(m_engine, (uint)dwCount + m_address);
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Compares the memory context to each context in the given array in the manner indicated by compare flags,
- /// returning an index of the first context that matches. (http://msdn.microsoft.com/en-ca/library/bb161750.aspx)
- ///
- /// A value from the CONTEXT_COMPARE enumeration that determines the type of comparison.
- /// An array of references to the IDebugMemoryContext2 objects to compare against.
- /// The number of contexts in the compareToItems array.
- /// Returns the index of the first memory context that satisfies the comparison.
- /// If successful, returns S_OK; otherwise, returns an error code.
- public int Compare(enum_CONTEXT_COMPARE uContextCompare, IDebugMemoryContext2[] compareToItems, uint compareToLength, out uint foundIndex)
- {
- foundIndex = uint.MaxValue;
-
- try
- {
- enum_CONTEXT_COMPARE contextCompare = (enum_CONTEXT_COMPARE)uContextCompare;
-
- for (uint c = 0; c < compareToLength; c++)
- {
- AD7MemoryAddress compareTo = compareToItems[c] as AD7MemoryAddress;
- if (compareTo == null)
- {
- continue;
- }
-
- if (!AD7Engine.ReferenceEquals(this.m_engine, compareTo.m_engine))
- {
- continue;
- }
-
- bool result;
-
- switch (contextCompare)
- {
- case enum_CONTEXT_COMPARE.CONTEXT_EQUAL:
- result = (this.m_address == compareTo.m_address);
- break;
-
- case enum_CONTEXT_COMPARE.CONTEXT_LESS_THAN:
- result = (this.m_address < compareTo.m_address);
- break;
-
- case enum_CONTEXT_COMPARE.CONTEXT_GREATER_THAN:
- result = (this.m_address > compareTo.m_address);
- break;
-
- case enum_CONTEXT_COMPARE.CONTEXT_LESS_THAN_OR_EQUAL:
- result = (this.m_address <= compareTo.m_address);
- break;
-
- case enum_CONTEXT_COMPARE.CONTEXT_GREATER_THAN_OR_EQUAL:
- result = (this.m_address >= compareTo.m_address);
- break;
-
- // The VSNDK debug engine doesn't understand scopes or functions
- case enum_CONTEXT_COMPARE.CONTEXT_SAME_SCOPE:
- case enum_CONTEXT_COMPARE.CONTEXT_SAME_FUNCTION:
- result = (this.m_address == compareTo.m_address);
- break;
-
- case enum_CONTEXT_COMPARE.CONTEXT_SAME_MODULE:
- result = (this.m_address == compareTo.m_address);
- break;
-
- case enum_CONTEXT_COMPARE.CONTEXT_SAME_PROCESS:
- result = true;
- break;
-
- default:
- // A new comparison was invented that we don't support
- return VSConstants.E_NOTIMPL;
- }
-
- if (result)
- {
- foundIndex = c;
- return VSConstants.S_OK;
- }
- }
-
- return VSConstants.S_FALSE;
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
- }
-
-
- ///
- /// Gets information that describes this context. Not implemented. (http://msdn.microsoft.com/en-ca/library/bb145034.aspx)
- ///
- /// A combination of flags from the CONTEXT_INFO_FIELDS enumeration that indicate which fields of the
- /// CONTEXT_INFO structure are to be fill in.
- /// The CONTEXT_INFO structure that is filled in.
- /// Not implemented.
- public int GetInfo(enum_CONTEXT_INFO_FIELDS dwFields, CONTEXT_INFO[] pinfo)
- {
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// Gets the user-displayable name for this context. This is not supported by the VSNDK debug engine.
- /// (http://msdn.microsoft.com/en-ca/library/bb146997.aspx)
- ///
- /// Returns the name of the memory context.
- /// Not implemented.
- public int GetName(out string pbstrName)
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Subtracts a specified value from the current context's address to create a new context.
- /// (http://msdn.microsoft.com/en-ca/library/bb146285.aspx)
- ///
- /// The number of memory bytes to decrement.
- /// Returns a new IDebugMemoryContext2 object.
- /// VSConstants.S_OK.
- public int Subtract(ulong dwCount, out IDebugMemoryContext2 ppMemCxt)
- {
- ppMemCxt = new AD7MemoryAddress(m_engine, (uint)dwCount - m_address);
- return VSConstants.S_OK;
- }
-
- #endregion
-
- #region IDebugCodeContext2 Members
-
-
- ///
- /// Gets the document context that corresponds to this code context. The document context represents a position in the source file
- /// that corresponds to the source code that generated this instruction. (http://msdn.microsoft.com/en-ca/library/bb161811.aspx)
- ///
- /// Returns the IDebugDocumentContext2 object that corresponds to the code context.
- /// VSConstants.S_OK.
- public int GetDocumentContext(out IDebugDocumentContext2 ppSrcCxt)
- {
- ppSrcCxt = m_documentContext;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the language information for this code context. (http://msdn.microsoft.com/en-ca/library/bb144925.aspx)
- ///
- /// Returns a string that contains the name of the language, such as "C++.".
- /// Returns the GUID for the language of the code context, for example, guidCPPLang.
- /// If successful, returns S_OK; otherwise, returns S_FALSE.
- public int GetLanguageInfo(ref string pbstrLanguage, ref Guid pguidLanguage)
- {
- if (m_documentContext != null)
- {
- m_documentContext.GetLanguageInfo(ref pbstrLanguage, ref pguidLanguage);
- return VSConstants.S_OK;
- }
- else
- {
- return VSConstants.S_FALSE;
- }
- }
-
- #endregion
-
- #region IDebugCodeContext100 Members
-
-
- ///
- /// Returns the program being debugged. In the case of this VSNDK debug debug engine, AD7Engine implements IDebugProgram2 which
- /// represents the program being debugged.
- /// (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugcodecontext100.getprogram.aspx)
- ///
- /// Returns the program being debugged.
- /// VSConstants.S_OK.
- int IDebugCodeContext100.GetProgram(out IDebugProgram2 pProgram)
- {
- pProgram = m_engine;
- return VSConstants.S_OK;
- }
-
- #endregion
- }
-}
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7Module.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7Module.cs
deleted file mode 100644
index e3b53f35..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7Module.cs
+++ /dev/null
@@ -1,232 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Runtime.InteropServices;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-using System.Diagnostics;
-using System.Threading;
-
-namespace VSNDK.DebugEngine
-{
-
- ///
- /// This class represents a module loaded in the debuggee process to the debugger. Not implemented, yet.
- ///
- /// It implements:
- ///
- /// IDebugModule2: This interface represents a modulethat is, an executable unit of a programsuch as a DLL.
- /// (http://msdn.microsoft.com/en-ca/library/bb145360.aspx)
- ///
- /// IDebugModule3: This interface represents a module that supports alternate locations of symbols and JustMyCode states.
- /// (http://msdn.microsoft.com/en-ca/library/bb145893.aspx)
- ///
- public class AD7Module : IDebugModule2, IDebugModule3
- {
-
- ///
- /// Constructor. Not implemented, yet.
- ///
- public AD7Module()
- {
- }
-
-
- ///
- /// Gets information about this module. (http://msdn.microsoft.com/en-ca/library/bb161975.aspx)
- ///
- /// A combination of flags from the MODULE_INFO_FIELDS enumeration that specify which fields of pInfo
- /// are to be filled out.
- /// A MODULE_INFO structure that is filled in with a description of the module.
- /// If successful, returns S_OK; otherwise, returns an error code.
- int IDebugModule2.GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] infoArray)
- {
- try
- {
- MODULE_INFO info = new MODULE_INFO();
-
- if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_NAME))
- {
- info.m_bstrName = "";
- info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
- }
- if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_URL))
- {
- info.m_bstrUrl = "";
- info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
- }
- if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS))
- {
- info.m_addrLoadAddress = 0;
- info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS;
- }
- if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS))
- {
- // A debugger that actually supports showing the preferred base should crack the PE header and get
- // that field. This debugger does not do that, so assume the module loaded where it was suppose to.
- info.m_addrPreferredLoadAddress = 0;
- info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS;
- }
- if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_SIZE))
- {
- info.m_dwSize = 0;
- info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_SIZE;
- }
- if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_LOADORDER))
- {
- info.m_dwLoadOrder = 0;
- info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADORDER;
- }
- if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION))
- {
- info.m_bstrUrlSymbolLocation = "";
- info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION;
- }
- if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_FLAGS))
- {
- info.m_dwModuleFlags = 0;
- info.m_dwModuleFlags |= (enum_MODULE_FLAGS.MODULE_FLAG_SYMBOLS);
- info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_FLAGS;
- }
- if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_VERSION))
- {
- info.m_bstrVersion = "";
- info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_VERSION;
- }
- if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_DEBUGMESSAGE))
- {
- info.m_bstrDebugMessage = "";
- info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_DEBUGMESSAGE;
- }
-
- infoArray[0] = info;
-
- return VSConstants.S_OK;
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
- }
-
- #region Deprecated interface methods
- // These methods are not called by the Visual Studio debugger, so they don't need to be implemented
-
-
- ///
- /// OBSOLETE. DO NOT USE. Reloads the symbols for this module. (http://msdn.microsoft.com/en-ca/library/bb145113.aspx)
- ///
- /// The path to the symbol store.
- /// Returns an informational message, such as a status or error message, that is displayed to the
- /// right of the module name in the Modules window.
- /// VSConstants.E_NOTIMPL.
- int IDebugModule2.ReloadSymbols_Deprecated(string urlToSymbols, out string debugMessage)
- {
- debugMessage = null;
- System.Diagnostics.Debug.Fail("This function is not called by the debugger.");
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// This method is not presented in IDebugModule3 webpage but the debug engine fails to build without it. It should have the same
- /// behavior as the above IDebugModule2.ReloadSymbols_Deprecated. (http://msdn.microsoft.com/en-ca/library/bb145893.aspx)
- ///
- ///
- ///
- /// Not implemented.
- int IDebugModule3.ReloadSymbols_Deprecated(string pszUrlToSymbols, out string pbstrDebugMessage)
- {
- throw new NotImplementedException();
- }
- #endregion
-
-
- ///
- /// This method is not presented in IDebugModule3 webpage but the debug engine fails to build without it.
- /// (http://msdn.microsoft.com/en-ca/library/bb145893.aspx). It should have the same behavior as the above
- /// IDebugModule2.GetInfo, i.e., gets information about this module. (http://msdn.microsoft.com/en-ca/library/bb161975.aspx)
- ///
- /// A combination of flags from the MODULE_INFO_FIELDS enumeration that specify which fields of pInfo
- /// are to be filled out.
- /// A MODULE_INFO structure that is filled in with a description of the module.
- /// If successful, returns S_OK; otherwise, returns an error code.
- int IDebugModule3.GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo)
- {
- return ((IDebugModule2)this).GetInfo(dwFields, pinfo);
- }
-
-
- ///
- /// Returns a list of paths searched for symbols and the results of searching each path.
- /// [http://msdn.microsoft.com/en-ca/library/bb161971(v=vs.100).aspx]
- ///
- /// A combination of flags from the SYMBOL_SEARCH_INFO_FIELDS enumeration specifying which fields
- /// of pInfo are to be filled in.
- /// A MODULE_SYMBOL_SEARCH_INFO structure whose members are to be filled in with the specified information.
- /// If this is a null value, this method returns E_INVALIDARG.
- /// VSConstants.S_OK.
- int IDebugModule3.GetSymbolInfo(enum_SYMBOL_SEARCH_INFO_FIELDS dwFields, MODULE_SYMBOL_SEARCH_INFO[] pinfo)
- {
- pinfo[0] = new MODULE_SYMBOL_SEARCH_INFO();
- pinfo[0].dwValidFields = 1; // SSIF_VERBOSE_SEARCH_INFO;
-
- string symbolsNotLoaded = "Symbols not loaded";
- pinfo[0].bstrVerboseSearchInfo = symbolsNotLoaded;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Retrieves information on whether the module represents user code or not. Used to support the JustMyCode features of the
- /// debugger. [http://msdn.microsoft.com/en-ca/library/bb146644(v=vs.100).aspx]
- /// The VSNDK debug engine does not support JustMyCode and therefore all modules are considered "My Code"
- ///
- /// Nonzero (TRUE) if module represents user code, zero (FALSE) if it does not.
- /// VSConstants.S_OK.
- int IDebugModule3.IsUserCode(out int pfUser)
- {
- pfUser = 1;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Loads and initializes symbols for the current module when the user explicitly asks for them to load. Not implemented.
- /// [http://msdn.microsoft.com/en-ca/library/bb146634(v=vs.100).aspx]
- ///
- /// Not implemented.
- int IDebugModule3.LoadSymbols()
- {
- throw new NotImplementedException();
- }
-
-
- ///
- /// Specifies whether the module should be considered user code or not. Used to support the JustMyCode features of the debugger.
- /// [http://msdn.microsoft.com/en-ca/library/bb146327(v=vs.100).aspx]
- /// The VSNDK debug engine does not support JustMyCode so this is not implemented
- ///
- /// Nonzero (TRUE) if the module should be considered user code, zero (FALSE) if it should not.
- /// Not implemented.
- int IDebugModule3.SetJustMyCodeState(int fIsUserCode)
- {
- throw new NotImplementedException();
- }
-
- }
-}
\ No newline at end of file
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7PendingBreakpoint.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7PendingBreakpoint.cs
deleted file mode 100644
index 88942e04..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7PendingBreakpoint.cs
+++ /dev/null
@@ -1,388 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Runtime.InteropServices;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-using System.Text;
-
-namespace VSNDK.DebugEngine
-{
-
- ///
- /// This class represents a peiding breakpoint that is ready to bind to a code location. A pending breakpoint is an abstract
- /// representation of a breakpoint before it is bound. When a user creates a new breakpoint, the pending breakpoint is created
- /// and is later bound. The bound breakpoints become children of the pending breakpoint.
- ///
- /// It implements IDebugPendingBreakpoint2: (http://msdn.microsoft.com/en-ca/library/bb161807.aspx)
- ///
- public class AD7PendingBreakpoint : IDebugPendingBreakpoint2
- {
- ///
- /// The breakpoint request that resulted in this pending breakpoint being created.
- ///
- private IDebugBreakpointRequest2 m_pBPRequest;
- private BP_REQUEST_INFO m_bpRequestInfo;
- private AD7Engine m_engine;
- private BreakpointManager m_bpManager;
-
- private List m_boundBreakpoints;
- public List boundBPs
- {
- get
- {
- return m_boundBreakpoints;
- }
- }
-
- private bool m_enabled;
- private bool m_deleted;
-
-
- ///
- /// Constructor.
- ///
- /// The breakpoint request used to create this pending breakpoint.
- /// The AD7Engine object that represents the DE.
- /// The breakpoint manager.
- public AD7PendingBreakpoint(IDebugBreakpointRequest2 pBPRequest, AD7Engine engine, BreakpointManager bpManager)
- {
- m_pBPRequest = pBPRequest;
- BP_REQUEST_INFO[] requestInfo = new BP_REQUEST_INFO[1];
- m_pBPRequest.GetRequestInfo(enum_BPREQI_FIELDS.BPREQI_BPLOCATION, requestInfo);
- m_bpRequestInfo = requestInfo[0];
- m_pBPRequest.GetRequestInfo(enum_BPREQI_FIELDS.BPREQI_CONDITION, requestInfo);
- if (requestInfo[0].dwFields != 0)
- {
- m_bpRequestInfo.bpCondition = requestInfo[0].bpCondition;
- m_bpRequestInfo.dwFields |= requestInfo[0].dwFields;
- }
- m_pBPRequest.GetRequestInfo(enum_BPREQI_FIELDS.BPREQI_PASSCOUNT, requestInfo);
- if (requestInfo[0].dwFields != 0)
- {
- m_bpRequestInfo.bpPassCount = requestInfo[0].bpPassCount;
- m_bpRequestInfo.dwFields |= requestInfo[0].dwFields;
- }
-
- m_engine = engine;
- m_bpManager = bpManager;
- m_boundBreakpoints = new System.Collections.Generic.List();
-
- m_enabled = true;
- m_deleted = false;
- }
-
-
- ///
- /// Determines whether this pending breakpoint can bind to a code location.
- ///
- /// If successful, returns TRUE; otherwise, returns FALSE.
- private bool CanBind()
- {
- // The engine only supports these types of breakpoints:
- // - File and line number.
- // - Function name and offset.
- if (this.m_deleted || m_engine.m_process == null)
- {
- return false;
- }
- else if (m_bpRequestInfo.bpLocation.bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FILE_LINE
- || m_bpRequestInfo.bpLocation.bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FUNC_OFFSET)
- {
- return true;
- }
-
- return false;
- }
-
-
- ///
- /// Remove all of the bound breakpoints for this pending breakpoint
- ///
- public void ClearBoundBreakpoints()
- {
- lock (m_boundBreakpoints)
- {
- for (int i = m_boundBreakpoints.Count - 1; i >= 0; i--)
- {
- ((IDebugBoundBreakpoint2)m_boundBreakpoints[i]).Delete();
- }
- }
- }
-
-
- ///
- /// Called by bound breakpoints when they are being deleted.
- ///
- /// A bound breakpoint.
- public void OnBoundBreakpointDeleted(AD7BoundBreakpoint boundBreakpoint)
- {
- lock (m_boundBreakpoints)
- {
- m_boundBreakpoints.Remove(boundBreakpoint);
- }
- }
-
- #region IDebugPendingBreakpoint2 Members
-
-
- /// GDB works with short path names only, which requires converting the path names to/from long ones. This function
- /// returns the short path name for a given long one.
- /// Long path name.
- /// Returns this short path name.
- /// Lenght of this short path name.
- ///
- [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
- public static extern int GetShortPathName(
- [MarshalAs(UnmanagedType.LPTStr)]
- string path,
- [MarshalAs(UnmanagedType.LPTStr)]
- StringBuilder shortPath,
- int shortPathLength
- );
-
-
- ///
- /// Bind this breakpoint. (http://msdn.microsoft.com/en-ca/library/bb145901.aspx)
- ///
- /// If successful, returns S_OK; otherwise, returns an error code.
- int IDebugPendingBreakpoint2.Bind()
- {
- try
- {
- if (CanBind())
- {
- AD7BoundBreakpoint xBBP = null;
-
- // Visual Studio returns a start position that is one less than it actually is
- xBBP = new AD7BoundBreakpoint(m_engine, m_bpRequestInfo, this);
-
- if (VSNDK.Package.ControlDebugEngine.isDebugEngineRunning == false)
- {
- return VSConstants.S_FALSE;
- }
-
- if ((xBBP == null) || (xBBP.GDB_ID == 0))
- {
- return VSConstants.S_FALSE;
- }
-
- // Set the enabled state of the bound breakpoint based on the pending breakpoint's enabled state
- ((IDebugBoundBreakpoint2)xBBP).Enable(Convert.ToInt32(m_enabled));
-
- m_boundBreakpoints.Add(xBBP);
-
- return VSConstants.S_OK;
- }
- else
- {
- // The breakpoint could not be bound. This may occur for many reasons such as an invalid location, an invalid
- // expression, etc... The VSNDK debug engine does not support this, but a real world engine will want to send an
- // instance of IDebugBreakpointErrorEvent2 to the UI and return a valid instance of IDebugErrorBreakpoint2 from
- // IDebugPendingBreakpoint2::EnumErrorBreakpoints. The debugger will then display information about why the
- // breakpoint did not bind to the user.
- return VSConstants.S_FALSE;
- }
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
- }
-
-
- ///
- /// Determines whether this pending breakpoint can bind to a code location. (http://msdn.microsoft.com/en-ca/library/bb146753.aspx)
- ///
- /// Returns an IEnumDebugErrorBreakpoints2 object that contains a list of IDebugErrorBreakpoint2
- /// objects if there could be errors.
- /// If successful, returns S_OK; otherwise, returns S_FALSE
- int IDebugPendingBreakpoint2.CanBind(out IEnumDebugErrorBreakpoints2 ppErrorEnum)
- {
- ppErrorEnum = null;
-
- if (!CanBind())
- {
- // The breakpoint could not be bound. This may occur for many reasons such as an invalid location, an invalid
- // expression, etc... The VSNDK debug engine does not support this, but a real world engine will want to send an
- // instance of IDebugBreakpointErrorEvent2 to the UI and return a valid instance of IDebugErrorBreakpoint2 from
- // IDebugPendingBreakpoint2::EnumErrorBreakpoints. The debugger will then display information about why the
- // breakpoint did not bind to the user.
- ppErrorEnum = null;
- return VSConstants.S_FALSE;
- }
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Deletes this pending breakpoint and all breakpoints bound from it. (http://msdn.microsoft.com/en-ca/library/bb145918.aspx)
- ///
- /// VSConstants.S_OK.
- int IDebugPendingBreakpoint2.Delete()
- {
- lock (m_boundBreakpoints)
- {
- for (int i = m_boundBreakpoints.Count - 1; i >= 0; i--)
- {
- ((IDebugBoundBreakpoint2)m_boundBreakpoints[i]).Delete();
- }
- }
-
- m_enabled = false;
- m_deleted = true;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Toggles the enabled state of this pending breakpoint. (http://msdn.microsoft.com/en-ca/library/bb145046.aspx)
- ///
- /// Set to nonzero (TRUE) to enable a pending breakpoint, or to zero (FALSE) to disable.
- /// VSConstants.S_OK.
- int IDebugPendingBreakpoint2.Enable(int fEnable)
- {
- lock (m_boundBreakpoints)
- {
- m_enabled = fEnable == 0 ? false : true;
-
- foreach (AD7BoundBreakpoint bp in m_boundBreakpoints)
- {
- ((IDebugBoundBreakpoint2)bp).Enable(fEnable);
- }
- }
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Enumerates all breakpoints bound from this pending breakpoint. (http://msdn.microsoft.com/en-ca/library/bb145139.aspx)
- ///
- /// Returns an IEnumDebugBoundBreakpoints2 object that enumerates the bound breakpoints.
- /// VSConstants.S_OK.
- int IDebugPendingBreakpoint2.EnumBoundBreakpoints(out IEnumDebugBoundBreakpoints2 ppEnum)
- {
- lock (m_boundBreakpoints)
- {
- IDebugBoundBreakpoint2[] boundBreakpoints = m_boundBreakpoints.ToArray();
- ppEnum = new AD7BoundBreakpointsEnum(boundBreakpoints);
- }
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Enumerates all error breakpoints that resulted from this pending breakpoint.
- /// (http://msdn.microsoft.com/en-ca/library/bb145598.aspx)
- ///
- /// A combination of values from the enum_BP_ERROR_TYPE enumeration that selects the type of errors
- /// to enumerate.
- /// Returns an IEnumDebugErrorBreakpoints2 object that contains a list of IDebugErrorBreakpoint2 objects.
- /// VSConstants.E_NOTIMPL.
- int IDebugPendingBreakpoint2.EnumErrorBreakpoints(enum_BP_ERROR_TYPE bpErrorType, out IEnumDebugErrorBreakpoints2 ppEnum)
- {
- // Called when a pending breakpoint could not be bound. This may occur for many reasons such as an invalid location, an
- // invalid expression, etc... The VSNDK debug engine does not support this, but a real world engine will want to send an
- // instance of IDebugBreakpointErrorEvent2 to the UI and return a valid enumeration of IDebugErrorBreakpoint2 from
- // IDebugPendingBreakpoint2::EnumErrorBreakpoints. The debugger will then display information about why the breakpoint
- // did not bind to the user.
- ppEnum = null;
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// Gets the breakpoint request that was used to create this pending breakpoint.
- /// (http://msdn.microsoft.com/en-ca/library/bb161770.aspx)
- ///
- /// Returns an IDebugBreakpointRequest2 object representing the breakpoint request that was used to
- /// create this pending breakpoint.
- /// VSConstants.S_OK.
- int IDebugPendingBreakpoint2.GetBreakpointRequest(out IDebugBreakpointRequest2 ppBPRequest)
- {
- ppBPRequest = this.m_pBPRequest;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the state of this pending breakpoint. (http://msdn.microsoft.com/en-ca/library/bb162178.aspx)
- ///
- /// A PENDING_BP_STATE_INFO structure that is filled in with a description of this pending breakpoint.
- /// VSConstants.S_OK.
- int IDebugPendingBreakpoint2.GetState(PENDING_BP_STATE_INFO[] pState)
- {
- if (m_deleted)
- {
- pState[0].state = (enum_PENDING_BP_STATE)enum_BP_STATE.BPS_DELETED;
- }
- else if (m_enabled)
- {
- pState[0].state = (enum_PENDING_BP_STATE)enum_BP_STATE.BPS_ENABLED;
- }
- else if (!m_enabled)
- {
- pState[0].state = (enum_PENDING_BP_STATE)enum_BP_STATE.BPS_DISABLED;
- }
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Sets or changes the condition associated with the pending breakpoint. (http://msdn.microsoft.com/en-ca/library/bb144977.aspx).
- /// Not implemented here, but a conditional breakpoint can be set using IDebugBoundBreakpoint2::SetCondition().
- ///
- /// A BP_CONDITION structure that specifies the condition to set.
- /// Not implemented.
- int IDebugPendingBreakpoint2.SetCondition(BP_CONDITION bpCondition)
- {
- throw new NotImplementedException();
- }
-
-
- ///
- /// Sets or changes the pass count associated with the pending breakpoint. (http://msdn.microsoft.com/en-ca/library/bb145038.aspx).
- /// Not implemented here, but a pass count associated to a breakpoint can be set/changed using
- /// IDebugBoundBreakpoint2::SetPassCount().
- ///
- /// A BP_PASSCOUNT structure that contains the pass count.
- /// Not implemented.
- int IDebugPendingBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
- {
- throw new NotImplementedException();
- }
-
-
- ///
- /// Toggles the virtualized state of this pending breakpoint. When a pending breakpoint is virtualized, the debug engine will
- /// attempt to bind it every time new code loads into the program. (http://msdn.microsoft.com/en-ca/library/bb146187.aspx)
- /// The VSNDK debug engine does not support this. Not implemented.
- ///
- /// Set to nonzero (TRUE) to virtualize the pending breakpoint, or to zero (FALSE) to turn off
- /// virtualization.
- /// VSConstants.S_OK.
- int IDebugPendingBreakpoint2.Virtualize(int fVirtualize)
- {
- return VSConstants.S_OK;
- }
-
- #endregion
- }
-}
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7Port.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7Port.cs
deleted file mode 100644
index 9b7643ca..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7Port.cs
+++ /dev/null
@@ -1,397 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.VisualStudio.Debugger.Interop;
-using System.Runtime.InteropServices.ComTypes;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Shell;
-using VSNDK.Parser;
-using System.Windows.Forms;
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// This class implements a port.
- ///
- /// It implements:
- ///
- /// - IDebugPort2 - This interface represents a debug port on a machine. (http://msdn.microsoft.com/en-us/library/bb147021.aspx)
- /// - IConnectionPointContainer - Supports connection points for connectable objects. Indicates to a client that the object is
- /// connectable and provides the IConnectionPoint interface. (http://msdn.microsoft.com/en-CA/library/ms683857.aspx)
- /// - IConnectionPoint - Supports connection points for connectable objects. (http://msdn.microsoft.com/en-us/library/ms694318.aspx)
- ///
- public class AD7Port : IDebugPort2, IConnectionPointContainer, IConnectionPoint
- {
-
- ///
- /// The name of the port.
- ///
- public readonly string m_name;
-
- ///
- /// The IP of the port.
- ///
- public readonly string m_IP;
-
- ///
- /// The password needed to have access to the port.
- ///
- public readonly string m_password;
-
- ///
- /// Boolean variable that indicates if the port is associated to the Simulator or the Device.
- ///
- public readonly bool m_isSimulator;
-
- ///
- /// The NDK host path.
- ///
- public readonly string m_toolsPath;
-
- ///
- /// List of processes running on this port.
- ///
- private readonly List m_processes = new List();
-
- ///
- /// The GUID that identifies the port.
- ///
- public readonly Guid m_guid;
-
- ///
- /// Represents the request that was used to create the port.
- ///
- private readonly AD7PortRequest m_request;
-
- ///
- /// Represents the port supplier for this port.
- ///
- public readonly AD7PortSupplier m_supplier;
-
- ///
- /// Maps objects to and from event "cookies" that represent a client's registration with an event provider.
- /// (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.eventsinkcollection.aspx)
- ///
- private EventSinkCollection m_eventSinks = new EventSinkCollection();
-
-
- ///
- /// Constructor.
- ///
- /// The port supplier for this port.
- /// The request used to create the port.
- /// The GUID that identifies the port.
- /// The name of the port.
- /// The password needed to have access to the port.
- /// Variable that indicates if the port is associated to the Simulator or the Device.
- /// The NDK host path.
- public AD7Port(AD7PortSupplier supplier, AD7PortRequest request, Guid guid, string portName, string password, bool isSimulator, string toolsPath)
- {
- m_name = portName;
- m_request = request;
- m_supplier = supplier;
- m_guid = guid;
- if (isSimulator)
- m_IP = m_name.Substring(11);
- else
- m_IP = m_name.Substring(8);
- m_password = password;
- m_isSimulator = isSimulator;
- m_toolsPath = toolsPath;
- }
-
-
- ///
- /// Gets the list of processes running on this port.
- ///
- /// Returns the list of processes running on this port.
- IEnumerable GetProcesses()
- {
- IDebugCoreServer2 server = null;
- if (m_processes.Count() != 0)
- {
- foreach (AD7Process p in m_processes)
- {
- AD7ProcessDestroyEvent ev = new AD7ProcessDestroyEvent();
- SendEvent(server, this, p, null, ev, ev.getGuid());
- }
- m_processes.Clear();
- }
-
- string publicKeyPath = Environment.GetEnvironmentVariable("AppData") + @"\BlackBerry\bbt_id_rsa.pub";
-
- string response = GDBParser.GetPIDsThroughGDB(m_IP, m_password, m_isSimulator, m_toolsPath, publicKeyPath, 7);
-
- if ((response == "TIMEOUT!") || (response.IndexOf("1^error,msg=", 0) != -1)) //found an error
- {
- if (response == "TIMEOUT!") // Timeout error, normally happen when the device is not connected.
- {
- MessageBox.Show("Please, verify if the Device/Simulator IP in \"BlackBerry -> Settings\" menu is correct and check if it is connected.", "Device/Simulator not connected or not configured properly", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else
- if (response[29] == ':') // error: 1^error,msg="169.254.0.3:8000: The requested address is not valid in its context."
- {
- string txt = response.Substring(13, response.IndexOf(':', 13) - 13) + response.Substring(29, response.IndexOf('"', 31) - 29);
- string caption = "";
- if (txt.IndexOf("The requested address is not valid in its context.") != -1)
- {
- txt += "\n\nPlease, verify the BlackBerry device/simulator IP settings.";
- caption = "Invalid IP";
- }
- else
- {
- txt += "\n\nPlease, verify if the device/simulator is connected.";
- caption = "Connection failed";
- }
- MessageBox.Show(txt, caption, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- response = "";
- }
- else if (response.Contains("^done"))
- {
- response = response.Remove(response.IndexOf("^done"));
- string[] tempListOfProcesses = response.Split('\n');
-
- int ind = (response[0] == '&') ? 1 : 0; // ignore the first if it starts with & (&"info pidlist")
- while (ind < tempListOfProcesses.Length - 1)
- {
- string process = tempListOfProcesses[ind];
- int pos = process.LastIndexOf('/');
- if (pos == -1)
- {
- ind++;
- continue;
- }
- process = process.Remove(pos).Substring(2);
- for (ind = ind + 1; ind < tempListOfProcesses.Length - 1; ind++) // ignore the duplicates
- {
- int pos2 = tempListOfProcesses[ind].LastIndexOf('/');
- if ((pos2 <= 2) || (tempListOfProcesses[ind].Substring(2, pos2 - 2) != process))
- break;
- }
- AD7Process proc = new AD7Process(this, process.Substring(process.IndexOf("- ") + 2), process.Remove(process.IndexOf(" ")));
- m_processes.Add(proc);
- AD7ProcessCreateEvent ev = new AD7ProcessCreateEvent();
- SendEvent(server, this, proc, null, ev, ev.getGuid());
- }
- }
- return m_processes;
- }
-
-
- ///
- /// Send an event to SDM.
- ///
- /// Server. Using NULL.
- /// The IDebugPort2 port.
- /// The IDebugProcess2 process.
- /// The IDebugProgram2 program. Using NULL.
- /// The event. It can be: AD7ProcessDestroyEvent or AD7ProcessCreateEvent.
- /// The event GUID.
- private void SendEvent(IDebugCoreServer2 server, IDebugPort2 port, IDebugProcess2 process, IDebugProgram2 program, IDebugEvent2 ev, Guid iid)
- {
- foreach (var eventSink in m_eventSinks)
- {
- IDebugPortEvents2 events = eventSink as IDebugPortEvents2;
- if (events != null)
- {
- events.Event(server, port, process, program, ev, ref iid);
- }
- }
- }
-
-
- #region Implementation of IDebugPort2
-
- ///
- /// Returns the port name. (http://msdn.microsoft.com/en-us/library/bb145890.aspx)
- ///
- /// Returns the name of the port.
- /// VSConstants.S_OK.
- public int GetPortName(out string pbstrName)
- {
- pbstrName = m_name;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Returns the port identifier. (http://msdn.microsoft.com/en-us/library/bb146747.aspx)
- ///
- /// Returns the GUID that identifies the port.
- /// VSConstants.S_OK.
- public int GetPortId(out Guid pguidPort)
- {
- pguidPort = m_guid;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Returns the request used to create a port. (http://msdn.microsoft.com/en-us/library/bb145127.aspx)
- ///
- /// Returns an IDebugPortRequest2 object representing the request that was used to create the port.
- /// VSConstants.S_OK.
- public int GetPortRequest(out IDebugPortRequest2 ppRequest)
- {
- ppRequest = m_request;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Returns the port supplier for this port. (http://msdn.microsoft.com/en-us/library/bb146688.aspx)
- ///
- /// Returns an IDebugPortSupplier2 object represents the port supplier for a port.
- /// VSConstants.S_OK.
- public int GetPortSupplier(out IDebugPortSupplier2 ppSupplier)
- {
- ppSupplier = m_supplier;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Returns the specified process running on a port. (http://msdn.microsoft.com/en-us/library/bb145867.aspx)
- ///
- /// An AD_PROCESS_ID structure that specifies the process identifier.
- /// Returns an IDebugProcess2 object representing the process.
- /// If successful, returns VSConstants.S_OK; otherwise, returns VSConstants.S_FALSE.
- public int GetProcess(AD_PROCESS_ID ProcessId, out IDebugProcess2 ppProcess)
- {
- IEnumerable procList = GetProcesses();
- var proc = from p in procList
- where p._processID == ProcessId.dwProcessId.ToString()
- select p;
- ppProcess = proc.FirstOrDefault();
- return ppProcess != null ? VSConstants.S_OK : VSConstants.S_FALSE;
- }
-
-
- ///
- /// Enumerates all the processes running on a port. (http://msdn.microsoft.com/en-us/library/bb161302.aspx)
- ///
- /// Returns an IEnumDebugProcesses2 object that contains a list of all the processes running on a port.
- /// VSConstants.S_OK.
- public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
- {
- IEnumerable procList = GetProcesses();
- IDebugProcess2[] processes = new IDebugProcess2[procList.Count()];
- int i = 0;
- foreach (var debugProcess in procList)
- {
- processes[i] = debugProcess;
- i++;
- }
- ppEnum = new AD7ProcessEnum(processes);
- return VSConstants.S_OK;
- }
-
- #endregion
-
-
- #region IConnectionPoint Members
-
- ///
- /// Establishes a connection between a connection point object and a client's sink. (http://msdn.microsoft.com/en-us/library/ms678815.aspx)
- ///
- /// An "object" instance of the client's advise sink. The client's sink receives
- /// outgoing calls from the connection point.
- /// A returned token that uniquely identifies this connection.
- public void Advise(object pUnkSink, out int pdwCookie)
- {
- pdwCookie = (int)m_eventSinks.Add(pUnkSink);
- }
-
-
- ///
- /// Creates an enumerator object to iterate through the current connections for this connection point.
- /// Not implemented. (http://msdn.microsoft.com/en-us/library/ms680755.aspx)
- ///
- /// An IEnumConnections object that receives the newly created enumerator.
- public void EnumConnections(out IEnumConnections ppEnum)
- {
- throw new NotImplementedException();
- }
-
-
- ///
- /// Retrieves the IID of the outgoing interface managed by this connection point. (http://msdn.microsoft.com/en-us/library/ms693468.aspx)
- ///
- /// An identifier of the outgoing interface managed by this connection point.
- public void GetConnectionInterface(out Guid pIID)
- {
- pIID = typeof(IDebugPortEvents2).GUID;
- }
-
-
- ///
- /// Retrieves the IConnectionPointContainer interface pointer for the parent connectable object. (http://msdn.microsoft.com/en-us/library/ms679669.aspx)
- ///
- /// An IConnectionPointContainer object.
- public void GetConnectionPointContainer(out IConnectionPointContainer ppCPC)
- {
- ppCPC = this;
- }
-
-
- ///
- /// Terminates an advisory connection previously established between a connection point object and a client's sink.
- /// (http://msdn.microsoft.com/en-us/library/ms686608.aspx)
- ///
- /// A connection token previously returned from IConnectionPoint::Advise.
- public void Unadvise(int dwCookie)
- {
- m_eventSinks.RemoveAt((uint)dwCookie);
- }
-
- #endregion
-
-
- #region IConnectionPointContainer Members
-
- ///
- /// Creates an enumerator object to iterate through all the connection points supported in the connectable object, one
- /// connection point per outgoing IID. Not implemented. (http://msdn.microsoft.com/en-CA/library/ms682460.aspx)
- ///
- /// An IEnumConnectionPoints object that receives the newly created enumerator.
- public void EnumConnectionPoints(out IEnumConnectionPoints ppEnum)
- {
- // We only need FindConnectionPoint().
- throw new NotImplementedException();
- }
-
-
- ///
- /// Returns a pointer to the IConnectionPoint interface of a connection point for a specified IID, if that IID describes a
- /// supported outgoing interface. (http://msdn.microsoft.com/en-CA/library/ms692476.aspx)
- ///
- /// Interface identifier of the outgoing interface whose connection point object is being requested.
- /// An IConnectionPoint object that receives the connection point that supports the riid interface.
- public void FindConnectionPoint(ref Guid riid, out IConnectionPoint ppCP)
- {
- ppCP = null;
- if (riid == typeof(IDebugPortEvents2).GUID)
- {
- ppCP = this;
- }
- }
-
- #endregion
- }
-}
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7PortRequest.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7PortRequest.cs
deleted file mode 100644
index 6bc062dc..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7PortRequest.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// This class describes a port. This description is used to add the port to a port supplier.
- ///
- /// It implements IDebugPortRequest2 (http://msdn.microsoft.com/en-us/library/bb146168.aspx)
- ///
- public class AD7PortRequest : IDebugPortRequest2
- {
- ///
- /// The name of the port to be created.
- ///
- private string m_name;
-
-
- ///
- /// Constructor.
- ///
- /// The name of the port. It is contains the IP and password of the Device/Simulator. The password must be
- /// removed when creating the port because this name will be displayed in Attach to Process UI.
- public AD7PortRequest(string name)
- {
- m_name = name;
- }
-
- #region Implementation of IDebugPortRequest2
-
- ///
- /// Gets the name of the port to create.
- ///
- /// Returns the name of the port.
- /// VSConstants.S_OK.
- public int GetPortName(out string portName)
- {
- portName = m_name;
- return VSConstants.S_OK;
- }
-
- #endregion
- }
-}
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7PortSupplier.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7PortSupplier.cs
deleted file mode 100644
index 60f5ec62..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7PortSupplier.cs
+++ /dev/null
@@ -1,339 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.VisualStudio.Debugger.Interop;
-using System.Runtime.InteropServices;
-using Microsoft.VisualStudio;
-using Microsoft.Win32;
-using System.Windows.Forms;
-using System.Security.Cryptography;
-using System.Runtime.InteropServices.ComTypes;
-using Microsoft.VisualStudio.Shell;
-using VSNDK.Parser;
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// This class supplies ports to the Session Debug Manager (SDM).
- ///
- /// It implements:
- ///
- /// - IDebugPortSupplier2 - This interface supplies ports to the session debug manager (SDM). (http://msdn.microsoft.com/en-ca/library/bb145819.aspx)
- /// - IDebugPortSupplierDescription2 - Enables the Visual Studio UI to display text inside the Transport Information section of
- /// the Attach to Process dialog box. (http://msdn.microsoft.com/en-us/library/bb458056.aspx)
- ///
- /// It is needed to enable updating the list of processes in the "attach to process" user interface.
- ///
- [ComVisible(true)]
- [Guid("BDC2218C-D50C-4A5A-A2F6-66BDC94FF8D6")]
- public class AD7PortSupplier : IDebugPortSupplier2, IDebugPortSupplierDescription2
- {
-
- ///
- /// The name of the port supplier.
- ///
- private string m_name;
-
- ///
- /// The description for the port supplier.
- ///
- private string m_description;
-
- ///
- /// The NDK host path.
- ///
- private string m_toolsPath = "";
-
- ///
- /// List of ports for this port supplier.
- ///
- Dictionary m_ports = new Dictionary();
-
-
- ///
- /// Constructor.
- ///
- public AD7PortSupplier()
- {
- m_name = "BlackBerry";
- m_description = "The BlackBerry transport lets you select a process that is running in a BlackBerry Device/Simulator";
- }
-
- private int verifyAndAddPorts()
- {
- if (GDBParser.s_running == true) // Returning because VS can debug only one app at a time.
- return 0;
-
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkPluginRegKey = null;
- string DeviceIP = "";
- string DevicePassword = "";
- string SimulatorIP = "";
- string SimulatorPassword = "";
-
- try
- {
- rkPluginRegKey = rkHKCU.OpenSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- m_toolsPath = rkPluginRegKey.GetValue("NDKHostPath").ToString();
-
- if ((m_toolsPath == null) || (m_toolsPath == ""))
- return -1;
-
- m_toolsPath += "/usr/bin";
-
- DeviceIP = rkPluginRegKey.GetValue("device_IP").ToString();
- if ((DeviceIP != "") && (DeviceIP != null))
- {
- DevicePassword = rkPluginRegKey.GetValue("device_password").ToString();
- if ((DevicePassword != "") && (DevicePassword != null))
- {
- try
- {
- DevicePassword = Decrypt(DevicePassword);
- }
- catch
- {
- DevicePassword = "";
- }
- }
- if (DevicePassword == "")
- {
- MessageBox.Show("Missing Device password", "Missing Device Password", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- }
- else
- {
- DeviceIP = "";
- }
- SimulatorIP = rkPluginRegKey.GetValue("simulator_IP").ToString();
- SimulatorPassword = rkPluginRegKey.GetValue("simulator_password").ToString();
- if ((SimulatorPassword != "") && (SimulatorPassword != null))
- {
- try
- {
- SimulatorPassword = Decrypt(SimulatorPassword);
- }
- catch
- {
- SimulatorPassword = "";
- }
- }
- }
- catch (Exception ex)
- {
- System.Windows.Forms.MessageBox.Show(ex.Message, "Microsoft Visual Studio", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
- }
-
- rkPluginRegKey.Close();
- rkHKCU.Close();
-
- if ((DeviceIP != "") && (DevicePassword != ""))
- {
- IDebugPort2 p;
- AddPort(new AD7PortRequest("Device: " + DeviceIP + "-" + DevicePassword), out p);
- }
-
- if (SimulatorIP != "")
- {
- IDebugPort2 p;
- AddPort(new AD7PortRequest("Simulator: " + SimulatorIP + "-" + SimulatorPassword), out p);
- }
- return 1;
- }
-
-
- ///
- /// Creates an AD7Port.
- ///
- /// Port request.
- /// Returns an AD7Port.
- AD7Port CreatePort(AD7PortRequest port_request)
- {
- string portname;
- Guid guid;
- bool isSimulator = false;
- port_request.GetPortName(out portname);
- string password = portname.Substring(portname.IndexOf('-') + 1);
- portname = portname.Remove(portname.IndexOf('-'));
- if (portname.Substring(0, 6) == "Device")
- guid = new Guid("{69519DBB-5329-4CCE-88A9-EC1628AD99C2}");
- else
- {
- guid = new Guid("{25040BDD-6683-4D5C-8EFA-EB4DDF5CA08E}");
- isSimulator = true;
- }
-
- return new AD7Port(this, port_request, guid, portname, password, isSimulator, m_toolsPath);
- }
-
-
- #region Implementation of IDebugPortSupplier2
-
- ///
- /// Adds a port. (http://msdn.microsoft.com/en-ca/library/bb161980.aspx)
- ///
- /// An IDebugPortRequest2 object that describes the port to be added.
- /// Returns an IDebugPort2 object that represents the port.
- /// VSConstants.S_OK.
- public int AddPort(IDebugPortRequest2 pRequest, out IDebugPort2 ppPort)
- {
- AD7PortRequest port_request = (AD7PortRequest)pRequest;
- var port = CreatePort(port_request);
- m_ports.Add(port.m_guid, port);
- ppPort = port;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Verifies that a port supplier can add new ports. (http://msdn.microsoft.com/en-ca/library/bb145880.aspx)
- ///
- /// VSConstants.S_OK.
- public int CanAddPort()
- {
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Retrieves a list of all the ports supplied by a port supplier. (http://msdn.microsoft.com/en-ca/library/bb146984.aspx)
- ///
- /// Returns an IEnumDebugPorts2 object containing a list of ports supplied.
- /// VSConstants.S_OK.
- public int EnumPorts(out IEnumDebugPorts2 ppEnum)
- {
- m_ports.Clear();
- int success = verifyAndAddPorts();
- AD7Port[] ports = new AD7Port[m_ports.Count()];
-
- if (m_ports.Count() > 0)
- {
- int i = 0;
- foreach (var p in m_ports)
- {
- ports[i] = p.Value;
- i++;
- }
- }
- else
- {
- if (success == 0)
- MessageBox.Show("Visual Studio can debug only one BlackBerry application at a time.\n\nPlease, select a different transport or close the current debug session.", "Visual Studio is already debugging an application", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- else if (success == -1)
- MessageBox.Show("You must select an API Level to be able to attach to a running process.\n\nPlease, use \"BlackBerry -> Settings -> Get more\" to download one.", "Missing NDK", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- else
- MessageBox.Show("Missing Device/Simulator information. Please, use menu BlackBerry -> Settings to add any of those information.", "Missing Device/Simulator Data", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
-
- ppEnum = new AD7PortEnum(ports);
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets a port from a port supplier. (http://msdn.microsoft.com/en-ca/library/bb161812.aspx)
- ///
- /// Globally unique identifier (GUID) of the port.
- /// Returns an IDebugPort2 object that represents the port.
- /// VSConstants.S_OK.
- public int GetPort(ref Guid guidPort, out IDebugPort2 ppPort)
- {
- ppPort = m_ports[guidPort];
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the port supplier identifier. (http://msdn.microsoft.com/en-ca/library/bb146617.aspx)
- ///
- /// Returns the GUID of the port supplier.
- /// VSConstants.S_OK.
- public int GetPortSupplierId(out Guid pguidPortSupplier)
- {
- pguidPortSupplier = this.GetType().GUID;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the port supplier name. (http://msdn.microsoft.com/en-ca/library/bb162136.aspx)
- ///
- /// Returns the name of the port supplier.
- /// VSConstants.S_OK.
- public int GetPortSupplierName(out string pbstrName)
- {
- pbstrName = m_name;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Removes a port. Not implemented. (http://msdn.microsoft.com/en-ca/library/bb162306.aspx)
- ///
- /// An IDebugPort2 object that represents the port to be removed.
- /// Not implemented. It should returns S_OK if successful; or an error code.
- public int RemovePort(IDebugPort2 pPort)
- {
- throw new NotImplementedException();
- }
-
- #endregion
-
-
- #region Implementation of IDebugPortSupplierDescription2
-
- ///
- /// Retrieves the description for the port supplier. (http://msdn.microsoft.com/en-us/library/bb457978.aspx)
- ///
- /// Metadata flags for the description.
- /// Description of the port supplier.
- /// VSConstants.S_OK.
- public int GetDescription(enum_PORT_SUPPLIER_DESCRIPTION_FLAGS[] pdwFlags, out string pbstrText)
- {
- pbstrText = m_description;
- return VSConstants.S_OK;
- }
-
- #endregion
-
- ///
- /// Decrypts a given string.
- ///
- /// A base64 encoded string that was created
- /// through the or
- /// extension methods.
- /// The decrypted string.
- /// Keep in mind that the decrypted string remains in memory
- /// and makes your application vulnerable per se. If runtime protection
- /// is essential, should be used.
- /// If
- /// is a null reference.
- public string Decrypt(string cipher)
- {
- if (cipher == null) throw new ArgumentNullException("cipher");
-
- //parse base64 string
- byte[] data = Convert.FromBase64String(cipher);
-
- //decrypt data
- byte[] decrypted = ProtectedData.Unprotect(data, null, DataProtectionScope.LocalMachine);
-
- return Encoding.Unicode.GetString(decrypted);
- }
- }
-}
\ No newline at end of file
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7Process.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7Process.cs
deleted file mode 100644
index 0ec91b9a..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7Process.cs
+++ /dev/null
@@ -1,412 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-using VSNDK.Parser;
-using System.Collections.Specialized;
-using Microsoft.VisualStudio.Shell.Interop;
-//using VSNDK.AddIn;
-using System.Windows.Forms;
-
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// This class represents a process running on a port. If the port is the local port, then IDebugProcess2 usually represents a
- /// physical process on the local machine. Not implemented completely. (http://msdn.microsoft.com/en-ca/library/bb147137.aspx).
- ///
- /// It also implements IDebugProcessEx2: This interface lets the session debug manager (SDM) notify a process that it is
- /// attaching to or detaching from the process. (http://msdn.microsoft.com/en-us/library/bb145892.aspx)
- ///
- /// Process "Is a container for a set of programs".
- ///
- /// This interface is implemented by a custom port supplier to manage programs as a group. An IDebugProcess2 contains one or more
- /// IDebugProgram2 interfaces.
- ///
- public class AD7Process : IDebugProcess2, IDebugProcessEx2
- {
- ///
- /// Identifies the session in which this process is attached to.
- ///
- IDebugSession2 session;
-
- ///
- /// The name of the process. Not used till now. Has no value assigned to it.
- ///
- public string _name;
-
- ///
- /// The AD7Port object that represents the port used in Attach to Process UI.
- ///
- public AD7Port _portAttach = null;
-
- ///
- /// The IDebugPort2 object that represents the port on which the process was launched.
- ///
- IDebugPort2 _port = null;
-
- ///
- /// Process GUID.
- ///
- public Guid _processGUID = Guid.NewGuid();
-
- ///
- /// Process ID.
- ///
- public string _processID;
-
- ///
- /// The server on which this process is running. Not used till now. Has no value assigned to it.
- ///
- IDebugCoreServer2 _server;
-
- ///
- /// The AD7Engine object that represents the DE.
- ///
- protected AD7Engine _engine = null;
-
- ///
- /// A program that is running in this process. It should be an array of programs, as a process "is a container for
- /// a set of programs" but, at this moment, the VSNDK supports only one program at a time.
- ///
- public IDebugProgram2 m_program = null;
-
- ///
- /// The list of programs that are running in this process.
- ///
- List m_listOfPrograms = new List();
-
- ///
- /// Constructor.
- ///
- /// The AD7Engine object that represents the DE.
- /// The IDebugPort2 object that represents the port on which the process was launched.
- public AD7Process(AD7Engine aEngine, IDebugPort2 aPort)
- {
- _engine = aEngine;
- _port = aPort;
- m_program = aEngine.m_program;
- }
-
-
- ///
- /// Constructor.
- ///
- /// The AD7Port object that represents the port used in Attach to Process UI.
- /// The process ID.
- /// The process name.
- public AD7Process(AD7Port aPort, string ID, string name)
- {
- _portAttach = aPort;
- _processID = ID;
- _name = name;
- }
-
-
- ///
- /// Attaches the session debug manager (SDM) to the process. Not implemented. Currently using IDebugEngine2.Attach.
- /// (http://msdn.microsoft.com/en-ca/library/bb145875.aspx)
- ///
- /// An IDebugEventCallback2 object that is used for debug event notification.
- /// An array of GUIDs of debug engines to be used to debug programs running in the process.
- /// This parameter can be a null value.
- /// The number of debug engines in the rgguidSpecificEngines array and the size of the
- /// rghrEngineAttach array.
- /// An array of HRESULT codes returned by the debug engines.
- /// VSConstants.S_OK.
- public int Attach(IDebugEventCallback2 pCallback, Guid[] rgguidSpecificEngines, uint celtSpecificEngines, int[] rghrEngineAttach)
- {
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Determines if the session debug manager (SDM) can detach the process. Not implemented.
- /// (http://msdn.microsoft.com/en-us/library/bb145567.aspx)
- ///
- /// VSConstants.S_OK.
- public int CanDetach()
- {
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Requests that the next program that is running code in this process halt and send an IDebugBreakEvent2 event object.
- /// Not implemented. (http://msdn.microsoft.com/en-us/library/bb162292.aspx)
- ///
- /// VSConstants.S_OK.
- public int CauseBreak()
- {
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Detaches the debugger from this process by detaching all of the programs in the process.
- /// (http://msdn.microsoft.com/en-us/library/bb162197.aspx)
- ///
- /// VSConstants.S_OK.
- public int Detach()
- {
- _port = null;
- _portAttach = null;
- _engine = null;
- m_program = null;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Retrieves a list of all the programs contained by this process.
- /// (http://msdn.microsoft.com/en-us/library/bb162305.aspx)
- ///
- /// Returns an IEnumDebugPrograms2 object that contains a list of all the programs in the process.
- /// VSConstants.S_OK.
- public int EnumPrograms(out IEnumDebugPrograms2 ppEnum)
- {
- if (m_listOfPrograms.Count == 0)
- {
- AD7ProgramNodeAttach pn = new AD7ProgramNodeAttach(this, new Guid("{E5A37609-2F43-4830-AA85-D94CFA035DD2}"));
- m_listOfPrograms.Add((IDebugProgram2)pn);
- }
- IDebugProgram2[] p = new IDebugProgram2[m_listOfPrograms.Count()];
- int i = 0;
- foreach (var prog in m_listOfPrograms)
- {
- p[i] = prog;
- i++;
- }
- ppEnum = new AD7ProgramEnum(p);
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Retrieves a list of all the threads running in all programs in the process. Not implemented.
- /// (http://msdn.microsoft.com/en-us/library/bb144981.aspx)
- ///
- /// Returns an IEnumDebugThreads2 object that contains a list of all threads in all programs in the
- /// process.
- /// VSConstants.S_OK.
- public int EnumThreads(out IEnumDebugThreads2 ppEnum)
- {
- ppEnum = null;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the name of the session that is debugging the process. [DEPRECATED. SHOULD ALWAYS RETURN E_NOTIMPL.]
- /// (http://msdn.microsoft.com/en-us/library/bb146718.aspx)
- ///
- /// DEPRECATED. Return null.
- /// This method should always return E_NOTIMPL.
- public int GetAttachedSessionName(out string pbstrSessionName)
- {
- pbstrSessionName = null;
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// Gets a description of the process. (http://msdn.microsoft.com/en-us/library/bb145895.aspx)
- ///
- /// A combination of values from the PROCESS_INFO_FIELDS enumeration that specifies which fields of
- /// the pProcessInfo parameter are to be filled in.
- /// A PROCESS_INFO structure that is filled in with a description of the process.
- /// VSConstants.S_OK.
- public int GetInfo(enum_PROCESS_INFO_FIELDS Fields, PROCESS_INFO[] pProcessInfo)
- {
- try
- {
- if ((Fields & enum_PROCESS_INFO_FIELDS.PIF_FILE_NAME) != 0)
- {
- pProcessInfo[0].bstrFileName = this._name;
- pProcessInfo[0].Fields |= enum_PROCESS_INFO_FIELDS.PIF_FILE_NAME;
- }
- if ((Fields & enum_PROCESS_INFO_FIELDS.PIF_BASE_NAME) != 0)
- {
- pProcessInfo[0].bstrBaseName = this._name.Substring(_name.LastIndexOf('/') + 1);
- pProcessInfo[0].Fields |= enum_PROCESS_INFO_FIELDS.PIF_BASE_NAME;
- }
- if ((Fields & enum_PROCESS_INFO_FIELDS.PIF_TITLE) != 0)
- {
- pProcessInfo[0].bstrTitle = this._name;
- pProcessInfo[0].Fields |= enum_PROCESS_INFO_FIELDS.PIF_TITLE;
- }
- if ((Fields & enum_PROCESS_INFO_FIELDS.PIF_PROCESS_ID) != 0)
- {
- pProcessInfo[0].ProcessId.dwProcessId = Convert.ToUInt32(this._processID);
- pProcessInfo[0].ProcessId.ProcessIdType = (uint)enum_AD_PROCESS_ID.AD_PROCESS_ID_SYSTEM;
- pProcessInfo[0].Fields |= enum_PROCESS_INFO_FIELDS.PIF_PROCESS_ID;
- }
- if ((Fields & enum_PROCESS_INFO_FIELDS.PIF_SESSION_ID) != 0)
- {
-// pProcessInfo[0].dwSessionId = 0;
- pProcessInfo[0].Fields |= enum_PROCESS_INFO_FIELDS.PIF_SESSION_ID;
- }
- if ((Fields & enum_PROCESS_INFO_FIELDS.PIF_ATTACHED_SESSION_NAME) != 0)
- {
-// pProcessInfo[0].bstrAttachedSessionName = null;
- pProcessInfo[0].Fields |= enum_PROCESS_INFO_FIELDS.PIF_ATTACHED_SESSION_NAME;
- }
- if ((Fields & enum_PROCESS_INFO_FIELDS.PIF_CREATION_TIME) != 0)
- {
-// pProcessInfo[0].CreationTime = null;
- pProcessInfo[0].Fields |= enum_PROCESS_INFO_FIELDS.PIF_CREATION_TIME;
- }
-
- return VSConstants.S_OK;
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
- }
-
-
- ///
- /// Gets the name of the process. (http://msdn.microsoft.com/en-us/library/bb161270.aspx)
- ///
- /// A value from the GETNAME_TYPE enumeration that specifies what type of name to return.
- /// Returns the name of the process.
- /// VSConstants.S_OK.
- public int GetName(enum_GETNAME_TYPE gnType, out string pbstrName)
- {
- pbstrName = _name;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the system process identifier. (http://msdn.microsoft.com/en-us/library/bb146648.aspx)
- ///
- /// An AD_PROCESS_ID structure that is filled in with the system process identifier information.
- /// VSConstants.S_OK.
- public int GetPhysicalProcessId(AD_PROCESS_ID[] pProcessId)
- {
- if (_engine == null)
- {
- pProcessId[0].dwProcessId = Convert.ToUInt32(_processID);
- pProcessId[0].ProcessIdType = (uint)enum_AD_PROCESS_ID.AD_PROCESS_ID_SYSTEM;
- }
- else
- {
- pProcessId[0].guidProcessId = _processGUID;
- pProcessId[0].ProcessIdType = (uint)enum_AD_PROCESS_ID.AD_PROCESS_ID_GUID;
- }
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the port that the process is running on. (http://msdn.microsoft.com/en-us/library/bb162121.aspx)
- ///
- /// Returns an IDebugPort2 object that represents the port on which the process was launched.
- /// VSConstants.S_OK.
- public int GetPort(out IDebugPort2 ppPort)
- {
- ppPort = _port;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the GUID for this process. (http://msdn.microsoft.com/en-us/library/bb161938.aspx)
- ///
- /// Returns the GUID for this process.
- /// VSConstants.S_OK.
- public int GetProcessId(out Guid pguidProcessId)
- {
- pguidProcessId = _processGUID;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the server that this process is running on. Not implemented completely because _server has no value assigned to it.
- /// (http://msdn.microsoft.com/en-us/library/bb147017.aspx)
- ///
- /// Returns an IDebugCoreServer2 object that represents the server on which this process is running.
- /// VSConstants.S_OK.
- public int GetServer(out IDebugCoreServer2 ppServer)
- {
- ppServer = _server;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Terminates the process. Not implemented. (http://msdn.microsoft.com/en-us/library/bb146226.aspx)
- ///
- /// VSConstants.S_OK.
- public int Terminate()
- {
- return VSConstants.S_OK;
- }
-
-
- #region IDebugProcessEx2 Members
-
- ///
- /// Informs the process that a session is now debugging the process. (http://msdn.microsoft.com/en-us/library/bb162300.aspx)
- ///
- /// A value that uniquely identifies the session attaching to this process.
- /// VSConstants.S_OK.
- public int Attach(IDebugSession2 pSession)
- {
- session = pSession;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Informs the process that a session is no longer debugging the process. (http://msdn.microsoft.com/en-us/library/bb146313.aspx)
- ///
- /// A value that uniquely identifies the session to detach this process from.
- /// VSConstants.S_OK.
- public int Detach(IDebugSession2 pSession)
- {
- session = pSession;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Adds program nodes for a list of debug engines. (http://msdn.microsoft.com/en-us/library/bb146990.aspx)
- /// In this project, it is used only one debug engine, that's why its GUID is assigned to the guidLaunchingEngine explicitly.
- ///
- /// The GUID of a DE that is to be used to launch programs (and is assumed to add its own
- /// program nodes).
- /// Array of GUIDs of DEs for which program nodes will be added.
- /// The number of GUIDs in the rgguidSpecificEngines array.
- /// VSConstants.S_OK.
- public int AddImplicitProgramNodes(ref Guid guidLaunchingEngine, Guid[] rgguidSpecificEngines, uint celtSpecificEngines)
- {
- guidLaunchingEngine = new Guid("{E5A37609-2F43-4830-AA85-D94CFA035DD2}");
- return VSConstants.S_OK;
- }
-
- #endregion
-
- }
-}
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7ProgramNode.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7ProgramNode.cs
deleted file mode 100644
index 94404c2b..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7ProgramNode.cs
+++ /dev/null
@@ -1,210 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-using System.Diagnostics;
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// This class implements IDebugProgramNode2. (http://msdn.microsoft.com/en-ca/library/bb146735.aspx)
- /// This interface represents a program that can be debugged.
- /// A running process is viewed as a ProgramNode by VS.
- /// A debug engine (DE) or a custom port supplier implements this interface to represent a program that can be debugged.
- ///
- public class AD7ProgramNode : IDebugProgramNode2
- {
- ///
- /// The GUID of the hosting process.
- ///
- readonly Guid m_processGuid;
-
- ///
- /// The ID of the program to be debugged.
- ///
- public string m_programID;
-
- ///
- /// The program friendly name.
- ///
- public string m_programName;
-
- ///
- /// The file name of the program to be debugged.
- ///
- readonly string m_exePath;
-
- ///
- /// The GUID of the VSNDK debug engine.
- ///
- readonly Guid m_engineGuid;
-
-
- ///
- /// Constructor.
- /// At this moment, used only for testing purposes, because GetProviderProcessData (AD7ProgramProvider.cs) needs a program node.
- ///
- /// The GUID for this process.
- public AD7ProgramNode(Guid processGuid)
- {
- m_processGuid = processGuid;
- m_programID = "";
- m_exePath = "";
- m_programName = "";
- m_engineGuid = new Guid(AD7Engine.Id);
- }
-
-
- ///
- /// Constructor.
- ///
- /// The GUID for this process.
- /// The ID of the program to be debugged.
- /// The name of the executable to be debugged.
- /// The GUID of the VSNDK debug engine.
- public AD7ProgramNode(Guid processGuid, string programID, string exePath, Guid engineGuid)
- {
- m_processGuid = processGuid;
- m_programID = programID;
-
- m_exePath = exePath;
- do
- {
- m_exePath = m_exePath.Replace("\\\\", "\\");
- }
- while (m_exePath.IndexOf("\\\\") != -1);
-
- int i = exePath.LastIndexOf('\\');
- if ((i != -1) && (i < (exePath.Length - 1)))
- m_programName = exePath.Substring(i + 1);
- else
- m_programName = exePath;
-
- m_engineGuid = engineGuid;
- }
-
- #region IDebugProgramNode2 Members
-
-
- ///
- /// Gets the name and identifier of the DE running this program. (http://msdn.microsoft.com/en-ca/library/bb146303.aspx)
- ///
- /// Returns the name of the DE running the program (C++-specific: this can be a null pointer
- /// indicating that the caller is not interested in the name of the engine).
- /// Returns the globally unique identifier of the DE running the program (C++-specific: this can
- /// be a null pointer indicating that the caller is not interested in the GUID of the engine).
- /// VSConstants.S_OK.
- int IDebugProgramNode2.GetEngineInfo(out string engineName, out Guid engineGuid)
- {
- engineName = "";
- engineGuid = m_engineGuid;
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the system process identifier for the process hosting a program. (http://msdn.microsoft.com/en-us/library/bb162159.aspx)
- ///
- /// Returns the system process identifier for the hosting process.
- /// VSConstants.S_OK.
- int IDebugProgramNode2.GetHostPid(AD_PROCESS_ID[] pHostProcessId)
- {
- // According to the MSDN documentation (http://msdn.microsoft.com/en-us/library/bb162159.aspx),
- // it should return the process id of the hosting process, but what is expected is the program ID...
- pHostProcessId[0].ProcessIdType = (uint)enum_AD_PROCESS_ID.AD_PROCESS_ID_GUID;
- pHostProcessId[0].guidProcessId = m_processGuid;
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the name of the process hosting a program. (http://msdn.microsoft.com/en-us/library/bb145135.aspx)
- ///
- /// A value from the GETHOSTNAME_TYPE enumeration that specifies the type of name to return.
- /// Returns the name of the hosting process.
- /// VSConstants.S_OK.
- int IDebugProgramNode2.GetHostName(enum_GETHOSTNAME_TYPE dwHostNameType, out string processName)
- {
- if (dwHostNameType == enum_GETHOSTNAME_TYPE.GHN_FILE_NAME)
- processName = "(BB-pid = " + m_programID + ") " + m_exePath;
- else
- processName = m_programName;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the name of a program. (http://msdn.microsoft.com/en-us/library/bb145928.aspx)
- ///
- /// Returns the name of the program.
- /// VSConstants.S_OK.
- int IDebugProgramNode2.GetProgramName(out string programName)
- {
- programName = m_programName;
- return VSConstants.S_OK;
- }
-
- #endregion
-
- #region Deprecated interface methods
- // These methods are not called by the Visual Studio debugger, so they don't need to be implemented
-
-
- ///
- /// DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161399.aspx)
- ///
- /// The IDebugProgram2 interface that represents the program to attach to.
- /// The IDebugEventCallback2 interface to be used to send debug events to the SDM.
- /// A value from the ATTACH_REASON enumeration that specifies the reason for attaching.
- /// VSConstants.E_NOTIMPL.
- int IDebugProgramNode2.Attach_V7(IDebugProgram2 pMDMProgram, IDebugEventCallback2 pCallback, uint dwReason)
- {
- Debug.Fail("This function is not called by the debugger");
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161803.aspx)
- ///
- /// VSConstants.E_NOTIMPL.
- int IDebugProgramNode2.DetachDebugger_V7()
- {
- Debug.Fail("This function is not called by the debugger");
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161297.aspx)
- ///
- /// Returns the name of the machine in which the program is running.
- /// VSConstants.E_NOTIMPL.
- int IDebugProgramNode2.GetHostMachineName_V7(out string hostMachineName)
- {
- Debug.Fail("This function is not called by the debugger");
- hostMachineName = null;
- return VSConstants.E_NOTIMPL;
- }
-
- #endregion
- }
-
-}
\ No newline at end of file
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7ProgramNodeAttach.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7ProgramNodeAttach.cs
deleted file mode 100644
index fea2d83b..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7ProgramNodeAttach.cs
+++ /dev/null
@@ -1,470 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Threading;
-using System.Xml;
-using System.Xml.Linq;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// This class is used only when the user wants to Attach to a running process and it implements:
- /// - IDebugProgramNode2. (http://msdn.microsoft.com/en-ca/library/bb146735.aspx)
- /// - and IDebugProgram2. (http://msdn.microsoft.com/en-us/library/bb147004.aspx)
- ///
- /// The Debug Engine does not use this class. It uses AD7ProgramNode.cs. This class is used only to represent each of the running
- /// processes that can be attached to the debug engine. When the debug engine attaches to a running process, an AD7ProgramNode
- /// class is used to represent the chosen running program. That's why some methods were not implemented.
- ///
- /// This interface represents a program that can be debugged.
- /// A running process is viewed as a ProgramNode by VS.
- /// A debug engine (DE) or a custom port supplier implements this interface to represent a program that can be debugged.
- ///
- class AD7ProgramNodeAttach : IDebugProgramNode2, IDebugProgram2
- {
- ///
- /// The hosting process.
- ///
- public AD7Process m_process;
-
- ///
- /// The GUID of the hosting process.
- ///
- public Guid m_processGuid;
-
- ///
- /// The ID of the program to be debugged.
- ///
- public string m_programID;
-
- ///
- /// The program friendly name.
- ///
- public string m_programName;
-
- ///
- /// The file name of the program to be debugged.
- ///
- readonly string m_exePath;
-
- ///
- /// The GUID of the VSNDK debug engine.
- ///
- readonly Guid m_engineGuid;
-
-
- ///
- /// Constructor.
- ///
- /// The hosting process.
- /// The GUID of the VSNDK debug engine.
- public AD7ProgramNodeAttach(AD7Process proc, Guid engineGuid)
- {
- m_process = proc;
- m_processGuid = proc._processGUID;
- m_programID = proc._processID;
-
- m_exePath = proc._name;
- do
- {
- m_exePath = m_exePath.Replace("\\\\", "\\");
- }
- while (m_exePath.IndexOf("\\\\") != -1);
-
- int i = proc._name.LastIndexOf('\\');
- if ((i != -1) && (i < (proc._name.Length - 1)))
- m_programName = proc._name.Substring(i + 1);
- else
- m_programName = proc._name;
-
- m_engineGuid = engineGuid;
- }
-
-
- #region IDebugProgram2 Members
-
-
- ///
- /// Determines if a debug engine (DE) can detach from the program. (http://msdn.microsoft.com/en-us/library/bb161967.aspx)
- /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
- ///
- /// VSConstants.S_OK.
- public int CanDetach()
- {
- // The VSNDK debug engine always supports detach
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Requests that the program stop execution the next time one of its threads attempts to run. The debugger calls CauseBreak
- /// when the user clicks on the pause button in VS. The debugger should respond by entering breakmode.
- /// (http://msdn.microsoft.com/en-us/library/bb145018.aspx)
- /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
- ///
- /// VSConstants.S_OK.
- public int CauseBreak()
- {
- return ((IDebugEngine2)this).CauseBreak();
- }
-
-
- ///
- /// Continues running this program from a stopped state. Any previous execution state (such as a step) is preserved, and
- /// the program starts executing again. (http://msdn.microsoft.com/en-us/library/bb162148.aspx).
- /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
- ///
- /// An IDebugThread2 object that represents the thread.
- /// VSConstants.S_OK.
- public int Continue(IDebugThread2 pThread)
- {
- // This method is not called by the debug engine.
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Detaches a debug engine from the program. (http://msdn.microsoft.com/en-us/library/bb146228.aspx)
- /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
- ///
- /// VSConstants.S_OK.
- public int Detach()
- {
- // This method is not called by the debug engine.
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Retrieves a list of the code contexts for a given position in a source file. Not implemented.
- /// (http://msdn.microsoft.com/en-us/library/bb145902.aspx)
- ///
- /// An object representing an abstract position in a source file known to the IDE.
- /// Returns an IEnumDebugCodeContexts2 object that contains a list of the code contexts.
- /// Not implemented.
- public int EnumCodeContexts(IDebugDocumentPosition2 pDocPos, out IEnumDebugCodeContexts2 ppEnum)
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Retrieves a list of the code paths for a given position in a source file. EnumCodePaths is used for the step-into specific
- /// feature -- right click on the current statement and decide which function to step into. This is not something that the
- /// VSNDK debug engine supports. (http://msdn.microsoft.com/en-us/library/bb162326.aspx)
- ///
- /// The word under the cursor in the Source or Disassembly view in the IDE.
- /// An IDebugCodeContext2 object representing the current code context.
- /// An IDebugStackFrame2 object representing the stack frame associated with the current breakpoint.
- /// Nonzero (TRUE) if in the Source view, or zero (FALSE) if in the Disassembly view.
- /// Returns an IEnumCodePaths2 object containing a list of the code paths.
- /// Returns an IDebugCodeContext2 object representing an additional code context to be set as a
- /// breakpoint in case the chosen code path is skipped. This can happen in the case of a short-circuited Boolean expression,
- /// for example.
- /// VSConstants.E_NOTIMPL.
- public int EnumCodePaths(string Hint, IDebugCodeContext2 start, IDebugStackFrame2 frame, int fSource, out IEnumCodePaths2 pathEnum, out IDebugCodeContext2 safetyContext)
- {
- pathEnum = null;
- safetyContext = null;
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// Retrieves a list of the modules that this program has loaded and is executing.
- /// (http://msdn.microsoft.com/en-us/library/bb146980.aspx)
- ///
- /// Returns an IEnumDebugModules2 object that contains a list of the modules.
- /// VSConstants.S_OK.
- public int EnumModules(out IEnumDebugModules2 ppEnum)
- {
- // Setting ppEnum to null because we are not adding/working with this feature now. It was causing an error
- // when opening Threads Window and ppEnum = new AD7ModuleEnum(new[] { m_module }).
- ppEnum = null;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Retrieves a list of the threads that are running in the program. (http://msdn.microsoft.com/en-us/library/bb145110.aspx)
- /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
- ///
- /// Returns an IEnumDebugThreads2 object that contains a list of the threads.
- /// If successful, returns S_OK; otherwise, returns an error code.
- public int EnumThreads(out IEnumDebugThreads2 ppEnum)
- {
- ppEnum = null;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the program's properties. The VSNDK debug engine does not support this.
- /// (http://msdn.microsoft.com/en-us/library/bb161801.aspx)
- ///
- /// Returns an IDebugProperty2 object that represents the program's properties.
- /// Not implemented.
- public int GetDebugProperty(out IDebugProperty2 ppProperty)
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Gets the disassembly stream for this program or a part of this program.
- /// The sample engine does not support dissassembly so it returns E_NOTIMPL
- ///
- /// Specifies a value from the DISASSEMBLY_STREAM_SCOPE enumeration that defines the scope of the
- /// disassembly stream.
- /// An object that represents the position of where to start the disassembly stream.
- /// Returns an IDebugDisassemblyStream2 object that represents the disassembly stream.
- /// VSConstants.E_NOTIMPL.
- public int GetDisassemblyStream(enum_DISASSEMBLY_STREAM_SCOPE dwScope, IDebugCodeContext2 codeContext, out IDebugDisassemblyStream2 disassemblyStream)
- {
- disassemblyStream = null;
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// This method gets the Edit and Continue (ENC) update for this program. A custom debug engine always returns E_NOTIMPL
- ///
- /// Returns an internal interface that can be used to update this program.
- /// VSConstants.S_OK.
- public int GetENCUpdate(out object update)
- {
- // The VSNDK debug engine does not participate in managed edit & continue.
- update = null;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Retrieves the memory bytes occupied by the program. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145291.aspx)
- ///
- /// Returns an IDebugMemoryBytes2 object that represents the memory bytes of the program.
- /// Not implemented.
- public int GetMemoryBytes(out IDebugMemoryBytes2 ppMemoryBytes)
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Gets the name of the program. The name returned by this method is always a friendly, user-displayable name that describes
- /// the program. (http://msdn.microsoft.com/en-us/library/bb161279.aspx)
- ///
- /// Returns the name of the program.
- /// VSConstants.S_OK.
- public int GetName(out string programName)
- {
- programName = this.m_programName;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets a GUID for this program. A debug engine (DE) must return the program identifier originally passed to the
- /// IDebugProgramNodeAttach2::OnAttach or IDebugEngine2::Attach methods. This allows identification of the program
- /// across debugger components. (http://msdn.microsoft.com/en-us/library/bb145581.aspx)
- ///
- /// Returns the GUID for this program.
- /// VSConstants.S_OK.
- public int GetProgramId(out Guid guidProgramId)
- {
- guidProgramId = m_processGuid;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Performs a step. This method is deprecated. Use the IDebugProcess3::Step method instead.
- /// (http://msdn.microsoft.com/en-us/library/bb162134.aspx)
- /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
- ///
- /// An IDebugThread2 object that represents the thread being stepped.
- /// A value from the STEPKIND enumeration that specifies the kind of step.
- /// A value from the STEPUNIT enumeration that specifies the unit of step.
- /// If successful, returns S_OK; otherwise, returns an error code.
- public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
- {
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Terminates the program. (http://msdn.microsoft.com/en-us/library/bb145919.aspx)
- /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
- ///
- /// VSConstants.S_OK.
- public int Terminate()
- {
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Writes a dump to a file. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145827.aspx)
- ///
- /// A value from the DUMPTYPE enumeration that specifies the type of dump, for example, short or
- /// long.
- /// The URL to write the dump to. Typically, this is in the form of file://c:\path\filename.ext,
- /// but may be any valid URL.
- /// VSConstants.E_NOTIMPL.
- public int WriteDump(enum_DUMPTYPE DUMPTYPE, string pszDumpUrl)
- {
- // The VSNDK debugger does not support creating or reading mini-dumps.
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// Get the process that this program is running in. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145293.aspx)
- ///
- /// Returns the IDebugProcess2 interface that represents the process.
- /// VSConstants.E_NOTIMPL.
- public int GetProcess(out IDebugProcess2 process)
- {
- Debug.Fail("This function is not called by the debugger");
-
- process = null;
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// Attaches to the program. Not implemented. (http://msdn.microsoft.com/en-us/library/bb161973.aspx)
- ///
- /// An IDebugEventCallback2 object to be used for debug event notification.
- /// VSConstants.E_NOTIMPL.
- public int Attach(IDebugEventCallback2 pCallback)
- {
- Debug.Fail("This function is not called by the debugger");
-
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// Continues running this program from a stopped state. Any previous execution state (such as a step) is cleared, and the
- /// program starts executing again. Not implemented. (http://msdn.microsoft.com/en-us/library/bb162315.aspx)
- /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
- ///
- /// VSConstants.S_OK.
- public int Execute()
- {
- return VSConstants.S_OK;
- }
-
- #endregion
-
- #region IDebugProgramNode2 Members
-
-
- ///
- /// Gets the name and GUID of the debug engine running this program. (http://msdn.microsoft.com/en-ca/library/bb146303.aspx)
- ///
- /// Returns the name of the DE running this program.
- /// Returns the GUID of the DE running this program.
- /// VSConstants.S_OK.
- public int GetEngineInfo(out string engineName, out Guid engineGuid)
- {
- engineName = "VSNDK Debug Engine";
- engineGuid = m_engineGuid;
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the system process identifier for the process hosting a program. (http://msdn.microsoft.com/en-us/library/bb162159.aspx)
- ///
- /// Returns the system process identifier for the hosting process.
- /// VSConstants.S_OK.
- public int GetHostPid(AD_PROCESS_ID[] pHostProcessId)
- {
- // According to the MSDN documentation (http://msdn.microsoft.com/en-us/library/bb162159.aspx),
- // it should return the process id of the hosting process, but what is expected is the program ID...
- pHostProcessId[0].ProcessIdType = (uint)enum_AD_PROCESS_ID.AD_PROCESS_ID_GUID;
- pHostProcessId[0].guidProcessId = m_processGuid;
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the name of the process hosting a program. (http://msdn.microsoft.com/en-us/library/bb145135.aspx)
- ///
- /// A value from the GETHOSTNAME_TYPE enumeration that specifies the type of name to return.
- /// Returns the name of the hosting process.
- /// VSConstants.S_OK.
- public int GetHostName(enum_GETHOSTNAME_TYPE dwHostNameType, out string processName)
- {
- if (dwHostNameType == enum_GETHOSTNAME_TYPE.GHN_FILE_NAME)
- processName = "(BB-pid = " + m_programID + ") " + m_exePath;
- else
- processName = m_programName;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the name of a program. (http://msdn.microsoft.com/en-us/library/bb145928.aspx)
- ///
- /// Returns the name of the program.
- /// VSConstants.S_OK.
- int IDebugProgramNode2.GetProgramName(out string programName)
- {
- programName = m_programName;
- return VSConstants.S_OK;
- }
-
- #endregion
-
- #region Deprecated interface methods
- // These methods are not called by the Visual Studio debugger, so they don't need to be implemented
-
-
- ///
- /// DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161399.aspx)
- ///
- /// The IDebugProgram2 interface that represents the program to attach to.
- /// The IDebugEventCallback2 interface to be used to send debug events to the SDM.
- /// A value from the ATTACH_REASON enumeration that specifies the reason for attaching.
- /// VSConstants.E_NOTIMPL.
- public int Attach_V7(IDebugProgram2 pMDMProgram, IDebugEventCallback2 pCallback, uint dwReason)
- {
- Debug.Fail("This function is not called by the debugger");
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161803.aspx)
- ///
- /// VSConstants.E_NOTIMPL.
- public int DetachDebugger_V7()
- {
- Debug.Fail("This function is not called by the debugger");
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161297.aspx)
- ///
- /// Returns the name of the machine in which the program is running.
- /// VSConstants.E_NOTIMPL.
- public int GetHostMachineName_V7(out string hostMachineName)
- {
- Debug.Fail("This function is not called by the debugger");
- hostMachineName = null;
- return VSConstants.E_NOTIMPL;
- }
-
- #endregion
- }
-}
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7ProgramProvider.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7ProgramProvider.cs
deleted file mode 100644
index fbd3518b..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7ProgramProvider.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Runtime.InteropServices;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-using System.Diagnostics;
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// This class implments IDebugProgramProvider2. (http://msdn.microsoft.com/en-us/library/bb161298.aspx)
- /// This registered interface allows the session debug manager (SDM) to obtain information about programs
- /// that have been "published" through the IDebugProgramPublisher2 interface.
- ///
- /// Partially implemented and not used at this moment.
- ///
- [ComVisible(true)]
- [Guid("AD06FD46-C790-4D5C-A274-8815DF9511B8")]
- public class AD7ProgramProvider : IDebugProgramProvider2
- {
-
- ///
- /// Constructor.
- ///
- public AD7ProgramProvider()
- {
- }
-
- #region IDebugProgramProvider2 Members
-
-
- ///
- /// Obtains information about programs running, filtered in a variety of ways.
- /// (http://msdn.microsoft.com/en-us/library/bb147025.aspx)
- ///
- /// A combination of flags from the PROVIDER_FLAGS enumeration.
- /// The port the calling process is running on.
- /// An AD_PROCESS_ID structure holding the ID of the process that contains the program in question.
- /// An array of GUIDs for debug engines assigned to debug this process (these will be used to filter
- /// the programs that are actually returned based on what the supplied engines support; if no engines are specified, then all
- /// programs will be returned).
- /// A PROVIDER_PROCESS_DATA structure that is filled in with the requested information.
- /// If successful, returns S_OK; otherwise, returns VSConstants.S_FALSE.
- int IDebugProgramProvider2.GetProviderProcessData(enum_PROVIDER_FLAGS Flags, IDebugDefaultPort2 port, AD_PROCESS_ID ProcessId, CONST_GUID_ARRAY EngineFilter, PROVIDER_PROCESS_DATA[] processArray)
- {
- processArray[0] = new PROVIDER_PROCESS_DATA();
-
- if (((uint)Flags & (uint)enum_PROVIDER_FLAGS.PFLAG_GET_PROGRAM_NODES) != 0)
- {
- // The debugger is asking the engine to return the program nodes it can debug. The VSNDK debug engine claims that it can
- // debug all processes, and returns exactly one program node for each process. A full-featured debugger may wish to
- // examine the target process and determine if it understands how to debug it.
-
- IDebugProgramNode2 node = (IDebugProgramNode2)(new AD7ProgramNode(ProcessId.guidProcessId));
-
- IntPtr[] programNodes = { Marshal.GetComInterfaceForObject(node, typeof(IDebugProgramNode2)) };
-
- IntPtr destinationArray = Marshal.AllocCoTaskMem(IntPtr.Size * programNodes.Length);
- Marshal.Copy(programNodes, 0, destinationArray, programNodes.Length);
-
- processArray[0].Fields = enum_PROVIDER_FIELDS.PFIELD_PROGRAM_NODES;
- processArray[0].ProgramNodes.Members = destinationArray;
- processArray[0].ProgramNodes.dwCount = (uint)programNodes.Length;
-
- return VSConstants.S_OK;
- }
-
- return VSConstants.S_FALSE;
- }
-
-
- ///
- /// Gets a program node, given a specific process ID. Not implemented.
- /// (http://msdn.microsoft.com/en-us/library/bb162155.aspx)
- ///
- /// A combination of flags from the PROVIDER_FLAGS enumeration.
- /// The port the calling process is running on.
- /// An AD_PROCESS_ID structure holding the ID of the process that contains the program in question.
- /// GUID of the debug engine that the program is attached to (if any).
- /// ID of the program for which to get the program node.
- /// An IDebugProgramNode2 object representing the requested program node.
- /// VSConstants.E_NOTIMPL.
- int IDebugProgramProvider2.GetProviderProgramNode(enum_PROVIDER_FLAGS Flags, IDebugDefaultPort2 port, AD_PROCESS_ID ProcessId, ref Guid guidEngine, ulong programId, out IDebugProgramNode2 programNode)
- {
- // This method is used for Just-In-Time debugging support, which this program provider does not support
- programNode = null;
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// Establishes a locale for any language-specific resources needed by the DE. Not implemented.
- /// (http://msdn.microsoft.com/en-us/library/bb161383.aspx)
- ///
- /// Language ID to establish. For example, 1033 for English.
- /// VSConstants.S_OK.
- int IDebugProgramProvider2.SetLocale(ushort wLangID)
- {
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Establishes a callback to watch for provider events associated with specific kinds of processes, allowing the process to
- /// be notified of port events. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145594.aspx)
- ///
- /// A combination of flags from the PROVIDER_FLAGS enumeration.
- /// The port the calling process is running on.
- /// An AD_PROCESS_ID structure holding the ID of the process that contains the program in question.
- /// An array of GUIDs of debug engines associated with the process.
- /// GUID of the debug engine that launched this process (if any).
- /// An IDebugPortNotify2 object that receives the event notifications.
- /// VSConstants.S_OK.
- int IDebugProgramProvider2.WatchForProviderEvents(enum_PROVIDER_FLAGS Flags, IDebugDefaultPort2 port, AD_PROCESS_ID ProcessId, CONST_GUID_ARRAY EngineFilter, ref Guid guidLaunchingEngine, IDebugPortNotify2 ad7EventCallback)
- {
- // The VSNDK debug engine is a native debugger, and can therefore always provide a program node
- // in GetProviderProcessData. Non-native debuggers may wish to implement this method as a way
- // of monitoring the process before code for their runtime starts. For example, if implementing a
- // 'foo script' debug engine, one could attach to a process which might eventually run 'foo script'
- // before this 'foo script' started.
- //
- // To implement this method, an engine would monitor the target process and call AddProgramNode
- // when the target process started running code which was debuggable by the engine. The
- // enum_PROVIDER_FLAGS.PFLAG_ATTACHED_TO_DEBUGGEE flag indicates if the request is to start
- // or stop watching the process.
-
- return VSConstants.S_OK;
- }
-
- #endregion
- }
-}
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7Property.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7Property.cs
deleted file mode 100644
index 3a8c8f7c..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7Property.cs
+++ /dev/null
@@ -1,377 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio;
-using VSNDK.Parser;
-using Microsoft.VisualStudio.Debugger.Interop;
-using System.Collections;
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// An implementation of IDebugProperty2. (http://msdn.microsoft.com/en-ca/library/bb161287.aspx)
- /// This interface represents a stack frame property, a program document property, or some other property.
- /// The property is usually the result of an expression evaluation.
- ///
- class AD7Property : IDebugProperty2
- {
-
- ///
- /// Object that contains all information about a variable / expression.
- ///
- private VariableInfo _variableInfo;
-
-
- ///
- /// Object that contains all information about a stack frame.
- ///
- private AD7StackFrame _stackFrame;
-
-
- ///
- /// Constructor.
- ///
- /// Contains all information about a variable / expression.
- public AD7Property(AD7StackFrame vi)
- {
- _stackFrame = vi;
- }
-
- ///
- /// Constructor.
- ///
- /// Contains all information about a variable / expression.
- public AD7Property(VariableInfo vi)
- {
- _variableInfo = vi;
- }
-
- ///
- /// Construct a DEBUG_PROPERTY_INFO representing this local or parameter.
- ///
- /// A combination of flags from the DEBUGPROP_INFO_FLAGS enumeration that specifies which variables are
- /// to be filled in.
- /// The Property info.
- public DEBUG_PROPERTY_INFO ConstructDebugPropertyInfo(enum_DEBUGPROP_INFO_FLAGS dwFields)
- {
- DEBUG_PROPERTY_INFO propertyInfo = new DEBUG_PROPERTY_INFO();
-
- if (_variableInfo != null)
- {
- string name = _variableInfo._name;
- if ((dwFields & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME) != 0)
- {
- propertyInfo.bstrFullName = name;
- propertyInfo.dwFields = (enum_DEBUGPROP_INFO_FLAGS)((uint)propertyInfo.dwFields | (uint)(DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME));
- }
-
- if ((dwFields & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME) != 0)
- {
- propertyInfo.bstrName = name;
- propertyInfo.dwFields = (enum_DEBUGPROP_INFO_FLAGS)((uint)propertyInfo.dwFields | (uint)(DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME));
- }
-
- if ((dwFields & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE) != 0)
- {
- propertyInfo.bstrType = _variableInfo._type;
- propertyInfo.dwFields = (enum_DEBUGPROP_INFO_FLAGS)((uint)propertyInfo.dwFields | (uint)(DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE));
- }
-
- if ((dwFields & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE) != 0)
- {
- propertyInfo.bstrValue = _variableInfo._value;
- propertyInfo.dwFields = (enum_DEBUGPROP_INFO_FLAGS)((uint)propertyInfo.dwFields | (uint)(DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE));
- }
-
- if ((dwFields & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB) != 0)
- {
- if (_variableInfo._children != null)
- {
- propertyInfo.dwAttrib |= (enum_DBG_ATTRIB_FLAGS)DBG_ATTRIB_FLAGS.DBG_ATTRIB_OBJ_IS_EXPANDABLE;
- }
- }
-
- // If the debugger has asked for the property, or the property has children (meaning it is a pointer in the sample)
- // then set the pProperty field so the debugger can call back when the chilren are enumerated.
- if ((dwFields & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP) != 0 || _variableInfo._children != null)
- {
- propertyInfo.pProperty = (IDebugProperty2)this;
- propertyInfo.dwFields = (enum_DEBUGPROP_INFO_FLAGS)((uint)propertyInfo.dwFields | (uint)(DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP));
- }
-
- }
- return propertyInfo;
- }
-
-
- #region IDebugProperty2 Members
-
- ///
- /// Enumerates the children of a property. This provides support for dereferencing pointers, displaying members of an array, or
- /// fields of a class or struct. (http://msdn.microsoft.com/en-us/library/bb161791.aspx)
- ///
- /// A combination of flags from the DEBUGPROP_INFO_FLAGS enumeration that specifies which fields in
- /// the enumerated DEBUG_PROPERTY_INFO structures are to be filled in.
- /// Specifies the radix to be used in formatting any numerical information.
- /// GUID of the filter used with the dwAttribFilter and pszNameFilter parameters to select which
- /// DEBUG_PROPERTY_INFO children are to be enumerated. For example, guidFilterLocals filters for local variables.
- /// A combination of flags from the DBG_ATTRIB_FLAGS enumeration that specifies what type of
- /// objects to enumerate, for example DBG_ATTRIB_METHOD for all methods that might be children of this property. Used in
- /// combination with the guidFilter and pszNameFilter parameters.
- /// The name of the filter used with the guidFilter and dwAttribFilter parameters to select which
- /// DEBUG_PROPERTY_INFO children are to be enumerated. For example, setting this parameter to "MyX" filters for all children
- /// with the name "MyX."
- /// Specifies the maximum time, in milliseconds, to wait before returning from this method. Use
- /// INFINITE to wait indefinitely.
- /// Returns an IEnumDebugPropertyInfo2 object containing a list of the child properties.
- /// If successful, returns S_OK; otherwise returns S_FALSE.
- public int EnumChildren(enum_DEBUGPROP_INFO_FLAGS dwFields, uint dwRadix, ref System.Guid guidFilter, enum_DBG_ATTRIB_FLAGS dwAttribFilter, string pszNameFilter, uint dwTimeout, out IEnumDebugPropertyInfo2 ppEnum)
- {
- ppEnum = null;
-
- if (_variableInfo != null)
- {
- if (_variableInfo._children != null)
- {
- if (_variableInfo._children.Count == 0)
- {
- // This is an array, struct, union, or pointer.
- // Create a variable object so we can list this variable's children.
-
- /// Some VS variable names cannot be used by GDB. When that happens, it is added the prefix VsNdK_ to the GDB variable
- /// name and it is stored in the GDBNames array. At the same time, the VS name is stored in the VSNames array using the
- /// same index position. This bool variable just indicate if this prefix is used or not.
- bool hasVsNdK_ = false;
-
- string numChildren = AD7StackFrame.m_dispatcher.createVar(_variableInfo._name, ref hasVsNdK_);
-
- ArrayList GDBNames = new ArrayList();
- ArrayList VSNames = new ArrayList();
-
- if (hasVsNdK_)
- {
- _variableInfo._GDBName = "VsNdK_" + _variableInfo._name;
- GDBNames.Add("VsNdK_" + _variableInfo._name);
- VSNames.Add(_variableInfo._name);
- }
-
- try // Catch non-numerical data
- {
- if (Convert.ToInt32(numChildren) > 0) // If the variable has children evaluate
- {
- if (_variableInfo._type.Contains("struct"))
- if (_variableInfo._type[_variableInfo._type.Length - 1] == '*')
- _variableInfo.listChildren(AD7StackFrame.m_dispatcher, "*", GDBNames, VSNames, hasVsNdK_, null);
- else if (_variableInfo._type.Contains("["))
- _variableInfo.listChildren(AD7StackFrame.m_dispatcher, "struct[]", GDBNames, VSNames, hasVsNdK_, null);
- else
- _variableInfo.listChildren(AD7StackFrame.m_dispatcher, "struct", GDBNames, VSNames, hasVsNdK_, null);
- else if (_variableInfo._type.Contains("["))
- _variableInfo.listChildren(AD7StackFrame.m_dispatcher, "[]", GDBNames, VSNames, hasVsNdK_, null);
- else if (_variableInfo._type.Contains("*"))
- _variableInfo.listChildren(AD7StackFrame.m_dispatcher, "*", GDBNames, VSNames, hasVsNdK_, null);
- else
- _variableInfo.listChildren(AD7StackFrame.m_dispatcher, "", GDBNames, VSNames, hasVsNdK_, null);
-
- }
- }
- catch (FormatException e)
- {
- }
- AD7StackFrame.m_dispatcher.deleteVar(_variableInfo._name, hasVsNdK_);
- }
- DEBUG_PROPERTY_INFO[] properties = new DEBUG_PROPERTY_INFO[_variableInfo._children.Count];
- int i = 0;
- foreach (VariableInfo child in _variableInfo._children)
- {
- VariableInfo.evaluateExpression(child._name, ref child._value, child._GDBName);
- properties[i] = new AD7Property(child).ConstructDebugPropertyInfo(dwFields);
- i++;
- }
- ppEnum = new AD7PropertyEnum(properties);
- return VSConstants.S_OK;
- }
- }
- else if (_stackFrame != null)
- {
- uint elementsReturned = 0;
- _stackFrame.CreateLocalsPlusArgsProperties(dwFields, out elementsReturned, out ppEnum);
- return VSConstants.S_OK;
- }
-
- return VSConstants.S_FALSE;
- }
-
-
- ///
- /// Returns the property that describes the most-derived property of a property.
- /// (http://msdn.microsoft.com/en-ca/library/bb161781.aspx)
- /// This is called to support object oriented languages. It allows the debug engine to return an IDebugProperty2 for the
- /// most-derived object in a hierarchy.
- /// The VSNDK debug engine does not support this. Not implemented.
- ///
- /// Returns an IDebugProperty2 object that represents the derived-most property.
- /// Not implemented.
- public int GetDerivedMostProperty(out IDebugProperty2 ppDerivedMost)
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Returns the extended information of a property. (http://msdn.microsoft.com/en-ca/library/bb145070.aspx)
- /// This method exists for the purpose of retrieving information that does not lend itself to being retrieved by calling the
- /// IDebugProperty2::GetPropertyInfo method. This includes information about custom viewers, managed type slots and other
- /// information.
- /// The VSNDK debug engine does not support this. Not implemented.
- ///
- /// GUID that determines the type of extended information to be retrieved.
- /// Returns a VARIANT (C++) or object (C#) that can be used to retrieve the extended property
- /// information. For example, this parameter might return an IUnknown interface that can be queried for an IDebugDocumentText2
- /// interface.
- /// Not implemented.
- public int GetExtendedInfo(ref System.Guid guidExtendedInfo, out object pExtendedInfo)
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Returns the memory bytes that compose the value of a property. (http://msdn.microsoft.com/en-ca/library/bb161360.aspx)
- /// Not implemented.
- ///
- /// Returns an IDebugMemoryBytes2 object that can be used to retrieve the memory that contains
- /// the value of the property.
- /// Not implemented.
- public int GetMemoryBytes(out IDebugMemoryBytes2 ppMemoryBytes)
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Returns the memory context for a property value. (http://msdn.microsoft.com/en-ca/library/bb147028.aspx)
- /// Not implemented.
- ///
- /// Returns the IDebugMemoryContext2 object that represents the memory associated with this property.
- /// Not implemented.
- public int GetMemoryContext(out IDebugMemoryContext2 ppMemory)
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Returns the parent of a property. (http://msdn.microsoft.com/en-ca/library/bb146184.aspx)
- /// Not implemented.
- ///
- /// Returns an IDebugProperty2 object that represents the parent of the property.
- /// Not implemented.
- public int GetParent(out IDebugProperty2 ppParent)
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Fills in a DEBUG_PROPERTY_INFO structure that describes a property. (http://msdn.microsoft.com/en-ca/library/bb145852.aspx)
- ///
- /// A combination of flags from the DEBUGPROP_INFO_FLAGS enumeration that specifies which fields are to
- /// be filled out in the pPropertyInfo structure.
- /// Radix to be used in formatting any numerical information.
- /// Specifies the maximum time, in milliseconds, to wait before returning from this method. Use
- /// INFINITE to wait indefinitely.
- /// Reserved for future use; set to a null value.
- /// Reserved for future use; set to zero.
- /// A DEBUG_PROPERTY_INFO structure that is filled in with the description of the property.
- /// VSConstants.S_OK.
- public int GetPropertyInfo(enum_DEBUGPROP_INFO_FLAGS dwFields, uint dwRadix, uint dwTimeout, IDebugReference2[] rgpArgs, uint dwArgCount, DEBUG_PROPERTY_INFO[] pPropertyInfo)
- {
- pPropertyInfo[0] = new DEBUG_PROPERTY_INFO();
- rgpArgs = null;
- pPropertyInfo[0] = ConstructDebugPropertyInfo(dwFields);
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Returns a reference to the property's value. IDebugProperty2 represents a property, while IDebugReference2 represents a
- /// reference to a property, typically a reference to an object in the program being debugged. Not implemented.
- /// (http://msdn.microsoft.com/en-ca/library/bb145600.aspx)
- ///
- /// Returns an IDebugReference2 object representing a reference to the property's value.
- /// Not implemented.
- public int GetReference(out IDebugReference2 ppReference)
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Returns the size, in bytes, of the property value. Not implemented. (http://msdn.microsoft.com/en-ca/library/bb145093.aspx)
- ///
- /// Returns the size, in bytes, of the property value.
- /// Not implemented.
- public int GetSize(out uint pdwSize)
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Sets the value of the property from the value of a given reference. (http://msdn.microsoft.com/en-ca/library/bb145613.aspx)
- /// The debugger will call this when the user tries to edit the property's values. As the sample has set the read-only flag on
- /// its properties, this should not be called.
- /// Not implemented.
- ///
- /// An array of arguments to pass to the managed code property setter. If the property setter does not
- /// take arguments or if this IDebugProperty2 object does not refer to such a property setter, rgpArgs should be a null value.
- /// This parameter is typically a null value.
- /// The number of arguments in the rgpArgs array.
- /// A reference, in the form of an IDebugReference2 object, to the value to use to set this property.
- /// How long to take to set the value, in milliseconds. A typical value is INFINITE. This affects
- /// the length of time that any possible evaluation can take.
- /// Not implemented.
- public int SetValueAsReference(IDebugReference2[] rgpArgs, uint dwArgCount, IDebugReference2 pValue, uint dwTimeout)
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Sets the value of a property from a given string. (http://msdn.microsoft.com/en-ca/library/bb160956.aspx)
- /// The debugger will call this when the user tries to edit the property's values in one of the debugger windows.
- ///
- /// A string containing the value to be set.
- /// A radix to be used in interpreting any numerical information. This can be 0 to attempt to determine
- /// the radix automatically.
- /// Specifies the maximum time, in milliseconds, to wait before returning from this method. Use
- /// INFINITE to wait indefinitely.
- /// VSConstants.S_OK.
- public int SetValueAsString(string pszValue, uint dwRadix, uint dwTimeout)
- {
- string result = "";
- VariableInfo.evaluateExpression(this._variableInfo._name + "=" + pszValue, ref result, null);
-
- return VSConstants.S_OK;
- }
-
- #endregion
-
- }
-}
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7StackFrame.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7StackFrame.cs
deleted file mode 100644
index 45efadb7..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7StackFrame.cs
+++ /dev/null
@@ -1,1442 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Collections;
-using System.Text;
-using Microsoft.VisualStudio;
-using VSNDK.Parser;
-using Microsoft.VisualStudio.Debugger.Interop;
-using System.Diagnostics;
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// This class contains all information about a variable / expression.
- ///
- public class VariableInfo
- {
-
- ///
- /// Variable's name or expression.
- ///
- public string _name;
-
- ///
- /// Variable's data type.
- ///
- public string _type;
-
- ///
- /// Variable's value or the result of an expression.
- ///
- public string _value;
-
- ///
- /// Variable's name to be used by GDB.
- ///
- public string _GDBName;
-
- ///
- /// List of variable's children.
- ///
- public ArrayList _children;
-
-
- ///
- /// Evaluate an expression / Get the value of a variable. This method basically send a "-data-evaluate-expression" command to GDB
- /// and evaluate the result.
- ///
- /// The expression/variable to be evaluated.
- /// The result of the expression/ value of variable.
- /// The GDB Name of the variable.
- /// A boolean value indicating if the expression evaluation was successful or not.
- public static bool evaluateExpression(string name, ref string result, string GDBName)
- {
- if (name[name.Length - 1] == '.')
- name = name.Remove(name.Length - 1);
-
- // Waits for the parsed response for the GDB/MI command that evaluates "name" as an expression.
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Data-Manipulation.html)
- result = GDBParser.parseCommand("-data-evaluate-expression \"" + name + "\"", 2);
- if (result.Substring(0, 2) == "61") // If result starts with 61, it means that there is an error.
- {
- if (GDBName != null) // Maybe that error was caused because GDB didn't accept the VS name. Use the GDBName if there is one.
- {
- // Gets the parsed response for the GDB/MI command that evaluates "GDBName" as an expression.
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Data-Manipulation.html)
- string result2 = GDBParser.parseCommand("-data-evaluate-expression \"" + GDBName + "\"", 2);
- if (result2.Substring(0, 2) == "60")
- result = result2;
- }
- }
-
- bool valid = true;
-
- if (result.Substring(0, 2) == "61") // If result starts with 61, it means that there is an error. So, expression is not valid.
- valid = false;
-
- result = result.Substring(3);
- result = result.Substring(1, result.Length - 2); // remove the quotes located in the beginning and at the end
- result = result.Replace("\\\"", "\"");
-
- if (valid)
- {
- int endString = result.IndexOf("\\\\000");
- int ini, end = 0;
- while (endString != -1) // remove garbage from strings
- {
- ini = result.IndexOf("\"", end);
- while ((ini > 0) && (result[ini - 1] == '\\'))
- ini = result.IndexOf("\"", ini + 1);
- if (ini == -1)
- break;
- end = result.IndexOf("\"", ini + 1);
- while ((end > 0) && (result[end - 1] == '\\'))
- end = result.IndexOf("\"", end + 1);
- if (end == -1)
- break;
- while ((endString != -1) && (endString < ini))
- endString = result.IndexOf("\\\\000", endString + 1);
- if ((endString > ini) && (endString < end))
- {
- result = result.Substring(0, endString) + result.Substring(end, (result.Length - end));
- end = endString;
- endString = result.IndexOf("\\\\000", end);
- }
- end++;
- };
- }
- return valid;
- }
-
-
- ///
- /// Gets the information about a variable/expression.
- ///
- /// Variable name / expression.
- /// The event dispatcher.
- /// Current stack frame.
- /// Return the VariableInfo object.
- public static VariableInfo get(string name, EventDispatcher m_eventDispatcher, AD7StackFrame m_frame)
- {
- VariableInfo vi = null;
- string search = "";
- string separator = "";
- bool isArray = false;
- bool isRoot = true;
-
- do
- {
- int dot = name.IndexOf(".");
- int squareBracket = name.IndexOf("[");
- int pos = name.IndexOf("->");
- if (dot == -1)
- dot = name.Length;
- if (squareBracket == -1)
- squareBracket = name.Length;
- if (pos == -1)
- pos = name.Length;
- int stop = dot < squareBracket ? dot : squareBracket;
- stop = stop < pos ? stop : pos;
-
- search = search + separator + name.Substring(0, stop);
- separator = "";
-
- if (stop < name.Length)
- {
- separator = name.Substring(stop, 1);
- if (separator == "-")
- {
- separator = "->";
- name = name.Substring(stop + 2, name.Length - (stop + 2));
- }
- else if (separator == "[")
- {
- int aux = name.IndexOf("]");
- isArray = true;
- separator = name.Substring(stop, (aux - stop) + 1);
- name = name.Substring(aux + 1, name.Length - (aux + 1));
- }
- else
- name = name.Substring(stop + 1, name.Length - (stop + 1));
- }
- else
- name = "";
-
- if (vi == null)
- {
- if (m_frame._locals != null)
- {
- foreach (VariableInfo var in m_frame._locals)
- {
- if (var._name == search)
- { // if the "search" expression is a local variable, it doesn't need to create a VariableInfo object for that.
- vi = var;
- break;
- }
- }
- }
-
- if (vi == null)
- {
- if (m_frame._arguments != null)
- {
- foreach (VariableInfo var in m_frame._arguments)
- { // if the "search" expression is an argument, it doesn't need to create a VariableInfo object for that.
- if (var._name == search)
- {
- vi = var;
- break;
- }
- }
- }
- }
- }
- else
- {
- isRoot = false;
- VariableInfo vi_child = null;
- if (vi._children != null)
- {
- foreach (VariableInfo var in vi._children)
- {
- if (var._name == search)
- {
- vi_child = var;
- break;
- }
- }
- }
- vi = vi_child;
- }
- } while ((vi != null) && ((isArray) || (name != "")));
-
-
- if (name != "") // variable not found probably because it is in an expression, so return to the original name to evaluate it.
- search = search + separator + name;
-
- string result = "";
- bool valid;
- if (vi == null)
- valid = evaluateExpression(search, ref result, null);
- else
- valid = evaluateExpression(search, ref result, vi._GDBName);
-
- if (vi != null)
- {
- if ((vi._value != result) || (!isRoot)) // if is not root means that it can be expanded...
- {
- vi._value = result;
- if (vi._value == null || (vi._type.Contains("*") && (vi._value != "0x0")))
- {
- // This is an array, struct, union, or pointer.
- // Create a variable object so we can list this variable's children.
- ArrayList GDBNames = new ArrayList();
- ArrayList VSNames = new ArrayList();
- bool hasVsNdK_ = false;
- m_eventDispatcher.createVar(vi._name, ref hasVsNdK_);
- if (hasVsNdK_)
- {
- GDBNames.Add("VsNdK_" + vi._name);
- VSNames.Add(vi._name);
- }
- vi._children = new ArrayList();
- if (vi._type.Contains("struct"))
- if (vi._type[vi._type.Length - 1] == '*')
- vi.listChildren(m_eventDispatcher, "*", GDBNames, VSNames, hasVsNdK_, null);
- else if (vi._type.Contains("["))
- vi.listChildren(m_eventDispatcher, "struct[]", GDBNames, VSNames, hasVsNdK_, null);
- else
- vi.listChildren(m_eventDispatcher, "struct", GDBNames, VSNames, hasVsNdK_, null);
- else if (vi._type.Contains("["))
- vi.listChildren(m_eventDispatcher, "[]", GDBNames, VSNames, hasVsNdK_, null);
- else if (vi._type.Contains("*"))
- vi.listChildren(m_eventDispatcher, "*", GDBNames, VSNames, hasVsNdK_, null);
- else
- vi.listChildren(m_eventDispatcher, "", GDBNames, VSNames, hasVsNdK_, null);
- m_eventDispatcher.deleteVar(vi._name, hasVsNdK_);
- }
- }
- }
- else
- {
- if (!valid)
- vi = new VariableInfo(search, "", result, null);
- else
- {
- string aux_exp = search.Replace(" ", "");
- string datatype;
-
- // Sending 2 GDB commands to get the data type of "aux_exp" because it is not known, at this moment, if "aux_exp"
- // is an expression, a primitive or a compound variable.
-
- // Gets the parsed response for the GDB command that returns the data type of "aux_exp".
- // (http://sourceware.org/gdb/onlinedocs/gdb/Symbols.html)
- string firstDatatype = GDBParser.parseCommand("whatis " + aux_exp, 3);
-
- // Gets the parsed response for the GDB command that returns a detailed description of the type.
- // (http://sourceware.org/gdb/onlinedocs/gdb/Symbols.html)
- string baseDatatype = GDBParser.parseCommand("ptype " + aux_exp, 4);
-
- if ((baseDatatype[baseDatatype.Length - 1] == '{') && (baseDatatype[baseDatatype.Length - 2] == ' '))
- baseDatatype = baseDatatype.Remove(baseDatatype.Length - 2);
- if (baseDatatype.Length < firstDatatype.Length)
- {
- if (firstDatatype.Contains(baseDatatype))
- {
- baseDatatype = firstDatatype;
- }
- }
- if ((baseDatatype == firstDatatype) || ((baseDatatype.Contains("::")) && (!baseDatatype.Contains("union"))))
- {
- baseDatatype = "";
- datatype = firstDatatype;
- }
- else
- {
- datatype = baseDatatype;
- }
- if (datatype[datatype.Length - 1] == '*')
- if (result == "0x0")
- {
- vi = new VariableInfo(search, firstDatatype, result, null);
- }
- else
- {
- vi = new VariableInfo(search, firstDatatype, baseDatatype, result, m_eventDispatcher, null, null);
- }
- else if ((datatype.Contains("struct")) || (datatype.Contains("[")))
- {
- vi = new VariableInfo(search, firstDatatype, baseDatatype, null, m_eventDispatcher, null, null);
- }
- else
- {
- vi = new VariableInfo(search, firstDatatype, result, null);
- }
- }
- }
- return vi;
- }
-
-
- ///
- /// Call the right VariableInfo constructor for locals and arguments.
- ///
- /// The name of the variable.
- /// The data type of the variable.
- /// The value of the variable.
- /// The event dispatcher.
- /// Return the VariableInfo created object.
- public static VariableInfo create(string name, string type, string value, EventDispatcher dispatcher)
- {
- VariableInfo newVar = new VariableInfo(name, type, "", value, dispatcher, null, null);
- return newVar;
- }
-
-
- ///
- /// Constructor for Variable Info Object without inquiring for the variable's children.
- ///
- /// The name of the variable.
- /// The data type of the variable.
- /// The value of the variable.
- /// The GDB Name of the variable.
- public VariableInfo(string name, string type, string value, string GDBName)
- {
- _name = name;
- _type = type;
- _value = value;
- _children = null;
- _GDBName = GDBName;
- }
-
-
- ///
- /// Constructor for Variable Info Object inquiring for the variable's children
- ///
- /// The name of the variable.
- /// The data type of the variable.
- /// The base type of the variable.
- /// The value of the variable.
- /// The event dispatcher.
- /// The names of the variables used by GDB.
- /// The Names of the variables used by VS.
- public VariableInfo(string name, string type, string baseType, string value, EventDispatcher dispatcher, ArrayList GDBNames, ArrayList VSNames)
- {
- /// numChildren - The result of the createvar returns ERROR or a number from 0 to "n" where "n" is the number of children
- /// of the variable.
- string numChildren = "";
-
- _name = name;
- _type = type;
- _value = value;
- _children = null;
- _GDBName = null;
-
- if (baseType != "")
- type = baseType;
-
- if (GDBNames == null)
- {
- GDBNames = new ArrayList();
- VSNames = new ArrayList();
- }
-
- if (value == null || (type.Contains("*") && (value != "0x0")))
- {
- // This is an array, struct, union, or pointer.
- // Create a variable object so we can list this variable's children.
-
- /// Some VS variable names cannot be used by GDB. When that happens, it is added the prefix VsNdK_ to the GDB variable
- /// name and it is stored in the GDBNames array. At the same time, the VS name is stored in the VSNames array using the
- /// same index position. This bool variable just indicate if this prefix is used or not.
- bool hasVsNdK_ = false;
-
- numChildren = dispatcher.createVar(_name, ref hasVsNdK_);
-
- if (hasVsNdK_)
- {
- _GDBName = "VsNdK_" + _name;
- GDBNames.Add("VsNdK_" + _name);
- VSNames.Add(_name);
- }
-
- try // Catch non-numerical data
- {
- if (Convert.ToInt32(numChildren) > 0) // If the variable has children, evaluate them.
- {
- _children = new ArrayList();
- if (type.Contains("struct"))
- if (type[type.Length - 1] == '*')
- this.listChildren(dispatcher, "*", GDBNames, VSNames, hasVsNdK_, null);
- else if (type.Contains("["))
- this.listChildren(dispatcher, "struct[]", GDBNames, VSNames, hasVsNdK_, null);
- else
- this.listChildren(dispatcher, "struct", GDBNames, VSNames, hasVsNdK_, null);
- else if (type.Contains("["))
- this.listChildren(dispatcher, "[]", GDBNames, VSNames, hasVsNdK_, null);
- else if (type.Contains("*"))
- this.listChildren(dispatcher, "*", GDBNames, VSNames, hasVsNdK_, null);
- else
- this.listChildren(dispatcher, "", GDBNames, VSNames, hasVsNdK_, null);
- }
- }
- catch (FormatException e)
- {
-
- }
-
- dispatcher.deleteVar(_name, hasVsNdK_);
- }
-
- if (value == null)
- evaluateExpression(name, ref _value, null);
- }
-
-
- ///
- /// Gets the list of children for a given variable.
- ///
- /// The event dispatcher.
- /// The variable's parent data type. "*" means it is a pointer; "struct[]" means it is an array of
- /// structures; "struct" means it is a structure; and "[]" means it is an array.
- /// The names of the variables used by GDB.
- /// The Names of the variables used by VS.
- /// Indicate if the variable name uses or not the prefix "VsNdK_".
- /// The GDB Name of the variable.
- public void listChildren(EventDispatcher dispatcher, string parentType, ArrayList GDBNames, ArrayList VSNames, bool hasVsNdK_, string GDBName)
- {
- string childListResponse;
- if (GDBName == null)
- {
- if (hasVsNdK_)
- {
- childListResponse = dispatcher.listChildren(_GDBName);
- }
- else
- {
- childListResponse = dispatcher.listChildren(_name);
- if ((childListResponse == "ERROR") && (_GDBName != null))
- {
- childListResponse = dispatcher.listChildren(_GDBName);
- }
- }
- }
- else
- childListResponse = dispatcher.listChildren(GDBName);
-
- if (childListResponse != "ERROR")
- {
- childListResponse = (childListResponse.Substring(3)).Replace("#;;;", "");
-
- string[] childList = childListResponse.Split('#');
- foreach (string childString in childList)
- {
- string name = null;
- string type = null;
- string value = null;
- int numChildren = 0;
- bool valid = true;
-
- string[] childProperties = childString.Split(';');
-
- if (childProperties[0] == "")
- continue;
-
- name = childProperties[0];
-
- if (name.Contains("::")) // discard this GDB expression.
- {
- continue;
- }
-
- GDBName = name;
-
- int end = name.Length;
- if (name[end - 1] == '"')
- end--;
- if (((name.Length > 8) && (name.Substring(end - 8, 8) == ".private")) ||
- ((name.Length > 7) && (name.Substring(end - 7, 7) == ".public")) ||
- ((name.Length > 10) && (name.Substring(end - 10, 10) == ".protected")) ||
- ((name.Length > 9) && (name.Substring(end - 9, 9) == ".private.")) ||
- ((name.Length > 8) && (name.Substring(end - 8, 8) == ".public.")) ||
- ((name.Length > 11) && (name.Substring(end - 11, 11) == ".protected.")))
- {
- // GDB is using an intermediate representation for the variable. Inquire GDB again using this intermediate name.
- int index = VSNames.IndexOf(_name);
- if (index != -1)
- GDBNames[index] = GDBName;
- else
- {
- GDBNames.Add(GDBName);
- VSNames.Add(_name);
- }
- this.listChildren(dispatcher, parentType, GDBNames, VSNames, hasVsNdK_, GDBName);
- continue;
- }
- else
- {
- int dot = name.LastIndexOf(".");
- if (dot != -1)
- {
- int index = GDBNames.IndexOf(name.Substring(0, dot));
- if (index != -1)
- {
- name = VSNames[index].ToString() + name.Substring(dot);
- }
- }
-
- name = name.Replace(".private", "");
- name = name.Replace(".public", "");
- name = name.Replace(".protected", "");
- name = name.Replace("..", ".");
-
- dot = name.LastIndexOf(".*");
- if (dot != -1)
- {
- name = "*(" + name.Remove(dot) + ")";
- }
-
- if (parentType == "*")
- {
- dot = name.LastIndexOf('.');
- if (dot != -1)
- {
- name = name.Substring(0, dot) + "->" + name.Substring(dot + 1, name.Length - (dot + 1));
- }
- }
- else if (parentType == "[]")
- {
- dot = name.LastIndexOf('.');
- name = name.Substring(0, dot) + "[" + name.Substring(dot + 1, name.Length - (dot + 1));
- name = name + "]";
- }
- GDBNames.Add(GDBName);
- VSNames.Add(name);
- }
-
- if (childProperties[1] != "")
- numChildren = Convert.ToInt32(childProperties[1]);
-
- value = childProperties[2];
- if ((value == "") || (value.Contains("{...}")) ||
- ((value.Length >= 2) && (value[0] == '[') && (value[value.Length - 1] == ']')))
- valid = evaluateExpression(name, ref value, GDBName);
-
- type = childProperties[3];
-
- VariableInfo child = new VariableInfo(name, type, value, GDBName);
-
- if ((valid) && (numChildren > 0 && value != "0x0"))
- {
- child._children = new ArrayList();
- }
- if (VSNames.Contains(name))
- {
- int index = VSNames.IndexOf(name);
- VSNames.RemoveAt(index);
- GDBNames.RemoveAt(index);
- }
- _children.Add(child); // If VS knows that there are children, it will inquiries again if those children data
- // were not filled.
- }
- }
- }
- }
-
-
- ///
- /// Represents a logical stack frame on the thread stack.
- ///
- /// It implements:
- ///
- /// IDebugStackFrame2: Represents a single stack frame in a call stack in a particular thread.
- /// (http://msdn.microsoft.com/en-us/library/bb161683.aspx)
- ///
- /// IDebugExpressionContext: Represents a context for expression evaluation, which allows expression evaluation and watch windows.
- /// (http://msdn.microsoft.com/en-ca/library/bb146178.aspx)
- ///
- public class AD7StackFrame : IDebugStackFrame2, IDebugExpressionContext2
- {
- ///
- /// The class that manages debug events for the debug engine.
- ///
- public static EventDispatcher m_dispatcher;
-
- ///
- /// The AD7Engine object that represents the DE.
- ///
- public readonly AD7Engine m_engine;
-
- ///
- /// Represents the thread for this stack frame.
- ///
- public readonly AD7Thread m_thread = null;
-
- ///
- /// The short path file name that contains the source code of this stack frame.
- ///
- private string m_documentName = "";
-
- ///
- /// The function name associated to this stack frame.
- ///
- public string m_functionName = "";
-
- ///
- /// Represents the current position (line number) in m_documentName.
- ///
- private uint m_lineNum = 0;
-
- ///
- /// Boolean value that indicates if this stack frame has an associated source code to present.
- ///
- private bool m_hasSource = false;
-
- ///
- /// The current context's address.
- ///
- private uint m_address = 0;
-
- ///
- /// List of variables that we want to filter from the locals window.
- ///
- private string[] m_variableFilter = { "__func__" };
-
- ///
- /// Contains the locals variables to this stack frame.
- ///
- public ArrayList _locals;
-
- ///
- /// Contains the parameters used to call the method/function that originated this stack frame.
- ///
- public ArrayList _arguments;
-
-
- ///
- ///
- ///
- public VariableInfo _lastEvaluatedExpression;
-
-
- ///
- /// Search the __stackframes cache for the internal representation of the stack frame associated to the GDB frameInfo
- /// information. If successful, returns the stack frame; otherwise, creates a new one and return it.
- ///
- /// The AD7Engine object that represents the DE.
- /// Represents the thread for this stack frame.
- /// Array of strings with the information provided by GDB about this stack frame.
- /// Boolean value that indicates if a new object for this stack frame was created or not.
- /// Returns the created/found stack frame.
- public static AD7StackFrame create(AD7Engine engine, AD7Thread thread, string[] frameInfo, ref bool created)
- {
- created = false;
- if (thread.__stackFrames != null)
- {
- foreach (AD7StackFrame frame in thread.__stackFrames)
- {
- if (frame.m_documentName != null && frame.m_functionName != null)
- {
- if (frame.m_documentName == frameInfo[3] && frame.m_functionName == frameInfo[2]) // frameInfo[2] = func, frameInfo[3] = file
- return frame;
- }
- }
- }
- else
- thread.__stackFrames = new ArrayList();
-
- AD7StackFrame newFrame = new AD7StackFrame(engine, thread, frameInfo);
- if (thread.__stackFrames == null) // that's weird, but sometimes VS is not initializing __stackFrames, so I added this loop to avoid other problems.
- thread.__stackFrames = new ArrayList() { newFrame };
- else
- thread.__stackFrames.Add(newFrame);
- created = true;
- return newFrame;
- }
-
-
- ///
- /// Constructor.
- ///
- /// The AD7Engine object that represents the DE.
- /// Represents the thread for this stack frame.
- /// Array of strings with the information provided by GDB about this stack frame.
- public AD7StackFrame(AD7Engine engine, AD7Thread thread, string[] frameInfo)
- {
- m_engine = engine;
- m_thread = thread;
- m_dispatcher = m_engine.eDispatcher;
-
- uint level = Convert.ToUInt32(frameInfo[0]);
- string address = frameInfo[1];
- m_functionName = frameInfo[2];
- m_documentName = frameInfo[3];
- try
- {
- m_lineNum = Convert.ToUInt32(frameInfo[4]);
- }
- catch (Exception e)
- {
- m_lineNum = 0;
- }
-
- _locals = new ArrayList();
- _arguments = new ArrayList();
- m_hasSource = (m_lineNum == 0) ? false : true;
- ArrayList evaluatedVars = new ArrayList();
-
- // Add the variable filter list to the evaluatedVars list.
- // Causes named variables to be ignored.
- evaluatedVars.AddRange(m_variableFilter);
-
- if (address.StartsWith("0x"))
- address = address.Remove(0, 2);
- m_address = uint.Parse(address, System.Globalization.NumberStyles.AllowHexSpecifier);
-
- // Query GDB for parameters and locals.
- string variablesResponse = m_engine.eDispatcher.getVariablesForFrame(level, m_thread._id).Replace("#;;;", "");
- if (variablesResponse == null || variablesResponse == "ERROR" || variablesResponse == "")
- return;
- variablesResponse = variablesResponse.Substring(3);
-
- string[] variableStrings = variablesResponse.Split('#');
-
- foreach (string variableString in variableStrings)
- {
- string name = null;
- bool arg = false;
- string type = null;
- string value = null;
-
- string[] variableProperties = variableString.Split(';');
-
- if (variableProperties[0] != "")
- {
- if (!evaluatedVars.Contains(variableProperties[0]))
- {
- name = variableProperties[0];
- evaluatedVars.Add(variableProperties[0]);
- if (variableProperties[1] != "")
- arg = true;
- if (variableProperties[2] != "")
- type = variableProperties[2];
- if (variableProperties[3] != "")
- value = variableProperties[3];
- if (arg)
- _arguments.Add(VariableInfo.create(name, type, value, m_engine.eDispatcher));
- else
- _locals.Add(VariableInfo.create(name, type, value, m_engine.eDispatcher));
- }
- }
- }
- }
-
- #region Non-interface methods
-
-
- ///
- /// Construct a FRAMEINFO for this stack frame with the requested information.
- ///
- /// A combination of flags from the FRAMEINFO_FLAGS enumeration that specifies which fields of the
- /// frameInfo parameter are to be filled in.
- /// A FRAMEINFO structure that is filled in with the description of the stack frame.
- public void SetFrameInfo(enum_FRAMEINFO_FLAGS dwFieldSpec, out FRAMEINFO frameInfo)
- {
- frameInfo = new FRAMEINFO();
-
- // The debugger is asking for the formatted name of the function which is displayed in the callstack window.
- // There are several optional parts to this name including the module, argument types and values, and line numbers.
- // The optional information is requested by setting flags in the dwFieldSpec parameter.
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME) != 0)
- {
- // If there is source information, construct a string that contains the module name, function name, and optionally argument names and values.
- if (m_hasSource)
- {
- frameInfo.m_bstrFuncName = "";
-
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_MODULE) != 0)
- {
-// frameInfo.m_bstrFuncName = System.IO.Path.GetFileName(module.Name) + "!";
- }
-
-
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_RETURNTYPE) != 0)
- {
- // Adds the return type to the m_bstrFuncName field.
- //frameInfo.m_bstrFuncName += _returnType;
- }
-
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_LANGUAGE) != 0)
- {
- // Adds the language to the m_bstrFuncName field.
- if (m_documentName.EndsWith(".c"))
- frameInfo.m_bstrFuncName += "(C) ";
- else if (m_documentName.EndsWith(".cpp") || m_documentName.EndsWith(".c++"))
- frameInfo.m_bstrFuncName += "(C++) ";
- }
-
- frameInfo.m_bstrFuncName += m_functionName;
-
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_ARGS) != 0)
- {
- // Add the arguments to the m_bstrFuncName field.
- frameInfo.m_bstrFuncName += "(";
- bool all = (dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_ARGS_ALL) != 0;
- int i = 0;
- foreach (VariableInfo arg in _arguments)
- {
- if (all || (dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_ARGS_TYPES) != 0)
- {
- frameInfo.m_bstrFuncName += arg._type + " ";
- }
-
- if (all || (dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_ARGS_NAMES) != 0)
- {
- frameInfo.m_bstrFuncName += arg._name;
- }
-
- if (all || (dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_ARGS_VALUES) != 0)
- {
- frameInfo.m_bstrFuncName += "=" + arg._value;
- }
-
- if (i < _arguments.Count - 1)
- {
- frameInfo.m_bstrFuncName += ", ";
- }
- i++;
- }
- frameInfo.m_bstrFuncName += ")";
- }
-
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_LINES) != 0)
- {
- frameInfo.m_bstrFuncName += " Line: " + m_lineNum.ToString();
- }
-
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_OFFSET) != 0)
- {
- // TODO:
- // Adds to the m_bstrFuncName field the offset in bytes from the start of the line if FIF_FUNCNAME_LINES is specified.
- // If FIF_FUNCNAME_LINES is not specified, or if line numbers are not available, adds the offset in bytes from the start of the function.
- }
-
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_FORMAT) != 0)
- {
- // TODO:
- // Formats the function name. The result is returned in the m_bstrFuncName field and no other fields are filled out.
- // According to http://msdn.microsoft.com/en-us/library/bb145138.aspx, this flag "Specify the FIF_FUNCNAME_FORMAT
- // flag to format the function name into a single string". This method already works on this way.
- }
- }
- else
- {
- frameInfo.m_bstrFuncName = "[External Code]";
- // No source information, so only return the module name and the instruction pointer.
- /*
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_MODULE) != 0)
- {
- frameInfo.m_bstrFuncName = EngineUtils.GetAddressDescription(module, ip);
- }
- else
- {
- frameInfo.m_bstrFuncName = EngineUtils.GetAddressDescription(null, ip);
- }
- */
- }
- frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_FUNCNAME;
- }
-
- // The debugger is requesting the name of the module for this stack frame.
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_MODULE) != 0)
- {
- frameInfo.m_bstrModule = "";
- frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_MODULE;
- }
-
-
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_RETURNTYPE) != 0)
- {
- // TODO:
- // Initialize/use the m_bstrReturnType field.
- frameInfo.m_bstrReturnType = "";
- frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_RETURNTYPE;
- }
-
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_ARGS) != 0)
- {
- // Initialize/use the m_bstrArgs field.
- frameInfo.m_bstrArgs = "";
- bool all = (dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_ARGS_ALL) != 0;
- int i = 0;
- foreach (VariableInfo arg in _arguments)
- {
- if (all || (dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_ARGS_TYPES) != 0)
- {
- frameInfo.m_bstrArgs += arg._type + " ";
- }
-
- if (all || (dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_ARGS_NAMES) != 0)
- {
- frameInfo.m_bstrArgs += arg._name;
- }
-
- if (all || (dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_ARGS_VALUES) != 0)
- {
- frameInfo.m_bstrArgs += "=" + arg._value;
- }
-
- if (i < _arguments.Count - 1)
- {
- frameInfo.m_bstrArgs += ", ";
- }
- i++;
- }
-
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_ARGS_NO_TOSTRING) != 0)
- {
- // TODO:
- // Do not allow ToString() function evaluation or formatting when returning function arguments.
- }
-
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_ARGS_NO_FUNC_EVAL) != 0)
- {
- // TODO:
- // Specifies that function (property) evaluation should not be used when retrieving argument values.
- }
-
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_ARGS_NOFORMAT) != 0)
- {
- // TODO:
- // Specifies that the arguments are not be formatted (for example, do not add opening and closing parentheses around
- // the argument list nor add a separator between arguments).
- }
-
- frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_ARGS;
- }
-
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_LANGUAGE) != 0)
- {
- // Initialize/use the m_bstrLanguage field.
- if (m_documentName != null)
- {
- if (m_documentName.EndsWith(".c"))
- frameInfo.m_bstrLanguage = "C";
- else if (m_documentName.EndsWith(".cpp") || m_documentName.EndsWith(".c++"))
- frameInfo.m_bstrLanguage = "C++";
- else
- frameInfo.m_bstrLanguage = "";
- }
- else
- frameInfo.m_bstrLanguage = "";
- frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_LANGUAGE;
- }
-
- // The debugger would like a pointer to the IDebugModule2 that contains this stack frame.
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_DEBUG_MODULEP) != 0)
- {
- frameInfo.m_pModule = m_engine.m_module;
- frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_DEBUG_MODULEP;
- }
-
- // The debugger is requesting the range of memory addresses for this frame.
- // For the sample engine, this is the contents of the frame pointer.
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_STACKRANGE) != 0)
- {
- // TODO:
- // Initialize/use the m_addrMin and m_addrMax (stack range) fields.
-
- frameInfo.m_addrMin = 0;
- frameInfo.m_addrMax = 0;
- frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_STACKRANGE;
- }
-
- // The debugger is requesting the IDebugStackFrame2 value for this frame info.
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_FRAME) != 0)
- {
- frameInfo.m_pFrame = this;
- frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_FRAME;
- }
-
- // Does this stack frame of symbols loaded?
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_DEBUGINFO) != 0)
- {
- frameInfo.m_fHasDebugInfo = m_hasSource ? 1 : 0;
- frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_DEBUGINFO;
- }
-
- // Is this frame stale?
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_STALECODE) != 0)
- {
- frameInfo.m_fStaleCode = 0;
- frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_STALECODE;
- }
-
- // The debug engine is to filter non-user code frames so they are not included.
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_FILTER_NON_USER_CODE ) != 0)
- {
- }
-
- // Frame information should be gotten from the hosted app-domain rather than the hosting process.
- if ((dwFieldSpec & enum_FRAMEINFO_FLAGS.FIF_DESIGN_TIME_EXPR_EVAL) != 0)
- {
- }
-
- }
-
-
- ///
- /// Construct an instance of IEnumDebugPropertyInfo2 for the combined locals and parameters.
- ///
- /// A combination of flags from the DEBUGPROP_INFO_FLAGS enumeration that specifies which fields in
- /// the enumObject are to be filled in.
- /// Returns the number of elements in the enumeration.
- /// Returns an IEnumDebugPropertyInfo2 object containing a list of the desired properties.
- public void CreateLocalsPlusArgsProperties(enum_DEBUGPROP_INFO_FLAGS dwFields, out uint elementsReturned, out IEnumDebugPropertyInfo2 enumObject)
- {
- elementsReturned = 0;
- int localsLength = 0;
-
- if (_locals != null)
- {
- localsLength = _locals.Count;
- elementsReturned += (uint)localsLength;
- }
-
- if (_arguments != null)
- {
- elementsReturned += (uint)_arguments.Count;
- }
- DEBUG_PROPERTY_INFO[] propInfo = new DEBUG_PROPERTY_INFO[elementsReturned];
-
- if (_locals != null)
- {
- int i = 0;
- foreach(VariableInfo var in _locals)
- {
- AD7Property property = new AD7Property(var);
- propInfo[i] = property.ConstructDebugPropertyInfo(dwFields);
- i++;
- }
- }
-
- if (_arguments != null)
- {
- int i = 0;
- foreach (VariableInfo arg in _arguments)
- {
- AD7Property property = new AD7Property(arg);
- propInfo[localsLength + i] = property.ConstructDebugPropertyInfo(dwFields);
- i++;
- }
- }
-
- enumObject = new AD7PropertyInfoEnum(propInfo);
- }
-
-
- ///
- /// Construct an instance of IEnumDebugPropertyInfo2 for the locals collection only.
- ///
- /// A combination of flags from the DEBUGPROP_INFO_FLAGS enumeration that specifies which fields in
- /// the enumObject are to be filled in.
- /// Returns the number of elements in the enumeration.
- /// Returns an IEnumDebugPropertyInfo2 object containing a list of the desired properties.
- private void CreateLocalProperties(enum_DEBUGPROP_INFO_FLAGS dwFields, out uint elementsReturned, out IEnumDebugPropertyInfo2 enumObject)
- {
- elementsReturned = (uint)_locals.Count;
- DEBUG_PROPERTY_INFO[] propInfo = new DEBUG_PROPERTY_INFO[_locals.Count];
-
- int i = 0;
- foreach (VariableInfo var in _locals)
- {
- AD7Property property = new AD7Property(var);
- propInfo[i] = property.ConstructDebugPropertyInfo(dwFields);
- i++;
- }
-
- enumObject = new AD7PropertyInfoEnum(propInfo);
- }
-
-
- ///
- /// Construct an instance of IEnumDebugPropertyInfo2 for the parameters collection only.
- ///
- /// A combination of flags from the DEBUGPROP_INFO_FLAGS enumeration that specifies which fields in
- /// the enumObject are to be filled in.
- /// Returns the number of elements in the enumeration.
- /// Returns an IEnumDebugPropertyInfo2 object containing a list of the desired properties.
- private void CreateParameterProperties(enum_DEBUGPROP_INFO_FLAGS dwFields, out uint elementsReturned, out IEnumDebugPropertyInfo2 enumObject)
- {
- elementsReturned = (uint)_arguments.Count;
- DEBUG_PROPERTY_INFO[] propInfo = new DEBUG_PROPERTY_INFO[_arguments.Count];
-
- int i = 0;
- foreach (VariableInfo arg in _arguments)
- {
- AD7Property property = new AD7Property(arg);
- propInfo[i] = property.ConstructDebugPropertyInfo(dwFields);
- i++;
- }
-
- enumObject = new AD7PropertyInfoEnum(propInfo);
- }
-
- #endregion
-
- #region IDebugStackFrame2 Members
-
-
- ///
- /// Creates an enumerator for properties associated with the stack frame, such as local variables.
- /// (http://msdn.microsoft.com/en-us/library/bb145607.aspx).
- ///
- /// A combination of flags from the DEBUGPROP_INFO_FLAGS enumeration that specifies which fields in
- /// the enumerated DEBUG_PROPERTY_INFO structures are to be filled in.
- /// The radix to be used in formatting any numerical information.
- /// A GUID of a filter used to select which DEBUG_PROPERTY_INFO structures are to be enumerated,
- /// such as guidFilterLocals.
- /// Maximum time, in milliseconds, to wait before returning from this method. Use INFINITE to wait
- /// indefinitely.
- /// Returns the number of properties enumerated. This is the same as calling the
- /// IEnumDebugPropertyInfo2::GetCount method.
- /// Returns an IEnumDebugPropertyInfo2 object containing a list of the desired properties.
- /// If successful, returns S_OK; otherwise, returns an error code.
- int IDebugStackFrame2.EnumProperties(enum_DEBUGPROP_INFO_FLAGS dwFields, uint nRadix, ref Guid guidFilter, uint dwTimeout, out uint elementsReturned, out IEnumDebugPropertyInfo2 enumObject)
- {
- elementsReturned = 0;
- enumObject = null;
-
- try
- {
- if (guidFilter == AD7Guids.guidFilterLocalsPlusArgs ||
- guidFilter == AD7Guids.guidFilterAllLocalsPlusArgs ||
- guidFilter == AD7Guids.guidFilterAllLocals)
- {
- CreateLocalsPlusArgsProperties(dwFields, out elementsReturned, out enumObject);
- return VSConstants.S_OK;
- }
- else if (guidFilter == AD7Guids.guidFilterLocals)
- {
- CreateLocalProperties(dwFields, out elementsReturned, out enumObject);
- return VSConstants.S_OK;
- }
- else if (guidFilter == AD7Guids.guidFilterArgs)
- {
- CreateParameterProperties(dwFields, out elementsReturned, out enumObject);
- return VSConstants.S_OK;
- }
- else
- {
- return VSConstants.E_NOTIMPL;
- }
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
- }
-
-
- ///
- /// Gets the code context for this stack frame. The code context represents the current instruction pointer in this stack frame.
- /// (http://msdn.microsoft.com/en-us/library/bb147046.aspx)
- ///
- /// Returns an IDebugCodeContext2 object that represents the current instruction pointer in this stack frame.
- /// If successful, returns S_OK; otherwise, returns an error code.
- int IDebugStackFrame2.GetCodeContext(out IDebugCodeContext2 memoryAddress)
- {
- memoryAddress = null;
- try
- {
- memoryAddress = new AD7MemoryAddress(m_engine, m_address);
- return VSConstants.S_OK;
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
- }
-
-
- ///
- /// Gets a description of the properties associated with a stack frame.
- /// (http://msdn.microsoft.com/en-us/library/bb144920.aspx)
- ///
- /// Returns an IDebugProperty2 object that describes the properties of this stack frame.
- /// VSConstants.S_OK.
- int IDebugStackFrame2.GetDebugProperty(out IDebugProperty2 property)
- {
- property = new AD7Property(this);
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the document context for this stack frame. The debugger will call this when the current stack frame is changed and
- /// will use it to open the correct source document for this stack frame. (http://msdn.microsoft.com/en-us/library/bb146338.aspx)
- ///
- /// Returns an IDebugDocumentContext2 object that represents the current position in a source
- /// document.
- /// If successful, returns S_OK; otherwise, returns an error code.
- int IDebugStackFrame2.GetDocumentContext(out IDebugDocumentContext2 docContext)
- {
- this.m_engine.cleanEvaluatedThreads();
- docContext = null;
-
- try
- {
- if (m_hasSource)
- {
- // Assume all lines begin and end at the beginning of the line.
- TEXT_POSITION begTp = new TEXT_POSITION();
- begTp.dwColumn = 0;
- begTp.dwLine = m_lineNum - 1;
- TEXT_POSITION endTp = new TEXT_POSITION();
- endTp.dwColumn = 0;
- endTp.dwLine = m_lineNum - 1;
-
- docContext = new AD7DocumentContext(m_documentName, begTp, endTp, null);
- return VSConstants.S_OK;
- }
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
-
- return VSConstants.S_FALSE;
- }
-
-
- ///
- /// Gets an evaluation context for expression evaluation within the current context of a stack frame and thread.
- /// Generally, an expression evaluation context can be thought of as a scope for performing expression evaluation.
- /// Call the IDebugExpressionContext2::ParseText method to parse an expression and then call the resulting
- /// IDebugExpression2::EvaluateSync or IDebugExpression2::EvaluateAsync methods to evaluate the parsed expression.
- /// (http://msdn.microsoft.com/en-us/library/bb161269.aspx)
- ///
- /// Returns an IDebugExpressionContext2 object that represents a context for expression evaluation.
- /// VSConstants.S_OK.
- int IDebugStackFrame2.GetExpressionContext(out IDebugExpressionContext2 ppExprCxt)
- {
- ppExprCxt = (IDebugExpressionContext2)this;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets a description of the stack frame. (http://msdn.microsoft.com/en-us/library/bb145146.aspx)
- ///
- /// A combination of flags from the FRAMEINFO_FLAGS enumeration that specifies which fields of the
- /// pFrameInfo parameter are to be filled in.
- /// The radix to be used in formatting any numerical information.
- /// A FRAMEINFO structure that is filled in with the description of the stack frame.
- /// If successful, returns S_OK; otherwise, returns an error code.
- int IDebugStackFrame2.GetInfo(enum_FRAMEINFO_FLAGS dwFieldSpec, uint nRadix, FRAMEINFO[] pFrameInfo)
- {
- try
- {
- SetFrameInfo(dwFieldSpec, out pFrameInfo[0]);
-
- int frame = 0;
- if (this.m_thread.__stackFrames != null)
- {
- foreach (AD7StackFrame sf in this.m_thread.__stackFrames)
- {
- if (sf.m_functionName == this.m_functionName)
- break;
- frame++;
- }
- }
-
- if (this.m_thread._id != this.m_engine.currentThread()._id)
- this.m_engine.eDispatcher.selectThread(this.m_thread._id);
-
- // Waits for the parsed response for the GDB/MI command that changes the selected frame.
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Stack-Manipulation.html)
- GDBParser.parseCommand("-stack-select-frame " + frame, 5);
-
- if (this.m_thread._id != this.m_engine.currentThread()._id)
- this.m_engine.eDispatcher.selectThread(this.m_engine.currentThread()._id);
-
- this.m_engine.cleanEvaluatedThreads();
-
- return VSConstants.S_OK;
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
- }
-
-
- ///
- /// Gets the language associated with this stack frame. (http://msdn.microsoft.com/en-us/library/bb145096.aspx)
- ///
- /// Returns the name of the language that implements the method associated with this stack frame.
- /// Returns the GUID of the language.
- /// VSConstants.S_OK.
- int IDebugStackFrame2.GetLanguageInfo(ref string pbstrLanguage, ref Guid pguidLanguage)
- {
- if (m_documentName.EndsWith(".c"))
- {
- pbstrLanguage = "C";
- pguidLanguage = AD7Guids.guidLanguageCpp;
- }
- else if (m_documentName.EndsWith(".cpp") || m_documentName.EndsWith(".c++"))
- {
- pbstrLanguage = "C++";
- pguidLanguage = AD7Guids.guidLanguageCpp;
- }
-
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the name of the stack frame. The name of a stack frame is typically the name of the method being executed.
- /// Not implemented. (http://msdn.microsoft.com/en-us/library/bb145002.aspx)
- ///
- /// Returns the name of the stack frame.
- /// Not implemented.
- int IDebugStackFrame2.GetName(out string name)
- {
- name = null;
-
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// Gets a machine-dependent representation of the range of physical addresses associated with a stack frame.
- /// Not implemented. (http://msdn.microsoft.com/en-us/library/bb145597.aspx)
- ///
- /// Returns the lowest physical address associated with this stack frame.
- /// Returns the highest physical address associated with this stack frame.
- /// Not implemented.
- int IDebugStackFrame2.GetPhysicalStackRange(out ulong addrMin, out ulong addrMax)
- {
- addrMin = 0;
- addrMax = 0;
-
- return VSConstants.E_NOTIMPL;
- }
-
-
- ///
- /// Gets the thread associated with a stack frame. (http://msdn.microsoft.com/en-us/library/bb161776.aspx)
- ///
- /// Returns an IDebugThread2 object that represents the thread.
- /// VSConstants.S_OK.
- int IDebugStackFrame2.GetThread(out IDebugThread2 thread)
- {
- thread = m_thread;
- return VSConstants.S_OK;
- }
-
- #endregion
-
- #region IDebugExpressionContext2 Members
-
-
- ///
- /// Retrieves the name of the evaluation context. The name is the description of this evaluation context. It is typically
- /// something that can be parsed by an expression evaluator that refers to this exact evaluation context. For example, in
- /// C++ the name is as follows: "{ function-name, source-file-name, module-file-name }"
- /// Not implemented. (http://msdn.microsoft.com/en-ca/library/bb161724.aspx)
- ///
- /// Returns the name of the evaluation context.
- /// Not implemented.
- int IDebugExpressionContext2.GetName(out string pbstrName)
- {
- throw new NotImplementedException();
- }
-
-
- ///
- /// Parses a text-based expression for evaluation. (http://msdn.microsoft.com/en-ca/library/bb162304.aspx).
- /// GDB will parse and evaluate the expression, returning the result or an error in the expression. So, the only task for this
- /// method is to create the IDebugExpression2 object that will be sent indirectly to the methods responsible for the evaluation.
- ///
- /// The expression to be parsed.
- /// A combination of flags from the PARSEFLAGS enumeration that controls parsing.
- /// The radix to be used in parsing any numerical information in pszCode.
- /// Returns the IDebugExpression2 object that represents the parsed expression, which is ready for
- /// binding and evaluation.
- /// Returns the error message if the expression contains an error.
- /// Returns the character index of the error in pszCode if the expression contains an error.
- /// VSConstants.S_OK.
- int IDebugExpressionContext2.ParseText(string pszCode,
- enum_PARSEFLAGS dwFlags,
- uint nRadix,
- out IDebugExpression2 ppExpr,
- out string pbstrError,
- out uint pichError)
- {
- pbstrError = "";
- pichError = 0;
- ppExpr = null;
-
- ppExpr = new AD7Expression(pszCode, this, m_engine.eDispatcher);
- return VSConstants.S_OK;
- }
-
- #endregion
- }
-}
-
diff --git a/src/VSNDK.DebugEngine/AD7.Impl/AD7Thread.cs b/src/VSNDK.DebugEngine/AD7.Impl/AD7Thread.cs
deleted file mode 100644
index c7ee3025..00000000
--- a/src/VSNDK.DebugEngine/AD7.Impl/AD7Thread.cs
+++ /dev/null
@@ -1,752 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-using System.Diagnostics;
-using VSNDK.Parser;
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace VSNDK.DebugEngine
-{
-
- ///
- /// Thread's category, from http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/807e26cc-4f3f-4e90-a9a8-b550d484b8c1
- ///
- enum enum_THREADCATEGORY
- {
- THREADCATEGORY_Worker = 0,
- THREADCATEGORY_UI = (THREADCATEGORY_Worker + 1),
- THREADCATEGORY_Main = (THREADCATEGORY_UI + 1),
- THREADCATEGORY_RPC = (THREADCATEGORY_Main + 1),
- THREADCATEGORY_Unknown = (THREADCATEGORY_RPC + 1)
- };
-
-
- ///
- /// This class represents a thread running in a program and it implements:
- ///
- /// IDebugThread2: (http://msdn.microsoft.com/en-ca/library/bb145332.aspx)
- ///
- /// IDebugThread100: (http://msdn.microsoft.com/en-us/library/ff471152.aspx)
- ///
- public class AD7Thread : IDebugThread2, IDebugThread100
- {
- ///
- /// The AD7Engine object that represents the DE.
- ///
- public AD7Engine _engine = null;
-
- ///
- /// Thread's name.
- ///
- public string _threadDisplayName;
-
- ///
- /// The suspend count determines how many times the IDebugThread2::Suspend method has been called so far.
- ///
- private uint _suspendCount;
-
- ///
- /// Full long path file name.
- ///
- public string _filename;
-
- ///
- /// Line number.
- ///
- public uint _line;
-
- ///
- /// Contains flags that specifies the information that were already verified about this thread's stack frame object.
- /// Used to avoid reevaluating stack frames that were already evaluated.
- ///
- public int _alreadyEvaluated = 0;
-
- ///
- /// Contains the stack frames for this thread
- ///
- public ArrayList __stackFrames = null;
-
- ///
- /// A FRAMEINFO structure that is filled in with the description of the previous stack frame that works as a cache, to avoid
- /// reevaluate the stack frame again.
- ///
- public FRAMEINFO[] previousFrameInfoArray = new FRAMEINFO[0];
-
- ///
- /// Thread's ID.
- ///
- public string _id;
-
- ///
- /// Thread's state.
- ///
- public string _state;
-
- ///
- /// Process' ID + Thread's ID.
- ///
- public string _targetID;
-
- ///
- /// Thread's priority.
- ///
- public string _priority;
-
-
- ///
- /// Constructor.
- ///
- /// The AD7Engine object that represents the DE.
- /// Thread's ID.
- /// Process' ID + Thread's ID.
- /// Thread's state.
- /// Thread's priority.
- /// Thread's name.
- /// Full short path file name.
- /// Line number.
- public AD7Thread(AD7Engine aEngine, string id, string targetID, string state, string priority, string name, string fullname, string line)//, DebuggedThread debuggedThread)
- {
- _engine = aEngine;
- _suspendCount = 0;
- if (id == "1")
- _threadDisplayName = "Main Thread";
- else
- _threadDisplayName = (name != "") ? name : "";
-
- if (fullname.Contains("~"))
- {
- // Need to lengthen the path used by Visual Studio.
- StringBuilder longPathName = new StringBuilder(1024);
- GetLongPathName(fullname, longPathName, longPathName.Capacity);
- _filename = longPathName.ToString();
- }
- else
- _filename = fullname;
-
- try
- {
- _line = Convert.ToUInt32(line);
- }
- catch
- {
- _line = 0;
- }
-
- _id = id;
- _state = state;
- _targetID = targetID;
- _priority = priority;
- }
-
-
- /// GDB works with short path names only, which requires converting the path names to/from long ones. This function
- /// returns the long path name for a given short one.
- /// Short path name.
- /// Returns this long path name.
- /// Lenght of this long path name.
- ///
- [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
- public static extern int GetLongPathName(
- [MarshalAs(UnmanagedType.LPTStr)]
- string path,
- [MarshalAs(UnmanagedType.LPTStr)]
- StringBuilder longPath,
- int longPathLength
- );
-
-
- ///
- /// Called by EventDipatcher to set the current location during break mode.
- ///
- /// Full short path file name.
- /// Line number.
- public void setCurrentLocation(string filename, uint line)
- {
- if (filename.Contains("~"))
- {
- // Need to lengthen the path used by Visual Studio.
- StringBuilder longPathName = new StringBuilder(1024);
- GetLongPathName(filename, longPathName, longPathName.Capacity);
- _filename = longPathName.ToString();
- }
- else
- _filename = filename;
- _line = line;
- }
-
-
- ///
- /// Gets the function name.
- ///
- /// If successful, returns the function name; otherwise, returns "".
- public string getFunctionName()
- {
- string func = "";
-
- if ((this._id != "") && (this._id != this._engine.currentThread()._id))
- _engine.eDispatcher.selectThread(this._id);
-
- string stackResponse = _engine.eDispatcher.getStackFrames().Replace("#;;;;", "");
-
- if (stackResponse != "")
- {
- string[] frameStrings = stackResponse.Split('#');
-
- // Query the stack depth without inquiring GDB.
- int numStackFrames = frameStrings.Length;
-
- if (numStackFrames > 30) // limiting the amount of stackFrames to avoid VS crashing.
- numStackFrames = 30;
-
- for (int i = 0; i < numStackFrames; i++)
- {
- string[] frameInfo = frameStrings[i].Split(';');
- if (frameInfo.Length >= 2)
- {
- if ((frameInfo[2] != "") && (frameInfo[2] != "??") && (!frameInfo[2].Contains("object.")))
- {
- func = frameInfo[2];
- break;
- }
- }
- }
-
- if ((this._id != "") && (this._id != this._engine.currentThread()._id))
- _engine.eDispatcher.selectThread(this._engine.currentThread()._id);
- }
-
- return func;
- }
-
-
- ///
- /// Determines whether the next statement can be set to the given stack frame and code context. Not implemented.
- /// (http://msdn.microsoft.com/en-ca/library/bb146582.aspx)
- ///
- /// Reserved for future use; set to a null value. If this is a null value, use the current
- /// stack frame.
- /// An IDebugCodeContext2 object that describes the code location about to be executed and
- /// its context.
- /// VSConstants.S_OK.
- int IDebugThread2.CanSetNextStatement(IDebugStackFrame2 pStackFrame, IDebugCodeContext2 pCodeContext)
- {
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Retrieves a list of the stack frames for this thread. (http://msdn.microsoft.com/en-ca/library/bb145138.aspx)
- ///
- /// A combination of flags from the FRAMEINFO_FLAGS enumeration that specifies which fields of the
- /// FRAMEINFO structures are to be filled out.
- /// Radix used in formatting numerical information in the enumerator.
- /// Returns an IEnumDebugFrameInfo2 object that contains a list of FRAMEINFO structures describing the
- /// stack frame.
- /// If successful, returns S_OK; otherwise, returns an error code.
- int IDebugThread2.EnumFrameInfo(enum_FRAMEINFO_FLAGS dwFieldSpec, uint nRadix, out IEnumDebugFrameInfo2 ppEnum)
- {
- if (this._id == "")
- {
- ppEnum = null;
- return Constants.S_FALSE;
- }
-
- if (this._engine.evaluatedTheseFlags(this._id, dwFieldSpec))
- {
- ppEnum = new AD7FrameInfoEnum(previousFrameInfoArray);
- return Constants.S_OK;
- }
-
- // Ask for general stack information.
- if ((this._id != "") && (this._id != this._engine.currentThread()._id))
- _engine.eDispatcher.selectThread(this._id);
-
- string stackResponse = _engine.eDispatcher.getStackFrames().Replace("#;;;;", "");
- if (stackResponse == "")
- {
- ppEnum = null;
- return Constants.S_FALSE;
- }
- string[] frameStrings = stackResponse.Split('#');
-
- // Query the stack depth without inquiring GDB.
- int numStackFrames = frameStrings.Length;
-
- if (numStackFrames > 30) // limiting the amount of stackFrames to avoid VS crashing.
- numStackFrames = 30;
-
- ppEnum = null;
- try
- {
- bool created = false;
- FRAMEINFO[] frameInfoArray = new FRAMEINFO[numStackFrames];
- for (int i = 0; i < numStackFrames; i++)
- {
- string[] frameInfo = frameStrings[i].Split(';');
- if (frameInfo.Length >= 3)
- {
- if (frameInfo[3].Contains("~"))
- {
- // Need to lengthen the path used by Visual Studio.
- StringBuilder longPathName = new StringBuilder(1024);
- GetLongPathName(frameInfo[3], longPathName, longPathName.Capacity);
- frameInfo[3] = longPathName.ToString();
- }
- AD7StackFrame frame = AD7StackFrame.create(_engine, this, frameInfo, ref created);
- if (frame.m_thread.__stackFrames == null) // that's weird, but sometimes VS is not initializing __stackFrames, so I added this loop to avoid other problems.
- {
- while (frame.m_thread.__stackFrames == null)
- frame.m_thread.__stackFrames = new ArrayList() { frame };
- }
- frame.SetFrameInfo(dwFieldSpec, out frameInfoArray[i]);
- }
- }
- if ((previousFrameInfoArray.Length != frameInfoArray.Length) || (created == true))
- {
- previousFrameInfoArray = frameInfoArray;
- ppEnum = new AD7FrameInfoEnum(frameInfoArray);
- }
- else
- {
- bool isEqual = true;
- for (int i = 0; i < frameInfoArray.Length; i++)
- {
- if (frameInfoArray[i].m_bstrFuncName != previousFrameInfoArray[i].m_bstrFuncName)
- {
- isEqual = false;
- break;
- }
- if (frameInfoArray[i].m_dwValidFields != previousFrameInfoArray[i].m_dwValidFields)
- {
- isEqual = false;
- break;
- }
- if (frameInfoArray[i].m_bstrLanguage != previousFrameInfoArray[i].m_bstrLanguage)
- {
- isEqual = false;
- break;
- }
- }
- if (!isEqual)
- {
- previousFrameInfoArray = frameInfoArray;
- ppEnum = new AD7FrameInfoEnum(frameInfoArray);
- }
- else
- {
- ppEnum = new AD7FrameInfoEnum(previousFrameInfoArray);
- }
- }
-
- if ((this._id != "") && (this._id != this._engine.currentThread()._id))
- _engine.eDispatcher.selectThread(this._engine.currentThread()._id);
-
- return Constants.S_OK;
- }
- catch (ComponentException e)
- {
- if ((this._id != "") && (this._id != this._engine.currentThread()._id))
- _engine.eDispatcher.selectThread(this._engine.currentThread()._id);
- return e.HResult;
- }
- catch (Exception e)
- {
- if ((this._id != "") && (this._id != this._engine.currentThread()._id))
- _engine.eDispatcher.selectThread(this._engine.currentThread()._id);
- return EngineUtils.UnexpectedException(e);
- }
- }
-
-
- ///
- /// Gets the logical thread associated with this physical thread. Not implemented.
- /// (http://msdn.microsoft.com/en-ca/library/bb161676.aspx)
- ///
- /// An IDebugStackFrame2 object that represents the stack frame.
- /// Returns an IDebugLogicalThread2 interface that represents the associated logical
- /// thread. A debug engine implementation should set this to a null value.
- /// VSConstants.S_OK.
- int IDebugThread2.GetLogicalThread(IDebugStackFrame2 pStackFrame, out IDebugLogicalThread2 ppLogicalThread)
- {
- ppLogicalThread = null;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the name of a thread. (http://msdn.microsoft.com/en-ca/library/bb162273.aspx)
- ///
- /// Returns the name of the thread.
- /// VSConstants.S_OK.
- int IDebugThread2.GetName(out string pbstrName)
- {
- pbstrName = _threadDisplayName;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the program in which a thread is running. (http://msdn.microsoft.com/en-ca/library/bb147002.aspx)
- ///
- /// Returns an IDebugProgram2 object that represents the program this thread is running in.
- /// VSConstants.S_OK.
- int IDebugThread2.GetProgram(out IDebugProgram2 ppProgram)
- {
- ppProgram = _engine.m_program;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the system thread identifier. (http://msdn.microsoft.com/en-ca/library/bb161964.aspx)
- ///
- /// Returns the system thread identifier.
- /// VSConstants.S_OK.
- int IDebugThread2.GetThreadId(out uint pdwThreadId)
- {
- try
- {
- pdwThreadId = Convert.ToUInt32(this._id);
- }
- catch
- {
- pdwThreadId = 0;
- }
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Gets the properties that describe this thread. (http://msdn.microsoft.com/en-ca/library/bb145602.aspx)
- ///
- /// A combination of flags from the THREADPROPERTY_FIELDS enumeration that determines which fields of
- /// ptp are to be filled in.
- /// A THREADPROPERTIES structure that that is filled in with the properties of the thread.
- /// If successful, returns S_OK; otherwise, returns an error code.
- int IDebugThread2.GetThreadProperties(enum_THREADPROPERTY_FIELDS dwFields, THREADPROPERTIES[] ptp)
- {
- try
- {
- if ((dwFields & enum_THREADPROPERTY_FIELDS.TPF_ID) != 0)
- {
- try
- {
- ptp[0].dwThreadId = Convert.ToUInt32(this._id);
- }
- catch
- {
- ptp[0].dwThreadId = 0;
- }
- ptp[0].dwFields |= enum_THREADPROPERTY_FIELDS.TPF_ID;
- }
- if ((dwFields & enum_THREADPROPERTY_FIELDS.TPF_SUSPENDCOUNT) != 0)
- {
- // VSNDK debug engine doesn't support suspending threads
- ptp[0].dwFields |= enum_THREADPROPERTY_FIELDS.TPF_SUSPENDCOUNT;
- }
- if ((dwFields & enum_THREADPROPERTY_FIELDS.TPF_STATE) != 0)
- {
- if (this._state == "running")
- ptp[0].dwThreadState = (uint)enum_THREADSTATE.THREADSTATE_RUNNING;
- else
- ptp[0].dwThreadState = (uint)enum_THREADSTATE.THREADSTATE_STOPPED;
- ptp[0].dwFields |= enum_THREADPROPERTY_FIELDS.TPF_STATE;
- }
- if ((dwFields & enum_THREADPROPERTY_FIELDS.TPF_PRIORITY) != 0)
- {
- ptp[0].bstrPriority = "Normal";
- ptp[0].dwFields |= enum_THREADPROPERTY_FIELDS.TPF_PRIORITY;
- }
- if ((dwFields & enum_THREADPROPERTY_FIELDS.TPF_NAME) != 0)
- {
- ptp[0].bstrName = _threadDisplayName;
- ptp[0].dwFields |= enum_THREADPROPERTY_FIELDS.TPF_NAME;
- }
- if ((dwFields & enum_THREADPROPERTY_FIELDS.TPF_LOCATION) != 0)
- {
- ptp[0].bstrLocation = "";
- if (__stackFrames != null)
- {
- foreach (AD7StackFrame frame in __stackFrames)
- {
- if (frame.m_functionName != "")
- {
- ptp[0].bstrLocation = frame.m_functionName;
- break;
- }
- }
- }
- if (ptp[0].bstrLocation == "")
- ptp[0].bstrLocation = "[External Code]";
-
- ptp[0].dwFields |= enum_THREADPROPERTY_FIELDS.TPF_LOCATION;
- }
-
- return Constants.S_OK;
- }
- catch (ComponentException e)
- {
- return e.HResult;
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
- }
-
-
- ///
- /// Resumes execution of a thread. (http://msdn.microsoft.com/en-ca/library/bb145813.aspx)
- ///
- /// Returns the suspend count after the resume operation.
- /// VSConstants.S_OK.
- int IDebugThread2.Resume(out uint pdwSuspendCount)
- {
- _suspendCount--;
- pdwSuspendCount = _suspendCount;
- if (_suspendCount == 0)
- {
- // Send GDB command to resume execution of thread
- }
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Sets the next statement to the given stack frame and code context. Not implemented.
- /// (http://msdn.microsoft.com/en-ca/library/bb160944.aspx)
- ///
- /// Reserved for future use; set to a null value.
- /// An IDebugCodeContext2 object that describes the code location about to be executed and
- /// its context.
- /// VSConstants.S_OK.
- int IDebugThread2.SetNextStatement(IDebugStackFrame2 pStackFrame, IDebugCodeContext2 pCodeContext)
- {
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Sets the name of the thread. (http://msdn.microsoft.com/en-ca/library/bb162322.aspx)
- ///
- /// The name of the thread.
- /// VSConstants.S_OK.
- int IDebugThread2.SetThreadName(string pszName)
- {
- _threadDisplayName = pszName;
- return VSConstants.S_OK;
- }
-
-
- ///
- /// Suspends a thread. (http://msdn.microsoft.com/en-us/library/bb145297.aspx)
- ///
- /// Returns the suspend count after the suspend operation.
- /// VSConstants.S_OK
- int IDebugThread2.Suspend(out uint pdwSuspendCount)
- {
- _suspendCount++;
- pdwSuspendCount = _suspendCount;
- return VSConstants.S_OK;
- }
-
- #region IDebugThread100 Members
-
-
- ///
- /// Sets the name of the thread.
- /// (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugthread100.setthreaddisplayname.aspx)
- ///
- /// The name of the thread.
- /// VSConstants.S_OK.
- int IDebugThread100.SetThreadDisplayName(string name)
- {
- this._threadDisplayName = name;
- return Constants.S_OK;
- }
-
-
- ///
- /// Gets the name of a thread.
- /// (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugthread100.getthreaddisplayname.aspx)
- ///
- /// Returns the name of the thread.
- /// VSConstants.S_OK.
- int IDebugThread100.GetThreadDisplayName(out string name)
- {
- name = this._threadDisplayName;
- return Constants.S_OK;
- }
-
-
- ///
- /// Returns whether this thread can be used to do function/property evaluation. Not implemented.
- /// (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugthread100.candofunceval.aspx)
- ///
- /// VSConstants.S_FALSE.
- int IDebugThread100.CanDoFuncEval()
- {
- return Constants.S_FALSE;
- }
-
-
- ///
- /// Set flags. Not implemented.
- /// (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugthread100.setflags.aspx)
- ///
- /// Flags.
- /// VSConstants.E_NOTIMPL.
- int IDebugThread100.SetFlags(uint flags)
- {
- // Not necessary to implement in the debug engine. Instead it is implemented in the SDM.
- return Constants.E_NOTIMPL;
- }
-
-
- ///
- /// Get flags. Not implemented.
- /// (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugthread100.getflags.aspx)
- ///
- /// Flags.
- /// VSConstants.E_NOTIMPL.
- int IDebugThread100.GetFlags(out uint flags)
- {
- // Not necessary to implement in the debug engine. Instead it is implemented in the SDM.
- flags = 0;
- return Constants.E_NOTIMPL;
- }
-
-
- ///
- /// Gets the properties that describe this thread.
- /// (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugthread100.getthreadproperties100.aspx)
- ///
- /// A combination of flags from the THREADPROPERTIES100 enumeration that determines which fields of
- /// ptp are to be filled in.
- /// A THREADPROPERTIES100 structure that that is filled in with the properties of the thread.
- /// If successful, returns S_OK; otherwise, returns an error code.
- int IDebugThread100.GetThreadProperties100(uint dwFields, THREADPROPERTIES100[] ptp)
- {
- try
- {
- if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_ID) != 0)
- {
- try
- {
- ptp[0].dwThreadId = Convert.ToUInt32(this._id);
- }
- catch
- {
- ptp[0].dwThreadId = 0;
- }
- ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_ID;
- }
- if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_SUSPENDCOUNT) != 0)
- {
- // VSNDK debug engine doesn't support suspending threads
- ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_SUSPENDCOUNT;
- }
- if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_STATE) != 0)
- {
- if (this._state == "running")
- ptp[0].dwThreadState = (uint)enum_THREADSTATE.THREADSTATE_RUNNING;
- else
- ptp[0].dwThreadState = (uint)enum_THREADSTATE.THREADSTATE_STOPPED;
- ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_STATE;
- }
- if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_PRIORITY) != 0)
- {
- ptp[0].bstrPriority = "Normal";
- ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_PRIORITY;
- }
- if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_NAME) != 0)
- {
- ptp[0].bstrName = _threadDisplayName;
- ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_NAME;
- }
- if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_DISPLAY_NAME) != 0)
- {
- // Thread display name is being requested
- ptp[0].bstrDisplayName = _threadDisplayName;
- ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_DISPLAY_NAME;
-
- // Give this display name a higher priority than the default (0)
- // so that it will actually be displayed
- ptp[0].DisplayNamePriority = 10;
- ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_DISPLAY_NAME_PRIORITY;
- }
- if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_LOCATION) != 0)
- {
- ptp[0].bstrLocation = "";
- if (__stackFrames != null)
- {
- foreach (AD7StackFrame frame in __stackFrames)
- {
- if ((frame.m_functionName != "") && (frame.m_functionName != "??"))
- {
- ptp[0].bstrLocation = frame.m_functionName;
- break;
- }
- }
- }
- else
- ptp[0].bstrLocation = getFunctionName();
-
- if (ptp[0].bstrLocation == "")
- ptp[0].bstrLocation = "[External Code]";
-
- ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_LOCATION;
- }
- if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_CATEGORY) != 0)
- {
- if (this._id == "1")
- ptp[0].dwThreadCategory = (uint)enum_THREADCATEGORY.THREADCATEGORY_Main;
- else
- ptp[0].dwThreadCategory = (uint)enum_THREADCATEGORY.THREADCATEGORY_Worker;
- ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_CATEGORY;
- }
- if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_AFFINITY) != 0)
- {
- // Thread cpu affinity is being requested
- ptp[0].AffinityMask = 0;
- ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_AFFINITY;
- }
-
- if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_PRIORITY_ID) != 0)
- {
- // Thread display name is being requested
- ptp[0].priorityId = 0;
- ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_PRIORITY_ID;
- }
- return Constants.S_OK;
- }
- catch (ComponentException e)
- {
- return e.HResult;
- }
- catch (Exception e)
- {
- return EngineUtils.UnexpectedException(e);
- }
- }
-
- #endregion
- }
-}
diff --git a/src/VSNDK.DebugEngine/Engine.Impl/BreakpointManager.cs b/src/VSNDK.DebugEngine/Engine.Impl/BreakpointManager.cs
deleted file mode 100644
index bd69b948..00000000
--- a/src/VSNDK.DebugEngine/Engine.Impl/BreakpointManager.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using Microsoft.VisualStudio.Debugger.Interop;
-using VSNDK.Parser;
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// This class manages breakpoints for the engine.
- ///
- public class BreakpointManager
- {
-
- ///
- /// The AD7Engine object that represents the DE.
- ///
- private AD7Engine m_engine;
-
- ///
- /// List of pending breakpoints.
- ///
- private List m_pendingBreakpoints;
-
- ///
- /// List of active breakpoints.
- ///
- private List m_activeBPs;
-
-
- ///
- /// Breakpoint manager constructor.
- ///
- /// Associated Debug Engine.
- public BreakpointManager(AD7Engine engine)
- {
- m_engine = engine;
- m_pendingBreakpoints = new System.Collections.Generic.List();
- m_activeBPs = new System.Collections.Generic.List();
- }
-
-
- ///
- /// A helper method used to construct a new pending breakpoint.
- ///
- /// An IDebugBreakpointRequest2 object that describes the pending breakpoint to create.
- /// Returns an IDebugPendingBreakpoint2 object that represents the pending breakpoint.
- public void CreatePendingBreakpoint(IDebugBreakpointRequest2 pBPRequest, out IDebugPendingBreakpoint2 ppPendingBP)
- {
- AD7PendingBreakpoint pendingBreakpoint = new AD7PendingBreakpoint(pBPRequest, m_engine, this);
- ppPendingBP = (IDebugPendingBreakpoint2)pendingBreakpoint;
- m_pendingBreakpoints.Add(pendingBreakpoint);
- }
-
-
- ///
- /// Return the active bound breakpoint matching the given GDB ID.
- ///
- /// Breakpoint ID in GDB.
- /// If successful, returns the active bound breakpoint; otherwise, returns null.
- public AD7BoundBreakpoint getBoundBreakpointForGDBID(uint GDB_ID)
- {
- foreach (AD7BoundBreakpoint bbp in m_activeBPs)
- {
- if ((bbp != null) && (bbp.GDB_ID == GDB_ID))
- {
- return bbp;
- }
- }
- return null;
- }
-
-
- ///
- /// Called from the engine's detach method to remove the debugger's breakpoint instructions.
- ///
- public void ClearBoundBreakpoints()
- {
- foreach (AD7PendingBreakpoint pendingBreakpoint in m_pendingBreakpoints)
- {
- pendingBreakpoint.ClearBoundBreakpoints();
- }
- }
-
- ///
- /// Creates an entry and remotely enables the breakpoint in the debug stub.
- ///
- /// The bound breakpoint to add.
- /// Breakpoint ID Number.
- public int RemoteAdd(AD7BoundBreakpoint aBBP)
- {
- // Call GDB to set a breakpoint based on filename and line no. in aBBP
- uint GDB_ID = 0;
- uint GDB_LinePos = 0;
- string GDB_Filename = "";
- string GDB_address = "";
- bool ret = false;
-
- if (aBBP.m_bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FILE_LINE)
- {
- ret = m_engine.eDispatcher.setBreakpoint(aBBP.m_filename, aBBP.m_line, out GDB_ID, out GDB_LinePos, out GDB_Filename, out GDB_address);
- }
- else if (aBBP.m_bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FUNC_OFFSET)
- {
- ret = m_engine.eDispatcher.setBreakpoint(aBBP.m_func, out GDB_ID, out GDB_LinePos, out GDB_Filename, out GDB_address);
- }
-
- if (ret)
- {
- m_activeBPs.Add(aBBP);
-
- aBBP.GDB_ID = GDB_ID;
- aBBP.GDB_FileName = GDB_Filename;
- aBBP.GDB_LinePos = GDB_LinePos;
- aBBP.GDB_Address = GDB_address;
- }
- return (int)GDB_ID;
- }
-
- ///
- /// Enable bound breakpoint.
- ///
- /// The Bound breakpoint to enable.
- public void RemoteEnable(AD7BoundBreakpoint aBBP)
- {
- m_engine.eDispatcher.enableBreakpoint(aBBP.GDB_ID, true);
- }
-
-
- ///
- /// Disable bound breakpoint.
- ///
- /// The Bound breakpoint to disable.
- public void RemoteDisable(AD7BoundBreakpoint aBBP)
- {
- m_engine.eDispatcher.enableBreakpoint(aBBP.GDB_ID, false);
- }
-
-
- ///
- /// Remove the associated bound breakpoint.
- ///
- /// The breakpoint to remove.
- public void RemoteDelete(AD7BoundBreakpoint aBBP)
- {
- m_activeBPs.Remove(aBBP);
- m_engine.eDispatcher.deleteBreakpoint(aBBP.GDB_ID);
- }
- }
-}
diff --git a/src/VSNDK.DebugEngine/Engine.Impl/EngineCallback.cs b/src/VSNDK.DebugEngine/Engine.Impl/EngineCallback.cs
deleted file mode 100644
index 9177e65b..00000000
--- a/src/VSNDK.DebugEngine/Engine.Impl/EngineCallback.cs
+++ /dev/null
@@ -1,235 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio.Debugger.Interop;
-using System.Diagnostics;
-using System.Collections.ObjectModel;
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// Used to send events to the debugger. Some examples of these events are thread create, exception thrown, module load.
- ///
- public class EngineCallback
- {
-
- ///
- /// The IDebugEventCallback2 object that receives debugger events.
- ///
- readonly IDebugEventCallback2 m_ad7Callback;
-
- ///
- /// The AD7Engine object that represents the DE.
- ///
- readonly AD7Engine m_engine;
-
-
- ///
- /// Constructor.
- ///
- /// The AD7Engine object that represents the DE.
- /// The IDebugEventCallback2 object that receives debugger events.
- public EngineCallback(AD7Engine engine, IDebugEventCallback2 ad7Callback)
- {
- m_ad7Callback = ad7Callback;
- m_engine = engine;
- }
-
-
- ///
- /// Send events to the debugger.
- ///
- /// Event object to be sent to the debugger.
- /// ID of the event.
- /// A program that is running in a process.
- /// A thread running in a program.
- public void Send(IDebugEvent2 eventObject, string iidEvent, IDebugProgram2 program, IDebugThread2 thread)
- {
- uint attributes;
- Guid riidEvent = new Guid(iidEvent);
-
- EngineUtils.RequireOk(eventObject.GetAttributes(out attributes));
-
- if ((thread == null) && (m_engine != null) && (m_engine.thread != null) && (program != null) && (eventObject != null) && (riidEvent != null) && (attributes != null))
- {
- if (m_engine._currentThreadIndex != -1)
- {
- EngineUtils.RequireOk(m_ad7Callback.Event(m_engine, null, program, m_engine.thread[m_engine._currentThreadIndex], eventObject, ref riidEvent, attributes));
- }
- else
- {
- if (m_engine.thread != null)
- EngineUtils.RequireOk(m_ad7Callback.Event(m_engine, null, program, m_engine.thread[0], eventObject, ref riidEvent, attributes));
- else
- EngineUtils.RequireOk(m_ad7Callback.Event(m_engine, null, program, null, eventObject, ref riidEvent, attributes));
- }
- }
- else
- EngineUtils.RequireOk(m_ad7Callback.Event(m_engine, null, program, thread, eventObject, ref riidEvent, attributes));
- }
-
-
- ///
- /// Call the method that will send the event to the debugger with all the arguments.
- ///
- /// Event object to be sent to the debugger.
- /// ID of the event.
- /// A thread running in a program.
- public void Send(IDebugEvent2 eventObject, string iidEvent, IDebugThread2 thread)
- {
- Send(eventObject, iidEvent, m_engine, thread);
- }
-
-
- ///
- /// IDebugErrorEvent2 is used to report error messages to the user when something goes wrong in the debug engine.
- /// The VSNDK debug engine doesn't take advantage of this. Not implemented.
- ///
- ///
- public void OnError(int hrErr)
- {
- }
-
-
- ///
- /// The VSNDK debug engine does not support binding breakpoints as modules load since the primary exe is the only module
- /// symbols are loaded for. A production debugger will need to bind breakpoints when a new module is loaded.
- ///
- /// A module loaded in the debugged process.
- public void OnModuleLoad(AD7Module debuggedModule)
- {
- // AD7Module ad7Module = new AD7Module(debuggedModule);
- AD7ModuleLoadEvent eventObject = new AD7ModuleLoadEvent(debuggedModule, true /* this is a module load */);
-
- // debuggedModule.Client = ad7Module;
-
- Send(eventObject, AD7ModuleLoadEvent.IID, null);
- }
-
-
- ///
- /// Send to the session debug manager (SDM) an event to output a string.
- /// Not used.
- ///
- /// The output string.
- public void OnOutputString(string outputString)
- {
- AD7OutputDebugStringEvent eventObject = new AD7OutputDebugStringEvent(outputString);
-
- Send(eventObject, AD7OutputDebugStringEvent.IID, null);
- }
-
-
- ///
- /// Send an event to SDM with the breakpoint that was hit.
- ///
- /// The thread running in a program.
- /// List of bound breakpoints. At this moment, this list has only one element.
- public void OnBreakpoint(AD7Thread thread, IList clients)
- {
- IDebugBoundBreakpoint2[] boundBreakpoints = new IDebugBoundBreakpoint2[clients.Count];
-
- int i = 0;
- foreach (object objCurrentBreakpoint in clients)
- {
- boundBreakpoints[i] = (IDebugBoundBreakpoint2)objCurrentBreakpoint;
- i++;
- }
-
- AD7BoundBreakpointsEnum boundBreakpointsEnum = new AD7BoundBreakpointsEnum(boundBreakpoints);
- AD7BreakpointEvent eventObject = new AD7BreakpointEvent(boundBreakpointsEnum);
-
- Send(eventObject, AD7BreakpointEvent.IID, thread);
- }
-
-
- ///
- // Exception events are sent when an exception occurs in the debugged that the debugger was not expecting.
- // The VSNDK debug engine does not support these. Not implemented.
- ///
- public void OnException()
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
-
- ///
- /// Step complete is sent when a step has finished. Not implemented.
- ///
- public void OnStepComplete()
- {
- throw new Exception("The method or operation is not implemented.");
-// AD7StepCompletedEvent.Send(m_engine);
- // TODO: implement this method...
- }
-
-
- ///
- /// This will get called when the engine receives the breakpoint event that is created when the user
- /// hits the pause button in VS.
- ///
- /// The thread running in a program.
- public void OnAsyncBreakComplete(AD7Thread thread)
- {
- AD7AsyncBreakCompleteEvent eventObject = new AD7AsyncBreakCompleteEvent();
- Send(eventObject, AD7AsyncBreakCompleteEvent.IID, thread);
- }
-
-
- ///
- /// Engines notify the debugger about the results of a symbol search by sending an instance of IDebugSymbolSearchEvent2.
- /// Not used.
- ///
- ///
- ///
- ///
- public void OnSymbolSearch(AD7Module module, string status, uint dwStatusFlags)
- {
- string statusString = (dwStatusFlags == 1 ? "Symbols Loaded - " : "No symbols loaded") + status;
-
- AD7SymbolSearchEvent eventObject = new AD7SymbolSearchEvent(module, statusString, dwStatusFlags);
- Send(eventObject, AD7SymbolSearchEvent.IID, null);
- }
-
-
- ///
- /// Engines notify the debugger that a breakpoint has bound through the breakpoint bound event.
- ///
- /// The bounded breakpoint.
- /// 0.
- public void OnBreakpointBound(object objBoundBreakpoint, uint address)
- {
- AD7BoundBreakpoint boundBreakpoint = (AD7BoundBreakpoint)objBoundBreakpoint;
- IDebugPendingBreakpoint2 pendingBreakpoint;
- ((IDebugBoundBreakpoint2)boundBreakpoint).GetPendingBreakpoint(out pendingBreakpoint);
-
- AD7BreakpointBoundEvent eventObject = new AD7BreakpointBoundEvent((AD7PendingBreakpoint)pendingBreakpoint, boundBreakpoint);
- Send(eventObject, AD7BreakpointBoundEvent.IID, null);
- }
-
-
- ///
- /// Send an event to notify the SDM that this thread was created.
- ///
- /// The new thread running in a program.
- public void OnThreadStart(AD7Thread debuggedThread)
- {
- AD7ThreadCreateEvent eventObject = new AD7ThreadCreateEvent();
- Send(eventObject, AD7ThreadCreateEvent.IID, debuggedThread);
- }
- }
-}
diff --git a/src/VSNDK.DebugEngine/Engine.Impl/EngineUtils.cs b/src/VSNDK.DebugEngine/Engine.Impl/EngineUtils.cs
deleted file mode 100644
index 84bbc69d..00000000
--- a/src/VSNDK.DebugEngine/Engine.Impl/EngineUtils.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Debugger.Interop;
-using System.Diagnostics;
-using System.Globalization;
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// Some utilities used in VSNDK debug engine projects.
- ///
- public static class EngineUtils
- {
-
- ///
- ///
- ///
- /// An integer value.
- public static void RequireOk(int hr)
- {
- if (hr != 0)
- {
- throw new InvalidOperationException();
- }
- }
-
-
- ///
- ///
- ///
- /// Exception.
- /// VSConstants.E_NOTIMPL.
- public static int UnexpectedException(Exception e)
- {
- Debug.Fail("Unexpected exception:" + e);
- return VSConstants.E_NOTIMPL;
- }
- }
-}
diff --git a/src/VSNDK.DebugEngine/Engine.Impl/EventDispatcher.cs b/src/VSNDK.DebugEngine/Engine.Impl/EventDispatcher.cs
deleted file mode 100644
index a3e7919c..00000000
--- a/src/VSNDK.DebugEngine/Engine.Impl/EventDispatcher.cs
+++ /dev/null
@@ -1,1906 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using Microsoft.VisualStudio.Debugger.Interop;
-using VSNDK.Parser;
-using System.Threading;
-using System.Windows.Forms;
-
-namespace VSNDK.DebugEngine
-{
- ///
- /// This class manages debug events for the debug engine.
- ///
- /// Process GDB's output by classifying it by type (e.g. breakpoint event) and providing relevant data.
- /// Send GDB commands as appropriate for the received event (e.g. call -exec-continue to resume execution after a breakpoint is
- /// inserted).
- /// Call debug engine methods to notify the SDM of an event (e.g. if a breakpoint is hit, call EngineCallback.OnBreakpoint()).
- ///
- public class EventDispatcher
- {
- ///
- /// The private AD7Engine object that represents the DE.
- ///
- private AD7Engine m_engine = null;
-
- ///
- /// The public AD7Engine object that represents the DE.
- ///
- public AD7Engine engine
- {
- get { return m_engine; }
- }
-
- ///
- /// Thread responsible for handling asynchronous output from GDB.
- ///
- private Thread m_processingThread = null;
-
- ///
- /// Represents the object that process asynchronous GDB's output by classifying it by type (e.g. breakpoint event).
- ///
- GDBOutput m_gdbOutput;
-
- ///
- /// Boolean variable that indicates if the current code is known or unknown, i.e., if there is a source code file associated.
- ///
- public static bool m_unknownCode = false;
-
- ///
- /// Object used to control the access to the critical section that exists in the "lockedBreakpoint" method.
- ///
- private Object m_lockBreakpoint = new Object();
-
- ///
- /// Object used to control the access to the critical section that exists in the "unlockBreakpoint" method.
- ///
- private Object m_unlockBreakpoint = new Object();
-
- ///
- /// Object used to control the access to the critical section that exists in the "enterCriticalRegion" method.
- ///
- private Object m_criticalRegion = new Object();
-
- ///
- /// Object used to control the access to the critical section that exists in the "leaveCriticalRegion" method.
- ///
- private Object m_leaveCriticalRegion = new Object();
-
- ///
- /// Boolean variable that indicates the GDB state: TRUE -> run mode; FALSE -> break mode.
- ///
- public static bool m_GDBRunMode = true;
-
- ///
- /// Variable that is manipulated only in methods enterCriticalRegion and leaveCriticalRegion
- ///
- public bool inCriticalRegion = false;
-
- ///
- /// There is a GDB bug that causes a message "Quit (expect signal SIGINT when the program is resumed)". If this message occurs
- /// 5 times, VSNDK will end the debug session. That's why this variable is needed, to count the amount of this kind of message
- /// that is received in a sequence.
- ///
- public int countSIGINT = 0;
-
-
- ///
- /// Ends the debug session by closing GDB, sending the appropriate events to the SDM, and breaking out of all
- /// buffer- and event-listening loops.
- ///
- /// The exit code.
- public void endDebugSession(uint exitCode)
- {
- // Exit the event dispatch loop.
- m_gdbOutput._running = false;
-
- // Send events to the SDM.
- AD7ThreadDestroyEvent.Send(engine, exitCode, null);
- AD7ProgramDestroyEvent.Send(engine, exitCode);
-
- // Exit GDB.
- GDBParser.exitGDB();
-
- // Notify the AddIn that this debug session has ended.
- VSNDK.Package.ControlDebugEngine.isDebugEngineRunning = false;
- }
-
-
- ///
- /// Constructor. Starts the thread responsible for handling asynchronous GDB output.
- ///
- /// The AD7Engine object that represents the DE.
- public EventDispatcher(AD7Engine engine)
- {
- m_engine = engine;
-
- m_gdbOutput = new GDBOutput(this);
- m_processingThread = new Thread(m_gdbOutput.processingGDBOutput);
- m_processingThread.Start();
- }
-
-
- ///
- /// Process asynchronous GDB's output by classifying it by type (e.g. breakpoint event).
- ///
- public class GDBOutput
- {
- ///
- /// This object manages debug events in the engine.
- ///
- private EventDispatcher m_eventDispatcher = null;
-
- ///
- /// This object manages breakpoints events.
- ///
- private HandleBreakpoints m_hBreakpoints = null;
-
- ///
- /// This object manages events related to execution control (processes, threads, programs).
- ///
- private HandleProcessExecution m_hProcExe = null;
-
- ///
- /// This object manages events related to output messages.
- ///
- private HandleOutputs m_hOutputs = null;
-
- ///
- /// Boolean variable that corresponds to the event dispatcher status. When false, exit the event dispatch loop.
- ///
- public bool _running = true;
-
-
- ///
- /// Constructor.
- ///
- /// This object manages debug events in the engine.
- public GDBOutput(EventDispatcher ed)
- {
- m_eventDispatcher = ed;
- _running = true;
- }
-
-
- ///
- /// Thread responsible for handling asynchronous GDB output.
- ///
- public void processingGDBOutput()
- {
- while (_running)
- {
- string response = "";
- while ((response = GDBParser.removeGDBResponse()) == "" && _running)
- {
- };
-
- // Creating a char delimiter that will be used to split the response in more than one event
- response = response.Replace("\r\n", "@");
-
- string[] events = response.Split('@');
- foreach (string ev in events)
- {
- if (ev.Length > 1) // only to avoid empty events, when there are two delimiters characters together.
- {
- if (m_eventDispatcher.countSIGINT > 0)
- if ((ev.Substring(0, 2) != "50") && (ev.Substring(0, 2) != "80"))
- m_eventDispatcher.countSIGINT = 0; // Reset the counter, if GDB has recovered from a GDB bug.
- switch (ev[0])
- {
- case '0': // Events related to starting GDB.
- break;
- case '1': // Not used.
- break;
- case '2': // Events related to breakpoints (including breakpoint hits).
- m_hBreakpoints = new HandleBreakpoints(m_eventDispatcher);
- m_hBreakpoints.handle(ev);
- break;
- case '3': // Not used.
- break;
- case '4': // Events related to execution control (processes, threads, programs) 1.
- m_hProcExe = new HandleProcessExecution(m_eventDispatcher);
- m_hProcExe.handle(ev);
- break;
- case '5': // Events related to execution control (processes, threads, programs and GDB Bugs) 2.
- m_hProcExe = new HandleProcessExecution(m_eventDispatcher);
- m_hProcExe.handle(ev);
- break;
- case '6': // Events related to evaluating expressions. Not used.
- break;
- case '7': // Events related to stack frames. Not used.
- break;
- case '8': // Events related to output.
- m_hOutputs = new HandleOutputs(m_eventDispatcher);
- m_hOutputs.handle(ev);
- break;
- case '9': // Not used.
- break;
- default: // Event that was not parsed correctly, or not handled completely.
- break;
- }
- }
- }
- }
- }
- }
-
-
- ///
- /// Interrupt the debugged process if necessary before changing a breakpoint.
- ///
- public void prepareToModifyBreakpoint()
- {
- if (m_engine.m_state != AD7Engine.DE_STATE.DESIGN_MODE
- && m_engine.m_state != AD7Engine.DE_STATE.BREAK_MODE)
- {
- HandleProcessExecution.m_needsResumeAfterInterrupt = true;
- m_engine.CauseBreak();
- }
- }
-
-
- ///
- /// If the process was running when the breakpoint was changed, resume the process.
- ///
- public void resumeFromInterrupt()
- {
- if (HandleProcessExecution.m_needsResumeAfterInterrupt)
- {
- HandleProcessExecution.m_needsResumeAfterInterrupt = false;
- continueExecution();
- }
- }
-
-
- ///
- /// Code to set the breakpoint in GDB and then confirm and set in Visual Studio
- ///
- /// Initial command to set the breakpoint in GDB, with the entire path when setting
- /// a breakpoint in a given line number.
- /// Initial command to set the breakpoint in GDB, with only the file name when setting
- /// a breakpoint in a given line number, or "" when setting a breakpoint in a function.
- /// Returns the breakpoint ID in GDB.
- /// Returns the breakpoint Line Number.
- /// Returns the breakpoint File Name.
- /// Returns the Breakpoint Address.
- /// If successful, returns true; otherwise, returns false.
- private bool setBreakpointImpl(string command, string command2, out uint GDB_ID, out uint GDB_line, out string GDB_filename, out string GDB_address)
- {
- string response;
- string bpointAddress;
- string bpointStopPoint;
-
- GDB_ID = 0;
- GDB_filename = "";
- GDB_address = "";
- GDB_line = 0;
-
- if (VSNDK.Package.ControlDebugEngine.isDebugEngineRunning == true)
- {
- prepareToModifyBreakpoint();
-
- // Gets the parsed response for the GDB/MI command that inserts breakpoint in a given line or a given function.
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Breakpoint-Commands.html)
- response = GDBParser.parseCommand(command, 6);
-
- if ((command2 != "") && ((response.Contains(""))))
- {
- response = GDBParser.parseCommand(command2, 6);
- }
-
- if (((response.Length < 2) && (VSNDK.Package.ControlDebugEngine.isDebugEngineRunning == false)) || (response == "Function not found!"))
- {
- resumeFromInterrupt();
- return false;
- }
-
- HandleBreakpoints hBreakpoints = new HandleBreakpoints(this);
- hBreakpoints.handle(response);
- GDB_ID = (uint)hBreakpoints.number;
- GDB_filename = hBreakpoints.FileName;
- GDB_address = hBreakpoints.Address;
-
- if ((GDB_address != "") && (GDB_address != ""))
- {
- //** Run Code to verify breakpoint stop point.
-
- // Gets the parsed response for the GDB command that print information about the specified breakpoint, in this
- // case, only its address. (http://sourceware.org/gdb/onlinedocs/gdb/Set-Breaks.html)
- bpointAddress = GDBParser.parseCommand("info b " + GDB_ID.ToString(), 18);
-
- // Gets the parsed response for the GDB command that inquire what source line covers a particular address.
- // (http://sourceware.org/gdb/onlinedocs/gdb/Machine-Code.html)
- bpointStopPoint = GDBParser.parseCommand("info line *" + bpointAddress, 18);
-
- GDB_line = (uint)Convert.ToInt64(bpointStopPoint.Trim());
- }
- else
- {
- GDB_address = "0x0";
- GDB_line = (uint)hBreakpoints.linePos;
- }
-
- resumeFromInterrupt();
-
- return true;
- }
- else
- return false;
- }
-
-
- ///
- /// Set a breakpoint given a filename and line number.
- ///
- /// Full path and filename for the code source.
- /// The line number for the breakpoint.
- /// Returns the breakpoint ID in GDB.
- /// Returns the breakpoint Line Number.
- /// Returns the breakpoint File Name.
- /// Returns the Breakpoint Address.
- /// If successful, returns true; otherwise, returns false.
- public bool setBreakpoint(string filename, uint line, out uint GDB_ID, out uint GDB_line, out string GDB_filename, out string GDB_address)
- {
- string cmd = @"-break-insert --thread-group i1 -f " + filename + ":" + line;
- int i = filename.LastIndexOf('\\');
- if ((i != -1) && (i + 1 < filename.Length))
- filename = filename.Substring(i + 1);
- string cmd2 = @"-break-insert --thread-group i1 -f " + filename + ":" + line;
- return setBreakpointImpl(cmd, cmd2, out GDB_ID, out GDB_line, out GDB_filename, out GDB_address);
- }
-
- ///
- /// Set a breakpoint given a function name.
- ///
- /// Function name.
- /// Returns the breakpoint ID in GDB.
- /// Returns the breakpoint Line Number.
- /// Returns the breakpoint File Name.
- /// Returns the Breakpoint Address.
- /// If successful, returns true; otherwise, returns false.
- public bool setBreakpoint(string func, out uint GDB_ID, out uint GDB_line, out string GDB_filename, out string GDB_address)
- {
- string cmd = @"-break-insert " + func;
- return setBreakpointImpl(cmd, "", out GDB_ID, out GDB_line, out GDB_filename, out GDB_address);
- }
-
- ///
- /// Ignore a given number of hit counts in GDB.
- ///
- /// Breakpoint ID in GDB.
- /// Number of hit counts to ignore.
- /// If successful, returns true; otherwise, returns false.
- public bool ignoreHitCount(uint GDB_ID, int ignore)
- {
- ignore -= 1; // The given number is decreased by one, because the VS command means to break when hit count is equal or greater
- // than X hits. So, the equivalent GDB command is to break after (X - 1) hit counts.
-
- if (ignore < 0)
- {
- // Had to ignore the biggest number of times to keep the breakpoint enabled and to avoid stopping on it.
- ignore = int.MaxValue;
- }
-
- // Gets the parsed response for the GDB/MI command that makes the breakpoint "GDB_ID" ignore "ignore" hit counts.
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Breakpoint-Commands.html)
- string cmd = @"-break-after " + GDB_ID + " " + ignore;
- string response = GDBParser.parseCommand(cmd, 18);
-
- if (response == "")
- return false;
-
- HandleBreakpoints hBreakpoints = new HandleBreakpoints(this);
- hBreakpoints.handle(response);
-
- return true;
- }
-
-
- ///
- /// Reset current hit count in GDB. There is no way to reset hit counts in GDB. To implement this functionality, the specified GDB
- /// breakpoint is deleted and a new one is created with the same conditions, substituting the GDB_ID of the VS breakpoint.
- ///
- /// The VS breakpoint.
- /// Is false when this method is called by SetCondition, true if not. Used to avoid setting
- /// breakpoint conditions again in case it is called by SetCondition method.
- /// If successful, returns true; otherwise, returns false.
- public bool resetHitCount(AD7BoundBreakpoint bbp, bool resetCondition)
- {
- // Declare local Variables
- uint GDB_LinePos = 0;
- string GDB_Filename = "";
- string GDB_address = "";
-
- uint GDB_ID = bbp.GDB_ID;
-
- // Deleting GDB breakpoint.
- deleteBreakpoint(GDB_ID);
-
- // Creating a new GDB breakpoint.
- bool ret = false;
- if (bbp.m_bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FILE_LINE)
- {
- ret = setBreakpoint(bbp.m_filename, bbp.m_line, out GDB_ID, out GDB_LinePos, out GDB_Filename, out GDB_address);
- }
- else if (bbp.m_bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FUNC_OFFSET)
- {
- ret = setBreakpoint(bbp.m_func, out GDB_ID, out GDB_LinePos, out GDB_Filename, out GDB_address);
- }
-
- if (ret)
- {
- bbp.GDB_ID = GDB_ID;
- bbp.m_hitCount = 0;
- bbp.SetPassCount(bbp.m_bpPassCount);
- if (resetCondition)
- bbp.SetCondition(bbp.m_bpCondition);
-
- return true;
- }
- return false;
- }
-
-
-
-
-
- ///
- /// Set breakpoint condition in GDB.
- ///
- /// Breakpoint ID in GDB.
- /// Condition to be set. When empty (""), means to remove any previous condition.
- /// If successful, returns true; otherwise, returns false.
- public bool setBreakpointCondition(uint GDB_ID, string condition)
- {
- string cmd;
-
- // Gets the parsed response for the GDB/MI command that sets a condition to the breakpoint "GDB_ID". If there is no
- // condition, any previous one associated to this breakpoint will be removed.
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Breakpoint-Commands.html)
- if (condition != "")
- cmd = @"-break-condition " + GDB_ID + " " + condition;
- else
- cmd = @"-break-condition " + GDB_ID;
- string response = GDBParser.parseCommand(cmd, 19);
-
- if (response == "")
- return false;
-
- HandleBreakpoints hBreakpoints = new HandleBreakpoints(this);
- hBreakpoints.handle(response);
- return true;
- }
-
-
- ///
- /// Delete a breakpoint in GDB.
- ///
- /// Breakpoint ID in GDB.
- /// If successful, returns true; otherwise, returns false.
- public bool deleteBreakpoint(uint GDB_ID)
- {
- if (m_gdbOutput._running)
- {
- prepareToModifyBreakpoint();
-
- // Gets the parsed response for the GDB/MI command that deletes the breakpoint "GDB_ID".
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Breakpoint-Commands.html)
- string response = GDBParser.parseCommand(@"-break-delete " + GDB_ID, 7);
- if (response == null || response == "")
- {
- resumeFromInterrupt();
- return false;
- }
-
- HandleBreakpoints hBreakpoints = new HandleBreakpoints(this);
- hBreakpoints.handle(response);
- uint retID = (uint)hBreakpoints.number;
-
- resumeFromInterrupt();
-
- if (GDB_ID != retID)
- {
- return false;
- }
- }
-
- return true;
- }
-
-
- ///
- /// Enable or disable a breakpoint.
- ///
- /// Breakpoint ID in GDB.
- /// If true, enable the breakpoint. If false, disable it.
- /// If successful, returns true; otherwise, returns false.
- public bool enableBreakpoint(uint GDB_ID, bool fEnable)
- {
- prepareToModifyBreakpoint();
-
- string inputCommand;
- string sEnable = "enable";
-
- if (!fEnable)
- {
- sEnable = "disable";
- }
-
- // Gets the parsed response for the GDB/MI command that enables or disables the breakpoint "GDB_ID".
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Breakpoint-Commands.html)
- inputCommand = @"-break-" + sEnable + " " + GDB_ID;
- string response = GDBParser.parseCommand(inputCommand, 8);
-
- HandleBreakpoints hBreakpoints = new HandleBreakpoints(this);
- hBreakpoints.handle(response);
- uint retID = (uint)hBreakpoints.number;
-
- resumeFromInterrupt();
- if (GDB_ID != retID)
- {
- return false;
- }
-
- return true;
- }
-
-
- ///
- /// Update hit count.
- ///
- /// Breakpoint ID in GDB.
- /// Hit count.
- public void updateHitCount(uint ID, uint hitCount)
- {
- var bbp = m_engine.BPMgr.getBoundBreakpointForGDBID(ID);
- if (bbp != null)
- {
- if (!bbp.m_breakWhenCondChanged)
- ((IDebugBoundBreakpoint2)bbp).SetHitCount(hitCount);
- }
- }
-
-
- ///
- /// Lock a breakpoint before updating its hit counts and/or condition. This is done to avoid a race condition that can happen when
- /// user modifies a breakpoint condition at run time and the same breakpoint is hit. When that happens, only one event will be
- /// handled at a time.
- ///
- /// Breakpoint to be locked.
- /// True if user is adding/modifying count and conditions upon which a breakpoint is fired. It is also true
- /// when event dispatcher is handling a breakpoint hit.
- /// True if user is adding/modifying conditions under which a conditional breakpoint fires. It is also true
- /// when event dispatcher is handling a breakpoint hit.
- /// If successful, returns true; otherwise, returns false.
- public bool lockedBreakpoint(AD7BoundBreakpoint bbp, bool hit, bool cond)
- {
- lock (m_lockBreakpoint)
- {
- if (hit && cond)
- {
- if ((!bbp.m_blockedPassCount) && (!bbp.m_blockedConditional))
- {
- bbp.m_blockedPassCount = true;
- bbp.m_blockedConditional = true;
- return true;
- }
- }
- else if (hit)
- {
- if (!bbp.m_blockedPassCount)
- {
- bbp.m_blockedPassCount = true;
- return true;
- }
- }
- else if (cond)
- {
- if (!bbp.m_blockedConditional)
- {
- bbp.m_blockedConditional = true;
- return true;
- }
- }
- return false;
- }
- }
-
-
- ///
- /// Unlock a breakpoint after updating its hit counts and/or condition. This is done to avoid a race condition that can happen when
- /// user modifies a breakpoint condition at run time and the same breakpoint is hit. When that happens, only one event will be
- /// handled at a time.
- ///
- /// Breakpoint to be locked.
- /// True if user is adding/modifying count and conditions upon which a breakpoint is fired. It is also true
- /// when event dispatcher is handling a breakpoint hit.
- /// True if user is adding/modifying conditions under which a conditional breakpoint fires. It is also true
- /// when event dispatcher is handling a breakpoint hit.
- public void unlockBreakpoint(AD7BoundBreakpoint bbp, bool hit, bool cond)
- {
- lock (m_unlockBreakpoint)
- {
- if (hit && cond)
- {
- bbp.m_blockedPassCount = false;
- bbp.m_blockedConditional = false;
- }
- else if (hit)
- {
- bbp.m_blockedPassCount = false;
- }
- else if (cond)
- {
- bbp.m_blockedConditional = false;
- }
- }
- }
-
-
- ///
- /// Control access to a critical region, that manipulates some of the debug engine variables, like its state. This is done to
- /// avoid a race condition that can happen when user modifies a breakpoint condition at run time and the same breakpoint is hit.
- /// When that happens, only one event will be handled at a time.
- ///
- /// If successful, returns true; otherwise, returns false.
- public bool enterCriticalRegion()
- {
- lock (m_criticalRegion)
- {
- if (!inCriticalRegion)
- {
- inCriticalRegion = true;
- return true;
- }
- return false;
- }
- }
-
-
- ///
- /// Leave the critical region, that manipulates some of the debug engine variables, like its state. This is done to
- /// avoid a race condition that can happen when user modifies a breakpoint condition at run time and the same breakpoint is hit.
- /// When that happens, only one event will be handled at a time.
- ///
- public void leaveCriticalRegion()
- {
- lock (m_leaveCriticalRegion)
- {
- inCriticalRegion = false;
- }
- }
-
-
- ///
- /// Update VS when a breakpoint is hit in GDB.
- ///
- /// Breakpoint ID from GDB.
- /// Thread ID.
- public void breakpointHit(uint ID, string threadID)
- {
- var xBoundBreakpoints = new List();
-
- // Search the active bound BPs and find ones that match the ID.
- var bbp = m_engine.BPMgr.getBoundBreakpointForGDBID(ID);
-
- if (bbp != null)
- xBoundBreakpoints.Add(bbp);
-
- if ((bbp == null) || (xBoundBreakpoints.Count == 0))
- {
- // if no matching breakpoints are found then its one of the following:
- // - Stepping operation
- // - Code based break
- // - Asm stepping
- }
- else
- {
- if (lockedBreakpoint(bbp, true, true))
- {
- while (!enterCriticalRegion())
- {
- Thread.Sleep(0);
- }
-
- bool breakExecution = true;
-
- if (bbp.m_breakWhenCondChanged)
- {
- string result = "";
- bool valid = VariableInfo.evaluateExpression(bbp.m_bpCondition.bstrCondition, ref result, null);
- if ((valid) && (bbp.m_previousCondEvaluation != result)) // check if condition evaluation has changed
- {
- if ((bbp.m_bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL) && (bbp.m_hitCount != bbp.m_bpPassCount.dwPassCount))
- {
- breakExecution = false;
- }
- else if ((bbp.m_bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER) && (bbp.m_hitCount < bbp.m_bpPassCount.dwPassCount))
- {
- breakExecution = false;
- }
- else if ((bbp.m_bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_MOD) && ((bbp.m_hitCount % bbp.m_bpPassCount.dwPassCount) != 0))
- {
- breakExecution = false;
- }
- bbp.m_previousCondEvaluation = result;
- }
- else
- breakExecution = false;
- }
- if (!breakExecution) // must continue the execution
- {
- bool hitBreakAll = m_engine.m_running.WaitOne(0);
- if (hitBreakAll)
- {
- m_engine.m_state = AD7Engine.DE_STATE.RUN_MODE;
-
- // Sends the GDB command that resumes the execution of the inferior program.
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
- GDBParser.addGDBCommand(@"-exec-continue --thread-group i1");
- EventDispatcher.m_GDBRunMode = true;
- m_engine.m_running.Set();
- }
- }
- else
- {
- if (bbp.m_breakWhenCondChanged)
- bbp.m_hitCount += 1;
-
- // Transition DE state
- EventDispatcher.m_GDBRunMode = false;
- m_engine.m_state = AD7Engine.DE_STATE.BREAK_MODE;
-
- // Found a bound breakpoint
- m_engine.Callback.OnBreakpoint(m_engine.selectThread(threadID), xBoundBreakpoints.AsReadOnly());
-
- if (bbp.m_isHitCountEqual)
- {
- // Have to ignore the biggest number of times to keep the breakpoint enabled and to avoid stopping on it.
- ignoreHitCount(ID, int.MaxValue);
- }
- else if (bbp.m_hitCountMultiple != 0)
- {
- ignoreHitCount(ID, (int)(bbp.m_hitCountMultiple - (bbp.m_hitCount % bbp.m_hitCountMultiple)));
- }
- }
- leaveCriticalRegion();
- unlockBreakpoint(bbp, true, true);
- }
- else
- {
- while (!enterCriticalRegion())
- {
- Thread.Sleep(0);
- }
-
- bool hitBreakAll = m_engine.m_running.WaitOne(0);
- if (hitBreakAll)
- {
- m_engine.m_state = AD7Engine.DE_STATE.RUN_MODE;
-
- // Sends the GDB command that resumes the execution of the inferior program.
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
- GDBParser.addGDBCommand(@"-exec-continue --thread-group i1");
- EventDispatcher.m_GDBRunMode = true;
- m_engine.m_running.Set();
- }
-
- leaveCriticalRegion();
- }
- }
- }
-
-
- ///
- /// Returns the document context needed for showing the location of the current instruction pointer.
- ///
- /// File name.
- /// Line number.
- /// Returns the document context needed for showing the location of the current instruction pointer.
- public AD7DocumentContext getDocumentContext(string filename, uint line)
- {
- // Get the location in the document that the breakpoint is in.
- TEXT_POSITION[] startPosition = new TEXT_POSITION[1];
- startPosition[0].dwLine = line;
- startPosition[0].dwColumn = 0;
- TEXT_POSITION[] endPosition = new TEXT_POSITION[1];
- endPosition[0].dwLine = line;
- endPosition[0].dwColumn = 0;
-
- uint address = 0;
- AD7MemoryAddress codeContext = new AD7MemoryAddress(m_engine, address);
-
- return new AD7DocumentContext(filename, startPosition[0], endPosition[0], codeContext);
- }
-
-
- ///
- /// Return the depth of the stack.
- ///
- /// Thread ID.
- /// Returns the stack depth.
- public int getStackDepth(string threadID)
- {
- // Returns the parsed response for the GDB/MI command that inquires about the depth of the stack.
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Stack-Manipulation.html)
- return Convert.ToInt32(GDBParser.parseCommand(@"-stack-info-depth --thread " + threadID + " --frame 0", 9));
- }
-
-
- ///
- /// List the frames currently on the stack.
- ///
- /// Returns a string with the frames currently on the stack.
- public string getStackFrames()
- {
- // Returns the parsed response for the GDB/MI command that list the frames currently on the stack.
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Stack-Manipulation.html)
- return GDBParser.parseCommand(@"-stack-list-frames", 10);
- }
-
-
- ///
- /// List the names of local variables and function arguments for the selected frame.
- ///
- /// Frame number.
- /// Thread ID.
- /// Returns a string with the names of local variables and function arguments for the selected frame.
- public string getVariablesForFrame(uint frameIndex, string threadID)
- {
- // Returns the parsed response for the GDB/MI command that list the names of local variables and function arguments for the
- // selected frame. (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Stack-Manipulation.html)
- return GDBParser.parseCommand(@"-stack-list-variables --thread " + threadID + " --frame " + frameIndex + " --simple-values", 11);
- }
-
-
- ///
- /// Make "id" the current thread.
- ///
- /// Thread ID.
- public void selectThread(string id)
- {
- // Waits for the parsed response for the GDB/MI command that make "id" the current thread.
- // (http://www.sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Thread-Commands.html)
- GDBParser.parseCommand(@"-thread-select " + id, 12);
- }
-
-
- ///
- /// Creates a variable object.
- ///
- /// Name of the variable.
- /// Boolean value that indicates if the variable name has the prefix VsNdK_.
- /// If successful, returns the variable's number of children; otherwise, returns string "ERROR".
- public string createVar(string name, ref bool hasVsNdK_)
- {
- // Gets the variable's number of children after sending the following GDB/MI command to create a variable object.
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Variable-Objects.html)
- string response = GDBParser.parseCommand("-var-create " + name + " \"*\" " + name, 13);
- if (response == "ERROR")
- {
- // The -var-create GDB/MI command can return an error when the variable name starts with some characters, like '_'.
- // So, in case of an error, add the prefix VsNdK_ to the variable name and try to create it again.
- response = GDBParser.parseCommand("-var-create VsNdK_" + name + " \"*\" " + name, 13);
- if (response != "ERROR")
- hasVsNdK_ = true;
- }
- return response;
- }
-
-
- ///
- /// Deletes a previously created variable object and all of its children.
- ///
- /// Name of the variable.
- /// Boolean value that indicates if the variable name has the prefix VsNdK_.
- public void deleteVar(string name, bool hasVsNdK_)
- {
- // Waits for the parsed response for the GDB/MI command that deletes a previously created variable object and all of
- // its children. (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Variable-Objects.html)
- if (!hasVsNdK_)
- GDBParser.parseCommand("-var-delete " + name, 14);
- else
- GDBParser.parseCommand("-var-delete VsNdK_" + name, 14);
- }
-
-
- ///
- /// Return a list of the children of the specified variable object.
- ///
- /// Variable name.
- /// Return a string that contains the list of the children of the specified variable object.
- public string listChildren(string name)
- {
- // Returns the parsed response for the GDB/MI command that list the children of the specified variable object.
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Variable-Objects.html)
- return GDBParser.parseCommand("-var-list-children --all-values " + name + " 0 50", 15);
- }
-
-
- ///
- /// Kill the child process in which your program is running under gdb.
- ///
- public void killProcess()
- {
- // Waits for the parsed response for the GDB command that kills the child process in which your program is running.
- // (http://sourceware.org/gdb/onlinedocs/gdb/Kill-Process.html#Kill-Process)
- GDBParser.parseCommand("kill", 16);
- }
-
-
- ///
- /// Called after the debug engine has set the initial breakpoints, or to resume a process that was interrupted.
- ///
- public void continueExecution()
- {
- //** Transition DE state
- bool hitBreakAll = m_engine.m_running.WaitOne(0);
- if (hitBreakAll)
- {
- m_engine.m_state = AD7Engine.DE_STATE.RUN_MODE;
-
- // Sends the GDB command that resumes the execution of the inferior program.
- // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
- GDBParser.addGDBCommand(@"-exec-continue --thread-group i1");
- EventDispatcher.m_GDBRunMode = true;
- m_engine.m_running.Set();
- }
- }
- }
-
-
- ///
- /// This class manages breakpoints events.
- ///
- public class HandleBreakpoints
- {
- ///
- /// GDB breakpoint ID.
- ///
- private int m_number = -1;
-
- ///
- /// Boolean variable that indicates if this breakpoint is enable (true) or disable (false).
- ///
- private bool m_enable = false;
-
- ///
- /// Breakpoint address.
- ///
- private string m_addr = "";
-
- ///
- /// Name of the function that contains this breakpoint.
- ///
- private string m_func = "";
-
- ///
- /// File name that contains this breakpoint.
- ///
- private string m_filename = "";
-
- ///
- /// Line number for this breakpoint.
- ///
- private int m_line = -1;
-
- ///
- /// Number of hits for this breakpoint.
- ///
- private int m_hits = -1;
-
- ///
- /// Number of hits to be ignored by this breakpoint.
- ///
- private int m_ignoreHits = -1;
-
- ///
- /// Condition associated to this breakpoint.
- ///
- private string m_condition = "";
-
- ///
- /// Thread ID that was interrupted when this breakpoint was hit.
- ///
- private string m_threadID = "";
-
- ///
- /// This object manages debug events in the engine.
- ///
- private EventDispatcher m_eventDispatcher = null;
-
- ///
- /// GDB_ID Property
- ///
- public int number
- {
- get { return m_number; }
- }
-
- ///
- /// GDB Line Position Property
- ///
- public int linePos
- {
- get { return m_line; }
- }
-
- ///
- /// GDB File name
- ///
- public string FileName
- {
- get { return m_filename; }
- }
-
- ///
- /// GDB Address
- ///
- public string Address
- {
- get { return m_addr; }
- }
-
-
- ///
- /// Constructor.
- ///
- /// This object manages debug events in the engine.
- public HandleBreakpoints(EventDispatcher ed)
- {
- m_eventDispatcher = ed;
- }
-
-
- ///
- /// This method manages breakpoints events by classifying each of them by sub-type (e.g. breakpoint inserted, modified, etc.).
- ///
- /// String that contains the event description.
- public void handle(string ev)
- {
- int ini = 0;
- int end = 0;
- switch (ev[1])
- {
- case '0':
- // Breakpoint inserted (synchronous).
- // Example: 20,1,y,0x0804d843,main,C:/Users/xxxxx/vsplugin-ndk/samples/Square/Square/main.c,319,0
- ini = 3;
- end = ev.IndexOf(';', 3);
- m_number = Convert.ToInt32(ev.Substring(ini, (end - ini)));
-
- if (ev[end + 1] == 'y')
- m_enable = true;
- else
- m_enable = false;
-
- ini = end + 3;
- end = ev.IndexOf(';', ini);
- m_addr = ev.Substring(ini, (end - ini));
- if (m_addr == "")
- {
- m_func = "??";
- EventDispatcher.m_unknownCode = true;
- m_filename = "";
- m_line = 0;
- m_hits = 0;
- return;
- }
-
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_func = ev.Substring(ini, end - ini);
-
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_filename = ev.Substring(ini, end - ini);
-
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_line = Convert.ToInt32(ev.Substring(ini, (end - ini)));
-
- ini = end + 1;
- m_hits = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
-
- break;
- case '1':
- // Breakpoint modified (asynchronous).
- // Example: 21,1,y,0x0804d843,main,C:/Users/xxxxxx/vsplugin-ndk/samples/Square/Square/main.c,318,1
- ini = 3;
- end = ev.IndexOf(';', 3);
- m_number = Convert.ToInt32(ev.Substring(ini, (end - ini))); ;
-
- if (ev[end + 1] == 'y')
- m_enable = true;
- else
- m_enable = false;
-
- ini = end + 3;
- end = ev.IndexOf(';', ini);
- m_addr = ev.Substring(ini, (end - ini));
-
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_func = ev.Substring(ini, end - ini);
-
- // Need to set the flag for unknown code if necessary.
- if (m_func == "??")
- {
- EventDispatcher.m_unknownCode = true;
- }
- else
- {
- EventDispatcher.m_unknownCode = false;
- }
-
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_filename = ev.Substring(ini, end - ini);
-
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_line = Convert.ToInt32(ev.Substring(ini, (end - ini)));
-
- ini = end + 1;
- m_hits = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
-
- // Update hit count on affected bound breakpoint.
- m_eventDispatcher.updateHitCount((uint)m_number, (uint)m_hits);
-
- break;
- case '2':
- // Breakpoint deleted asynchronously (a temporary breakpoint). Example: 22,2\r\n
- m_number = Convert.ToInt32(ev.Substring(3, (ev.Length - 3)));
-
- break;
- case '3':
- // Breakpoint enabled. Example: 23 (enabled all) or 23,1 (enabled only breakpoint 1)
- if (ev.Length > 2)
- m_number = Convert.ToInt32(ev.Substring(3, (ev.Length - 3)));
- else
- m_number = 0; // 0 means ALL breakpoints.
-
- break;
- case '4':
- // Breakpoint disabled. Example: 24 (disabled all) or 24,1 (disabled only breakpoint 1)
- if (ev.Length > 2)
- m_number = Convert.ToInt32(ev.Substring(3, (ev.Length - 3)));
- else
- m_number = 0; // 0 means ALL breakpoints.
-
- break;
- case '5':
- // Breakpoint deleted. Example: 25 (deleted all) or 25,1 (deleted only breakpoint 1)
- if (ev.Length > 2)
- m_number = Convert.ToInt32(ev.Substring(3, (ev.Length - 3)));
- else
- m_number = 0; // 0 means ALL breakpoints.
-
- break;
- case '6':
- // Break after "n" hits (or ignore n hits). Example: 26;1;100
- ini = 3;
- end = ev.IndexOf(';', 3);
- m_number = Convert.ToInt32(ev.Substring(3, (end - 3)));
-
- ini = end + 1;
- m_ignoreHits = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
-
- break;
- case '7':
- // Breakpoint hit.
- // Example: 27,1,C:/Users/xxxxxx/vsplugin-ndk/samples/Square/Square/main.c,319;1\r\n
- bool updatingCondBreak = this.m_eventDispatcher.engine.m_updatingConditionalBreakpoint.WaitOne(0);
- if (updatingCondBreak)
- {
-
- m_eventDispatcher.engine.resetStackFrames();
-
- ini = 3;
- end = ev.IndexOf(';', 3);
- m_number = Convert.ToInt32(ev.Substring(3, (end - 3)));
-
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_filename = ev.Substring(ini, end - ini);
-
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_line = Convert.ToInt32(ev.Substring(ini, (end - ini)));
-
- ini = end + 1;
- m_threadID = ev.Substring(ini, (ev.Length - ini));
-
- this.m_eventDispatcher.engine.cleanEvaluatedThreads();
-
- // Call the method/event that will stop SDM because a breakpoint was hit here.
- if (m_eventDispatcher.engine._updateThreads)
- {
- m_eventDispatcher.engine.UpdateListOfThreads();
- }
- m_eventDispatcher.engine.selectThread(m_threadID).setCurrentLocation(m_filename, (uint)m_line);
- m_eventDispatcher.engine.setAsCurrentThread(m_threadID);
-
- // A breakpoint can be hit during a step
- if (m_eventDispatcher.engine.m_state == AD7Engine.DE_STATE.STEP_MODE)
- {
- HandleProcessExecution.onStepCompleted(m_eventDispatcher, m_filename, (uint)m_line);
- }
- else
- {
- // Visual Studio shows the line position one more than it actually is
- m_eventDispatcher.engine.m_docContext = m_eventDispatcher.getDocumentContext(m_filename, (uint)(m_line - 1));
- m_eventDispatcher.breakpointHit((uint)m_number, m_threadID);
- }
- this.m_eventDispatcher.engine.m_updatingConditionalBreakpoint.Set();
- }
- break;
- case '8':
- // Breakpoint condition set. Example: 28;1;expression
- ini = 3;
- end = ev.IndexOf(';', 3);
- if (end != -1)
- {
- m_number = Convert.ToInt32(ev.Substring(3, (end - 3)));
-
- ini = end + 1;
- m_condition = ev.Substring(ini, (ev.Length - ini));
- }
- else
- {
- m_number = Convert.ToInt32(ev.Substring(3));
- m_condition = "";
- }
- break;
- case '9': // Error in testing breakpoint condition
- break;
- default: // not used.
- break;
- }
- }
- }
-
-
- ///
- /// This class manages events related to execution control (processes, threads, programs).
- ///
- public class HandleProcessExecution
- {
- ///
- /// Thread ID.
- ///
- private int m_threadId = -1; // when threadId is 0, it means all threads.
-
- ///
- /// Process ID.
- ///
- private int m_processId = -1;
-
- ///
- /// Name of the signal that caused an interruption.
- ///
- private string m_signalName = "";
-
- ///
- /// Meaning of the signal that caused an interruption.
- ///
- private string m_signalMeaning = "";
-
- ///
- /// File name.
- ///
- private string m_file = "";
-
- ///
- /// Line number.
- ///
- private int m_line = -1;
-
- ///
- /// Address.
- ///
- private int m_address = -1;
-
- ///
- /// Function name.
- ///
- private string m_func = "";
-
- ///
- /// Error caused by a GDB command that failed.
- ///
- private string m_error = "";
-
- ///
- /// This object manages debug events in the engine.
- ///
- private EventDispatcher m_eventDispatcher = null;
-
- ///
- /// Boolean variable that indicates if GDB has to resume execution after handling what caused it to enter in break mode.
- ///
- public static bool m_needsResumeAfterInterrupt = false;
-
- ///
- /// Used as a communication signal between the Event Dispatcher and the debug engine method responsible for stopping GDB
- /// execution (IDebugEngine2.CauseBreak()). So, VS is able to wait for GDB's interruption before entering in break mode.
- ///
- public static ManualResetEvent m_mre = new ManualResetEvent(false);
-
-
- ///
- /// Constructor.
- ///
- /// This object manages debug events in the engine.
- public HandleProcessExecution(EventDispatcher ed)
- {
- m_eventDispatcher = ed;
- }
-
-
- ///
- /// This method manages events related to execution control by classifying each of them by sub-type (e.g. thread created, program interrupted, etc.).
- ///
- /// String that contains the event description.
- public void handle(string ev)
- {
- int ini = 0;
- int end = 0;
- int numCommas = 0;
- switch (ev[0])
- {
- case '4':
- switch (ev[1])
- {
- case '0':
- // Thread created. Example: 40,2,20537438
- EventDispatcher.m_GDBRunMode = true;
- ini = 3;
- end = ev.IndexOf(";", 3);
- m_threadId = Convert.ToInt32(ev.Substring(ini, (end - ini)));
-
- ini = end + 1;
- m_processId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
-
- m_eventDispatcher.engine._updateThreads = true;
-
- break;
- case '1':
- // Process running. Example: 41,1 (when threadId is 0 means "all threads": example: 41,0)
- EventDispatcher.m_GDBRunMode = true;
- m_threadId = Convert.ToInt32(ev.Substring(3, (ev.Length - 3)));
-
- break;
- case '2':
- // Program exited normally. Example: 42
- m_eventDispatcher.endDebugSession(0);
-
- break;
- case '3':
- // Program was exited with an exit code. Example: 43,1;1 (not sure if there is a threadID, but the last ";" exist)
- // TODO: not tested yet
- end = ev.IndexOf(";", 3);
- uint exitCode = Convert.ToUInt32(ev.Substring(3, (end - 3)));
- m_eventDispatcher.endDebugSession(exitCode);
-
- break;
- case '4':
- // Program interrupted.
- // Examples:
- // 44,ADDR,FUNC,THREAD-ID
- // 44,ADDR,FUNC,FILENAME,LINE,THREAD-ID
-
- m_eventDispatcher.engine.resetStackFrames();
- EventDispatcher.m_GDBRunMode = false;
- numCommas = 0;
- foreach (char c in ev)
- {
- if (c == ';')
- numCommas++;
- }
-
- ini = 3;
- end = ev.IndexOf(';', ini);
- m_address = Convert.ToInt32(ev.Substring(ini, (end - ini)), 16);
-
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_func = ev.Substring(ini, (end - ini));
-
- if (m_func == "??")
- {
- EventDispatcher.m_unknownCode = true;
- }
- else
- {
- EventDispatcher.m_unknownCode = false;
- }
-
- switch (numCommas)
- {
- case 3:
- // Thread ID
- ini = end + 1;
- m_threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
- EventDispatcher.m_unknownCode = true;
- break;
- case 4:
- // Filename and line number
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_file = ev.Substring(ini, (end - ini));
-
- ini = end + 1;
- m_line = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
- break;
- case 5:
- // Filename, line number and thread ID
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_file = ev.Substring(ini, (end - ini));
-
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_line = Convert.ToInt32(ev.Substring(ini, (end - ini)));
-
- ini = end + 1;
- m_threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
- break;
- default:
- break;
- }
-
- this.m_eventDispatcher.engine.cleanEvaluatedThreads();
-
-
- if (m_eventDispatcher.engine._updateThreads)
- {
- m_eventDispatcher.engine.UpdateListOfThreads();
- }
- if (m_threadId > 0)
- {
- m_eventDispatcher.engine.selectThread(m_threadId.ToString()).setCurrentLocation(m_file, (uint)m_line);
- m_eventDispatcher.engine.setAsCurrentThread(m_threadId.ToString());
- }
-
- // Call the method/event that will let SDM know that the debugged program was interrupted.
- onInterrupt(m_threadId);
-
- // Signal that interrupt is processed
- m_mre.Set();
-
- break;
-
- case '5':
- // End-stepping-range.
- m_eventDispatcher.engine.resetStackFrames();
- EventDispatcher.m_GDBRunMode = false;
- ini = 3;
- end = ev.IndexOf(';', 3);
- if (end == -1)
- end = ev.Length;
- string temp = ev.Substring(ini, (end - ini));
-
- ini = end + 1;
-
- if (ev.Length > ini)
- end = ev.IndexOf(';', ini);
- else
- end = -1;
-
- if (end == -1)
- {
- // Set sane default values for the missing file and line information
- m_file = "";
- m_line = 1;
- m_threadId = Convert.ToInt32(temp);
- EventDispatcher.m_unknownCode = true;
- }
- else
- {
- m_file = temp;
- m_line = Convert.ToInt32(ev.Substring(ini, (end - ini)));
-
- ini = end + 1;
- m_threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
- EventDispatcher.m_unknownCode = false;
- }
-
- this.m_eventDispatcher.engine.cleanEvaluatedThreads();
-
-
- if (m_eventDispatcher.engine._updateThreads)
- {
- m_eventDispatcher.engine.UpdateListOfThreads();
- }
- if (m_threadId > 0)
- {
- if ((EventDispatcher.m_unknownCode == false) && (m_file != ""))
- m_eventDispatcher.engine.selectThread(m_threadId.ToString()).setCurrentLocation(m_file, (uint)m_line);
- m_eventDispatcher.engine.setAsCurrentThread(m_threadId.ToString());
- }
-
- HandleProcessExecution.onStepCompleted(m_eventDispatcher, m_file, (uint)m_line);
-
- break;
- case '6':
- // Function-finished.
- m_eventDispatcher.engine.resetStackFrames();
- EventDispatcher.m_GDBRunMode = false;
- ini = 3;
- end = ev.IndexOf(';', 3);
- if (end == -1)
- {
- // Set sane default values for the missing file and line information
- m_file = "";
- m_line = 1;
- m_threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
- EventDispatcher.m_unknownCode = true;
- }
- else
- {
- m_file = ev.Substring(ini, (end - ini));
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_line = Convert.ToInt32(ev.Substring(ini, (end - ini)));
-
- ini = end + 1;
- m_threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
- EventDispatcher.m_unknownCode = false;
- }
-
- this.m_eventDispatcher.engine.cleanEvaluatedThreads();
-
- if (m_eventDispatcher.engine._updateThreads)
- {
- m_eventDispatcher.engine.UpdateListOfThreads();
- }
- if (m_threadId > 0)
- {
- if ((EventDispatcher.m_unknownCode == false) && (m_file != ""))
- m_eventDispatcher.engine.selectThread(m_threadId.ToString()).setCurrentLocation(m_file, (uint)m_line);
- m_eventDispatcher.engine.setAsCurrentThread(m_threadId.ToString());
- }
-
- HandleProcessExecution.onStepCompleted(m_eventDispatcher, m_file, (uint)m_line);
-
- break;
- case '7':
- // -exec-interrupt or signal-meaning="Killed". There's nothing to do in this case.
- m_eventDispatcher.engine.resetStackFrames();
- EventDispatcher.m_GDBRunMode = false;
-
- this.m_eventDispatcher.engine.cleanEvaluatedThreads();
-
- m_threadId = Convert.ToInt32(ev.Substring(3, (ev.Length - 3)));
-
- if (m_eventDispatcher.engine._updateThreads)
- {
- m_eventDispatcher.engine.UpdateListOfThreads();
- }
- if (m_threadId > 0)
- {
- if ((EventDispatcher.m_unknownCode == false) && (m_file != ""))
- m_eventDispatcher.engine.selectThread(m_threadId.ToString()).setCurrentLocation(m_file, (uint)m_line);
- m_eventDispatcher.engine.setAsCurrentThread(m_threadId.ToString());
- }
-
- if (m_eventDispatcher.engine.m_state != AD7Engine.DE_STATE.BREAK_MODE)
- {
- onInterrupt(m_threadId);
- }
- // Signal that interrupt is processed
- m_mre.Set();
-
- break;
- case '8':
- // SIGKILL
- m_eventDispatcher.endDebugSession(0);
- break;
- case '9':
- // ERROR, ex: 49,Cannot find bounds of current function
- m_eventDispatcher.engine.resetStackFrames();
- this.m_eventDispatcher.engine.cleanEvaluatedThreads();
-
- if (m_eventDispatcher.engine._updateThreads)
- {
- m_eventDispatcher.engine.UpdateListOfThreads();
- }
-
- if (ev.Length >= 3)
- {
- m_error = ev.Substring(3, (ev.Length - 3));
- if (m_error == "Cannot find bounds of current function")
- {
- // We don't have symbols for this function so further stepping won't be possible. Return from this function.
- VSNDK.DebugEngine.EventDispatcher.m_unknownCode = true;
- m_eventDispatcher.engine.Step(m_eventDispatcher.engine.currentThread(), enum_STEPKIND.STEP_OUT, enum_STEPUNIT.STEP_LINE);
- }
- }
- break;
- default: // Not used.
- break;
- }
- break;
- case '5':
- switch (ev[1])
- {
- case '0':
- // Quit (expect signal SIGINT when the program is resumed)
- m_eventDispatcher.countSIGINT += 1;
- if (m_eventDispatcher.countSIGINT > 5)
- {
- m_eventDispatcher.endDebugSession(0);
- MessageBox.Show("Lost communication with GDB. Please refer to documentation for more details.", "GDB failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- break;
- case '1':
- // Thread exited. Example: 51,2
- ini = 3;
- m_threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
-
- m_eventDispatcher.engine._updateThreads = true;
-
- break;
- case '2':
- // GDB Bugs, like "... 2374: internal-error: frame_cleanup_after_sniffer ...". Example: 52
- m_eventDispatcher.endDebugSession(0);
- MessageBox.Show("This is a known issue that can happen when interrupting GDB's execution by hitting the \"break all\" or toggling a breakpoint in run mode. \n\n GDB CRASHED. Details: \"../../gdb/frame.c:2374: internal-error: frame_cleanup_after_sniffer: Assertion `frame->prologue_cache == NULL' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\" \r\n \nPlease close the app in the device/simulator if you want to debug it again.", "GDB failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
-
- break;
- case '3':
- // Lost communication with device/simulator: ^error,msg="Remote communication error: No error."
- MessageBox.Show("Lost communication with the device/simulator.", "Communication lost", MessageBoxButtons.OK, MessageBoxIcon.Error);
- m_eventDispatcher.endDebugSession(0);
-
- break;
- case '4':
- // Program interrupted due to a segmentation fault.
- // Examples:
- // 54,ADDR,FUNC,THREAD-ID
- // 54,ADDR,FUNC,FILENAME,LINE,THREAD-ID
-
- m_eventDispatcher.engine.resetStackFrames();
- EventDispatcher.m_GDBRunMode = false;
- numCommas = 0;
- foreach (char c in ev)
- {
- if (c == ';')
- numCommas++;
- }
-
- ini = 3;
- end = ev.IndexOf(';', ini);
- m_address = Convert.ToInt32(ev.Substring(ini, (end - ini)), 16);
-
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_func = ev.Substring(ini, (end - ini));
-
- if (m_func == "??")
- {
- EventDispatcher.m_unknownCode = true;
- }
- else
- {
- EventDispatcher.m_unknownCode = false;
- }
-
- switch (numCommas)
- {
- case 3:
- // Thread ID
- ini = end + 1;
- m_threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
- EventDispatcher.m_unknownCode = true;
- break;
- case 5:
- // Filename, line number and thread ID
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_file = ev.Substring(ini, (end - ini));
-
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_line = Convert.ToInt32(ev.Substring(ini, (end - ini)));
-
- ini = end + 1;
- m_threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
- break;
- default:
- break;
- }
-
- MessageBox.Show("Segmentation Fault: If you continue debugging could take the environment to an unstable state.", "Segmentation Fault", MessageBoxButtons.OK, MessageBoxIcon.Warning);
-
- this.m_eventDispatcher.engine.cleanEvaluatedThreads();
-
- if (m_eventDispatcher.engine._updateThreads)
- {
- m_eventDispatcher.engine.UpdateListOfThreads();
- }
- if (m_threadId > 0)
- {
- m_eventDispatcher.engine.selectThread(m_threadId.ToString()).setCurrentLocation(m_file, (uint)m_line);
- m_eventDispatcher.engine.setAsCurrentThread(m_threadId.ToString());
- }
-
- onInterrupt(m_threadId);
-
- break;
-
- case '5':
- // Exited-signaled. Ex: 55;SIGSEGV;Segmentation fault
- // or Aborted. Ex: 55;SIGABRT;Aborted
- ini = 3;
- end = ev.IndexOf(';', ini);
- m_signalName = ev.Substring(ini, (end - ini));
-
- ini = end + 1;
- end = ev.IndexOf(';', ini);
- m_signalMeaning = ev.Substring(ini, (end - ini));
-
- ini = end + 1;
- try
- {
- m_threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
- }
- catch
- {
- }
-
- if (m_signalMeaning == "Segmentation fault")
- {
- MessageBox.Show("Segmentation Fault: Closing debugger.", "Segmentation Fault", MessageBoxButtons.OK, MessageBoxIcon.Error);
- m_eventDispatcher.endDebugSession(0);
- }
-
- if (m_signalMeaning == "Aborted")
- {
- MessageBox.Show("Program aborted: Closing debugger.", "Program Aborted", MessageBoxButtons.OK, MessageBoxIcon.Error);
- m_eventDispatcher.endDebugSession(0);
- }
-
- break;
- case '6':
- // GDB Bugs, like "... 3550: internal-error: handle_inferior_event ...". Example: 56
- m_eventDispatcher.endDebugSession(0);
- MessageBox.Show("This is a known issue that can happen while debugging multithreaded programs. \n\n GDB CRASHED. Details: \"../../gdb/infrun.c:3550: internal-error: handle_inferior_event: Assertion ptid_equal (singlestep_ptid, ecs->ptid)' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\" \r\n \nPlease close the app in the device/simulator if you want to debug it again.", "GDB failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
-
- break;
- case '7': // Not used
- break;
- case '8': // Not used
- break;
- case '9': // Not used
- break;
- default: // Not used.
- break;
- }
- break;
- default: // Not used.
- break;
- }
- }
-
-
- ///
- /// Update VS when a step action is completed in GDB.
- ///
- /// This object manages debug events in the engine.
- /// File name.
- /// Line number.
- public static void onStepCompleted(EventDispatcher eventDispatcher, string file, uint line)
- {
- if (eventDispatcher.engine.m_state == AD7Engine.DE_STATE.STEP_MODE)
- {
- eventDispatcher.engine.m_state = AD7Engine.DE_STATE.BREAK_MODE;
-
- // Visual Studio shows the line position one more than it actually is
- eventDispatcher.engine.m_docContext = eventDispatcher.getDocumentContext(file, line - 1);
- AD7StepCompletedEvent.Send(eventDispatcher.engine);
- }
- }
-
-
- ///
- /// Update VS when the debugging process is interrupted in GDB.
- ///
- /// Thread ID.
- private void onInterrupt(int threadID)
- {
- Debug.Assert(m_eventDispatcher.engine.m_state == AD7Engine.DE_STATE.RUN_MODE);
- m_eventDispatcher.engine.m_state = AD7Engine.DE_STATE.BREAK_MODE;
-
- if (m_file != "" && m_line > 0)
- {
- // Visual Studio shows the line position one more than it actually is
- m_eventDispatcher.engine.m_docContext = m_eventDispatcher.getDocumentContext(m_file, (uint)(m_line - 1));
- }
-
- // Only send OnAsyncBreakComplete if break-all was requested by the user
- if (!m_needsResumeAfterInterrupt)
- {
- m_eventDispatcher.engine.Callback.OnAsyncBreakComplete(m_eventDispatcher.engine.selectThread(threadID.ToString()));
- }
- }
- }
-
-
- ///
- /// This class manages events related to output messages.
- ///
- public class HandleOutputs
- {
- ///
- /// GDB textual output from the running target to be presented in the VS standard output window.
- ///
- private string m_stdOut = "";
-
- ///
- /// Other GDB messages to be presented in the VS standard output window.
- ///
- private string m_console = "";
-
- ///
- /// This object manages debug events in the engine.
- ///
- private EventDispatcher m_eventDispatcher = null;
-
-
- ///
- /// Constructor.
- ///
- /// This object manages debug events in the engine.
- public HandleOutputs(EventDispatcher ed)
- {
- m_eventDispatcher = ed;
- }
-
-
- ///
- /// This method manages events related to output messages by classifying each of them by sub-type.
- ///
- /// String that contains the event description.
- public void handle(string ev)
- {
- int ini = 0;
- int end = 0;
- switch (ev[1])
- {
- case '0': // Display the m_console message in the VS output window. Example: 80,\"\"[New pid 15380494 tid 2]\\n\"\"!80
- ini = 4;
- end = ev.IndexOf("\"!80", 4);
- m_console = ev.Substring(ini, (end - ini));
-
- // TODO: Call the method/event that will output this message in the VS output window.
-
- break;
- case '1': // Display the m_stdOut message in the VS standard output window. Instruction should look like this: 81,\"\" ... "\"!81
- ini = 4;
- end = ev.IndexOf("\"!81", 4);
- m_stdOut = ev.Substring(ini, (end - ini));
-
- // TODO: Call the method/event that will output this message in the VS standar output window.
-
- break;
- default: // not used.
- break;
- }
- }
- }
-}
diff --git a/src/VSNDK.DebugEngine/NameValueCollectionHelper.cs b/src/VSNDK.DebugEngine/NameValueCollectionHelper.cs
deleted file mode 100644
index 10c9ed6c..00000000
--- a/src/VSNDK.DebugEngine/NameValueCollectionHelper.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Collections.Specialized;
-
-namespace VSNDK.DebugEngine
-{
- ///
- ///
- ///
- public static class NameValueCollectionHelper
- {
-
- ///
- ///
- ///
- ///
- ///
- public static string DumpToString(NameValueCollection value)
- {
- var xSB = new StringBuilder();
- foreach (string xKey in value.Keys)
- {
- xSB.AppendFormat("{0}={1};", xKey, (string)value[xKey]);
- }
- return xSB.ToString();
- }
-
-
- ///
- ///
- ///
- ///
- ///
- public static void LoadFromString(NameValueCollection target, string value)
- {
- if (target.Count > 0)
- {
- throw new Exception("Target is not empty!");
- }
- if (String.IsNullOrEmpty(value))
- {
- return;
- }
-
- string[] xPairs = value.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
- foreach (var xPair in xPairs)
- {
- string[] xParts = xPair.Split('=');
- if (xParts.Length > 1)
- {
- target.Add(xParts[0], xParts[1]);
- }
- else
- {
- target.Add(xParts[0], "");
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/VSNDK.DebugEngine/Properties/AssemblyInfo.cs b/src/VSNDK.DebugEngine/Properties/AssemblyInfo.cs
deleted file mode 100644
index 8a09361e..00000000
--- a/src/VSNDK.DebugEngine/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("VSNDK.DebugEngine")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("BlackBerry")]
-[assembly: AssemblyProduct("VSNDK.DebugEngine")]
-[assembly: AssemblyCopyright("Copyright © Research In Motion 2012")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("7925a96c-7e19-4796-87ef-41634e94a31a")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/src/VSNDK.DebugEngine/VSNDK.DebugEngine.csproj b/src/VSNDK.DebugEngine/VSNDK.DebugEngine.csproj
deleted file mode 100644
index 438496ec..00000000
--- a/src/VSNDK.DebugEngine/VSNDK.DebugEngine.csproj
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {59A7B188-E307-4495-A3AF-4ED76B086A87}
- Library
- Properties
- VSNDK.DebugEngine
- VSNDK.DebugEngine
- v4.0
- 512
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- true
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
-
-
-
-
-
-
-
-
-
-
-
- False
- ..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio 2010 SDK\VisualStudioIntegration\Common\Assemblies\v2.0\Microsoft.VisualStudio.Debugger.Interop.10.0.dll
-
-
- False
- ..\..\..\..\..\Microsoft.VisualStudio.Debugger.InteropA.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {CC7B28E0-CB31-44F7-A380-E7072F670F38}
- GDBParser
-
-
- {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}
- VSNDK.Package
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.DebugEngine/VSNDK.DebugEngine.csproj.user b/src/VSNDK.DebugEngine/VSNDK.DebugEngine.csproj.user
deleted file mode 100644
index 59536a59..00000000
--- a/src/VSNDK.DebugEngine/VSNDK.DebugEngine.csproj.user
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
- Program
- C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Package.Test/DebugTokenDataTestClass.cs b/src/VSNDK.Package.Test/DebugTokenDataTestClass.cs
deleted file mode 100644
index 8fc1d0de..00000000
--- a/src/VSNDK.Package.Test/DebugTokenDataTestClass.cs
+++ /dev/null
@@ -1,180 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using NUnit.Framework;
-using RIM.VSNDK_Package.DebugToken.Model;
-using Microsoft.Win32;
-
-namespace VSNDK.Package.Test
-{
- [TestFixture]
- public class DebugTokenDataTestClass
- {
- private DebugTokenData DebugTokenObject;
-
- ///
- /// Setup for testing
- ///
- [SetUp]
- public void Setup()
- {
- /// Create Object
- DebugTokenObject = new RIM.VSNDK_Package.DebugToken.Model.DebugTokenData();
-
- /// Set Paths - This would normally be done by the creation of the package.
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkNDKPath = null;
- string qnx_target = "";
- string qnx_host = "";
-
- rkNDKPath = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- qnx_host = rkNDKPath.GetValue("NDKHostPath").ToString();
- qnx_target = rkNDKPath.GetValue("NDKHostPath").ToString();
-
- string qnx_config = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK";
-
- System.Environment.SetEnvironmentVariable("QNX_TARGET", qnx_target);
- System.Environment.SetEnvironmentVariable("QNX_HOST", qnx_host);
- System.Environment.SetEnvironmentVariable("QNX_CONFIGURATION", qnx_config);
-
- string ndkpath = string.Format(@"{0}/usr/bin;{1}\bin;{0}/usr/qde/eclipse/jre/bin;", qnx_host, qnx_config) + System.Environment.GetEnvironmentVariable("PATH");
- System.Environment.SetEnvironmentVariable("PATH", ndkpath);
- }
-
- ///
- /// Test for constructor
- ///
- [TestCase]
- public void DebugTokenDataConstructorTest()
- {
- /// Verify Test Case
- Assert.IsNotNull(DebugTokenObject);
- }
-
- ///
- /// Test what happens when Signing Certificate is unset.
- ///
- [TestCase]
- public void CreateDebugToken_NoCert_Test()
- {
- /// Initialize Test Case
- DebugTokenObject.CertPath = "";
- bool result = DebugTokenObject.createDebugToken();
-
- /// Verify Test Case
- Assert.IsFalse(result);
- }
-
- ///
- /// Test what happens when an invalid Key Store Password is sent
- ///
- [TestCase]
- public void CreateDebugToken_InvalidKeyStore_Test()
- {
- /// Initialize Test Case
- DebugTokenObject.KeyStorePassword = "invalid";
- bool result = DebugTokenObject.createDebugToken();
-
- /// Verify Test Case
- Assert.IsFalse(result);
- }
-
- ///
- /// Test what happens when an invalid Signing certificate path is sent
- ///
- [TestCase]
- public void CreateDebugToken_InvalidCertPath_Test()
- {
- /// Initialize Test Case
- DebugTokenObject.CertPath = @"C:\";
- bool result = DebugTokenObject.createDebugToken();
-
- /// Verify Test Case
- Assert.IsFalse(result);
- }
-
- ///
- /// Test what happens when an invalid Device PIN is sent
- ///
- [TestCase]
- public void CreateDebugToken_InvalidDevicePIN_Test()
- {
- /// Initialize Test Case
- DebugTokenObject.DevicePIN = "error";
- bool result = DebugTokenObject.createDebugToken();
-
- /// Verify Test Case
- Assert.IsFalse(result);
- }
-
- ///
- /// Test success test
- ///
- [TestCase]
- public void CreateDebugToken_Success_Test()
- {
-
- bool result = DebugTokenObject.createDebugToken();
-
- /// Verify Test Case
- Assert.IsTrue(result);
-
- }
-
- ///
- /// Test what happens when DeviceID is empty
- ///
- [TestCase]
- public void getDevicePin_EmptyDeviceID_Test()
- {
- /// Initialize Test Case
- DebugTokenObject.DeviceIP = "";
- bool result = DebugTokenObject.getDeviceInfo();
-
- /// Verify Test Case
- Assert.IsFalse(result);
- }
-
- ///
- /// Test what happens when a successful command is run
- ///
- [TestCase]
- public void getDevicePin_Success_Test()
- {
- /// Initialize Test Case
- bool result = DebugTokenObject.getDeviceInfo();
-
- /// Verify Test Case
- Assert.IsTrue(result);
- }
-
- ///
- /// Test what happens when an invalid password is sent
- ///
- [TestCase]
- public void getDevicePin_InvalidPassword_Test()
- {
- /// Initialize Test Case
- DebugTokenObject.DevicePassword = "error";
- bool result = DebugTokenObject.getDeviceInfo();
-
- /// Verify Test Case
- Assert.IsFalse(result);
- }
-
- ///
- /// Test what happens when an invalid Device IP is sent
- ///
- [TestCase]
- public void getDevicePin_InvalidDeviceIP_Test()
- {
- /// Initialize Test Case
- DebugTokenObject.DeviceIP = "1.1.1.1";
- bool result = DebugTokenObject.getDeviceInfo();
-
- /// Verify Test Case
- Assert.IsFalse(result);
- }
- }
-}
diff --git a/src/VSNDK.Package.Test/Properties/AssemblyInfo.cs b/src/VSNDK.Package.Test/Properties/AssemblyInfo.cs
deleted file mode 100644
index 02fcb1a5..00000000
--- a/src/VSNDK.Package.Test/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("VSNDK.Package.Test")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("VSNDK.Package.Test")]
-[assembly: AssemblyCopyright("Copyright © 2013")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("857773c8-9090-43d9-b73e-bee08a70cb78")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/src/VSNDK.Package.Test/SettingsDataTests.cs b/src/VSNDK.Package.Test/SettingsDataTests.cs
deleted file mode 100644
index 89f80ddb..00000000
--- a/src/VSNDK.Package.Test/SettingsDataTests.cs
+++ /dev/null
@@ -1,641 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using NUnit.Framework;
-using RIM.VSNDK_Package.Settings.Models;
-using RIM.VSNDK_Package;
-using Microsoft.Win32;
-using System.Collections;
-using System.IO;
-using System.Xml;
-using System.Windows.Data;
-
-namespace VSNDK.Package.Test
-{
- [TestFixture]
- class SettingsDataTests
- {
- private SettingsData settingsDataObject;
-
- ///
- /// Setup for testing
- ///
- [TestFixtureSetUp]
- public void TFSetup()
- {
- /// Create Object
- settingsDataObject = new SettingsData();
-
- /// Backup NDK Entries
- string[] dirPaths = new string[2];
- dirPaths[0] = Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)) + @"bbndk_vs\..\qconfig\";
- dirPaths[1] = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK\qconfig\";
-
- for (int i = 0; i < 2; i++)
- {
- if (!Directory.Exists(dirPaths[i]))
- continue;
-
- string[] filePaths = Directory.GetFiles(dirPaths[i], "*.xml");
-
- foreach (string file in filePaths)
- {
- try
- {
- File.Move(file, file.Replace(".xml", ".tmp"));
- }
- catch
- {
- break;
- }
- }
- }
- }
-
-
- ///
- /// Setup for testing
- ///
- [TestFixtureTearDown]
- public void TFTearDown()
- {
- /// Backup NDK Entries
- string[] dirPaths = new string[2];
- dirPaths[0] = Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)) + @"bbndk_vs\..\qconfig\";
- dirPaths[1] = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK\qconfig\";
-
- for (int i = 0; i < 2; i++)
- {
- if (!Directory.Exists(dirPaths[i]))
- continue;
-
- string[] filePaths = Directory.GetFiles(dirPaths[i], "*.tmp");
-
- foreach (string file in filePaths)
- {
- try
- {
- File.Move(file, file.Replace(".tmp", ".xml"));
- }
- catch
- {
- break;
- }
- }
- }
- }
-
-
- ///
- /// Test function with key values not set.
- ///
- [TestCase]
- public void GetDeviceInfoTest_KeyValuesNotSet()
- {
- /// Setup
- settingsDataObject.DeviceIP = "";
- settingsDataObject.DevicePassword = "";
-
- string keyName = @"Software\BlackBerry\BlackBerryVSPlugin";
- using (RegistryKey key = Registry.CurrentUser.OpenSubKey(keyName, true))
- {
- if (key == null)
- {
- // Do Nothing
- }
- else
- {
-
- key.DeleteValue("device_password", false);
- key.DeleteValue("device_IP", false);
- }
- }
-
- settingsDataObject.getDeviceInfo();
-
- Assert.IsNullOrEmpty(settingsDataObject.DeviceIP, "Device IP is not empty or null, " + settingsDataObject.DeviceIP);
- Assert.IsNullOrEmpty(settingsDataObject.DevicePassword, "Device Password is not empty or null, " + settingsDataObject.DevicePassword);
- }
-
- ///
- /// Test function with keys set.
- ///
- [TestCase]
- public void GetDeviceInfoTest_KeyValuesSet()
- {
- string ipAddr = "127.0.0.1";
- string password = "password";
-
- /// Setup
- settingsDataObject.DeviceIP = "";
- settingsDataObject.DevicePassword = "";
-
-
- string keyName = @"Software\BlackBerry\BlackBerryVSPlugin";
- using (RegistryKey key = Registry.CurrentUser.OpenSubKey(keyName, true))
- {
- if (key == null)
- {
- // Do Nothing
- }
- else
- {
- key.SetValue("device_password", GlobalFunctions.Encrypt(password), RegistryValueKind.String);
- key.SetValue("device_IP", ipAddr, RegistryValueKind.String);
- }
- }
-
- settingsDataObject.getDeviceInfo();
-
- Assert.IsTrue(settingsDataObject.DeviceIP == ipAddr , "Device IP value is not equal to test value, " + ipAddr + "!= " + settingsDataObject.DeviceIP);
- Assert.IsTrue(settingsDataObject.DevicePassword == password, "Device Password value is not equal to test value, " + password + " != " + settingsDataObject.DevicePassword);
- }
-
- ///
- /// Test function to set device info
- ///
- [TestCase]
- public void SetDeviceInfoTest()
- {
- string deviceIP = "127.0.0.1";
- string devicePassword = "password";
-
- /// Setup
- settingsDataObject.DeviceIP = deviceIP;
- settingsDataObject.DevicePassword = devicePassword;
-
- settingsDataObject.setDeviceInfo();
-
-
- string keyName = @"Software\BlackBerry\BlackBerryVSPlugin";
- using (RegistryKey key = Registry.CurrentUser.OpenSubKey(keyName, true))
- {
- if (key == null)
- {
- // Do Nothing
- }
- else
- {
- Assert.IsTrue(deviceIP == key.GetValue("device_IP").ToString(), "Device IP value is not equal to test value, " + deviceIP + "!= " + key.GetValue("device_IP").ToString());
- Assert.IsTrue(devicePassword == GlobalFunctions.Decrypt(key.GetValue("device_password").ToString()), "Device Password value is not equal to test value, " + devicePassword + " != " + GlobalFunctions.Decrypt(key.GetValue("device_password").ToString()));
- }
- }
-
- }
-
- ///
- /// Test function with key value not set
- ///
- [TestCase]
- public void GetSimulatorInfoTest_KeyValuesNotSet()
- {
- /// Setup
- settingsDataObject.SimulatorIP = "";
- settingsDataObject.SimulatorPassword = "";
-
- string keyName = @"Software\BlackBerry\BlackBerryVSPlugin";
- using (RegistryKey key = Registry.CurrentUser.OpenSubKey(keyName, true))
- {
- if (key == null)
- {
- // Do Nothing
- }
- else
- {
-
- key.DeleteValue("simulator_password", false);
- key.DeleteValue("simulator_IP", false);
- }
- }
-
- settingsDataObject.getSimulatorInfo();
-
- Assert.IsNullOrEmpty(settingsDataObject.SimulatorIP, "Simulator IP is not empty or null, " + settingsDataObject.SimulatorIP);
- Assert.IsNullOrEmpty(settingsDataObject.SimulatorPassword, "Simulator Password is not empty or null, " + settingsDataObject.SimulatorPassword);
- }
-
- ///
- /// Test function with key values set
- ///
- [TestCase]
- public void GetSimulatorInfoTest_KeyValuesSet()
- {
- string ipAddr = "127.0.0.1";
- string password = "password";
-
- /// Setup
- settingsDataObject.SimulatorIP = "";
- settingsDataObject.SimulatorPassword = "";
-
-
- string keyName = @"Software\BlackBerry\BlackBerryVSPlugin";
- using (RegistryKey key = Registry.CurrentUser.OpenSubKey(keyName, true))
- {
- if (key == null)
- {
- // Do Nothing
- }
- else
- {
- key.SetValue("simulator_password", GlobalFunctions.Encrypt(password), RegistryValueKind.String);
- key.SetValue("simulator_IP", ipAddr, RegistryValueKind.String);
- }
- }
-
- settingsDataObject.getSimulatorInfo();
-
- Assert.IsTrue(settingsDataObject.SimulatorIP == ipAddr , "Simulator IP value is not equal to test value, " + ipAddr + "!= " + settingsDataObject.SimulatorIP);
- Assert.IsTrue(settingsDataObject.SimulatorPassword == password, "Simulator Password value is not equal to test value, " + password + " != " + settingsDataObject.SimulatorPassword);
- }
-
- ///
- /// Test function to set simulator info
- ///
- [TestCase]
- public void SetSimulatorInfoTest()
- {
- string simulatorIP = "127.0.0.1";
- string simulatorPassword = "password";
-
- /// Setup
- settingsDataObject.SimulatorIP = simulatorIP;
- settingsDataObject.SimulatorPassword = simulatorPassword;
-
- settingsDataObject.setSimulatorInfo();
-
-
- string keyName = @"Software\BlackBerry\BlackBerryVSPlugin";
- using (RegistryKey key = Registry.CurrentUser.OpenSubKey(keyName, true))
- {
- if (key == null)
- {
- // Do Nothing
- }
- else
- {
- Assert.IsTrue(simulatorIP == key.GetValue("simulator_IP").ToString(), "Simulator IP value is not equal to test value, " + simulatorIP + "!= " + key.GetValue("simulator_IP").ToString());
- Assert.IsTrue(simulatorPassword == GlobalFunctions.Decrypt(key.GetValue("simulator_password").ToString()), "Simulator Password value is not equal to test value, " + simulatorPassword + " != " + GlobalFunctions.Decrypt(key.GetValue("simulator_password").ToString()));
- }
- }
-
- }
-
- ///
- /// Test function with key value not set
- ///
- [TestCase]
- public void GetNDKPathTest_KeyValuesNotSet()
- {
- /// Setup
- settingsDataObject.HostPath = "";
- settingsDataObject.TargetPath = "";
-
- string keyName = @"Software\BlackBerry\BlackBerryVSPlugin";
- using (RegistryKey key = Registry.CurrentUser.OpenSubKey(keyName, true))
- {
- if (key == null)
- {
- // Do Nothing
- }
- else
- {
-
- key.DeleteValue("NDKHostPath", false);
- key.DeleteValue("NDKTargetPath", false);
- }
- }
-
- settingsDataObject.getNDKPath();
-
- Assert.IsNullOrEmpty(settingsDataObject.HostPath, "Host Path is not empty or null, " + settingsDataObject.HostPath);
- Assert.IsNullOrEmpty(settingsDataObject.TargetPath, "Target Path is not empty or null, " + settingsDataObject.TargetPath);
- }
-
- ///
- /// Test function with key values set
- ///
- [TestCase]
- public void GetNDKPathTest_KeyValuesSet()
- {
- string hostPath = @"C:\bbndk_vs\host\";
- string targetPath = @"C:\bbndk_vs\target\";
-
- /// Setup
- settingsDataObject.HostPath = "";
- settingsDataObject.TargetPath = "";
-
-
- string keyName = @"Software\BlackBerry\BlackBerryVSPlugin";
- using (RegistryKey key = Registry.CurrentUser.OpenSubKey(keyName, true))
- {
- if (key == null)
- {
- // Do Nothing
- }
- else
- {
- key.SetValue("NDKHostPath", hostPath, RegistryValueKind.String);
- key.SetValue("NDKTargetPath", targetPath, RegistryValueKind.String);
- }
- }
-
- settingsDataObject.getNDKPath();
-
- Assert.IsTrue(settingsDataObject.HostPath == hostPath, "Host Path value is not equal to test value, " + hostPath + "!= " + settingsDataObject.HostPath);
- Assert.IsTrue(settingsDataObject.TargetPath == targetPath, "Target Path value is not equal to test value, " + targetPath + " != " + settingsDataObject.TargetPath);
- }
-
- ///
- /// Test function with valid version number
- ///
- [TestCase]
- public void GetAPINameTest_ValidVersion()
- {
- string version = "10.2.0.1155";
- string name = "BlackBerry Native SDK 10.2";
-
- string result = settingsDataObject.getAPIName(version);
-
- Assert.IsTrue(result == name, "API Name does not matched expected result., " + result + "!= " + name);
- }
-
- ///
- /// Test function with invalid version number
- ///
- [TestCase]
- public void GetAPINameTest_InvalidVersion()
- {
- string version = "1.1.1.1";
- string name = "";
-
- string result = settingsDataObject.getAPIName(version);
-
- Assert.IsTrue(result == name, "API Name does not matched expected result., " + result + "!= " + name);
- }
-
- ///
- /// Test function with no API's
- ///
- [TestCase]
- public void RefreshScreen_NoAPIs()
- {
- settingsDataObject.RefreshScreen();
-
- Assert.IsTrue(settingsDataObject.NDKEntries.Count == 0, "NDK Entries should be empty. ");
- }
-
- ///
- /// Test function with a single API in standard folder
- ///
- [TestCase]
- public void RefreshScreen_APIs1()
- {
- string version = "10.2.0.1155";
-
- GenerateXMLFiles(Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)) + @"bbndk_vs\..\qconfig\", version);
-
- settingsDataObject.RefreshScreen();
-
- Assert.IsTrue(settingsDataObject.NDKEntries.Count == 1, "Number of Entries is unexpected. ");
- Assert.IsTrue(((NDKEntryClass)settingsDataObject.NDKEntries.GetItemAt(0)).HostPath == @"C:/bbndk_vs/host_" + version.Replace('.', '_') + @"/win32/x86", "Host Path is not expected");
- Assert.IsTrue(((NDKEntryClass)settingsDataObject.NDKEntries.GetItemAt(0)).TargetPath == @"C:/bbndk_vs/target_" + version.Replace('.', '_') + @"/win32/qnx6", "Target Path is not expected");
- Assert.IsTrue(((NDKEntryClass)settingsDataObject.NDKEntries.GetItemAt(0)).NDKName == "BlackBerry Native SDK 10.2", "NDK Name is not expected");
-
- RemoveXmlFiles();
- }
-
- ///
- /// Test function with a single API in momentics folder
- ///
- [TestCase]
- public void RefreshScreen_APIs2()
- {
- string version = "10.2.0.1155";
-
- GenerateXMLFiles(Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)) + @"bbndk_vs\..\qconfig\", version);
-
- settingsDataObject.RefreshScreen();
-
- Assert.IsTrue(settingsDataObject.NDKEntries.Count == 1, "Number of Entries is unexpected. ");
- Assert.IsTrue(((NDKEntryClass)settingsDataObject.NDKEntries.GetItemAt(0)).HostPath == @"C:/bbndk_vs/host_" + version.Replace('.', '_') + @"/win32/x86", "Host Path is not expected");
- Assert.IsTrue(((NDKEntryClass)settingsDataObject.NDKEntries.GetItemAt(0)).TargetPath == @"C:/bbndk_vs/target_" + version.Replace('.', '_') + @"/win32/qnx6", "Target Path is not expected");
- Assert.IsTrue(((NDKEntryClass)settingsDataObject.NDKEntries.GetItemAt(0)).NDKName == "BlackBerry Native SDK 10.2", "NDK Name is not expected");
-
- RemoveXmlFiles();
- }
-
- ///
- /// Test function with multiple APIs
- ///
- [TestCase]
- public void RefreshScreen_APIs3()
- {
- string version = "10.2.0.1155";
- string version2 = "10.2.0.1200";
-
- GenerateXMLFiles(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK\qconfig\", version2);
- GenerateXMLFiles(Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)) + @"bbndk_vs\..\qconfig\", version);
-
- settingsDataObject.RefreshScreen();
-
- Assert.IsTrue(settingsDataObject.NDKEntries.Count == 2, "Number of Entries is unexpected. ");
- Assert.IsTrue(((NDKEntryClass)settingsDataObject.NDKEntries.GetItemAt(0)).HostPath == @"C:/bbndk_vs/host_" + version.Replace('.', '_') + @"/win32/x86", "Host Path is not expected");
- Assert.IsTrue(((NDKEntryClass)settingsDataObject.NDKEntries.GetItemAt(0)).TargetPath == @"C:/bbndk_vs/target_" + version.Replace('.', '_') + @"/win32/qnx6", "Target Path is not expected");
- Assert.IsTrue(((NDKEntryClass)settingsDataObject.NDKEntries.GetItemAt(0)).NDKName == "BlackBerry Native SDK 10.2", "NDK Name is not expected");
- Assert.IsTrue(((NDKEntryClass)settingsDataObject.NDKEntries.GetItemAt(1)).HostPath == @"C:/bbndk_vs/host_" + version2.Replace('.', '_') + @"/win32/x86", "Host Path is not expected");
- Assert.IsTrue(((NDKEntryClass)settingsDataObject.NDKEntries.GetItemAt(1)).TargetPath == @"C:/bbndk_vs/target_" + version2.Replace('.', '_') + @"/win32/qnx6", "Target Path is not expected");
- Assert.IsTrue(((NDKEntryClass)settingsDataObject.NDKEntries.GetItemAt(1)).NDKName == "BlackBerry Native SDK 10.2", "NDK Name is not expected");
-
- RemoveXmlFiles();
- }
-
- ///
- /// Test function for selecting no API
- ///
- [TestCase]
- public void RefreshScreen_SelectedAPI1()
- {
- string version = "10.2.0.1155";
- string version2 = "10.2.0.1200";
-
- GenerateXMLFiles(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK\qconfig\", version2);
- GenerateXMLFiles(Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)) + @"bbndk_vs\..\qconfig\", version);
-
- string keyName = @"Software\BlackBerry\BlackBerryVSPlugin";
- using (RegistryKey key = Registry.CurrentUser.OpenSubKey(keyName, true))
- {
- if (key == null)
- {
- // Do Nothing
- }
- else
- {
- key.SetValue("NDKHostPath", "", RegistryValueKind.String);
- key.SetValue("NDKTargetPath", "", RegistryValueKind.String);
- }
- }
-
- settingsDataObject.RefreshScreen();
-
- Assert.IsTrue(settingsDataObject.NDKEntryClass.HostPath == "", "Host path is not blank");
- Assert.IsTrue(settingsDataObject.NDKEntryClass.TargetPath == "", "Target path is not blank");
- Assert.IsTrue(settingsDataObject.NDKEntryClass.NDKName == "", "NDK name is not blank");
-
- RemoveXmlFiles();
- }
-
-
- ///
- /// Test function for selecting a single api
- ///
- [TestCase]
- public void RefreshScreen_SelectedAPI2()
- {
- string version = "10.2.0.1155";
- string version2 = "10.2.0.1200";
-
- GenerateXMLFiles(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK\qconfig\", version2);
- GenerateXMLFiles(Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)) + @"bbndk_vs\..\qconfig\", version);
-
- string keyName = @"Software\BlackBerry\BlackBerryVSPlugin";
- using (RegistryKey key = Registry.CurrentUser.OpenSubKey(keyName, true))
- {
- if (key == null)
- {
- // Do Nothing
- }
- else
- {
- key.SetValue("NDKHostPath", @"C:/bbndk_vs/host_" + version.Replace('.', '_') + @"/win32/x86", RegistryValueKind.String);
- key.SetValue("NDKTargetPath", @"C:/bbndk_vs/target_" + version.Replace('.', '_') + @"/win32/qnx6", RegistryValueKind.String);
- }
- }
-
- settingsDataObject.RefreshScreen();
-
- Assert.IsTrue(settingsDataObject.NDKEntryClass.HostPath == @"C:/bbndk_vs/host_" + version.Replace('.', '_') + @"/win32/x86", "Host path is not " + @"C:/bbndk_vs/host_" + version.Replace('.', '_') + @"/win32/x86");
- Assert.IsTrue(settingsDataObject.NDKEntryClass.TargetPath == @"C:/bbndk_vs/target_" + version.Replace('.', '_') + @"/win32/qnx6", "Target path is not " + @"C:/bbndk_vs/target_" + version.Replace('.', '_') + @"/win32/qnx6");
- Assert.IsTrue(settingsDataObject.NDKEntryClass.NDKName == "BlackBerry Native SDK 10.2", "BlackBerry Native SDK 10.2");
-
- RemoveXmlFiles();
- }
-
- ///
- /// Test the setting of the NDK Paths
- ///
- [TestCase]
- public void TC_setNDKPaths()
- {
- // Initialize Test
- string targetPath = ((NDKEntryClass)settingsDataObject.NDKEntries.GetItemAt(0)).TargetPath;
- string hostPath = ((NDKEntryClass)settingsDataObject.NDKEntries.GetItemAt(0)).HostPath;
- string qnx_config = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK";
-
- settingsDataObject.NDKEntryClass = (NDKEntryClass)settingsDataObject.NDKEntries.GetItemAt(0);
-
- RegistryKey regKeyCurrentUser = Registry.CurrentUser;
- RegistryKey regKey = regKeyCurrentUser.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- regKey.SetValue("NDKTargetPath", "");
- regKey.SetValue("NDKHostPath", "");
-
- // Run Test
- settingsDataObject.setNDKPaths();
-
- // Validate Test
- Assert.IsTrue(regKey.GetValue("NDKHostPath").ToString() == hostPath, "Host path does not match expected result");
- Assert.IsTrue(regKey.GetValue("NDKTargetPath").ToString() == targetPath, "Target path does not match expected result");
- Assert.IsTrue(System.Environment.GetEnvironmentVariable("QNX_TARGET") == targetPath, "QNX_TARGET system variable is not match expected result");
- Assert.IsTrue(System.Environment.GetEnvironmentVariable("QNX_HOST") == hostPath, "QNX_HOST system variable is not match expected result");
- Assert.IsTrue(System.Environment.GetEnvironmentVariable("QNX_CONFIGURATION") == qnx_config, "QNX_CONFIGURATION system variable is not match expected result");
- Assert.IsTrue(System.Environment.GetEnvironmentVariable("PATH").Contains(hostPath), "Path system variable does not contain host path");
- Assert.IsTrue(System.Environment.GetEnvironmentVariable("PATH").Contains(qnx_config), "Path system variable does not contain config path");
- }
-
- ///
- /// Helper function to generate XML Files
- ///
- ///
- private void GenerateXMLFiles(string path, string version)
- {
- XmlDocument doc = new XmlDocument();
- XmlNode docNode = doc.CreateXmlDeclaration("1.0", "UTF-8", "no");
- doc.AppendChild(docNode);
-
- XmlNode sysDefNode = doc.CreateElement("qnxSystemDefinition");
- doc.AppendChild(sysDefNode);
-
- XmlNode installationNode = doc.CreateElement("installation");
- sysDefNode.AppendChild(installationNode);
-
- XmlNode baseNode = doc.CreateElement("base");
- baseNode.InnerText = @"C:/bbndk_vs";
- installationNode.AppendChild(baseNode);
-
- XmlNode hostNode = doc.CreateElement("host");
- hostNode.InnerText = @"C:/bbndk_vs/host_" + version.Replace('.', '_') + @"/win32/x86";
- installationNode.AppendChild(hostNode);
-
- XmlNode nameNode = doc.CreateElement("name");
- nameNode.InnerText = "BlackBerry Native SDK 10.2";
- installationNode.AppendChild(nameNode);
-
- XmlNode targetNode = doc.CreateElement("target");
- targetNode.InnerText = @"C:/bbndk_vs/target_" + version.Replace('.', '_') + @"/win32/qnx6";
- installationNode.AppendChild(targetNode);
-
- XmlNode versionNode = doc.CreateElement("version");
- versionNode.InnerText = version;
- installationNode.AppendChild(versionNode);
-
- XmlNode annotationNode = doc.CreateElement("annotation");
- installationNode.AppendChild(annotationNode);
-
- XmlNode appInfoNode = doc.CreateElement("appInfo");
- XmlAttribute appInfoAttribute = doc.CreateAttribute("source");
- appInfoAttribute.Value = "p2install";
- appInfoNode.Attributes.Append(appInfoAttribute);
- annotationNode.AppendChild(appInfoNode);
-
- XmlNode dversionNode = doc.CreateElement("detailedVersion");
- dversionNode.InnerText = version;
- appInfoNode.AppendChild(dversionNode);
-
- Directory.CreateDirectory(path);
- doc.Save(path + version + ".xml");
- }
-
- ///
- /// Helper function to remove test xml files
- ///
- private void RemoveXmlFiles()
- {
- /// Remove NDK Entries
- string[] dirPaths = new string[2];
- dirPaths[0] = Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)) + @"bbndk_vs\..\qconfig\";
- dirPaths[1] = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK\qconfig\";
-
- for (int i = 0; i < 2; i++)
- {
- if (!Directory.Exists(dirPaths[i]))
- continue;
-
- string[] filePaths = Directory.GetFiles(dirPaths[i], "*.xml");
-
- foreach (string file in filePaths)
- {
- try
- {
- File.Delete(file);
- }
- catch
- {
- break;
- }
- }
- }
- }
-
-
- }
-}
diff --git a/src/VSNDK.Package.Test/SigningDataTestClass.cs b/src/VSNDK.Package.Test/SigningDataTestClass.cs
deleted file mode 100644
index ae30ef85..00000000
--- a/src/VSNDK.Package.Test/SigningDataTestClass.cs
+++ /dev/null
@@ -1,252 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using NUnit.Framework;
-using RIM.VSNDK_Package.Signing.Models;
-using RIM.VSNDK_Package;
-using System.IO;
-using Microsoft.Win32;
-
-namespace VSNDK.Package.Test
-{
- [TestFixture]
- public class SigningData_BackupRestore_TestClass
- {
- private SigningData _signingData = null;
- private string _certName = "";
- private string _certTmpPath = "";
-
- ///
- /// Setup for testing
- ///
- [TestFixtureSetUp]
- public void TFSetup()
- {
- /// Create Object
- _signingData = new SigningData();
- _certName = "BackupTest.zip";
- _certTmpPath = @"\temp";
- }
-
- ///
- /// Setup for testing
- ///
- [TestFixtureTearDown]
- public void TFTearDown()
- {
- /// Remove Zip file and unzipped files
- File.Delete(_signingData.CertPath + _certName);
- Directory.Delete(_signingData.CertPath + _certTmpPath);
- }
-
- ///
- /// Test the backup functionality
- ///
- [TestCase]
- public void SigningDataBackupTest()
- {
- _signingData.Backup(_certName);
- Assert.True(File.Exists(_signingData.CertPath + _certName));
- }
-
-
- ///
- /// Test the restore functionality
- ///
- [TestCase]
- public void SigningDataRestoreTest()
- {
- string certName = "BackupTest.zip";
- _signingData.CertPath = _signingData.CertPath + @"temp\";
- _signingData.Restore(certName);
- Assert.True(Directory.Exists(_signingData.CertPath), "Restore directory not created");
-
- DirectoryInfo di = new DirectoryInfo(_signingData.CertPath);
- FileInfo[] fileList = di.GetFiles();
-
- foreach (FileInfo file in fileList)
- {
- FileInfo file2 = new FileInfo(_signingData.CertPath + @"..\" + file.Name);
- FileAssert.AreEqual(file, file2, "File isn't the same: " + file.Name);
- }
- }
- }
-
- [TestFixture]
- public class SigningData_Register_TestClass
- {
- private SigningData _signingData = null;
- private string _cskPassword = "";
- private string _certName = "";
- private string _certTmpName = "";
-
- ///
- /// Setup for testing
- ///
- [TestFixtureSetUp]
- public void TFSetup()
- {
- /// Create Object
- _signingData = new SigningData();
-
- _certName = @"/bbidtoken.csk";
- _certTmpName = @"/bbidtoken.csk.bak";
-
- if (_signingData.Registered)
- {
- /// Backup CSK Password
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkCDKPass = null;
- rkCDKPass = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- _cskPassword = GlobalFunctions.Decrypt(rkCDKPass.GetValue("CSKPass").ToString());
- rkCDKPass.Close();
- rkHKCU.Close();
-
- /// Backup CSK File..
- File.Copy(_signingData.CertPath + _certName, _signingData.CertPath + _certTmpName);
-
- /// Remove Key so we can register again.
- _signingData.UnRegister();
-
- /// Backup CSK File..
- File.Copy(_signingData.CertPath + _certTmpName, _signingData.CertPath + _certName);
- }
- else
- {
- Assert.Ignore();
- }
- }
-
- ///
- /// Setup for testing
- ///
- [TestFixtureTearDown]
- public void TFTearDown()
- {
- /// Remove backup file
- File.Delete(_signingData.CertPath + _certTmpName);
- }
-
- ///
- /// Test the unregister function - All Registered
- ///
- [TestCase]
- public void SigningDataRegisterTest()
- {
- string password = "";
-
- /// Check success Fail
- _signingData.Register("Test", _cskPassword);
-
- /// Check return value from remote call
- StringAssert.IsMatch("CSK file deleted.\n", _signingData.Messages, "Return value from command is not as expected. " + _signingData.Messages);
-
- /// Check return value for errors
- StringAssert.DoesNotMatch("", _signingData.Errors, "Errors have been regturned from remote call. " + _signingData.Errors);
-
- /// Check to see that the cert file was removed
- Assert.True(File.Exists(_signingData.CertPath + @"/author.p12"), "Certificate File is not present");
-
- /// Check to see that the csk file was removed
- Assert.True(File.Exists(_signingData.CertPath + @"/bbidtoken.csk"), "CSK File is not present.");
-
- /// Get CSK Password
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkCDKPass = null;
- rkCDKPass = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- password = GlobalFunctions.Decrypt(rkCDKPass.GetValue("CSKPass").ToString());
- StringAssert.IsMatch(_cskPassword, password, "Password is not a match " + _cskPassword + " != " + password);
- rkCDKPass.Close();
- rkHKCU.Close();
- }
-
- }
-
- [TestFixture]
- public class SigningData_UnRegister_TestClass
- {
- private SigningData _signingData = null;
- private string _cskPassword = "";
- private string _certName = "";
- private string _certTmpName = "";
-
- ///
- /// Setup for testing
- ///
- [TestFixtureSetUp]
- public void TFSetup()
- {
- /// Create Object
- _signingData = new SigningData();
-
- _certName = @"/bbidtoken.csk";
- _certTmpName = @"/bbidtoken.csk.bak";
-
- if (_signingData.Registered)
- {
- /// Backup CSK Password
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkCDKPass = null;
- rkCDKPass = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- _cskPassword = rkCDKPass.GetValue("CSKPass").ToString();
- rkCDKPass.Close();
- rkHKCU.Close();
-
- /// Backup CSK File..
- File.Copy(_signingData.CertPath + _certName, _signingData.CertPath + _certTmpName);
- }
- else
- {
- Assert.Ignore();
- }
- }
-
- ///
- /// Setup for testing
- ///
- [TestFixtureTearDown]
- public void TFTearDown()
- {
- /// Backup CSK File..
- File.Copy(_signingData.CertPath + _certTmpName, _signingData.CertPath + _certName);
-
- /// Check success Fail
- _signingData.Register("Test Company", _cskPassword);
-
- /// Remove backup file
- File.Delete(_signingData.CertPath + _certTmpName);
- }
-
- ///
- /// Test the unregister function - All Registered
- ///
- [TestCase]
- public void SigningDataUnregisterTest()
- {
- /// Check success Fail
- _signingData.UnRegister();
-
- /// Check return value from remote call
- StringAssert.IsMatch("CSK file deleted.\n", _signingData.Messages, "Return value from command is not as expected. " + _signingData.Messages);
-
- /// Check return value for errors
- StringAssert.DoesNotMatch("", _signingData.Errors, "Errors have been regturned from remote call. " + _signingData.Errors);
-
- /// Check to see that the cert file was removed
- Assert.False(File.Exists(_signingData.CertPath + @"/author.p12"), "Certificate File is still present");
-
- /// Check to see that the csk file was removed
- Assert.False(File.Exists(_signingData.CertPath + @"/bbidtoken.csk"), "CSK File is still present.");
-
- /// Get CSK Password
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkCDKPass = null;
- rkCDKPass = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- StringAssert.IsMatch("", GlobalFunctions.Decrypt(rkCDKPass.GetValue("CSKPass").ToString()), "Password is not set to blank");
- rkCDKPass.Close();
- rkHKCU.Close();
- }
-
- }
-}
diff --git a/src/VSNDK.Package.Test/UpdateManagerDataTestClass.cs b/src/VSNDK.Package.Test/UpdateManagerDataTestClass.cs
deleted file mode 100644
index fcc16bf8..00000000
--- a/src/VSNDK.Package.Test/UpdateManagerDataTestClass.cs
+++ /dev/null
@@ -1,152 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using NUnit.Framework;
-using RIM.VSNDK_Package.UpdateManager.Model;
-using RIM.VSNDK_Package;
-using System.IO;
-using Microsoft.Win32;
-
-namespace VSNDK.Package.Test
-{
- [TestFixture]
- class UpdateManagerDataTestClass
- {
- private UpdateManagerData updateManagerDataObject;
-
- ///
- /// Setup for testing
- ///
- [TestFixtureSetUp]
- public void TF_Setup()
- {
- /// Create Object
- updateManagerDataObject = new UpdateManagerData();
-
- }
-
- [TestFixtureTearDown]
- public void TF_TearDown()
- {
-
- }
-
- ///
- /// Test GetAPILevel with a bad version expecting a no match
- ///
- [TestCase]
- public void TC_GetAPILevel_NoMatch()
- {
- /// Initialize Test
- string version = "1.0.0.0";
- string expectedResult = "";
-
- /// Run Test
- string result = updateManagerDataObject.GetAPILevel(version);
-
- /// Validate Test
- Assert.IsTrue(result == expectedResult, "Expected result is not empty, " + result);
- }
-
- ///
- /// Test GetAPILevel with a valid version expecting the correct API Level
- ///
- [TestCase]
- public void TC_GetAPILevel_Match()
- {
- /// Initialize Test
- string version = "10.2.0";
- string expectedResult = "10.2.0.1155";
-
- /// Run Test
- string result = updateManagerDataObject.GetAPILevel(version);
-
- /// Validate Test
- Assert.IsTrue(result == expectedResult, "Expected result does not match, " + result + " != " + expectedResult);
- }
-
- ///
- /// Test IsRuntimeInstalled with a invalid version expecting blank
- ///
- [TestCase]
- public void TC_IsRuntimeInstalled_NoMatch()
- {
- /// Initialize Test
- string version = "10.2.0.1197";
-
- /// Run Test
- bool result = updateManagerDataObject.IsRuntimeInstalled(version);
-
- /// Validate Test
- Assert.IsFalse(result, "Result should be false.");
- }
-
- ///
- /// Test IsRuntimeInstalled with a invalid version expecting blank
- ///
- [TestCase]
- public void TC_IsRuntimeInstalled_Match()
- {
- /// Initialize Test
- string version = "10.2.0.1197";
- Directory.CreateDirectory(GlobalFunctions.bbndkPathConst + @"\runtime_" + version.Replace(".", "_"));
-
- /// Run Test
- bool result = updateManagerDataObject.IsRuntimeInstalled(version);
-
- /// Validate Test
- Assert.IsTrue(result, "Result should be true.");
-
- ///Clean Up Test
- Directory.Delete(GlobalFunctions.bbndkPathConst + @"\runtime_" + version.Replace(".", "_"));
- }
-
- ///
- /// Test getCurrentAPIVersion when an API Version is not set.
- ///
- [TestCase]
- public void TC_getCurrentAPIVersion_Unset()
- {
- /// Initialize Test
- RegistryKey regKeyCurrentUser = Registry.CurrentUser;
- RegistryKey regKey = regKeyCurrentUser.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- regKey.SetValue("NDKTargetPath", "");
- regKey.Close();
- regKeyCurrentUser.Close();
-
- /// Run Test
- string result = updateManagerDataObject.getCurrentAPIVersion();
-
- /// Validate Test
- Assert.IsTrue(result == "", "Return value doesn't match expected result. " + result + " != " + "");
-
- }
-
- ///
- /// Test getCurrentAPIVersion when an API Version is set.
- ///
- [TestCase]
- public void TC_getCurrentAPIVersion_Set()
- {
- /// Initialize Test
- string version = "10.2.0.1155";
- RegistryKey regKeyCurrentUser = Registry.CurrentUser;
- RegistryKey regKey = regKeyCurrentUser.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- regKey.SetValue("NDKTargetPath", @"C:/bbndk_vs/target_" + version.Replace('.', '_') + "/qnx6");
-
- /// Run Test
- string result = updateManagerDataObject.getCurrentAPIVersion();
-
- /// Validate Test
- Assert.IsTrue(result == version, "Return value doesn't match expected result. " + result + " != " + version);
-
- /// Clean Up
- regKey.SetValue("NDKTargetPath", "");
- regKey.Close();
- regKeyCurrentUser.Close();
- }
-
-
- }
-}
diff --git a/src/VSNDK.Package.Test/VSNDK.Package.Test.csproj b/src/VSNDK.Package.Test/VSNDK.Package.Test.csproj
deleted file mode 100644
index 89f9ca10..00000000
--- a/src/VSNDK.Package.Test/VSNDK.Package.Test.csproj
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}
- Library
- Properties
- VSNDK.Package.Test
- VSNDK.Package.Test
- v4.0
- 512
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}
- VSNDK.Package
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Package/ControlDebugEngine.cs b/src/VSNDK.Package/ControlDebugEngine.cs
deleted file mode 100644
index 0398c696..00000000
--- a/src/VSNDK.Package/ControlDebugEngine.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace VSNDK.Package
-{
- public static class ControlDebugEngine
- {
- public static bool isDebugEngineRunning = false;
- }
-}
diff --git a/src/VSNDK.Package/DebugToken/DebugTokenDialog.xaml b/src/VSNDK.Package/DebugToken/DebugTokenDialog.xaml
deleted file mode 100644
index ef1720f5..00000000
--- a/src/VSNDK.Package/DebugToken/DebugTokenDialog.xaml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Package/DebugToken/DebugTokenDialog.xaml.cs b/src/VSNDK.Package/DebugToken/DebugTokenDialog.xaml.cs
deleted file mode 100644
index ff3bc42a..00000000
--- a/src/VSNDK.Package/DebugToken/DebugTokenDialog.xaml.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-using Microsoft.VisualStudio.PlatformUI;
-using RIM.VSNDK_Package.Signing.Models;
-using RIM.VSNDK_Package.DebugToken.Model;
-using PkgResources = RIM.VSNDK_Package.Resources;
-using RIM.VSNDK_Package.Signing;
-
-namespace RIM.VSNDK_Package.DebugToken
-{
- ///
- /// Interaction logic for DebugTokenDialog.xaml
- ///
- public partial class DebugTokenDialog : DialogWindow
- {
- #region Member Variables and Constants
- private DebugTokenData deployTokenData;
- public bool IsClosing = false;
- #endregion
-
- ///
- /// DebugTokenDialog Constructor
- ///
- public DebugTokenDialog()
- {
- DebugTokenData._initializedCorrectly = true;
-
- InitializeComponent();
-
- if (DebugTokenData._initializedCorrectly == false)
- {
- btnAdd.IsEnabled = false;
- btnRefresh.IsEnabled = false;
- IsClosing = true;
- this.Close();
- return;
- }
- deployTokenData = gridMain.DataContext as DebugTokenData;
-
- if (deployTokenData.Error != "")
- {
- MessageBox.Show(deployTokenData.Error, PkgResources.Errors);
- deployTokenData.Error = "";
-
- IsClosing = true;
-
- Close();
-
- }
-
- btnAdd.IsEnabled = !deployTokenData.AlreadyRegistered;
- btnRefresh.IsEnabled = deployTokenData.AlreadyRegistered;
- }
-
- ///
- /// Add debug token to device and registration file.
- ///
- ///
- ///
- private void btnAdd_Click(object sender, RoutedEventArgs e)
- {
- try
- {
- this.Cursor = Cursors.Wait;
-
- if (!(deployTokenData.addDevice(this)))
- {
- deployTokenData.Error = "";
- e.Handled = true;
- btnAdd.IsEnabled = false;
- btnRefresh.IsEnabled = false;
- }
- else
- {
- btnAdd.IsEnabled = false;
- btnRefresh.IsEnabled = true;
- }
- }
- finally
- {
- this.Cursor = Cursors.Arrow;
- }
- }
-
-
- ///
- /// Refresh debug token to device and registration file.
- ///
- ///
- ///
- private void btnRefresh_Click(object sender, RoutedEventArgs e)
- {
- this.Cursor = Cursors.Wait;
-
- if (!(deployTokenData.refreshDevice(this)))
- {
- deployTokenData.Error = "";
- e.Handled = true;
- btnAdd.IsEnabled = false;
- btnRefresh.IsEnabled = false;
- }
- else
- {
- btnAdd.IsEnabled = false;
- btnRefresh.IsEnabled = true;
- }
-
- this.Cursor = Cursors.Arrow;
- }
-
- }
-}
diff --git a/src/VSNDK.Package/DebugToken/DebugTokenDictionary.xaml b/src/VSNDK.Package/DebugToken/DebugTokenDictionary.xaml
deleted file mode 100644
index 77a99673..00000000
--- a/src/VSNDK.Package/DebugToken/DebugTokenDictionary.xaml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Package/DebugToken/Model/DebugTokenData.cs b/src/VSNDK.Package/DebugToken/Model/DebugTokenData.cs
deleted file mode 100644
index 8d1a004a..00000000
--- a/src/VSNDK.Package/DebugToken/Model/DebugTokenData.cs
+++ /dev/null
@@ -1,850 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using RIM.VSNDK_Package.Signing.Models;
-using System.Security.Cryptography;
-using Microsoft.Win32;
-using System.IO;
-using System.Windows.Data;
-using RIM.VSNDK_Package.Signing;
-using System.Windows.Forms;
-using System.ComponentModel;
-
-namespace RIM.VSNDK_Package.DebugToken.Model
-{
-
- ///
- /// The DataModel for the DebugToken dialog
- ///
- public class DebugTokenData : INotifyPropertyChanged
- {
-
- #region Member Variables and Constants
-
- private static string _deviceIP;
- private static string _devicePassword;
- private static string _errors;
- private static string _devicePin = "Not Attached";
- private static string _companyName = "";
- private static string _authorID = "";
- private static string _tmpAuthorID = "";
- private static string _ndkTargetPath;
- private static string _ndkHostPath;
- private static string _certPath;
- private static string _deviceosversion = "";
- private static string _storepass;
- private static string _localFolder;
- private static bool _alreadyRegistered = false;
- private static string _tokenExpiryDate = "";
- private static string _tmpTokenExpiryDate = "";
- private static string _tokenAuthor = "";
- private static string _tmpTokenAuthor = "";
- public static bool _initializedCorrectly = true;
- private const string _colCompanyName = "CompanyName";
- private const string _colAuthorID = "AuthorID";
- private const string _colAttachedDevice = "AttachedDevice";
- private const string _colExpiryDate = "ExpiryDate";
- public static bool restart = false;
-
- #endregion
-
- #region Properties
-
- ///
- /// Company Name Property
- ///
- public bool AlreadyRegistered
- {
- get { return _alreadyRegistered; }
- set { _alreadyRegistered = value; }
- }
-
- ///
- /// KeyStore Password
- ///
- public string KeyStorePassword
- {
- get { return _storepass; }
- set { _storepass = value; }
- }
-
- ///
- /// Device PIN
- ///
- public string DevicePIN
- {
- get { return _devicePin; }
- set { _devicePin = value; }
- }
-
- ///
- /// Device Password
- ///
- public string DevicePassword
- {
- get { return _devicePassword; }
- set { _devicePassword = value; }
- }
-
- ///
- /// Device PIN
- ///
- public string DeviceIP
- {
- get { return _deviceIP; }
- set { _deviceIP = value; }
- }
-
- ///
- /// Device OS Version
- ///
- public string DeviceOSVersion
- {
- get { return _deviceosversion; }
- set { _deviceosversion = value; }
- }
-
- ///
- /// Signing Certificate Path Property
- ///
- public string CertPath
- {
- get { return _certPath; }
- set { _certPath = value; }
- }
-
- ///
- /// Local Folder Property
- ///
- public string LocalFolder
- {
- get { return _localFolder; }
- set { _localFolder = value; }
- }
-
- ///
- /// Expiry Date Property
- ///
- public string ExpiryDate
- {
- get { return _tokenExpiryDate; }
- set { _tokenExpiryDate = value; OnPropertyChanged(_colExpiryDate); }
- }
-
- ///
- /// Contains any errors during the registration
- ///
- public string Error
- {
- get { return _errors; }
- set { _errors = value; }
- }
-
- ///
- /// Company Name Property
- ///
- public string CompanyName
- {
- get { return _companyName; }
- set { _companyName = value; OnPropertyChanged(_colCompanyName); }
- }
-
- ///
- /// Author ID Property
- ///
- public string AuthorID
- {
- get { return _authorID; }
- set { _authorID = value; OnPropertyChanged(_colAuthorID); }
- }
-
- ///
- /// Attached Device Property
- ///
- public string AttachedDevice
- {
- get
- {
-
- if (DevicePIN != "Not Attached")
- {
- return DevicePIN.Substring(0, 2) + DevicePIN.Substring(2, 8).ToUpper();
- }
- else
- {
- return DevicePIN;
- }
- }
- set
- {
- DevicePIN = value;
- OnPropertyChanged(_colAttachedDevice);
- }
- }
-
- #endregion
-
- ///
- /// Constructor
- ///
- public DebugTokenData()
- {
- refreshScreen();
- }
-
- public bool resetPassword()
- {
- _errors = "";
- RegistrationWindow win = new RegistrationWindow();
- win.ResizeMode = System.Windows.ResizeMode.NoResize;
- bool? res = win.ShowDialog();
- if (res == true)
- KeyStorePassword = win.tbPassword.Password;
-
- return res == true;
- }
-
- ///
- /// Set all the screen info
- ///
- private void refreshScreen()
- {
- LocalFolder = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\";
- CertPath = LocalFolder + "author.p12";
-
- if (!File.Exists(CertPath))
- {
- System.Windows.Forms.MessageBox.Show("Missing Signing Keys. Use menu \"BlackBerry\" -> \"Signing\" to register your signing keys.", "Signing keys not registered", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- _initializedCorrectly = false;
- _tmpTokenAuthor = "";
- _tmpAuthorID = "";
- _authorID = "";
- _companyName = "";
- _tokenExpiryDate = "";
- DevicePIN = "Not Attached";
- return;
- }
-
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkPluginRegKey = null;
-
- try
- {
- rkPluginRegKey = rkHKCU.OpenSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- DeviceIP = rkPluginRegKey.GetValue("device_IP").ToString();
- DevicePassword = rkPluginRegKey.GetValue("device_password").ToString();
- _ndkHostPath = rkPluginRegKey.GetValue("NDKHostPath").ToString();
- _ndkTargetPath = rkPluginRegKey.GetValue("NDKTargetPath").ToString();
- KeyStorePassword = (rkPluginRegKey.GetValue("CSKPass") != null) ? rkPluginRegKey.GetValue("CSKPass").ToString() : "";
- _alreadyRegistered = false;
- _tokenExpiryDate = "";
- _tmpTokenExpiryDate = "";
- _tokenAuthor = "";
- _tmpAuthorID = "";
- _authorID = "";
- _companyName = "";
- _tmpTokenAuthor = "";
- if (_errors == null)
- _errors = "";
-
- if ((DeviceIP == "") || (DeviceIP == null))
- {
- MessageBox.Show("Missing Device IP", "Missing Device IP", MessageBoxButtons.OK, MessageBoxIcon.Error);
- rkPluginRegKey.Close();
- rkHKCU.Close();
- _initializedCorrectly = false;
- _tmpTokenAuthor = "";
- _tmpAuthorID = "";
- _authorID = "";
- _companyName = "";
- _tokenExpiryDate = "";
- DevicePIN = "Not Attached";
- return;
- }
-
- if (DevicePassword != null)
- {
- try
- {
- DevicePassword = Decrypt(DevicePassword);
- }
- catch
- {
- MessageBox.Show("Missing Device password", "Missing Device Password", MessageBoxButtons.OK, MessageBoxIcon.Error);
- rkPluginRegKey.Close();
- rkHKCU.Close();
- _initializedCorrectly = false;
- _tmpTokenAuthor = "";
- _tmpAuthorID = "";
- _authorID = "";
- _companyName = "";
- _tokenExpiryDate = "";
- DevicePIN = "Not Attached";
- return;
- }
- }
-
- if (KeyStorePassword != "")
- {
- KeyStorePassword = Decrypt(KeyStorePassword);
- }
-
- if (getDeviceInfo())
- {
- if (getDebugTokenInfo())
- {
- isRegistered();
- }
- }
- }
- catch (Exception ex)
- {
- System.Windows.Forms.MessageBox.Show(ex.Message, "Microsoft Visual Studio", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
- }
-
- rkPluginRegKey.Close();
- rkHKCU.Close();
-
- }
-
- ///
- /// Add current device to device list.
- ///
- public bool addDevice(DebugTokenDialog parent)
- {
- if (DevicePIN == "Not Attached")
- {
- _errors = "No device attached.\n";
- return false;
- }
-
- if (KeyStorePassword == "")
- {
- if (!resetPassword())
- return false;
- }
-
- if (createDebugToken()) uploadDebugToken();
-
- if ((_errors.Contains("invalid password")) || (_errors.Contains("password is not valid")) || (_errors.Contains("invalid store password")))
- {
- MessageBox.Show("The specified password is invalid.\n\nPlease, enter the same one that you used to generate your BB ID Token.\n\nIf you don't remember it, you might close the next window, unregister and register again using BlackBerry -> Signing menu.",_errors, MessageBoxButtons.OK, MessageBoxIcon.Error);
-
- parent.Close();
- if (resetPassword())
- {
- restart = true;
- }
- return false;
- }
-
- if (_errors.Contains("Cannot connect:"))
- {
- MessageBox.Show(_errors, "Cannot connect", MessageBoxButtons.OK, MessageBoxIcon.Error);
- _initializedCorrectly = false;
- _tmpTokenAuthor = "";
- _tmpAuthorID = "";
- _authorID = "";
- _companyName = "";
- _tokenExpiryDate = "";
- DevicePIN = "Not Attached";
- return false;
- }
-
- refreshScreen();
- return true;
- }
-
- ///
- /// Refresh current device to device list.
- ///
- public bool refreshDevice(DebugTokenDialog parent)
- {
- if (DevicePIN == "Not Attached")
- {
- _errors = "No device attached.\n";
- return false;
- }
-
- if (KeyStorePassword == "")
- {
- if (!resetPassword())
- return false;
- }
-
- if (createDebugToken()) uploadDebugToken();
-
- if ((_errors.Contains("invalid password")) || (_errors.Contains("password is not valid")) || (_errors.Contains("invalid store password")))
- {
- MessageBox.Show("The specified password is invalid.\n\nPlease, enter the same one that you used to generate your BB ID Token.\n\nIf you don't remember it, you might close the next window, unregister and register again using BlackBerry -> Signing menu.",_errors, MessageBoxButtons.OK, MessageBoxIcon.Error);
-
- parent.Close();
- if (resetPassword())
- {
- restart = true;
- }
- return false;
- }
-
- if (_errors.Contains("Cannot connect:"))
- {
- MessageBox.Show(_errors, "Cannot connect", MessageBoxButtons.OK, MessageBoxIcon.Error);
- _initializedCorrectly = false;
- _tmpTokenAuthor = "";
- _tmpAuthorID = "";
- _authorID = "";
- _companyName = "";
- _tokenExpiryDate = "";
- DevicePIN = "Not Attached";
- return false;
- }
-
- refreshScreen();
- return true;
- }
-
- ///
- /// Retrieve debug token details
- ///
- /// True if successfully retrieved
- private bool getDebugTokenInfo()
- {
- bool success = false;
-
- if (!File.Exists(LocalFolder + "DebugToken.bar"))
- {
- return success;
- }
-
- System.Diagnostics.Process p = new System.Diagnostics.Process();
- System.Diagnostics.ProcessStartInfo startInfo = p.StartInfo;
- startInfo.UseShellExecute = false;
- startInfo.CreateNoWindow = true;
- startInfo.RedirectStandardError = true;
- startInfo.RedirectStandardOutput = true;
- p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(p_ErrorDataReceived);
- p.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(p_OutputDataReceived);
-
-
- /// Get Device PIN
- startInfo.FileName = "cmd.exe";
- startInfo.WorkingDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + "\\BlackBerry\\VSPlugin-NDK\\qnxtools\\bin\\";
- startInfo.Arguments = string.Format(@"/C blackberry-airpackager.bat -listManifest ""{0}""", LocalFolder + "DebugToken.bar");
-
- try
- {
- p.Start();
- p.BeginErrorReadLine();
- p.BeginOutputReadLine();
- p.WaitForExit();
- if (p.ExitCode != 0)
- {
- success = false;
- }
- else
- {
- success = true;
- }
- p.Close();
- }
- catch (Exception e)
- {
- System.Diagnostics.Debug.WriteLine(startInfo.Arguments);
- System.Diagnostics.Debug.WriteLine(e.Message);
- success = false;
- }
-
- return success;
-
- }
-
- ///
- /// Get the device Info of the connected device
- ///
- /// True if successful
- public bool getDeviceInfo()
- {
- bool success = false;
-
- if (string.IsNullOrEmpty(DeviceIP))
- {
- return success;
- }
-
- System.Diagnostics.Process p = new System.Diagnostics.Process();
- System.Diagnostics.ProcessStartInfo startInfo = p.StartInfo;
- startInfo.UseShellExecute = false;
- startInfo.CreateNoWindow = true;
- startInfo.RedirectStandardError = true;
- startInfo.RedirectStandardOutput = true;
- p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(p_ErrorDataReceived);
- p.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(p_OutputDataReceived);
-
- /// Get Device PIN
- startInfo.FileName = "cmd.exe";
- startInfo.WorkingDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + "\\BlackBerry\\VSPlugin-NDK\\qnxtools\\bin\\";
- startInfo.Arguments = string.Format("/C blackberry-deploy.bat -listDeviceInfo {0} -password {1}", DeviceIP, DevicePassword);
-
- try
- {
- p.Start();
- p.BeginErrorReadLine();
- p.BeginOutputReadLine();
- p.WaitForExit();
- if (p.ExitCode != 0)
- {
- success = false;
- }
- else
- {
- success = true;
- }
-
- p.Close();
- }
- catch (Exception e)
- {
- System.Diagnostics.Debug.WriteLine(startInfo.Arguments);
- System.Diagnostics.Debug.WriteLine(e.Message);
- success = false;
- }
-
- return success;
-
- }
-
- ///
- /// Get the list of registered devices and display
- ///
- private bool isRegistered()
- {
- //Reset Screen
- CompanyName = "";
- AuthorID = "";
- ExpiryDate = "";
-
- if ((_tmpTokenExpiryDate != "") && (_tmpTokenAuthor == _tokenAuthor))
- {
- AlreadyRegistered = true;
- CompanyName = _tmpTokenAuthor;
- AuthorID = _tmpAuthorID;
- ExpiryDate = _tmpTokenExpiryDate;
- }
- else
- {
- AlreadyRegistered = false;
- }
-
- return AlreadyRegistered;
- }
-
- ///
- /// Upload Token to connected device
- ///
- /// True if successful
- private bool uploadDebugToken()
- {
- bool success = false;
-
- if (string.IsNullOrEmpty(DeviceIP))
- {
- return success;
- }
- else if (!File.Exists(LocalFolder + "DebugToken.bar"))
- {
- return success;
- }
-
- System.Diagnostics.Process p = new System.Diagnostics.Process();
- System.Diagnostics.ProcessStartInfo startInfo = p.StartInfo;
- startInfo.UseShellExecute = false;
- startInfo.CreateNoWindow = true;
- startInfo.RedirectStandardError = true;
- startInfo.RedirectStandardOutput = true;
- p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(p_ErrorDataReceived);
- p.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(p_OutputDataReceived);
-
- /// Request Debug Token
- startInfo.FileName = "cmd.exe";
- startInfo.WorkingDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + "\\BlackBerry\\VSPlugin-NDK\\qnxtools\\bin\\";
- startInfo.Arguments = string.Format(@"/C blackberry-deploy.bat -installDebugToken ""{0}"" -device {1} -password {2}", LocalFolder + "DebugToken.bar", DeviceIP, DevicePassword);
-
- try
- {
- p.Start();
- p.BeginErrorReadLine();
- p.BeginOutputReadLine();
- p.WaitForExit();
- if (p.ExitCode != 0)
- {
- success = false;
- }
- else
- {
- success = true;
- }
- p.Close();
- }
- catch (Exception e)
- {
- System.Diagnostics.Debug.WriteLine(startInfo.Arguments);
- System.Diagnostics.Debug.WriteLine(e.Message);
- success = false;
- }
-
- return success;
-
- }
-
- ///
- /// remove debug token from connected device
- ///
- /// True if successful
- private bool removeDebugToken()
- {
- bool success = false;
-
- if (string.IsNullOrEmpty(DeviceIP))
- {
- return success;
- }
- else if (string.IsNullOrEmpty(_authorID))
- {
- return success;
- }
-
- System.Diagnostics.Process p = new System.Diagnostics.Process();
- System.Diagnostics.ProcessStartInfo startInfo = p.StartInfo;
- startInfo.UseShellExecute = false;
- startInfo.CreateNoWindow = true;
- startInfo.RedirectStandardError = true;
- startInfo.RedirectStandardOutput = true;
- p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(p_ErrorDataReceived);
- p.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(p_OutputDataReceived);
-
- /// Request Debug Token
- startInfo.FileName = "cmd.exe";
- startInfo.WorkingDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + "\\BlackBerry\\VSPlugin-NDK\\qnxtools\\bin\\";
- startInfo.Arguments = string.Format(@"/C blackberry-deploy.bat -uninstallApp -device {0} -password {1} -package-id {2}", DeviceIP, DevicePassword, _authorID);
-
- try
- {
- p.Start();
- p.BeginErrorReadLine();
- p.BeginOutputReadLine();
- p.WaitForExit();
- if (p.ExitCode != 0)
- {
- success = false;
- }
- else
- {
- success = true;
- }
- p.Close();
- }
- catch (Exception e)
- {
- System.Diagnostics.Debug.WriteLine(startInfo.Arguments);
- System.Diagnostics.Debug.WriteLine(e.Message);
- success = false;
- }
-
- return success;
-
- }
-
- ///
- /// Create a new Debug Token for connected device
- ///
- /// True if successful
- public bool createDebugToken()
- {
- bool success = false;
-
- if (string.IsNullOrEmpty(CertPath))
- {
- return success;
- }
-
- System.Diagnostics.Process p = new System.Diagnostics.Process();
- System.Diagnostics.ProcessStartInfo startInfo = p.StartInfo;
- startInfo.UseShellExecute = false;
- startInfo.CreateNoWindow = true;
- startInfo.RedirectStandardError = true;
- startInfo.RedirectStandardOutput = true;
- p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(p_ErrorDataReceived);
- p.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(p_OutputDataReceived);
-
- /// Request Debug Token
- startInfo.FileName = "cmd.exe";
- startInfo.WorkingDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + "\\BlackBerry\\VSPlugin-NDK\\qnxtools\\bin\\";
- startInfo.Arguments = string.Format(@"/C blackberry-debugtokenrequest.bat -storepass {0} -deviceid ""{1}"" ""{2}""",
- KeyStorePassword, DevicePIN, LocalFolder + "DebugToken.bar");
-
-
- try
- {
- p.Start();
- p.BeginErrorReadLine();
- p.BeginOutputReadLine();
- p.WaitForExit();
- if (p.ExitCode != 0)
- {
- success = false;
- }
- else
- {
- success = true;
- }
- p.Close();
- }
- catch (Exception e)
- {
- System.Diagnostics.Debug.WriteLine(startInfo.Arguments);
- System.Diagnostics.Debug.WriteLine(e.Message);
- success = false;
- }
-
- return success;
-
- }
-
- ///
- /// On Data Received event handler
- ///
- ///
- ///
- private void p_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
- {
- if (e.Data != null)
- {
- System.Diagnostics.Debug.WriteLine(e.Data);
- if (e.Data.Contains("Error:"))
- _errors += e.Data + "\n";
- else if (e.Data.Contains("devicepin::"))
- {
- AttachedDevice = e.Data.Substring(e.Data.LastIndexOf("::") + 2);
- _alreadyRegistered = false;
- }
- else if (e.Data.Contains("Package-Author-Id:"))
- _tmpAuthorID = e.Data.Substring(e.Data.LastIndexOf(": ") + 2);
- else if (e.Data.Contains("Package-Author:"))
- _tmpTokenAuthor = e.Data.Substring(e.Data.LastIndexOf(": ") + 2);
- else if (e.Data.Contains("[n]debug_token_expiration::"))
- _tmpTokenExpiryDate = e.Data.Substring(e.Data.LastIndexOf("::") + 2);
- else if (e.Data.Contains("[n]debug_token_author::"))
- _tokenAuthor = e.Data.Substring(e.Data.LastIndexOf("::") + 2);
- else if (e.Data.Contains("scmbundle::"))
- _deviceosversion = e.Data.Substring(e.Data.LastIndexOf("::") + 2);
- }
- }
-
- ///
- /// On Error received event handler
- ///
- ///
- ///
- private void p_ErrorDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
- {
- if (e.Data != null)
- {
- System.Diagnostics.Debug.WriteLine(e.Data);
-
- if (e.Data.Contains("-password"))
- {
- _errors += "The password supplied for connecting to your device is not set or invalid\n";
- }
- else
- _errors += e.Data + "\n";
- }
- }
-
-
-
- ///
- /// Encrypts a given password and returns the encrypted data
- /// as a base64 string.
- ///
- /// An unencrypted string that needs
- /// to be secured.
- /// A base64 encoded string that represents the encrypted
- /// binary data.
- ///
- /// This solution is not really secure as we are
- /// keeping strings in memory. If runtime protection is essential,
- /// should be used.
- /// If
- /// is a null reference.
- public string Encrypt(string plainText)
- {
- if (plainText == null) throw new ArgumentNullException("plainText");
-
- //encrypt data
- var data = Encoding.Unicode.GetBytes(plainText);
- byte[] encrypted = ProtectedData.Protect(data, null, DataProtectionScope.LocalMachine);
-
- //return as base64 string
- return Convert.ToBase64String(encrypted);
- }
-
- ///
- /// Decrypts a given string.
- ///
- /// A base64 encoded string that was created
- /// through the or
- /// extension methods.
- /// The decrypted string.
- /// Keep in mind that the decrypted string remains in memory
- /// and makes your application vulnerable per se. If runtime protection
- /// is essential, should be used.
- /// If
- /// is a null reference.
- public string Decrypt(string cipher)
- {
- if (cipher == null) throw new ArgumentNullException("cipher");
-
- //parse base64 string
- byte[] data = Convert.FromBase64String(cipher);
-
- //decrypt data
- byte[] decrypted = ProtectedData.Unprotect(data, null, DataProtectionScope.LocalMachine);
-
- return Encoding.Unicode.GetString(decrypted);
- }
-
- #region INotifyPropertyChanged Implementation
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- ///
- /// Fire the PropertyChnaged event handler on change of property
- ///
- ///
- protected void OnPropertyChanged(string propName)
- {
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs(propName));
- }
- }
-
- #endregion
-
- }
-}
diff --git a/src/VSNDK.Package/EditorFactory.cs b/src/VSNDK.Package/EditorFactory.cs
deleted file mode 100644
index 3e1999e7..00000000
--- a/src/VSNDK.Package/EditorFactory.cs
+++ /dev/null
@@ -1,223 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Diagnostics;
-using System.Globalization;
-using System.Runtime.InteropServices;
-using System.Security.Permissions;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Shell.Interop;
-using Microsoft.VisualStudio.Shell;
-using Microsoft.VisualStudio.TextManager.Interop;
-using Microsoft.VisualStudio.OLE.Interop;
-
-using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider;
-
-namespace RIM.VSNDK_Package
-{
- ///
- /// Factory for creating the bar-descriptor editor
- ///
- [Guid(GuidList.guidVSNDK_PackageEditorFactoryString)]
- public sealed class EditorFactory : IVsEditorFactory, IDisposable
- {
- /// Declare Constants
- public const string defaultExtension = ".xml";
-
- /// Private Member Variables
- private VSNDK_PackagePackage editorPackage;
- private ServiceProvider vsServiceProvider;
-
- ///
- /// Constructor
- ///
- ///
- public EditorFactory(VSNDK_PackagePackage package)
- {
- /// Set internal member variables
- this.editorPackage = package;
- }
-
- ///
- /// Close the factory
- ///
- ///
- public int Close()
- {
- return VSConstants.S_OK;
- }
-
- ///
- /// Create an instance of the custom editor
- ///
- /// Behaviour Flags
- /// Document to be opened.
- /// Name of the view
- /// Pointer to the IVSHierarchy
- /// Item ID for this instance
- /// This parameter is used to determine if a document buffer (DocData object) has already been created
- /// Pointer to the IUnknown interface for the DocView object
- /// Pointer to the IUnknown interface for the DocData object
- /// Caption mentioned by the editor for the doc window
- /// the Command UI Guid. Any UI element that is visible in the editor has to use this GUID. This is specified in the .vsct file
- /// Flags for CreateDocumentWindow
- ///
- public int CreateEditorInstance(uint grfCreateDoc, string pszMkDocument, string pszPhysicalView, IVsHierarchy pvHier, uint itemid, IntPtr punkDocDataExisting, out IntPtr ppunkDocView, out IntPtr ppunkDocData, out string pbstrEditorCaption, out Guid pguidCmdUI, out int pgrfCDW)
- {
- /// Initialize variables.
- ppunkDocView = IntPtr.Zero;
- ppunkDocData = IntPtr.Zero;
- pguidCmdUI = GuidList.guidVSNDK_PackageEditorFactory;
- pgrfCDW = 0;
- pbstrEditorCaption = null;
- IVsTextLines textBuffer = null;
-
- /// Validate Inputs
- if ((grfCreateDoc & (VSConstants.CEF_OPENFILE | VSConstants.CEF_SILENT)) == 0)
- {
- return VSConstants.E_INVALIDARG;
- }
-
- if (punkDocDataExisting == IntPtr.Zero)
- { /// File is not open yet. Create a new text buffer object.
-
- /// get the ILocalRegistry interface so we can use it to
- /// create the text buffer from the shell's local registry
- try
- {
- ILocalRegistry localRegistry = (ILocalRegistry)GetService(typeof(SLocalRegistry));
- if (localRegistry != null)
- { /// Successfully created
- IntPtr ptr;
- Guid iid = typeof(IVsTextLines).GUID;
- Guid CLSID_VsTextBuffer = typeof(VsTextBufferClass).GUID;
- localRegistry.CreateInstance(CLSID_VsTextBuffer, null, ref iid, 1 /*CLSCTX_INPROC_SERVER*/, out ptr);
- try
- {
- textBuffer = Marshal.GetObjectForIUnknown(ptr) as IVsTextLines;
- }
- finally
- {
- Marshal.Release(ptr); // Release RefCount from CreateInstance call
- }
-
- // It is important to site the TextBuffer object
- IObjectWithSite objWSite = (IObjectWithSite)textBuffer;
- if (objWSite != null)
- {
- Microsoft.VisualStudio.OLE.Interop.IServiceProvider oleServiceProvider = (Microsoft.VisualStudio.OLE.Interop.IServiceProvider)GetService(typeof(Microsoft.VisualStudio.OLE.Interop.IServiceProvider));
- objWSite.SetSite(oleServiceProvider);
- }
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine("Can not get IVsCfgProviderEventsHelper" + ex.Message);
- throw;
- }
- }
- else
- { /// File is already open. Verify open document is a Text Buffer
-
-
- /// QI existing buffer for text lines
- textBuffer = Marshal.GetObjectForIUnknown(punkDocDataExisting) as IVsTextLines;
- if (textBuffer == null)
- {
- return VSConstants.VS_E_INCOMPATIBLEDOCDATA;
- }
- }
-
- /// Create the Document (editor)
- EditorPane NewEditor = new EditorPane(vsServiceProvider, editorPackage, pszMkDocument, textBuffer);
- ppunkDocView = Marshal.GetIUnknownForObject(NewEditor);
- ppunkDocData = Marshal.GetIUnknownForObject(textBuffer);
- pbstrEditorCaption = "";
- return VSConstants.S_OK;
- }
-
- ///
- /// Private function to return the required service.
- ///
- /// Service Type
- ///
- public object GetService(Type serviceType)
- {
- return vsServiceProvider.GetService(serviceType);
- }
-
- ///
- /// This method is called by the Environment (inside IVsUIShellOpenDocument::
- /// OpenStandardEditor and OpenSpecificEditor) to map a LOGICAL view to a
- /// PHYSICAL view.
- ///
- ///
- ///
- ///
- public int MapLogicalView(ref Guid rguidLogicalView, out string pbstrPhysicalView)
- {
- /// Initialize our parameter
- pbstrPhysicalView = null;
-
- /// we support only a single physical view
- if (VSConstants.LOGVIEWID_Primary == rguidLogicalView)
- { /// primary view uses NULL as pbstrPhysicalView
- return VSConstants.S_OK;
- }
- else
- { /// you must return E_NOTIMPL for any unrecognized rguidLogicalView values
- return VSConstants.E_NOTIMPL;
- }
- }
-
- ///
- /// Used for initialization of the editor in the environment
- ///
- /// pointer to the service provider. Can be used to obtain instances of other interfaces
- ///
- public int SetSite(IOleServiceProvider psp)
- {
- vsServiceProvider = new ServiceProvider(psp);
- return VSConstants.S_OK;
- }
-
- ///
- /// IDisposable Constructor
- ///
- public void Dispose()
- {
- Dispose(true);
- }
-
- ///
- /// IDisposable Constructor Override
- ///
- ///
- private void Dispose(bool disposing)
- {
- lock (this)
- {
- if (disposing)
- { ///dispose all managed and unmanaged resources
- if (vsServiceProvider != null)
- {
- vsServiceProvider.Dispose();
- vsServiceProvider = null;
- }
- }
- }
- }
- }
-}
diff --git a/src/VSNDK.Package/EditorFactoryNotifyForProject.cs b/src/VSNDK.Package/EditorFactoryNotifyForProject.cs
deleted file mode 100644
index 01d7ca09..00000000
--- a/src/VSNDK.Package/EditorFactoryNotifyForProject.cs
+++ /dev/null
@@ -1,177 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Globalization;
-using Microsoft.VisualStudio.Shell;
-
-namespace RIM.VSNDK_Package
-{
- ///
- /// This attribute adds a File Extension for a Project System so that the Project
- /// will call IVsEditorFactoryNotify methods when an item of this type is added
- /// or renamed.
- ///
- ///
- /// For example:
- /// [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Projects\
- /// {F184B08F-C81C-45F6-A57F-5ABD9991F28F}\FileExtensions\.addin]
- /// "EditorFactoryNotify"="{FA3CD31E-987B-443A-9B81-186104E8DAC1}"
- ///
- [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
- [System.Runtime.InteropServices.ComVisibleAttribute(false)]
- public sealed class EditorFactoryNotifyForProjectAttribute : RegistrationAttribute
- {
- #region Fields
- private Guid projectType;
- private Guid factoryType;
- private string fileExtension;
- #endregion
-
- #region Constructors
- ///
- /// Creates a new ProvideEditorFactoryNotifyForProject attribute to register a
- /// file extension with a project.
- ///
- /// The type of project; can be a Type, a GUID or a string representation of a GUID
- /// The type of factory; can be a Type, a GUID or a string representation of a GUID
- /// The file extension the EditorFactoryNotify wants to handle
- public EditorFactoryNotifyForProjectAttribute(object projectType, string fileExtension, object factoryType)
- {
- if (factoryType == null)
- {
- throw new ArgumentNullException("factoryType", "Factory type can not be null.");
- }
- if (projectType == null)
- {
- throw new ArgumentNullException("projectType", "Project type can not be null.");
- }
-
- this.fileExtension = fileExtension;
-
- // figure out what type of object they passed in and get the GUID from it
- if (factoryType is string)
- {
- this.factoryType = new Guid(factoryType.ToString());
- }
- else if (factoryType is Type)
- {
- this.factoryType = ((Type)factoryType).GUID;
- }
- else if (factoryType is Guid)
- {
- this.factoryType = (Guid)factoryType;
- }
- else
- {
- throw new ArgumentException("Parameter is expected to be an instance of the type 'Type' or 'Guid'.", "factoryType");
- }
-
- // figure out what type of object they passed in and get the GUID from it
- if (projectType is string)
- {
- this.projectType = new Guid(projectType.ToString());
- }
- else if (projectType is Type)
- {
- this.projectType = ((Type)projectType).GUID;
- }
- else if (projectType is Guid)
- {
- this.projectType = (Guid)projectType;
- }
- else
- {
- throw new ArgumentException("Parameter is expected to be an instance of the type 'Type' or 'Guid'.", "projectType");
- }
- }
- #endregion
-
- #region Properties
- ///
- /// Get the Guid representing the type of the editor factory
- ///
- //public Guid FactoryType
- public object FactoryType
- {
- get { return factoryType; }
- }
-
- ///
- /// Get the Guid representing the project type
- ///
- public object ProjectType
- {
- get { return projectType; }
- }
-
- ///
- /// Get or Set the extension of the XML files that support this view
- ///
- public string FileExtension
- {
- get { return fileExtension; }
- }
-
- ///
- /// Extention path within the registration context
- ///
- private string ProjectFileExtensionPath
- {
- get
- {
- return string.Format(CultureInfo.InvariantCulture, "Projects\\{0}\\FileExtensions\\{1}", projectType.ToString("B"), fileExtension);
- }
- }
- #endregion
-
- #region Methods
- ///
- /// Called to register this attribute with the given context. The context
- /// contains the location where the registration information should be placed.
- /// It also contains other information such as the type being registered and path information.
- ///
- /// Given context to register in
- public override void Register(RegistrationContext context)
- {
- if (context == null)
- {
- throw new ArgumentNullException("context");
- }
-
- context.Log.WriteLine(String.Format(CultureInfo.CurrentCulture, "EditorFactoryNoftifyForProject: {0} Extension = {1}\n", projectType.ToString(), fileExtension));
-
- using (Key childKey = context.CreateKey(ProjectFileExtensionPath))
- {
- childKey.SetValue("EditorFactoryNotify", factoryType.ToString("B"));
- }
- }
-
- ///
- /// Unregister this file extension.
- ///
- /// Given context to unregister from
- public override void Unregister(RegistrationContext context)
- {
- if (context != null)
- {
- context.RemoveKey(ProjectFileExtensionPath);
- }
- }
- #endregion
- }
-}
diff --git a/src/VSNDK.Package/EditorPane.cs b/src/VSNDK.Package/EditorPane.cs
deleted file mode 100644
index 6ce9bcb1..00000000
--- a/src/VSNDK.Package/EditorPane.cs
+++ /dev/null
@@ -1,478 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.VisualStudio.OLE.Interop;
-using Microsoft.VisualStudio.Shell.Interop;
-using Microsoft.VisualStudio.TextManager.Interop;
-using System.Runtime.InteropServices;
-using Microsoft.VisualStudio.XmlEditor;
-using Microsoft.VisualStudio;
-using System.ComponentModel.Design;
-using Microsoft.VisualStudio.Shell;
-using System.Security.Permissions;
-
-namespace RIM.VSNDK_Package
-{
- ///
- /// This control hosts the editor and is responsible for
- /// handling the commands targeted to the editor
- ///
-
- [ComVisible(true)]
- public sealed class EditorPane : Microsoft.VisualStudio.Shell.WindowPane, IOleComponent, IVsDeferredDocView, IVsLinkedUndoClient
- {
- #region Fields
- private VSNDK_PackagePackage _thisPackage;
- private ServiceProvider _service;
- private string _fileName = string.Empty;
- private VsDesignerControl _vsDesignerControl;
- private IVsTextLines _textBuffer;
- private uint _componentId;
- private IOleUndoManager _undoManager;
- private XmlStore _store;
- private XmlModel _model;
- #endregion
-
- #region "Window.Pane Overrides"
- ///
- /// Constructor that calls the Microsoft.VisualStudio.Shell.WindowPane constructor then
- /// our initialization functions.
- ///
- /// Our Package instance.
- public EditorPane(ServiceProvider service, VSNDK_PackagePackage package, string fileName, IVsTextLines textBuffer)
- : base(null)
- {
- _thisPackage = package;
- _fileName = fileName;
- _textBuffer = textBuffer;
- _service = service;
- }
-
- ///
- /// Event on close of the editor pane
- ///
- protected override void OnClose()
- {
- // unhook from Undo related services
- if (_undoManager != null)
- {
- IVsLinkCapableUndoManager linkCapableUndoMgr = (IVsLinkCapableUndoManager)_undoManager;
- if (linkCapableUndoMgr != null)
- {
- linkCapableUndoMgr.UnadviseLinkedUndoClient();
- }
-
- // Throw away the undo stack etc.
- // It is important to “zombify” the undo manager when the owning object is shutting down.
- // This is done by calling IVsLifetimeControlledObject.SeverReferencesToOwner on the undoManager.
- // This call will clear the undo and redo stacks. This is particularly important to do if
- // your undo units hold references back to your object. It is also important if you use
- // "mdtStrict" linked undo transactions as this sample does (see IVsLinkedUndoTransactionManager).
- // When one object involved in linked undo transactions clears its undo/redo stacks, then
- // the stacks of the other documents involved in the linked transaction will also be cleared.
- IVsLifetimeControlledObject lco = (IVsLifetimeControlledObject)_undoManager;
- lco.SeverReferencesToOwner();
- _undoManager = null;
- }
-
- IOleComponentManager mgr = GetService(typeof(SOleComponentManager)) as IOleComponentManager;
- mgr.FRevokeComponent(_componentId);
-
- this.Dispose(true);
-
- base.OnClose();
- }
- #endregion
-
- ///
- /// Called after the WindowPane has been sited with an IServiceProvider from the environment
- ///
- protected override void Initialize()
- {
- base.Initialize();
-
- // Create and initialize the editor
- #region Register with IOleComponentManager
- IOleComponentManager componentManager = (IOleComponentManager)GetService(typeof(SOleComponentManager));
- if (this._componentId == 0 && componentManager != null)
- {
- OLECRINFO[] crinfo = new OLECRINFO[1];
- crinfo[0].cbSize = (uint)Marshal.SizeOf(typeof(OLECRINFO));
- crinfo[0].grfcrf = (uint)_OLECRF.olecrfNeedIdleTime | (uint)_OLECRF.olecrfNeedPeriodicIdleTime;
- crinfo[0].grfcadvf = (uint)_OLECADVF.olecadvfModal | (uint)_OLECADVF.olecadvfRedrawOff | (uint)_OLECADVF.olecadvfWarningsOff;
- crinfo[0].uIdleTimeInterval = 100;
- int hr = componentManager.FRegisterComponent(this, crinfo, out this._componentId);
- ErrorHandler.Succeeded(hr);
- }
- #endregion
-
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditorPane));
-
- #region Hook Undo Manager
- // Attach an IOleUndoManager to our WindowFrame. Merely calling QueryService
- // for the IOleUndoManager on the site of our IVsWindowPane causes an IOleUndoManager
- // to be created and attached to the IVsWindowFrame. The WindowFrame automaticall
- // manages to route the undo related commands to the IOleUndoManager object.
- // Thus, our only responsibilty after this point is to add IOleUndoUnits to the
- // IOleUndoManager (aka undo stack).
- _undoManager = (IOleUndoManager)GetService(typeof(SOleUndoManager));
-
- // In order to use the IVsLinkedUndoTransactionManager, it is required that you
- // advise for IVsLinkedUndoClient notifications. This gives you a callback at
- // a point when there are intervening undos that are blocking a linked undo.
- // You are expected to activate your document window that has the intervening undos.
- if (_undoManager != null)
- {
- IVsLinkCapableUndoManager linkCapableUndoMgr = (IVsLinkCapableUndoManager)_undoManager;
- if (linkCapableUndoMgr != null)
- {
- linkCapableUndoMgr.AdviseLinkedUndoClient(this);
- }
- }
- #endregion
-
- // hook up our
- XmlEditorService es = GetService(typeof(XmlEditorService)) as XmlEditorService;
- _store = es.CreateXmlStore();
- _store.UndoManager = _undoManager;
-
- _model = _store.OpenXmlModel(new Uri(_fileName));
-
- // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable,
- // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on
- // the object returned by the Content property.
- _vsDesignerControl = new VsDesignerControl(_service, new ViewModel(_thisPackage, _store, _model, this, _textBuffer));
- base.Content = _vsDesignerControl;
-
- RegisterIndependentView(true);
-
- IMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as IMenuCommandService;
- if (null != mcs)
- {
- // Now create one object derived from MenuCommnad for each command defined in
- // the CTC file and add it to the command service.
-
- // For each command we have to define its id that is a unique Guid/integer pair, then
- // create the OleMenuCommand object for this command. The EventHandler object is the
- // function that will be called when the user will select the command. Then we add the
- // OleMenuCommand to the menu service. The addCommand helper function does all this for us.
- AddCommand(mcs, VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.NewWindow,
- new EventHandler(OnNewWindow), new EventHandler(OnQueryNewWindow));
- AddCommand(mcs, VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.ViewCode,
- new EventHandler(OnViewCode), new EventHandler(OnQueryViewCode));
- }
- }
-
- ///
- /// returns the name of the file currently loaded
- ///
- public string FileName
- {
- get { return _fileName; }
- }
-
- ///
- /// Clean up any resources being used.
- ///
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- RegisterIndependentView(false);
-
- using (_model)
- {
- _model = null;
- }
- using (_store)
- {
- _store = null;
- }
- }
- base.Dispose(disposing);
- }
-
- ///
- /// Gets an instance of the RunningDocumentTable (RDT) service which manages the set of currently open
- /// documents in the environment and then notifies the client that an open document has changed
- ///
- private void NotifyDocChanged()
- {
- // Make sure that we have a file name
- if (_fileName.Length == 0)
- return;
-
- // Get a reference to the Running Document Table
- IVsRunningDocumentTable runningDocTable = (IVsRunningDocumentTable)GetService(typeof(SVsRunningDocumentTable));
-
- // Lock the document
- uint docCookie;
- IVsHierarchy hierarchy;
- uint itemID;
- IntPtr docData;
- int hr = runningDocTable.FindAndLockDocument(
- (uint)_VSRDTFLAGS.RDT_ReadLock,
- _fileName,
- out hierarchy,
- out itemID,
- out docData,
- out docCookie
- );
- ErrorHandler.ThrowOnFailure(hr);
-
- // Send the notification
- hr = runningDocTable.NotifyDocumentChanged(docCookie, (uint)__VSRDTATTRIB.RDTA_DocDataReloaded);
-
- // Unlock the document.
- // Note that we have to unlock the document even if the previous call failed.
- ErrorHandler.ThrowOnFailure(runningDocTable.UnlockDocument((uint)_VSRDTFLAGS.RDT_ReadLock, docCookie));
-
- // Check ff the call to NotifyDocChanged failed.
- ErrorHandler.ThrowOnFailure(hr);
- }
-
- ///
- /// Helper function used to add commands using IMenuCommandService
- ///
- /// The IMenuCommandService interface.
- /// This guid represents the menu group of the command.
- /// The command ID of the command.
- /// An EventHandler which will be called whenever the command is invoked.
- /// An EventHandler which will be called whenever we want to query the status of
- /// the command. If null is passed in here then no EventHandler will be added.
- private static void AddCommand(IMenuCommandService mcs, Guid menuGroup, int cmdID,
- EventHandler commandEvent, EventHandler queryEvent)
- {
- // Create the OleMenuCommand from the menu group, command ID, and command event
- CommandID menuCommandID = new CommandID(menuGroup, cmdID);
- OleMenuCommand command = new OleMenuCommand(commandEvent, menuCommandID);
-
- // Add an event handler to BeforeQueryStatus if one was passed in
- if (null != queryEvent)
- {
- command.BeforeQueryStatus += queryEvent;
- }
-
- // Add the command using our IMenuCommandService instance
- mcs.AddCommand(command);
- }
-
- ///
- /// Registers an independent view with the IVsTextManager so that it knows
- /// the user is working with a view over the text buffer. This will trigger
- /// the text buffer to prompt the user whether to reload the file if it is
- /// edited outside of the environment.
- ///
- /// True to subscribe, false to unsubscribe
- void RegisterIndependentView(bool subscribe)
- {
- IVsTextManager textManager = (IVsTextManager)GetService(typeof(SVsTextManager));
-
- if (textManager != null)
- {
- if (subscribe)
- {
- textManager.RegisterIndependentView((IVsWindowPane)this, this._textBuffer);
- }
- else
- {
- textManager.UnregisterIndependentView((IVsWindowPane)this, this._textBuffer);
- }
- }
- }
-
- ///
- /// This method loads a localized string based on the specified resource.
- ///
- /// Resource to load
- /// String loaded for the specified resource
- internal string GetResourceString(string resourceName)
- {
- string resourceValue;
- IVsResourceManager resourceManager = (IVsResourceManager)GetService(typeof(SVsResourceManager));
- if (resourceManager == null)
- {
- throw new InvalidOperationException("Could not get SVsResourceManager service. Make sure the package is Sited before calling this method");
- }
- Guid packageGuid = _thisPackage.GetType().GUID;
- int hr = resourceManager.LoadResourceString(ref packageGuid, -1, resourceName, out resourceValue);
- Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(hr);
- return resourceValue;
- }
-
- #region Commands
-
- ///
- /// On create of new window
- ///
- ///
- ///
- private void OnQueryNewWindow(object sender, EventArgs e)
- {
- OleMenuCommand command = (OleMenuCommand)sender;
- command.Enabled = true;
- }
-
- ///
- /// Create a new window
- ///
- ///
- ///
- private void OnNewWindow(object sender, EventArgs e)
- {
- NewWindow();
- }
-
- private void OnQueryViewCode(object sender, EventArgs e)
- {
- OleMenuCommand command = (OleMenuCommand)sender;
- command.Enabled = true;
- }
-
- ///
- /// Event that fires on view of code
- ///
- ///
- ///
- private void OnViewCode(object sender, EventArgs e)
- {
- ViewCode();
- }
-
- ///
- /// Method to create a new windows
- ///
- private void NewWindow()
- {
- int hr = VSConstants.S_OK;
-
- IVsUIShellOpenDocument uishellOpenDocument = (IVsUIShellOpenDocument)GetService(typeof(SVsUIShellOpenDocument));
- if (uishellOpenDocument != null)
- {
- IVsWindowFrame windowFrameOrig = (IVsWindowFrame)GetService(typeof(SVsWindowFrame));
- if (windowFrameOrig != null)
- {
- IVsWindowFrame windowFrameNew;
- Guid LOGVIEWID_Primary = Guid.Empty;
- hr = uishellOpenDocument.OpenCopyOfStandardEditor(windowFrameOrig, ref LOGVIEWID_Primary, out windowFrameNew);
- if (windowFrameNew != null)
- hr = windowFrameNew.Show();
- ErrorHandler.ThrowOnFailure(hr);
- }
- }
- }
-
- ///
- /// Method to viewcode
- ///
- private void ViewCode()
- {
- Guid XmlTextEditorGuid = new Guid("FA3CD31E-987B-443A-9B81-186104E8DAC1");
-
- // Open the referenced document using our editor.
- IVsWindowFrame frame;
- IVsUIHierarchy hierarchy;
- uint itemid;
- VsShellUtilities.OpenDocumentWithSpecificEditor(this, _model.Name,
- XmlTextEditorGuid, VSConstants.LOGVIEWID_Primary, out hierarchy, out itemid, out frame);
- ErrorHandler.ThrowOnFailure(frame.Show());
- }
-
- #endregion
-
- #region IVsLinkedUndoClient
-
- public int OnInterveningUnitBlockingLinkedUndo()
- {
- return VSConstants.E_FAIL;
- }
-
- #endregion
-
- #region IVsDeferredDocView
-
- ///
- /// Assigns out parameter with the Guid of the EditorFactory.
- ///
- /// The output parameter that receives a value of the Guid of the EditorFactory.
- /// S_OK if Marshal operations completed successfully.
- int IVsDeferredDocView.get_CmdUIGuid(out Guid pGuidCmdId)
- {
- pGuidCmdId = GuidList.guidVSNDK_PackageEditorFactory;
- return VSConstants.S_OK;
- }
-
- ///
- /// Assigns out parameter with the document view being implemented.
- ///
- /// The parameter that receives a reference to current view.
- /// S_OK if Marshal operations completed successfully.
- [EnvironmentPermission(SecurityAction.Demand)]
- int IVsDeferredDocView.get_DocView(out IntPtr ppUnkDocView)
- {
- ppUnkDocView = Marshal.GetIUnknownForObject(this);
- return VSConstants.S_OK;
- }
-
- #endregion
-
- #region IOleComponent
-
- int IOleComponent.FContinueMessageLoop(uint uReason, IntPtr pvLoopData, MSG[] pMsgPeeked)
- {
- return VSConstants.S_OK;
- }
-
- int IOleComponent.FDoIdle(uint grfidlef)
- {
- if (_vsDesignerControl != null)
- {
- _vsDesignerControl.DoIdle();
- }
- return VSConstants.S_OK;
- }
-
- int IOleComponent.FPreTranslateMessage(MSG[] pMsg)
- {
- return VSConstants.S_OK;
- }
-
- int IOleComponent.FQueryTerminate(int fPromptUser)
- {
- return 1; //true
- }
-
- int IOleComponent.FReserved1(uint dwReserved, uint message, IntPtr wParam, IntPtr lParam)
- {
- return VSConstants.S_OK;
- }
-
- IntPtr IOleComponent.HwndGetWindow(uint dwWhich, uint dwReserved)
- {
- return IntPtr.Zero;
- }
-
- void IOleComponent.OnActivationChange(IOleComponent pic, int fSameComponent, OLECRINFO[] pcrinfo, int fHostIsActivating, OLECHOSTINFO[] pchostinfo, uint dwReserved) { }
- void IOleComponent.OnAppActivate(int fActive, uint dwOtherThreadID) { }
- void IOleComponent.OnEnterState(uint uStateID, int fEnter) { }
- void IOleComponent.OnLoseActivation() { }
- void IOleComponent.Terminate() { }
-
- #endregion
- }
-}
diff --git a/src/VSNDK.Package/GlobalFunctions.cs b/src/VSNDK.Package/GlobalFunctions.cs
deleted file mode 100644
index fb6f5078..00000000
--- a/src/VSNDK.Package/GlobalFunctions.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Security.Cryptography;
-using System.IO;
-
-namespace RIM.VSNDK_Package
-{
- public static class GlobalFunctions
- {
- ///
- /// function to check if user is online.
- /// Needs to be online for UpdateManager to work.
- ///
- ///
- public static bool isOnline()
- {
- try
- {
- System.Net.IPHostEntry ipHostEntry = System.Net.Dns.GetHostEntry("downloads.blackberry.com");
- return true;
- }
- catch (System.Net.Sockets.SocketException)
- {
- return false;
- }
- }
-
- public static string bbndkPathConst = Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)) + "bbndk_vs";
-
- ///
- /// Encrypts a given password and returns the encrypted data
- /// as a base64 string.
- ///
- /// An unencrypted string that needs
- /// to be secured.
- /// A base64 encoded string that represents the encrypted
- /// binary data.
- ///
- /// This solution is not really secure as we are
- /// keeping strings in memory. If runtime protection is essential,
- /// should be used.
- /// If
- /// is a null reference.
- public static string Encrypt(string plainText)
- {
- if (plainText == null) throw new ArgumentNullException("plainText");
-
- //encrypt data
- var data = Encoding.Unicode.GetBytes(plainText);
- byte[] encrypted = ProtectedData.Protect(data, null, DataProtectionScope.LocalMachine);
-
- //return as base64 string
- return Convert.ToBase64String(encrypted);
- }
-
- ///
- /// Decrypts a given string.
- ///
- /// A base64 encoded string that was created
- /// through the or
- /// extension methods.
- /// The decrypted string.
- /// Keep in mind that the decrypted string remains in memory
- /// and makes your application vulnerable per se. If runtime protection
- /// is essential, should be used.
- /// If
- /// is a null reference.
- public static string Decrypt(string cipher)
- {
- if (cipher == null) throw new ArgumentNullException("cipher");
-
- //parse base64 string
- byte[] data = Convert.FromBase64String(cipher);
-
- //decrypt data
- byte[] decrypted = ProtectedData.Unprotect(data, null, DataProtectionScope.LocalMachine);
-
- return Encoding.Unicode.GetString(decrypted);
- }
-
- }
-}
diff --git a/src/VSNDK.Package/GlobalSuppressions.cs b/src/VSNDK.Package/GlobalSuppressions.cs
deleted file mode 100644
index 6455558e..00000000
--- a/src/VSNDK.Package/GlobalSuppressions.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-// This file is used by Code Analysis to maintain SuppressMessage
-// attributes that are applied to this project. Project-level
-// suppressions either have no target or are given a specific target
-// and scoped to a namespace, type, member, etc.
-//
-// To add a suppression to this file, right-click the message in the
-// Error List, point to "Suppress Message(s)", and click "In Project
-// Suppression File". You do not need to add suppressions to this
-// file manually.
-
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1017:MarkAssembliesWithComVisible")]
diff --git a/src/VSNDK.Package/Guids.cs b/src/VSNDK.Package/Guids.cs
deleted file mode 100644
index 40f4a21c..00000000
--- a/src/VSNDK.Package/Guids.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-// Guids.cs
-// MUST match guids.h
-using System;
-
-namespace RIM.VSNDK_Package
-{
- static class GuidList
- {
- public const string guidVSNDK_PackagePkgString = "db9f9c5f-fb27-4297-ab44-fa8774e962ca";
- public const string guidVSNDK_PackageCmdSetString = "d531fe01-f48e-443d-8ea1-1530a352525f";
- public const string guidToolWindowPersistanceString = "87346a4d-fbf2-46ff-8f59-31915e39cfb9";
- public const string guidVSNDK_PackageEditorFactoryString = "9e985c5e-5b53-4cb1-bcd0-40a56f18eb4d";
- public const string guidVsTemplateDesignerEditorFactoryString = "6bf3ea12-98bb-41e2-ba01-8662f713d293";
-
- public const string guidVSStd97String = "{5efc7975-14bc-11cf-9b2b-00aa00573819}";
- public const string guidVSStd2KString = "{1496A755-94DE-11D0-8C3F-00C04FC2AAE2}";
- public const string guidVSDebugGroup = "{C9DD4A59-47FB-11D2-83E7-00C04F9902C1}";
-
- public static readonly Guid guidVSNDK_PackageCmdSet = new Guid(guidVSNDK_PackageCmdSetString);
- public static readonly Guid guidVSNDK_PackageEditorFactory = new Guid(guidVsTemplateDesignerEditorFactoryString);
- public static readonly Guid guidTest = new Guid(guidVSStd2KString);
- };
-}
\ No newline at end of file
diff --git a/src/VSNDK.Package/IViewModel.cs b/src/VSNDK.Package/IViewModel.cs
deleted file mode 100644
index 390f03d2..00000000
--- a/src/VSNDK.Package/IViewModel.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.VisualStudio.XmlEditor;
-using System.ComponentModel;
-using System.Windows.Data;
-using System.IO;
-
-namespace RIM.VSNDK_Package
-{
- ///
- /// Implementation of the IViewModel interface
- ///
- public interface IViewModel
- {
- ///
- /// Form Properties
- ///
- string Name { get; set; }
- string AppName { get; set; }
- string Description { get; set; }
- string Version { get; set; }
- string BuildID { get; set; }
- string Author { get; set; }
- string AuthorID { get; set; }
- List AssetList { get; }
-
- XmlModel Model { get; }
-
- string Chrome { get; set; }
- bool Transparent { get; set; }
-
- event EventHandler ViewModelChanged;
-
- void DoIdle();
- void AddIcon(FileInfo icon);
- void DeleteIcon(object iconName);
- void AddSplashScreen(FileInfo iconName);
- void DeleteSplashScreen(object iconName);
- void AddLocalAsset(string newAsset);
- void DeleteLocalAsset(object removeAsset);
- void EditLocalAsset(string identifier, bool? isPublic, string assetType);
-
- void Close();
-
- void CheckPermission(string identifier);
- void UnCheckPermission(string identifier);
- void setAuthorInfo();
-
- void OnSelectChanged(object p);
- }
-}
diff --git a/src/VSNDK.Package/Import/Import.xaml b/src/VSNDK.Package/Import/Import.xaml
deleted file mode 100644
index 184245fd..00000000
--- a/src/VSNDK.Package/Import/Import.xaml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Package/Import/Import.xaml.cs b/src/VSNDK.Package/Import/Import.xaml.cs
deleted file mode 100644
index 5222f1b5..00000000
--- a/src/VSNDK.Package/Import/Import.xaml.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-using Microsoft.VisualStudio.PlatformUI;
-using Microsoft.Win32;
-using System.IO;
-using System.Xml;
-using System.Windows.Forms;
-using PkgResources = RIM.VSNDK_Package.Resources;
-using RIM.VSNDK_Package.Import.Model;
-using EnvDTE;
-
-namespace RIM.VSNDK_Package.Import
-{
- ///
- /// Interaction logic for Window1.xaml
- ///
- public partial class Import : DialogWindow
- {
-
- private Project _project;
- private string _sourceDir;
- private string _destDir;
-
- ///
- /// Import Constructor
- ///
- public Import()
- {
- InitializeComponent();
- }
-
- ///
- /// Import Constructor
- ///
- /// Reference to project.
- /// Source Directory to import from.
- /// Destination Directory to import to.
- public Import(Project project, string sourceDir, string destDir)
- {
- InitializeComponent();
-
- _project = project;
- _sourceDir = sourceDir;
- _destDir = destDir;
- }
-
- ///
- /// Display the dialog in Model form and start import process.
- ///
- public void ShowModel2()
- {
- this.Show();
-
- FileInfo projectDir = new FileInfo(_destDir);
- DirectoryInfo source = new DirectoryInfo(_sourceDir);
- DirectoryInfo destination = new DirectoryInfo(projectDir.DirectoryName);
-
- ImportModel data = gridMain.DataContext as ImportModel;
- if (data != null)
- {
- data.AddSummaryString("Starting Conversion Process");
- if (data.WalkDirectoryTree(_project, source, destination, null))
- {
- data.AddBlackBerryConfigurations(_project);
- }
- data.AddSummaryString("Conversion Process Completed");
- }
- }
-
- ///
- /// Close the dialog.
- ///
- ///
- ///
- private void btnOK_Click(object sender, RoutedEventArgs e)
- {
- this.Close();
- }
- }
-}
diff --git a/src/VSNDK.Package/Import/ImportDictionary.xaml b/src/VSNDK.Package/Import/ImportDictionary.xaml
deleted file mode 100644
index ffd88866..00000000
--- a/src/VSNDK.Package/Import/ImportDictionary.xaml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Package/Import/Model/ImportModel.cs b/src/VSNDK.Package/Import/Model/ImportModel.cs
deleted file mode 100644
index 743d0a1b..00000000
--- a/src/VSNDK.Package/Import/Model/ImportModel.cs
+++ /dev/null
@@ -1,296 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.ComponentModel;
-using System.Collections;
-using Microsoft.Win32;
-using PkgResources = RIM.VSNDK_Package.Resources;
-using System.Xml;
-using System.Security.Cryptography;
-using System.IO;
-using System.Windows.Data;
-using EnvDTE;
-using Microsoft.VisualStudio.VCProjectEngine;
-using System.Diagnostics;
-
-namespace RIM.VSNDK_Package.Import.Model
-{
- ///
- /// DataModel Class for the Import Dialog
- ///
- class ImportModel : INotifyPropertyChanged
- {
- #region Member Variables and Constants
- private const string _colSumaryString = "SummaryString";
- private const string BLACKBERRY = "BlackBerry";
- private const string BLACKBERRYSIMULATOR = "BlackBerrySimulator";
-
- private IList _summaryList;
- private CollectionView _summaryString;
- #endregion
-
- ///
- /// ImportModel Constructor
- ///
- public ImportModel()
- {
- _summaryList = new List();
- _summaryList.Add("Conversion Summary");
- }
-
-
- #region Properties
-
- ///
- /// Getter/Setter for the SummaryString Property
- ///
- public CollectionView SummaryString
- {
- get { return _summaryString; }
- set
- {
- _summaryString = value;
- OnPropertyChanged(_colSumaryString);
- }
- }
-
- #endregion
-
- ///
- /// Helper function to add a summary string to the list
- ///
- ///
- public void AddSummaryString(string entry)
- {
- _summaryList.Add(entry);
- SummaryString = new CollectionView(_summaryList);
- }
-
- ///
- /// Recursive Function to walk a specified directory tree and add the files into a Visual Studio C project.
- ///
- /// Destination Project
- /// Source Directory to begin walking
- /// Destination Directory of new project to copy files to
- /// VCFilter object to add files to
- ///
- public bool WalkDirectoryTree(Project proj, DirectoryInfo sourceDir, DirectoryInfo destinationDir, VCFilter filter)
- {
- VCFilter localFilter = filter;
- System.IO.FileInfo[] files = null;
- System.IO.DirectoryInfo[] subDirs = null;
-
- // First, process all the files directly under this folder
- try
- {
- files = sourceDir.GetFiles("*.*");
-
- foreach (FileInfo file in files)
- {
- if (file.Name.Contains("vcxproj"))
- {
- AddSummaryString("Selected project already converted.");
- return false;
- }
- }
- }
- catch (UnauthorizedAccessException e)
- {
- return false;
- }
-
- if (files != null)
- {
- // Now find all the subdirectories under this directory.
- subDirs = sourceDir.GetDirectories();
-
- if (localFilter == null)
- {
- foreach (System.IO.DirectoryInfo dirInfo in subDirs)
- {
- if (dirInfo.Name == "src")
- {
- IVCCollection tmpCollection;
- VCFilter tmpFilter;
- tmpCollection = (proj.Object as VCProject).Filters;
- tmpFilter = tmpCollection.Item("Source Files");
- (proj.Object as VCProject).RemoveFilter(tmpFilter);
- }
- if (dirInfo.Name == "res")
- {
- IVCCollection tmpCollection;
- VCFilter tmpFilter;
- tmpCollection = (proj.Object as VCProject).Filters;
- tmpFilter = tmpCollection.Item("Resource Files");
- (proj.Object as VCProject).RemoveFilter(tmpFilter);
- }
- }
- }
-
- foreach (System.IO.FileInfo fi in files)
- {
- AddFileToProject(proj, fi.FullName, destinationDir.FullName, localFilter);
- }
-
- foreach (System.IO.DirectoryInfo dirInfo in subDirs)
- {
- VCFilter newFilter = AddFolderToProject(proj, destinationDir.FullName, dirInfo.Name, localFilter);
- // Resursive call for each subdirectory.
- DirectoryInfo source = new DirectoryInfo(dirInfo.FullName);
- DirectoryInfo destination = new DirectoryInfo(Path.Combine(destinationDir.FullName, dirInfo.Name));
- if (!WalkDirectoryTree(proj, source, destination, newFilter))
- return false;
- }
-
- }
- return true;
- }
-
- ///
- /// Add File to specified project
- ///
- ///
- private void AddFileToProject(Project proj, string source, string destination, VCFilter filter)
- {
- VCFilter localFilter = filter;
-
- try
- {
- FileInfo fileInfo1 = new FileInfo(source);
-
- if (!File.Exists(System.IO.Path.Combine(destination, fileInfo1.Name)))
- {
- File.Copy(source, System.IO.Path.Combine(destination, fileInfo1.Name));
- }
-
- if ((fileInfo1.Name != ".cproject") && (fileInfo1.Name != ".project"))
- {
- if (localFilter == null)
- {
- if (proj.ProjectItems.Item(fileInfo1.Name) == null)
- {
- proj.ProjectItems.AddFromFileCopy(System.IO.Path.Combine(destination, fileInfo1.Name));
- AddSummaryString("Project File Added: " + System.IO.Path.Combine(destination, fileInfo1.Name));
- }
- else
- {
- AddSummaryString("Duplicate File: " + System.IO.Path.Combine(destination, fileInfo1.Name));
- }
- }
- else
- {
- IVCCollection tmpCollection;
- tmpCollection = localFilter.Files;
-
- if (tmpCollection.Item(fileInfo1.Name) == null)
- {
- localFilter.AddFile(System.IO.Path.Combine(destination, fileInfo1.Name));
- AddSummaryString("Project File Added: " + System.IO.Path.Combine(destination, fileInfo1.Name));
- }
- else
- {
- AddSummaryString("Duplicate File: " + System.IO.Path.Combine(destination, fileInfo1.Name));
- }
-
- }
-
- }
- else
- {
- AddSummaryString("File Skipped: " + System.IO.Path.Combine(destination, fileInfo1.Name));
- }
-
- }
- catch (Exception e)
- {
-
- }
- }
-
- ///
- /// Add Folder to Specified Project
- ///
- ///
- private VCFilter AddFolderToProject(Project proj, string dirInfo, string newDir, VCFilter filter)
- {
- VCFilter localFilter = filter;
-
- try
- {
- DirectoryInfo directoryInfo1 = new DirectoryInfo(dirInfo);
- directoryInfo1.CreateSubdirectory(newDir);
- if (localFilter == null)
- {
- localFilter = (proj.Object as VCProject).AddFilter(newDir);
- }
- else
- {
- localFilter = localFilter.AddFilter(newDir);
- }
-
- AddSummaryString("Folder Added: " + newDir);
- }
- catch (Exception e)
- {
- string error = e.Message;
- }
-
- return localFilter;
- }
-
- ///
- /// add blackberry configurations
- ///
- ///
- public void AddBlackBerryConfigurations(Project proj)
- {
- try
- {
- ConfigurationManager mgr = proj.ConfigurationManager;
- Configurations cfgs = mgr.AddPlatform(BLACKBERRY, "Win32", true);
- AddSummaryString("Added BlackBerry Configuration");
- cfgs = mgr.AddPlatform(BLACKBERRYSIMULATOR, "Win32", true);
- AddSummaryString("Added BlackBerry Simulator Configuration");
- mgr.DeletePlatform("Win32");
- }
- catch (Exception e)
- {
- Debug.WriteLine(e.Message);
- }
- }
-
- #region INotifyPropertyChanged Implementation
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- ///
- /// Fire the PropertyChnaged event handler on change of property
- ///
- ///
- protected void OnPropertyChanged(string propName)
- {
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs(propName));
- }
- }
-
- #endregion
-
- }
-}
diff --git a/src/VSNDK.Package/Logger.cs b/src/VSNDK.Package/Logger.cs
deleted file mode 100644
index 88dae13c..00000000
--- a/src/VSNDK.Package/Logger.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace RIM.VSNDK_Package
-{
- class Logger
- {
- private System.IO.StreamWriter file;
-
- public Logger()
- {
-
- }
-
- public void LogToFile(string targetPath, string line)
- {
- file = new System.IO.StreamWriter(targetPath, true);
- file.WriteLine(line);
- file.Close();
- }
- }
-}
diff --git a/src/VSNDK.Package/NameValueCollectionHelper.cs b/src/VSNDK.Package/NameValueCollectionHelper.cs
deleted file mode 100644
index 2ab96a9f..00000000
--- a/src/VSNDK.Package/NameValueCollectionHelper.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Collections.Specialized;
-
-namespace VSNDK.Package
-{
- ///
- ///
- ///
- public static class NameValueCollectionHelper
- {
-
- ///
- ///
- ///
- ///
- ///
- public static string DumpToString(NameValueCollection value)
- {
- var xSB = new StringBuilder();
- foreach (string xKey in value.Keys)
- {
- xSB.AppendFormat("{0}={1};", xKey, (string)value[xKey]);
- }
- return xSB.ToString();
- }
-
-
- ///
- ///
- ///
- ///
- ///
- public static void LoadFromString(NameValueCollection target, string value)
- {
- if (target.Count > 0)
- {
- throw new Exception("Target is not empty!");
- }
- if (String.IsNullOrEmpty(value))
- {
- return;
- }
-
- string[] xPairs = value.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
- foreach (var xPair in xPairs)
- {
- string[] xParts = xPair.Split('=');
- if (xParts.Length > 1)
- {
- target.Add(xParts[0], xParts[1]);
- }
- else
- {
- target.Add(xParts[0], "");
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/VSNDK.Package/NativeMethods.cs b/src/VSNDK.Package/NativeMethods.cs
deleted file mode 100644
index ac1b4620..00000000
--- a/src/VSNDK.Package/NativeMethods.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace RIM.VSNDK_Package
-{
- ///
- /// This class will contain all methods that we need to import.
- ///
- internal class NativeMethods
- {
- public const int WM_LBUTTONDOWN = 0x0201;
- public const int WM_LBUTTONDBLCLK = 0x0203;
- public const int WM_RBUTTONDOWN = 0x0204;
- public const int WM_MBUTTONDOWN = 0x0207;
-
- //Including a private constructor to prevent a compiler-generated default constructor
- private NativeMethods()
- {
- }
-
- // Import the SendMessage function from user32.dll
- [DllImport("user32.dll")]
- public static extern IntPtr SendMessage(IntPtr hwnd,
- int Msg,
- IntPtr wParam,
- [MarshalAs(UnmanagedType.IUnknown)] out object lParam);
- }
-}
\ No newline at end of file
diff --git a/src/VSNDK.Package/PkgCmdID.cs b/src/VSNDK.Package/PkgCmdID.cs
deleted file mode 100644
index 552d7723..00000000
--- a/src/VSNDK.Package/PkgCmdID.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-// PkgCmdID.cs
-// MUST match PkgCmdID.h
-using System;
-
-namespace RIM.VSNDK_Package
-{
- static class PkgCmdIDList
- {
- public const uint cmdidBlackBerryTools = 0x0100;
- public const uint cmdidBlackBerrySettings = 0x0101;
- public const uint cmdidBlackBerryDebugToken = 0x0103;
- public const uint cmdidBlackBerryProjectImport = 0x0104;
-
- public const int cmdidfooLocalBox = 0x0200;
-
-
-
- };
-}
\ No newline at end of file
diff --git a/src/VSNDK.Package/Properties/AssemblyInfo.cs b/src/VSNDK.Package/Properties/AssemblyInfo.cs
deleted file mode 100644
index 028cbfa5..00000000
--- a/src/VSNDK.Package/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("VSNDK.Package")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("RIM")]
-[assembly: AssemblyProduct("VSNDK.Package")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: ComVisible(false)]
-[assembly: CLSCompliant(false)]
-[assembly: NeutralResourcesLanguage("en-US")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
-
-[assembly: InternalsVisibleTo("VSNDK.Package_IntegrationTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f5a9bc4f77b74406a37bfd1c314ff87e73c3404311e95f1647205a3f7999c2454f3c816605cdccadcfe97dd444464057a267f838f84329235313cbaa186299f30d0db843613692df338a72829294dbba2bd2ed08e22863aeba0a5b69bb8a96cf558bb0230e590b2122555bddd35088248726a1ca953ca6f7bbfd6f8ce971aec7")]
-[assembly: InternalsVisibleTo("VSNDK.Package_UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f5a9bc4f77b74406a37bfd1c314ff87e73c3404311e95f1647205a3f7999c2454f3c816605cdccadcfe97dd444464057a267f838f84329235313cbaa186299f30d0db843613692df338a72829294dbba2bd2ed08e22863aeba0a5b69bb8a96cf558bb0230e590b2122555bddd35088248726a1ca953ca6f7bbfd6f8ce971aec7")]
diff --git a/src/VSNDK.Package/Resources.Designer.cs b/src/VSNDK.Package/Resources.Designer.cs
deleted file mode 100644
index e3460bdb..00000000
--- a/src/VSNDK.Package/Resources.Designer.cs
+++ /dev/null
@@ -1,225 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.18052
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace RIM.VSNDK_Package {
- using System;
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources() {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RIM.VSNDK_Package.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- ///
- /// Looks up a localized string similar to You have to specify the Author name.
- ///
- internal static string AuthorMissing {
- get {
- return ResourceManager.GetString("AuthorMissing", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to It is important that you back up your signing keys. If you should lose your signing keys, or forget your password, you will be required to re-register with BlackBerry. After re-registering, new versions of your applications will appear as new applications, and will not have access to shared data from previous versions. Exporting your signing keys will also allow you to import them to multiple computers allow you to sign from any of them..
- ///
- internal static string BackupRestoreInfo {
- get {
- return ResourceManager.GetString("BackupRestoreInfo", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Can not create tool window..
- ///
- internal static string CanNotCreateWindow {
- get {
- return ResourceManager.GetString("CanNotCreateWindow", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to You have to specify a confirm password.
- ///
- internal static string CSJConfirmPasswordMissing {
- get {
- return ResourceManager.GetString("CSJConfirmPasswordMissing", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to You have to specify BlackBerry ID token password and it must be at least 6 characters long.
- ///
- internal static string CSJPasswordMissing {
- get {
- return ResourceManager.GetString("CSJPasswordMissing", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to You have to provide the Pin.
- ///
- internal static string CSJPinMissing {
- get {
- return ResourceManager.GetString("CSJPinMissing", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to bar-descriptor Designer.
- ///
- internal static string ErrorMessageBoxTitle {
- get {
- return ResourceManager.GetString("ErrorMessageBoxTitle", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Errors.
- ///
- internal static string Errors {
- get {
- return ResourceManager.GetString("Errors", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Info.
- ///
- internal static string Info {
- get {
- return ResourceManager.GetString("Info", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The vstemplate file you are attempting to load is missing TemplateData.
- ///
- internal static string InvalidVsTemplateData {
- get {
- return ResourceManager.GetString("InvalidVsTemplateData", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Please check if the Natvie SDK is installed..
- ///
- internal static string NativSDKNotInstalled {
- get {
- return ResourceManager.GetString("NativSDKNotInstalled", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The Passwords do not match..
- ///
- internal static string PasswordNotmatch {
- get {
- return ResourceManager.GetString("PasswordNotmatch", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to RDK CSJ file is required!.
- ///
- internal static string RDKCSJFileMissing {
- get {
- return ResourceManager.GetString("RDKCSJFileMissing", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Reformat.
- ///
- internal static string ReformatBuffer {
- get {
- return ResourceManager.GetString("ReformatBuffer", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Please, enter the "Author Name" and the password that was used to create the BlackBerry ID token..
- ///
- internal static string RegistrationInfo {
- get {
- return ResourceManager.GetString("RegistrationInfo", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Synchronize XML file with view.
- ///
- internal static string SynchronizeBuffer {
- get {
- return ResourceManager.GetString("SynchronizeBuffer", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Signing.
- ///
- internal static string ToolWindowTitle {
- get {
- return ResourceManager.GetString("ToolWindowTitle", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Do you want to unregister and remove the BlackBerry ID Token file?.
- ///
- internal static string UnRegistrationInfo {
- get {
- return ResourceManager.GetString("UnRegistrationInfo", resourceCulture);
- }
- }
- }
-}
diff --git a/src/VSNDK.Package/Resources.resx b/src/VSNDK.Package/Resources.resx
deleted file mode 100644
index f36f2e36..00000000
--- a/src/VSNDK.Package/Resources.resx
+++ /dev/null
@@ -1,174 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- Can not create tool window.
-
-
- You have to specify a confirm password
-
-
- You have to specify BlackBerry ID token password and it must be at least 6 characters long
-
-
- You have to provide the Pin
-
-
- You have to specify the Author name
-
-
- Errors
-
-
- Info
-
-
- Please check if the Natvie SDK is installed.
-
-
- The Passwords do not match.
-
-
- RDK CSJ file is required!
-
-
- Signing
-
-
- It is important that you back up your signing keys. If you should lose your signing keys, or forget your password, you will be required to re-register with BlackBerry. After re-registering, new versions of your applications will appear as new applications, and will not have access to shared data from previous versions. Exporting your signing keys will also allow you to import them to multiple computers allow you to sign from any of them.
-
-
- Please, enter the "Author Name" and the password that was used to create the BlackBerry ID token.
-
-
- Do you want to unregister and remove the BlackBerry ID Token file?
-
-
- bar-descriptor Designer
-
-
- The vstemplate file you are attempting to load is missing TemplateData
-
-
- Reformat
-
-
- Synchronize XML file with view
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Package/Resources/File.ico b/src/VSNDK.Package/Resources/File.ico
deleted file mode 100644
index d6104fc5..00000000
Binary files a/src/VSNDK.Package/Resources/File.ico and /dev/null differ
diff --git a/src/VSNDK.Package/Resources/Package.ico b/src/VSNDK.Package/Resources/Package.ico
deleted file mode 100644
index ea3b23fe..00000000
Binary files a/src/VSNDK.Package/Resources/Package.ico and /dev/null differ
diff --git a/src/VSNDK.Package/Settings/Model/SettingsData.cs b/src/VSNDK.Package/Settings/Model/SettingsData.cs
deleted file mode 100644
index 0bfeefdd..00000000
--- a/src/VSNDK.Package/Settings/Model/SettingsData.cs
+++ /dev/null
@@ -1,431 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.ComponentModel;
-using System.Collections;
-using Microsoft.Win32;
-using System.Xml;
-using System.IO;
-using System.Windows.Data;
-using Microsoft.VisualStudio.Shell;
-
-namespace RIM.VSNDK_Package.Settings.Models
-{
- ///
- /// Class the story a new NDK configuration entry.
- ///
- public class NDKEntryClass
- {
- public string NDKName { get; set; }
- public string HostPath { get; set; }
- public string TargetPath { get; set; }
- public NDKEntryClass(string name, string host, string target)
- {
- NDKName = name;
- HostPath = host;
- TargetPath = target;
- }
- }
-
- ///
- /// Data Model Class for the Settings Dialog
- ///
- public class SettingsData : INotifyPropertyChanged
- {
- #region Member Variables and Constants
- private string _deviceIP;
- private string _devicePassword;
- private Package _pkg;
- private string _simulatorIP;
- private string _simulatorPassword;
- private CollectionView _ndkEntries;
- private NDKEntryClass _ndkEntry = new NDKEntryClass("", "", "");
-
- private string _targetPath;
- private string _hostPath;
-
- private const string _colDeviceIP = "DeviceIP";
- private const string _colDevicePW = "DevicePassword";
- private const string _colSimulatorIP = "SimulatorIP";
- private const string _colSimulatorPW = "SimulatorPassword";
- private const string _colNDKEntry = "NDKEntry";
- #endregion
-
- ///
- /// SettingsData Constructor
- ///
- public SettingsData()
- {
- getDeviceInfo();
- getSimulatorInfo();
- RefreshScreen();
- }
-
- ///
- /// Refresh the screen
- ///
- public void RefreshScreen()
- {
- /// Get the NDK Path data
- getNDKPath();
-
- /// Refresh the NDK List
- string[] dirPaths = new string[2];
- dirPaths[0] = Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)) + @"bbndk_vs\..\qconfig\";
- dirPaths[1] = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK\qconfig\";
- IList NDKList = new List();
-
- for (int i = 0; i < 2; i++)
- {
- if (!Directory.Exists(dirPaths[i]))
- continue;
-
- string[] filePaths = Directory.GetFiles(dirPaths[i], "*.xml");
-
- foreach (string file in filePaths)
- {
- try
- {
- XmlDocument xmlDoc = new XmlDocument();
- xmlDoc.Load(file);
- string name = xmlDoc.GetElementsByTagName("name")[0].InnerText;
- string hostpath = xmlDoc.GetElementsByTagName("host")[0].InnerText;
- string targetpath = xmlDoc.GetElementsByTagName("target")[0].InnerText;
- NDKEntryClass NDKEntry = new NDKEntryClass(name, hostpath, targetpath);
- NDKList.Add(NDKEntry);
-
- if (NDKEntry.HostPath == HostPath)
- {
- NDKEntryClass = NDKEntry;
- }
-
- }
- catch
- {
- break;
- }
- }
- }
-
- NDKEntries = new CollectionView(NDKList);
- }
-
- ///
- /// return API Name
- ///
- /// version to match
- ///
- public string getAPIName(string version)
- {
- string result = "";
-
- APITargetListSingleton ap = APITargetListSingleton.Instance;
-
- foreach (APITargetClass target in ap._tempAPITargetList)
- {
- if (target.TargetVersion == version)
- {
- result = target.TargetName;
- break;
- }
- }
-
- return result;
-
- }
-
- #region Properties
-
- ///
- /// Getter/Setter for the DeviceIP property
- ///
- public string DeviceIP
- {
- get { return _deviceIP; }
- set { _deviceIP = value; OnPropertyChanged(_colDeviceIP); }
- }
-
- ///
- /// Getter Setter for the TargetPath
- ///
- public string TargetPath
- {
- get { return _targetPath; }
- set { _targetPath = value; }
- }
-
- ///
- /// Getter Setter for the HostPath
- ///
- public string HostPath
- {
- get { return _hostPath; }
- set { _hostPath = value; }
- }
-
- ///
- /// Getter/Setter for the DevicePassword property
- ///
- public string DevicePassword
- {
- get { return _devicePassword; }
- set { _devicePassword = value; OnPropertyChanged(_colDevicePW); }
- }
-
- ///
- /// Getter/Setter for the SimulatorIP property
- ///
- public string SimulatorIP
- {
- get { return _simulatorIP; }
- set { _simulatorIP = value; OnPropertyChanged(_colSimulatorIP); }
- }
-
- ///
- /// Getter/Setter for the SimulatorPassword property
- ///
- public string SimulatorPassword
- {
- get { return _simulatorPassword; }
- set { _simulatorPassword = value; OnPropertyChanged(_colSimulatorPW); }
- }
-
- ///
- /// Getter for the NDKEntries property
- ///
- public CollectionView NDKEntries
- {
- get { return _ndkEntries; }
- set { _ndkEntries = value; }
- }
-
- ///
- /// Getter/Setter for the NDKEntryClass property
- ///
- public NDKEntryClass NDKEntryClass
- {
- get { return _ndkEntry; }
- set
- {
- if (_ndkEntry == value) return;
- _ndkEntry = value;
- OnPropertyChanged(_colNDKEntry);
- }
- }
-
- #endregion
-
- ///
- /// Set Device Password and IP
- ///
- ///
- public void setDeviceInfo()
- {
- registerTargetInfo(DevicePassword, DeviceIP, "device");
- }
-
- ///
- /// Set Simulator Password and IP
- ///
- ///
- public void setSimulatorInfo()
- {
- registerTargetInfo(SimulatorPassword, SimulatorIP, "simulator");
- }
-
- ///
- /// Function to retrieve device info from the registry
- ///
- ///
- public void getDeviceInfo()
- {
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkSettingsPath = null;
-
- try
- {
- rkSettingsPath = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
-
- object pwd = rkSettingsPath.GetValue("device_password");
- if (pwd != null)
- DevicePassword = GlobalFunctions.Decrypt(pwd.ToString());
-
- object ip = rkSettingsPath.GetValue("device_IP");
- if (ip != null)
- DeviceIP = ip.ToString();
- }
- catch
- {
-
- }
-
- rkSettingsPath.Close();
- rkHKCU.Close();
- }
-
- ///
- /// Function to retrieve simulator info from the registry
- ///
- ///
- public void getSimulatorInfo()
- {
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkSettingsPath = null;
-
- try
- {
- rkSettingsPath = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
-
- object pwd = rkSettingsPath.GetValue("simulator_password");
- if (pwd != null)
- SimulatorPassword = GlobalFunctions.Decrypt(pwd.ToString());
-
- object ip = rkSettingsPath.GetValue("simulator_IP");
- if (ip != null)
- SimulatorIP = ip.ToString();
- }
- catch
- {
-
- }
-
- rkSettingsPath.Close();
- rkHKCU.Close();
- }
-
-
- ///
- /// Set the password and IP address into the correct registry keys for both simulator and device
- ///
- /// The password to encrypt and store.
- /// The IP Address to store.
- /// The key location device or simulator.
- private void registerTargetInfo(string password, string IP, string type)
- {
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkTargetInfo = null;
-
- try
- {
- rkTargetInfo = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- if (password == null)
- password = "";
-
- if (IP == null)
- IP = "";
-
- rkTargetInfo.SetValue(type + "_password", GlobalFunctions.Encrypt(password));
- rkTargetInfo.SetValue(type + "_IP", IP);
- }
- catch
- {
-
- }
- finally
- {
- rkTargetInfo.Close();
- rkHKCU.Close();
- }
- }
-
- ///
- /// Set the NDK Path into the register for future reference by the MSBUILD
- ///
- public void setNDKPaths()
- {
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkNDKPath = null;
-
- try
- {
- rkNDKPath = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- rkNDKPath.SetValue("NDKHostPath", _ndkEntry.HostPath);
- rkNDKPath.SetValue("NDKTargetPath", _ndkEntry.TargetPath);
-
- string qnx_config = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK";
-
- System.Environment.SetEnvironmentVariable("QNX_TARGET", _ndkEntry.TargetPath);
- System.Environment.SetEnvironmentVariable("QNX_HOST", _ndkEntry.HostPath);
- System.Environment.SetEnvironmentVariable("QNX_CONFIGURATION", qnx_config);
-
- string ndkpath = string.Format(@"{0}/usr/bin;{1}\bin;{0}/usr/qde/eclipse/jre/bin;", _ndkEntry.HostPath, qnx_config) +
- System.Environment.GetEnvironmentVariable("PATH");
- System.Environment.SetEnvironmentVariable("PATH", ndkpath);
- }
- catch
- {
-
- }
- rkNDKPath.Close();
- rkHKCU.Close();
-
- }
-
- ///
- /// Return the NDK Path from the registry
- ///
- ///
- public bool getNDKPath()
- {
- bool success = false;
-
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkNDKPath = null;
-
- try
- {
- rkNDKPath = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- HostPath = rkNDKPath.GetValue("NDKHostPath").ToString();
- TargetPath = rkNDKPath.GetValue("NDKTargetPath").ToString();
- rkNDKPath.Close();
- rkHKCU.Close();
- success = true;
- }
- catch
- {
- if (rkNDKPath != null)
- rkNDKPath.Close();
- rkHKCU.Close();
- success = false;
- }
-
- return success;
- }
-
- #region INotifyPropertyChanged Implementation
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- ///
- /// Fire the PropertyChnaged event handler on change of property
- ///
- ///
- protected void OnPropertyChanged(string propName)
- {
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs(propName));
- }
- }
-
- #endregion
-
- }
-
-
-}
diff --git a/src/VSNDK.Package/Settings/SettingsDialog.xaml b/src/VSNDK.Package/Settings/SettingsDialog.xaml
deleted file mode 100644
index 74898472..00000000
--- a/src/VSNDK.Package/Settings/SettingsDialog.xaml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Package/Settings/SettingsDialog.xaml.cs b/src/VSNDK.Package/Settings/SettingsDialog.xaml.cs
deleted file mode 100644
index 4ed8cb98..00000000
--- a/src/VSNDK.Package/Settings/SettingsDialog.xaml.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-using Microsoft.VisualStudio.PlatformUI;
-using Microsoft.Win32;
-using System.IO;
-using System.Xml;
-using System.Windows.Forms;
-using PkgResources = RIM.VSNDK_Package.Resources;
-using RIM.VSNDK_Package.Settings.Models;
-using System.Net;
-using System.Net.Sockets;
-using RIM.VSNDK_Package.UpdateManager.Model;
-using Microsoft.VisualStudio.Shell;
-
-namespace RIM.VSNDK_Package.Settings
-{
-
- ///
- /// Interaction logic for Settings.xaml
- ///
- public partial class SettingsDialog : DialogWindow
- {
- private SettingsData _data;
-
- ///
- /// Settings Dialog Constructor
- ///
- public SettingsDialog()
- {
-
- InitializeComponent();
-
- _data = new SettingsData();
- gridMain.DataContext = _data;
-
- _data.getSimulatorInfo();
- _data.getDeviceInfo();
- tbDevicePassword.Password = _data.DevicePassword;
- tbSimulatorPassword.Password = _data.SimulatorPassword;
- }
-
- ///
- /// Persist Changes
- ///
- ///
- ///
- private void btnOK_Click(object sender, RoutedEventArgs e)
- {
- _data.DevicePassword = tbDevicePassword.Password;
- _data.SimulatorPassword = tbSimulatorPassword.Password;
- _data.setDeviceInfo();
- _data.setSimulatorInfo();
- _data.NDKEntryClass = (NDKEntryClass)NDKEntry.SelectedItem;
- _data.setNDKPaths();
-
- DialogResult = true; ;
-
- }
-
- ///
- /// Open App Target Dialog
- ///
- ///
- ///
- private void Update_Click(object sender, RoutedEventArgs e)
- {
- this.Cursor = System.Windows.Input.Cursors.Wait;
-
- UpdateManager.UpdateManager updateManager = UpdateManager.UpdateManager.create();
-
- _data.RefreshScreen();
- NDKEntry.ItemsSource = null;
- NDKEntry.ItemsSource = _data.NDKEntries;
-
- this.Cursor = System.Windows.Input.Cursors.Hand;
-
- }
- }
-}
diff --git a/src/VSNDK.Package/Signing/Browser.Designer.cs b/src/VSNDK.Package/Signing/Browser.Designer.cs
deleted file mode 100644
index 7053adac..00000000
--- a/src/VSNDK.Package/Signing/Browser.Designer.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-using System.Windows.Forms;
-using System.ComponentModel;
-using System.Net;
-using System;
-using System.IO;
-using System.Net.Security;
-using System.Security.Cryptography.X509Certificates;
-using RIM.VSNDK_Package.Signing.Models;
-
-namespace RIM.VSNDK_Package.Signing
-{
- partial class Browser
- {
-
- private SigningData signingData = null;
-
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- signingData = new SigningData();
-
- // validate certificate by calling a function
- ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateRemoteCertificate);
-
- this.webBrowser1 = new System.Windows.Forms.WebBrowser();
- this.SuspendLayout();
- //
- // webBrowser1
- //
- this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.webBrowser1.Location = new System.Drawing.Point(0, 0);
- this.webBrowser1.MaximumSize = new System.Drawing.Size(1280, 768);
- this.webBrowser1.MinimumSize = new System.Drawing.Size(1280, 768);
- this.webBrowser1.Name = "webBrowser1";
- this.webBrowser1.Size = new System.Drawing.Size(1280, 768);
- this.webBrowser1.TabIndex = 0;
- this.webBrowser1.Url = new System.Uri("https://developer.blackberry.com/codesigning/", System.UriKind.Absolute);
- this.webBrowser1.Navigating += new System.Windows.Forms.WebBrowserNavigatingEventHandler(this.webBrowser1_Navigating);
- //
- // Browser
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(1280, 768);
- this.Controls.Add(this.webBrowser1);
- this.Name = "Browser";
- this.Text = "Sign in to create and download your BlackBerry ID token";
- this.ResumeLayout(false);
- this.MinimizeBox = false;
-
- }
-
- #endregion
-
- private System.Windows.Forms.WebBrowser webBrowser1;
-
- ///
- /// Method that handles the Navigating event.
- ///
- /// Contains the WebBrowser1 data.
- ///
- public void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
- {
- if (e.Url.Segments[e.Url.Segments.Length - 1].EndsWith("csk.pg"))
- {
- this.Cursor = Cursors.WaitCursor;
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create(e.Url);
- request.Referer = ((WebBrowser)sender).Url.ToString();
- request.CookieContainer = new CookieContainer();
- string cookie_txt = webBrowser1.Document.Cookie;
- string[] cookies = cookie_txt.Split(';');
-
- try
- {
- // Copying cookies from WebBrowser to the HttpWebRequest.
- foreach (string cookie in cookies)
- {
- string[] details = cookie.Split('=');
- if (details.Length == 2)
- {
- details[1] = details[1].Replace(",", "%2C");
- request.CookieContainer.Add(e.Url, new Cookie(details[0].Trim(), details[1].Trim()));
- }
- }
-
- request.KeepAlive = true;
-
- // Getting the response
- HttpWebResponse response = (HttpWebResponse)request.GetResponse();
-
- // Creating a StreamReader
- System.IO.Stream stream = response.GetResponseStream();
- System.Text.Encoding ec = System.Text.Encoding.GetEncoding("utf-8");
- System.IO.StreamReader reader = new System.IO.StreamReader(stream, ec);
-
- // Creating the bbidtoken.csk file
- File.WriteAllText(signingData.bbidtokenPath, reader.ReadToEnd());
-
- reader.Close();
- response.Close();
- }
- catch (Exception e1)
- {
- MessageBox.Show("An error occurred while downloading your signing key. " + e1.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- this.Cursor = Cursors.Arrow;
- this.Close();
- }
- }
-
- ///
- /// Callback used to validate the certificate in an SSL conversation
- ///
- ///
- ///
- ///
- ///
- ///
- private static bool ValidateRemoteCertificate(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors policyErrors)
- {
- // This code must be included in InitializeComponent() method:
- // validate certificate by calling a function
- // ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateRemoteCertificate);
-
- bool result = false;
- if (cert.Subject.Contains(".blackberry.com"))
- {
- result = true;
- }
-
- return result;
- }
-
- }
-}
\ No newline at end of file
diff --git a/src/VSNDK.Package/Signing/Browser.cs b/src/VSNDK.Package/Signing/Browser.cs
deleted file mode 100644
index 95c353c1..00000000
--- a/src/VSNDK.Package/Signing/Browser.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Windows.Forms;
-
-namespace RIM.VSNDK_Package.Signing
-{
- public partial class Browser : Form
- {
- SigningDialog signingDialog;
-
- public Browser(SigningDialog sd)
- {
- signingDialog = sd;
- InitializeComponent();
- }
- }
-}
diff --git a/src/VSNDK.Package/Signing/DeRegisterWindow.xaml b/src/VSNDK.Package/Signing/DeRegisterWindow.xaml
deleted file mode 100644
index 7ed307e3..00000000
--- a/src/VSNDK.Package/Signing/DeRegisterWindow.xaml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Package/Signing/DeRegisterWindow.xaml.cs b/src/VSNDK.Package/Signing/DeRegisterWindow.xaml.cs
deleted file mode 100644
index ccc3aaaa..00000000
--- a/src/VSNDK.Package/Signing/DeRegisterWindow.xaml.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-using Microsoft.VisualStudio.PlatformUI;
-using RIM.VSNDK_Package.Signing.Models;
-using PkgResources = RIM.VSNDK_Package.Resources;
-
-namespace RIM.VSNDK_Package.Signing
-{
- ///
- /// Interaction logic for DeRegisterWindow.xaml
- ///
- public partial class DeRegisterWindow : Window
- {
-
- private SigningData signingData = null;
-
- ///
- /// Constructor
- ///
- public DeRegisterWindow()
- {
- InitializeComponent();
-
- signingData = new SigningData();
- gridMain.DataContext = signingData;
- }
-
- ///
- /// Event fired on OK button click
- ///
- ///
- ///
- private void btnOK_Click(object sender, RoutedEventArgs e)
- {
- if (!signingData.UnRegister())
- {
- MessageBox.Show(signingData.Errors, "Registration Window", MessageBoxButton.OK, MessageBoxImage.Exclamation, MessageBoxResult.OK);
- signingData.Errors = null;
- e.Handled = true;
- return;
- }
- else if (!string.IsNullOrEmpty(signingData.Messages))
- {
- signingData.Messages = signingData.Messages.Replace("CSK", "BB ID Token");
- MessageBox.Show(signingData.Messages, "Registration Window", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
- signingData.Messages = null;
- }
-
- DialogResult = true;
- }
-
- }
-}
diff --git a/src/VSNDK.Package/Signing/Models/PasswordBoxAssistant.cs b/src/VSNDK.Package/Signing/Models/PasswordBoxAssistant.cs
deleted file mode 100644
index d1f9fa31..00000000
--- a/src/VSNDK.Package/Signing/Models/PasswordBoxAssistant.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-
-namespace RIM.VSNDK_Package.Signing.Models
-{
- //Attache property for binding passwordbox
- //see src @ http://blog.functionalfun.net/2008/06/wpf-passwordbox-and-data-binding.html
- public static class PasswordBoxAssistant
- {
- public static readonly DependencyProperty BoundPassword = DependencyProperty.RegisterAttached("BoundPassword", typeof(string),
- typeof(PasswordBoxAssistant), new PropertyMetadata(string.Empty, OnBoundPasswordChanged));
- public static readonly DependencyProperty BindPassword = DependencyProperty.RegisterAttached("BindPassword", typeof (bool),
- typeof (PasswordBoxAssistant), new PropertyMetadata(false, OnBindPasswordChanged));
- private static readonly DependencyProperty UpdatingPassword = DependencyProperty.RegisterAttached("UpdatingPassword",
- typeof(bool), typeof(PasswordBoxAssistant), new PropertyMetadata(false));
-
- private static void OnBoundPasswordChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- PasswordBox box = d as PasswordBox;
- // only handle this event when the property is attached to a PasswordBox
- // and when the BindPassword attached property has been set to true
- if (d == null || !GetBindPassword(d))
- {
- return;
- }
- // avoid recursive updating by ignoring the box's changed event
- box.PasswordChanged -= HandlePasswordChanged;
- string newPassword = (string)e.NewValue;
- if (!GetUpdatingPassword(box))
- {
- box.Password = newPassword;
- }
- box.PasswordChanged += HandlePasswordChanged;
- }
-
- private static void OnBindPasswordChanged(DependencyObject dp, DependencyPropertyChangedEventArgs e)
- {
- // when the BindPassword attached property is set on a PasswordBox,
- // start listening to its PasswordChanged event
- PasswordBox box = dp as PasswordBox;
- if (box == null)
- {
- return;
- }
- bool wasBound = (bool)(e.OldValue);
- bool needToBind = (bool)(e.NewValue);
- if (wasBound)
- {
- box.PasswordChanged -= HandlePasswordChanged;
- }
- if (needToBind)
- {
- box.PasswordChanged += HandlePasswordChanged;
- }
- }
- private static void HandlePasswordChanged(object sender, RoutedEventArgs e)
- {
- PasswordBox box = sender as PasswordBox;
- // set a flag to indicate that we're updating the password
- SetUpdatingPassword(box, true);
- // push the new password into the BoundPassword property
- SetBoundPassword(box, box.Password);
- SetUpdatingPassword(box, false);
- }
-
- public static void SetBindPassword(DependencyObject dp, bool value)
- {
- dp.SetValue(BindPassword, value);
- }
- public static bool GetBindPassword(DependencyObject dp)
- {
- return (bool)dp.GetValue(BindPassword);
- }
- public static string GetBoundPassword(DependencyObject dp)
- {
- return (string)dp.GetValue(BoundPassword);
- }
- public static void SetBoundPassword(DependencyObject dp, string value)
- {
- dp.SetValue(BoundPassword, value);
- }
-
- private static bool GetUpdatingPassword(DependencyObject dp)
- {
- return (bool)dp.GetValue(UpdatingPassword);
- }
- private static void SetUpdatingPassword(DependencyObject dp, bool value)
- {
- dp.SetValue(UpdatingPassword, value);
- }
- }
-}
diff --git a/src/VSNDK.Package/Signing/Models/SigningData.cs b/src/VSNDK.Package/Signing/Models/SigningData.cs
deleted file mode 100644
index 6d7b5c67..00000000
--- a/src/VSNDK.Package/Signing/Models/SigningData.cs
+++ /dev/null
@@ -1,460 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.ComponentModel;
-using System.Windows.Data;
-using System.IO;
-using System.IO.Packaging;
-using Microsoft.Win32;
-
-namespace RIM.VSNDK_Package.Signing.Models
-{
- ///
- /// Common Class for the signing dialogs
- ///
- public class SigningData : INotifyPropertyChanged
- {
- ///
- /// Constants
- ///
- private const string _colRegistered = "Registered";
- private const string _colUnregistered = "Unregistered";
- private const string _colUnregisterdText = "UnregisteredText";
- public const string _p12 = @"/author.p12";
- public const string _tokencsk = @"/bbidtoken.csk";
- public const string _db = @"/barsigner.db";
- public const string _signercsk = @"/bbsigner.csk";
- public const string _bbt_id_rsa = @"/bb_id_rsa";
- public const string _bbt_id_rsa_pub = @"/bb_id_rsa.pub";
-
- ///
- /// Private Members
- ///
- private bool _registered;
- private string _certPath;
- private string _errors;
- private string _message;
-
- ///
- /// Constructor
- ///
- public SigningData()
- {
- _certPath = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\";
-
- RefreshScreen();
- }
-
- ///
- /// Refresh the screen data
- ///
- public void RefreshScreen()
- {
- Registered = File.Exists(_certPath + _p12);
- }
-
- ///
- /// Unregistered propert
- /// For setting the enabled property for the Unregistered button
- ///
- public bool Unregistered
- {
- get
- {
- return !_registered;
- }
- }
-
- ///
- /// Returns the path to the certificate file.
- ///
- public string CertPath
- {
- get
- {
- return _certPath;
- }
- set
- {
- _certPath = value;
- }
- }
-
- ///
- /// Returns the path to the bbidtoken path.
- ///
- public string bbidtokenPath
- {
- get
- {
- return _certPath + _tokencsk;
- }
- }
-
- ///
- /// Property for setting the registered label
- ///
- public string UnregisteredText
- {
- get
- {
- return _registered ? "Registered" : "Not Registered";
- }
- }
-
- ///
- /// Property for getting/setting _errors
- ///
- public string Errors
- {
- get
- {
- return _errors;
- }
- set
- {
- _errors = value;
- }
- }
-
- ///
- /// Property for getting/setting _message
- ///
- public string Messages
- {
- get
- {
- return _message;
- }
- set
- {
- _message = value;
- }
- }
-
- ///
- /// Function to backup the signing certs at the specified path
- ///
- /// Path to the signing keys
- /// Path to destination zip file
- public void Backup(string toZipFile)
- {
- using (Package pkg = Package.Open(CertPath + toZipFile, FileMode.Create))
- {
- AddUriToPackage(_p12, pkg);
- AddUriToPackage(_tokencsk, pkg);
- AddUriToPackage(_db, pkg);
- AddUriToPackage(_signercsk, pkg);
- AddUriToPackage(_bbt_id_rsa, pkg);
- AddUriToPackage(_bbt_id_rsa_pub, pkg);
- }
- }
-
- ///
- /// Set Password into the registry.
- ///
- private void setPassword(string password)
- {
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkCDKPass = null;
-
- rkCDKPass = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- rkCDKPass.SetValue("CSKPass", GlobalFunctions.Encrypt(password));
-
- rkCDKPass.Close();
- rkHKCU.Close();
- }
-
- ///
- /// Run the blackberry-signer tool with parameters passed in
- ///
- ///
- public bool Register(string authorID, string password)
- {
- bool success = false;
- System.Diagnostics.Process p = new System.Diagnostics.Process();
- System.Diagnostics.ProcessStartInfo startInfo = p.StartInfo;
- startInfo.UseShellExecute = false;
- startInfo.CreateNoWindow = true;
- startInfo.RedirectStandardError = true;
- startInfo.RedirectStandardOutput = true;
- p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(ErrorDataReceived);
- p.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(OutputDataReceived);
-
- //run register tool
- startInfo.FileName = "cmd.exe";
- startInfo.WorkingDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + "\\BlackBerry\\VSPlugin-NDK\\qnxtools\\bin\\";
- startInfo.Arguments = string.Format("/C blackberry-keytool -genkeypair -storepass {0} -author {1}", password, "\"" + authorID + "\"");
-
- try
- {
- p.Start();
- p.BeginErrorReadLine();
- p.BeginOutputReadLine();
- p.WaitForExit();
- if (p.ExitCode != 0)
- success = false;
- else
- success = true;
- p.Close();
- }
- catch (Exception e)
- {
- System.Diagnostics.Debug.WriteLine(startInfo.Arguments);
- System.Diagnostics.Debug.WriteLine(e.Message);
- success = false;
- }
-
- setPassword(password);
-
- return success && string.IsNullOrEmpty(_errors);
- }
-
- ///
- /// Run the blackberry-signer tool with parameters passed in
- ///
- ///
- public bool UnRegister()
- {
- bool success = false;
-
- try
- {
-
- System.Diagnostics.Process p = new System.Diagnostics.Process();
- System.Diagnostics.ProcessStartInfo startInfo = p.StartInfo;
- startInfo.UseShellExecute = false;
- startInfo.CreateNoWindow = true;
- startInfo.RedirectStandardError = true;
- startInfo.RedirectStandardOutput = true;
- p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(ErrorDataReceived);
- p.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(OutputDataReceived);
-
- //run register tool
- startInfo.FileName = "cmd.exe";
- startInfo.WorkingDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + "\\BlackBerry\\VSPlugin-NDK\\qnxtools\\bin\\";
- startInfo.Arguments = string.Format("/C blackberry-signer.bat -cskdelete");
-
- p.Start();
- p.BeginErrorReadLine();
- p.BeginOutputReadLine();
- p.WaitForExit();
-
- if (p.ExitCode != 0)
- {
- success = false;
- }
- else
- {
- /// Remove Files
- FileInfo fi_p12 = new FileInfo(System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\author.p12");
- FileInfo fi_csk = new FileInfo(System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\bbidtoken.csk");
- fi_p12.Delete();
- fi_csk.Delete();
- /// Set password to blank
- setPassword("");
-
- success = true;
- }
- p.Close();
- }
- catch (Exception e)
- {
- _errors += e.Message + "\n";
- success = false;
- }
-
- return success;
- }
-
-
- ///
- /// Event Handler for output received from the Register Process
- ///
- ///
- ///
- void OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
- {
- if (e.Data != null)
- {
- if (e.Data.Contains("Error:"))
- _errors += e.Data + "\n";
- else
- _message += e.Data + "\n";
- }
- }
-
- ///
- /// Event Handler for the error data received from the Registger Process
- ///
- ///
- ///
- void ErrorDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
- {
- if (e.Data != null)
- {
- _errors += e.Data + "\n";
- }
- }
-
- ///
- /// Function to clean up after register process
- ///
- public void CleanUp()
- {
- if (!File.Exists(System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\author.p12"))
- {
- FileInfo fi_csk = new FileInfo(System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\bbidtoken.csk");
-
- try
- {
- fi_csk.Delete();
- }
- catch (System.IO.IOException ex)
- {
-
- }
- }
- }
-
- ///
- /// Function to add a file to the zip
- ///
- /// File name
- /// Package to add file to
- private void AddUriToPackage(string file, Package pkg)
- {
- if (File.Exists(_certPath + file))
- {
- Uri uri = null;
- PackagePart pkgPart = null;
- uri = PackUriHelper.CreatePartUri(new Uri(file, UriKind.Relative));
- pkgPart = pkg.CreatePart(uri, string.Empty);
- using (FileStream fileStream = new FileStream(_certPath + file, FileMode.Open, FileAccess.Read))
- {
- CopyStream(fileStream, pkgPart.GetStream());
- }
- }
- }
-
- ///
- /// Function to unzip and restore a set of singing keys
- ///
- ///
- ///
- public void Restore(string fromZipFile)
- {
-
- Package zipFilePackage = ZipPackage.Open(fromZipFile, FileMode.Open, FileAccess.ReadWrite);
-
- //Iterate through the all the files that
- //is added within the collection and
- foreach (ZipPackagePart contentFile in zipFilePackage.GetParts())
- {
- createFile(contentFile);
- }
-
- zipFilePackage.Close();
-
- }
-
-
- ///
- /// Method to create file at the temp folder
- ///
- ///
- ///
- ///
- private void createFile(ZipPackagePart contentFile)
- {
- // Initially create file under the folder specified
- string contentFilePath = string.Empty;
- contentFilePath = contentFile.Uri.OriginalString.Replace('/',
- System.IO.Path.DirectorySeparatorChar);
-
- if (contentFilePath.StartsWith(
- System.IO.Path.DirectorySeparatorChar.ToString()))
- {
- contentFilePath = contentFilePath.TrimStart(
- System.IO.Path.DirectorySeparatorChar);
- }
- else
- {
- //do nothing
- }
-
- contentFilePath = System.IO.Path.Combine(_certPath, contentFilePath);
-
- //Check for the folder already exists. If not then create that folder
-
- if (System.IO.Directory.Exists(
- System.IO.Path.GetDirectoryName(contentFilePath)) != true)
- {
- System.IO.Directory.CreateDirectory(
- System.IO.Path.GetDirectoryName(contentFilePath));
- }
- else
- {
- //do nothing
- }
-
- System.IO.FileStream newFileStream =
- System.IO.File.Create(contentFilePath);
- newFileStream.Close();
- byte[] content = new byte[contentFile.GetStream().Length];
- contentFile.GetStream().Read(content, 0, content.Length);
- System.IO.File.WriteAllBytes(contentFilePath, content);
-
- }
-
- ///
- /// Function to copy a stream from one stream to another
- ///
- /// Source Stream
- /// Target Stream
- private void CopyStream(Stream source, Stream target)
- {
- const int bufSize = 0x1000;
- byte[] buf = new byte[bufSize];
- int bytesRead = 0;
- while ((bytesRead = source.Read(buf, 0, bufSize)) > 0)
- target.Write(buf, 0, bytesRead);
- }
-
- ///
- /// Registered Property
- ///
- public bool Registered
- {
- get
- {
- return _registered;
- }
- set
- {
- _registered = value;
- OnPropertyChanged(_colRegistered);
- OnPropertyChanged(_colUnregisterdText);
- OnPropertyChanged(_colUnregistered);
- }
- }
-
- ///
- /// Property Changed Event
- ///
- public event PropertyChangedEventHandler PropertyChanged;
-
- ///
- /// Fire the PropertyChnaged event handler on change of property
- ///
- ///
- protected void OnPropertyChanged(string propName)
- {
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs(propName));
- }
- }
- }
-}
diff --git a/src/VSNDK.Package/Signing/RegistrationWindow.xaml b/src/VSNDK.Package/Signing/RegistrationWindow.xaml
deleted file mode 100644
index df712e55..00000000
--- a/src/VSNDK.Package/Signing/RegistrationWindow.xaml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Package/Signing/RegistrationWindow.xaml.cs b/src/VSNDK.Package/Signing/RegistrationWindow.xaml.cs
deleted file mode 100644
index a07778a3..00000000
--- a/src/VSNDK.Package/Signing/RegistrationWindow.xaml.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-using RIM.VSNDK_Package.Signing.Models;
-using System.IO;
-using System.ComponentModel;
-
-namespace RIM.VSNDK_Package.Signing
-{
- ///
- /// Interaction logic for RegistrationWindow.xaml
- ///
- public partial class RegistrationWindow : Window
- {
- private SigningData signingData = null;
-
- ///
- /// RegistrationWindow Constructor
- ///
- public RegistrationWindow()
- {
- InitializeComponent();
-
- signingData = new SigningData();
- gridMain.DataContext = signingData;
- }
-
- ///
- /// Perform actions on the OK button click
- ///
- ///
- ///
- private void btnOk_Click(object sender, RoutedEventArgs e)
- {
- if (!signingData.Register(tbAuthor.Text, tbPassword.Password))
- {
- MessageBox.Show(signingData.Errors, "Registration Window", MessageBoxButton.OK, MessageBoxImage.Exclamation, MessageBoxResult.OK);
- signingData.Errors = null;
- e.Handled = true;
- return;
- }
- else if (!string.IsNullOrEmpty(signingData.Messages))
- {
- signingData.Messages = signingData.Messages.Replace("CSK", "BB ID Token");
- MessageBox.Show(signingData.Messages, "Registration Window", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
- signingData.Messages = null;
- }
-
- signingData.Register("", "");
-
- DialogResult = true;
- }
-
- ///
- /// Perform actions on close of dialog.
- ///
- ///
- protected override void OnClosing(CancelEventArgs e)
- {
- signingData.CleanUp();
- }
- }
-}
\ No newline at end of file
diff --git a/src/VSNDK.Package/Signing/SigningDialog.xaml b/src/VSNDK.Package/Signing/SigningDialog.xaml
deleted file mode 100644
index d4a092f6..00000000
--- a/src/VSNDK.Package/Signing/SigningDialog.xaml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Package/Signing/SigningDialog.xaml.cs b/src/VSNDK.Package/Signing/SigningDialog.xaml.cs
deleted file mode 100644
index c6ab82ab..00000000
--- a/src/VSNDK.Package/Signing/SigningDialog.xaml.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-using RIM.VSNDK_Package.Signing.Models;
-using System.IO;
-using Microsoft.VisualStudio.PlatformUI;
-using Microsoft.Win32;
-using System.Xml;
-
-namespace RIM.VSNDK_Package.Signing
-{
- ///
- /// Interaction logic for SigningDialog.xaml
- ///
- public partial class SigningDialog : Window
- {
- private SigningData signingData = null;
-
- public SigningDialog()
- {
- InitializeComponent();
-
- signingData = new SigningData();
- gridMain.DataContext = signingData;
- }
-
- ///
- /// Open BlackBerry Signing in the default browser and start a thread that will move the downloaded
- /// bbidtoken.csk file to the right folder. Then, it is presented the Regisration Dialog.
- ///
- ///
- ///
- private void btnRegister_Click(object sender, RoutedEventArgs e)
- {
- Browser wb = new Browser(this);
- wb.ShowDialog();
-
- if (!signingData.Registered)
- {
- RegistrationWindow win = new RegistrationWindow();
- win.ResizeMode = System.Windows.ResizeMode.NoResize;
- bool? res = win.ShowDialog();
- }
-
- signingData.RefreshScreen();
- }
-
- ///
- /// Unregister your signing keys.
- ///
- ///
- ///
- private void btnUnregister_Click(object sender, RoutedEventArgs e)
- {
- DeRegisterWindow win = new DeRegisterWindow();
- bool? res = win.ShowDialog();
-
- signingData.RefreshScreen();
- }
-
- ///
- /// Backup your signing keys.
- ///
- ///
- ///
- private void btnBackup_Click(object sender, RoutedEventArgs e)
- {
- string zipfile = string.Empty;
-
- ///Create Dialog
- Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
- dlg.FileName = "signingkey";
- dlg.DefaultExt = ".zip"; // Default file extension
- dlg.Filter = "zip files (.zip)|*.zip"; // Filter files by extension
- bool? result = dlg.ShowDialog();
- if (result == true)
- {
- zipfile = dlg.FileName;
- signingData.Backup(zipfile);
- }
- }
-
- ///
- /// Restore your signing keys.
- ///
- ///
- ///
- private void btnRestore_Click(object sender, RoutedEventArgs e)
- {
- string zipfile = string.Empty;
- Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
- dlg.DefaultExt = ".zip"; // Default file extension
- dlg.Filter = "zip files (.zip)|*.zip"; // Filter files by extension
- bool? result = dlg.ShowDialog();
- if (result == true)
- {
- zipfile = dlg.FileName;
- signingData.Restore(zipfile);
- signingData.RefreshScreen();
- }
- }
- }
-}
diff --git a/src/VSNDK.Package/Templates/VCWizards/BlackBerry/BarDescriptor/Scripts/1033/default.js b/src/VSNDK.Package/Templates/VCWizards/BlackBerry/BarDescriptor/Scripts/1033/default.js
deleted file mode 100644
index 0ba3a53f..00000000
--- a/src/VSNDK.Package/Templates/VCWizards/BlackBerry/BarDescriptor/Scripts/1033/default.js
+++ /dev/null
@@ -1,64 +0,0 @@
-function OnPrep(selProj, selObj)
-{
- var L_WizardDialogTitle_Text = "BlackBerry Descriptor Wizard";
- return PrepCodeWizard(selProj, L_WizardDialogTitle_Text);
-}
-
-function GetTargetName(strName, strProjectName, strResPath, strHelpPath)
-{
- try
- {
- return "bar-descriptor.xml";
- }
- catch(e)
- {
- throw e;
- }
-}
-
-function OnFinish(selProj, selObj)
-{
- var oCM;
- try
- {
- oCM = selProj.CodeModel;
-
- var strTemplatePath = wizard.FindSymbol("TEMPLATES_PATH");
- var strFileName = "bar-descriptor.xml";
-
- if (wizard.DoesFileExist(strFileName))
- {
- wizard.ReportError(strFileName + " already exists.");
- return VS_E_WIZCANCEL;
- }
-
- var L_TRANSACTION_Text = "Add ";
- oCM.StartTransaction(L_TRANSACTION_Text + strFileName);
-
- wizard.AddSymbol("PROJECT_NAME", wizard.FindSymbol("PROJECT_NAME"));
-
- // render the srf file
- wizard.RenderTemplate(strTemplatePath + "\\" + "bar-descriptor.xml", strFileName);
-
- // add the srf file to the selected folder (could be the root of the project)
- var srffile = selObj.AddFromFile(strFileName);
- if( srffile )
- {
- var window = srffile.Open(vsViewKindPrimary);
- if(window)
- window.visible = true;
- }
-
- oCM.CommitTransaction();
- }
- catch(e)
- {
- if (oCM)
- oCM.AbortTransaction();
-
- if (e.description.length != 0)
- SetErrorInfo(e);
- return e.number
- }
-}
-
diff --git a/src/VSNDK.Package/Templates/VCWizards/BlackBerry/BarDescriptor/Templates/1033/bar-descriptor.xml b/src/VSNDK.Package/Templates/VCWizards/BlackBerry/BarDescriptor/Templates/1033/bar-descriptor.xml
deleted file mode 100644
index 7eaed084..00000000
--- a/src/VSNDK.Package/Templates/VCWizards/BlackBerry/BarDescriptor/Templates/1033/bar-descriptor.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
- com.example.[!output PROJECT_NAME]
-
-
- [!output PROJECT_NAME]
-
-
- 1.0.0
-
-
- 1
-
-
- The [!output PROJECT_NAME] application
-
-
- Example Inc.
-
-
- ABC1234YjsnUk235h
-
-
- none
- false
-
-
-
- core.games
-
- armle-v7
- [!output PROJECT_NAME]
-
-
- armle-v7
- [!output PROJECT_NAME]
-
-
- x86
- [!output PROJECT_NAME]
-
-
- armle-v7
- [!output PROJECT_NAME]
-
-
-
-
-
-
-
-
-
- run_native
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Package/Templates/VCWizards/BlackBerry/BarDescriptor/Templates/1033/bar-descriptor.xsd b/src/VSNDK.Package/Templates/VCWizards/BlackBerry/BarDescriptor/Templates/1033/bar-descriptor.xsd
deleted file mode 100644
index 021cb2e6..00000000
--- a/src/VSNDK.Package/Templates/VCWizards/BlackBerry/BarDescriptor/Templates/1033/bar-descriptor.xsd
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Package/Templates/VCWizards/BlackBerry/BarDescriptor/Templates/1033/templates.inf b/src/VSNDK.Package/Templates/VCWizards/BlackBerry/BarDescriptor/Templates/1033/templates.inf
deleted file mode 100644
index 98031e60..00000000
--- a/src/VSNDK.Package/Templates/VCWizards/BlackBerry/BarDescriptor/Templates/1033/templates.inf
+++ /dev/null
@@ -1 +0,0 @@
-bar-descriptor.xml
\ No newline at end of file
diff --git a/src/VSNDK.Package/Templates/bar-descriptor.cs b/src/VSNDK.Package/Templates/bar-descriptor.cs
deleted file mode 100644
index 511fd164..00000000
--- a/src/VSNDK.Package/Templates/bar-descriptor.cs
+++ /dev/null
@@ -1,560 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.296
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-//
-// This source code was auto-generated by xsd, Version=4.0.30319.1.
-//
-namespace RIM.VSNDK_Package {
- using System.Xml.Serialization;
-
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- [System.Xml.Serialization.XmlRootAttribute(Namespace="http://www.qnx.com/schemas/application/1.0", IsNullable=true)]
- public partial class asset : object, System.ComponentModel.INotifyPropertyChanged {
-
- private string pathField;
-
- private string entryField;
-
- private string typeField;
-
- private string valueField;
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string path {
- get {
- return this.pathField;
- }
- set {
- this.pathField = value;
- this.RaisePropertyChanged("path");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string entry {
- get {
- return this.entryField;
- }
- set {
- this.entryField = value;
- this.RaisePropertyChanged("entry");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string type {
- get {
- return this.typeField;
- }
- set {
- this.typeField = value;
- this.RaisePropertyChanged("type");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlTextAttribute()]
- public string Value {
- get {
- return this.valueField;
- }
- set {
- this.valueField = value;
- this.RaisePropertyChanged("Value");
- }
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName) {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null)) {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- [System.Xml.Serialization.XmlRootAttribute(Namespace="http://www.qnx.com/schemas/application/1.0", IsNullable=false)]
- public partial class qnx : object, System.ComponentModel.INotifyPropertyChanged {
-
- private string idField;
-
- private string nameField;
-
- private string versionNumberField;
-
- private string buildIdField;
-
- private string descriptionField;
-
- private string authorField;
-
- private string categoryField;
-
- private qnxInitialWindow[] initialWindowField;
-
- private asset[] assetField;
-
- private qnxConfiguration[] configurationField;
-
- private qnxIcon[] iconField;
-
- private qnxAction[] actionField;
-
- private qnxEnv[] envField;
-
- ///
- public string id {
- get {
- return this.idField;
- }
- set {
- this.idField = value;
- this.RaisePropertyChanged("id");
- }
- }
-
- ///
- public string name {
- get {
- return this.nameField;
- }
- set {
- this.nameField = value;
- this.RaisePropertyChanged("name");
- }
- }
-
- ///
- public string versionNumber {
- get {
- return this.versionNumberField;
- }
- set {
- this.versionNumberField = value;
- this.RaisePropertyChanged("versionNumber");
- }
- }
-
- ///
- public string buildId {
- get {
- return this.buildIdField;
- }
- set {
- this.buildIdField = value;
- this.RaisePropertyChanged("buildId");
- }
- }
-
- ///
- public string description {
- get {
- return this.descriptionField;
- }
- set {
- this.descriptionField = value;
- this.RaisePropertyChanged("description");
- }
- }
-
- ///
- public string author {
- get {
- return this.authorField;
- }
- set {
- this.authorField = value;
- this.RaisePropertyChanged("author");
- }
- }
-
- ///
- public string category {
- get {
- return this.categoryField;
- }
- set {
- this.categoryField = value;
- this.RaisePropertyChanged("category");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("initialWindow")]
- public qnxInitialWindow[] initialWindow {
- get {
- return this.initialWindowField;
- }
- set {
- this.initialWindowField = value;
- this.RaisePropertyChanged("initialWindow");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("asset", IsNullable=true)]
- public asset[] asset {
- get {
- return this.assetField;
- }
- set {
- this.assetField = value;
- this.RaisePropertyChanged("asset");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("configuration")]
- public qnxConfiguration[] configuration {
- get {
- return this.configurationField;
- }
- set {
- this.configurationField = value;
- this.RaisePropertyChanged("configuration");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("icon")]
- public qnxIcon[] icon {
- get {
- return this.iconField;
- }
- set {
- this.iconField = value;
- this.RaisePropertyChanged("icon");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("action", IsNullable=true)]
- public qnxAction[] action {
- get {
- return this.actionField;
- }
- set {
- this.actionField = value;
- this.RaisePropertyChanged("action");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("env")]
- public qnxEnv[] env {
- get {
- return this.envField;
- }
- set {
- this.envField = value;
- this.RaisePropertyChanged("env");
- }
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName) {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null)) {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxInitialWindow : object, System.ComponentModel.INotifyPropertyChanged {
-
- private string systemChromeField;
-
- private string transparentField;
-
- ///
- public string systemChrome {
- get {
- return this.systemChromeField;
- }
- set {
- this.systemChromeField = value;
- this.RaisePropertyChanged("systemChrome");
- }
- }
-
- ///
- public string transparent {
- get {
- return this.transparentField;
- }
- set {
- this.transparentField = value;
- this.RaisePropertyChanged("transparent");
- }
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName) {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null)) {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxConfiguration : object, System.ComponentModel.INotifyPropertyChanged {
-
- private string platformArchitectureField;
-
- private asset[] assetField;
-
- private string idField;
-
- private string nameField;
-
- ///
- public string platformArchitecture {
- get {
- return this.platformArchitectureField;
- }
- set {
- this.platformArchitectureField = value;
- this.RaisePropertyChanged("platformArchitecture");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("asset", IsNullable=true)]
- public asset[] asset {
- get {
- return this.assetField;
- }
- set {
- this.assetField = value;
- this.RaisePropertyChanged("asset");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string id {
- get {
- return this.idField;
- }
- set {
- this.idField = value;
- this.RaisePropertyChanged("id");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string name {
- get {
- return this.nameField;
- }
- set {
- this.nameField = value;
- this.RaisePropertyChanged("name");
- }
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName) {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null)) {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxIcon : object, System.ComponentModel.INotifyPropertyChanged {
-
- private string imageField;
-
- ///
- public string image {
- get {
- return this.imageField;
- }
- set {
- this.imageField = value;
- this.RaisePropertyChanged("image");
- }
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName) {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null)) {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxAction : object, System.ComponentModel.INotifyPropertyChanged {
-
- private string systemField;
-
- private string valueField;
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string system {
- get {
- return this.systemField;
- }
- set {
- this.systemField = value;
- this.RaisePropertyChanged("system");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlTextAttribute()]
- public string Value {
- get {
- return this.valueField;
- }
- set {
- this.valueField = value;
- this.RaisePropertyChanged("Value");
- }
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName) {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null)) {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxEnv : object, System.ComponentModel.INotifyPropertyChanged {
-
- private string varField;
-
- private string valueField;
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string var {
- get {
- return this.varField;
- }
- set {
- this.varField = value;
- this.RaisePropertyChanged("var");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string value {
- get {
- return this.valueField;
- }
- set {
- this.valueField = value;
- this.RaisePropertyChanged("value");
- }
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName) {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null)) {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- [System.Xml.Serialization.XmlRootAttribute(Namespace="http://www.qnx.com/schemas/application/1.0", IsNullable=false)]
- public partial class NewDataSet : object, System.ComponentModel.INotifyPropertyChanged {
-
- private object[] itemsField;
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("asset", typeof(asset), IsNullable=true)]
- [System.Xml.Serialization.XmlElementAttribute("qnx", typeof(qnx))]
- public object[] Items {
- get {
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- this.RaisePropertyChanged("Items");
- }
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName) {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null)) {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
- }
-}
diff --git a/src/VSNDK.Package/UpdateManager/Model/UpdateManagerData.cs b/src/VSNDK.Package/UpdateManager/Model/UpdateManagerData.cs
deleted file mode 100644
index 5a4e46df..00000000
--- a/src/VSNDK.Package/UpdateManager/Model/UpdateManagerData.cs
+++ /dev/null
@@ -1,988 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.ComponentModel;
-using System.Windows.Data;
-using RIM.VSNDK_Package.Settings;
-using RIM.VSNDK_Package.DebugToken;
-using System.IO;
-using System.Xml;
-using System.Linq;
-using System.Windows;
-using RIM.VSNDK_Package.DebugToken.Model;
-using Microsoft.Win32;
-using Microsoft.VisualStudio.Shell;
-using System.Security.Cryptography;
-using System.Management;
-
-namespace RIM.VSNDK_Package.UpdateManager.Model
-{
-
- ///
- /// Data Model for the Update Manager Dialog
- ///
- public class UpdateManagerData : INotifyPropertyChanged
- {
- #region Constants
-
- private const string _colAPITarget = "APITarget";
- private const string _colAPITargets = "APITargets";
- private const string _colSimulator = "Simulator";
- private const string _colSimulators = "Simulators";
- private const string _colStatus = "Status";
- private const string _colIsInstalling = "IsInstalling";
-
- #endregion
-
- #region Member Variables
-
- private bool isInstalling = false;
- private string installVersion = "";
- private bool _isRuntime = false;
- private bool _isSimulator = false;
- private CollectionView _apiTargets;
- private CollectionView _simulators;
- private CollectionView _simulators2;
- private APITargetClass _apiTarget;
- private SimulatorsClass _simulator;
- private string _errors = "";
- public string bbndkPathConst = Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)) + "bbndk_vs";
- private string _status = "";
- private string _error = "";
- private string DeviceIP;
- private string DevicePassword;
- public bool isConfiguring = false;
- public bool installed = false;
- public List installProcessID = new List();
-
- private List installedAPIList;
- private List installedNDKList;
- private List installedRuntimeList;
- private string _deviceosversion;
-
- #endregion
-
- #region Public Member Functions
-
- ///
- /// Constructor
- ///
- public UpdateManagerData()
- {
- Status = "";
-
- installedAPIList = InstalledAPIListSingleton.Instance._installedAPIList;
- installedNDKList = InstalledNDKListSingleton.Instance._installedNDKList;
- APITargets = new CollectionView(APITargetListSingleton.Instance._tempAPITargetList);
- Simulators = new CollectionView(SimulatorListSingleton.Instance._simulatorList);
-
- }
-
- ///
- /// Function to filter the sublist of simulators
- ///
- ///
- public void FilterSubList(string apiLevel)
- {
- Simulators2 = new CollectionView(SimulatorListSingleton.Instance._simulatorList.FindAll(i => i.APILevel.Contains(apiLevel)));
- }
-
- ///
- /// Refresh all the lists
- ///
- public void RefreshScreen()
- {
- //((VSNDK_PackagePackage)_pkg).GetInstalledAPIList();
- //// ((VSNDK_PackagePackage)_pkg).GetAvailableAPIList();
- //((VSNDK_PackagePackage)_pkg).GetInstalledSimulatorList();
- //((VSNDK_PackagePackage)_pkg).GetSimulatorList();
-
- //installedAPIList = ((VSNDK_PackagePackage)_pkg).InstalledAPIList;
- //installedNDKList = ((VSNDK_PackagePackage)_pkg).InstalledNDKList;
- //APITargets = new CollectionView(((VSNDK_PackagePackage)_pkg).APITargetList);
- //Simulators = new CollectionView(((VSNDK_PackagePackage)_pkg).SimulatorList);
- }
-
- ///
- /// Install Specified API
- ///
- /// version of API to install
- /// true if successful
- public bool InstallAPI(string version, bool isRuntime, bool isSimulator)
- {
- bool success = false;
- _isRuntime = isRuntime;
- _isSimulator = isSimulator;
- _error = "";
-
- installVersion = version;
-
- Status = "Installing API Level";
-
- System.Diagnostics.Process p = new System.Diagnostics.Process();
- System.Diagnostics.ProcessStartInfo startInfo = p.StartInfo;
- startInfo.UseShellExecute = false;
- startInfo.CreateNoWindow = true;
- startInfo.RedirectStandardError = true;
- startInfo.RedirectStandardOutput = true;
- p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(p_ErrorDataReceived);
- p.EnableRaisingEvents = true;
- p.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(InstallDataReceived);
- p.Exited += new EventHandler(p_Exited);
-
- /// Get Device PIN
- startInfo.FileName = "cmd.exe";
- startInfo.Arguments = string.Format(@"/C " + bbndkPathConst + @"\eclipsec --install {0} {1} {2}", version, isRuntime ? "--runtime" : "", isSimulator ? "--simulator" : "");
-
- try
- {
- IsInstalling = true;
- p.Start();
- p.BeginErrorReadLine();
- p.BeginOutputReadLine();
- int parentProcessID = p.Id;
- ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_Process WHERE ParentProcessId=" + parentProcessID);
- ManagementObjectCollection collection = searcher.Get();
- foreach (ManagementObject item in collection)
- {
- try
- {
- installProcessID.Add(Convert.ToInt32(item["ProcessId"].ToString()));
- }
- catch (Exception e)
- {
- }
- }
-
- }
- catch (Exception e)
- {
- System.Diagnostics.Debug.WriteLine(startInfo.Arguments);
- System.Diagnostics.Debug.WriteLine(e.Message);
- success = false;
- }
-
- return success;
- }
-
- ///
- /// Wait till the API installation ends. This method is called only when the installation process has finished downloading all
- /// the needed files and it is just finishing the configuration. This process is supposed to take less than one minute.
- ///
- public void waitTerminateInstallation()
- {
- if (installProcessID.Count == 1)
- {
- foreach (int pid in installProcessID)
- {
- var p = System.Diagnostics.Process.GetProcessById(pid);
- p.WaitForExit();
- }
- }
- }
-
- ///
- /// Cancel the API installation.
- ///
- public void cancelInstallation()
- {
- foreach (int pid in installProcessID)
- {
- var p = System.Diagnostics.Process.GetProcessById(pid);
- p.Kill();
- }
- }
-
- ///
- /// Uninstall Specified API
- ///
- /// version of API to uninstall
- /// true if successful
- public bool UninstallAPI(string version, bool isSimulator)
- {
- bool success = false;
- _error = "";
- _isSimulator = isSimulator;
-
- Status = "Uninstalling API Level";
-
- System.Diagnostics.Process p = new System.Diagnostics.Process();
- System.Diagnostics.ProcessStartInfo startInfo = p.StartInfo;
- startInfo.UseShellExecute = false;
- startInfo.CreateNoWindow = true;
- startInfo.RedirectStandardError = true;
- startInfo.RedirectStandardOutput = true;
- p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(p_ErrorDataReceived);
- p.EnableRaisingEvents = true;
- p.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(InstallDataReceived);
- p.Exited += new EventHandler(p_Exited);
-
- /// Get Device PIN
- startInfo.FileName = "cmd.exe";
- startInfo.Arguments = string.Format(@"/C " + bbndkPathConst + @"\eclipsec --uninstall {0} {1}", version, isSimulator ? "--simulator" : "");
-
- try
- {
- IsInstalling = true;
- p.Start();
- p.BeginErrorReadLine();
- p.BeginOutputReadLine();
- }
- catch (Exception e)
- {
- System.Diagnostics.Debug.WriteLine(startInfo.Arguments);
- System.Diagnostics.Debug.WriteLine(e.Message);
- success = false;
- }
-
- return success;
- }
-
- ///
- /// Function to retrieve device info from the registry
- ///
- ///
- public void getDeviceSimInfo(bool isSim)
- {
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkSettingsPath = null;
- object pwd = null;
- object ip = null;
-
- try
- {
- rkSettingsPath = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
-
- if (isSim)
- {
- pwd = rkSettingsPath.GetValue("simulator_password");
- ip = rkSettingsPath.GetValue("simulator_IP");
- }
- else
- {
- pwd = rkSettingsPath.GetValue("device_password");
- ip = rkSettingsPath.GetValue("device_IP");
- }
-
-
- if (pwd != null)
- DevicePassword = GlobalFunctions.Decrypt(pwd.ToString());
-
- if (ip != null)
- DeviceIP = ip.ToString();
- }
- catch
- {
-
- }
-
- rkSettingsPath.Close();
- rkHKCU.Close();
- }
-
- ///
- /// Check to see if API is installed
- ///
- /// Check version number
- /// Check API name
- /// true if installed
- private int IsAPIInstalled(string version, string name, bool allowSubstringVersion)
- {
- int success = 0;
-
- /// Check for 2.1 version
- if (version.StartsWith("2.1.0"))
- version = "2.1.0";
-
- while ((success == 0) && (version.Contains('.')))
- {
- if (InstalledAPIListSingleton.Instance._installedAPIList != null)
- {
- APIClass result = InstalledAPIListSingleton.Instance._installedAPIList.Find(i => i.Version.Contains(version));
-
- if (result != null)
- {
- success = 1;
- }
- }
-
- if (InstalledNDKListSingleton.Instance._installedNDKList != null)
- {
- APIClass result = InstalledNDKListSingleton.Instance._installedNDKList.Find(i => i.Version.Contains(version));
-
- if (result != null)
- {
- success = 2;
- }
- }
-
- if (!allowSubstringVersion)
- break;
-
- if (success == 0)
- {
- version = version.Substring(0, version.LastIndexOf('.'));
- }
- }
-
- return success;
- }
-
-
- ///
- /// Validate to make sure device matches the API Level chosen.
- ///
- ///
- public bool validateDeviceVersion(bool isSim)
- {
- bool retVal = false;
- string baseVersion = "10.2.0.0";
- DebugTokenData dtokenData;
-
- if (!isSim)
- dtokenData = new DebugTokenData();
-
- getDeviceSimInfo(isSim);
-
- if (getDeviceInfo())
- { //** Device Info retrieved - validate API's
- if (getCurrentAPIVersion() != _deviceosversion)
- { //** Currently selected API version is different from attached device OS version.
- if (IsAPIInstalled(_deviceosversion, "", false) > 0)
- {
- retVal = true;
- }
- else
- {
- if (baseVersion.CompareTo(_deviceosversion) > 0)
- {
- UpdateManagerDialog umd = new UpdateManagerDialog("The API Level for the operating system version of the attached device is not currently installed. Would you like to install it now?", _deviceosversion, false, false);
-
- if (umd.ShowDialog() == true)
- {
- retVal = true;
- }
- else
- {
- retVal = false;
- }
- }
- else
- {
- if (IsRuntimeInstalled(_deviceosversion))
- {
- retVal = true;
- }
- else
- {
- if (IsAPIInstalled(_deviceosversion.Substring(0, _deviceosversion.LastIndexOf('.')), "", true) == 0)
- {
- string apiLevel = GetAPILevel(_deviceosversion.Substring(0, _deviceosversion.LastIndexOf('.')));
-
- if (apiLevel != "")
- {
- UpdateManagerDialog umd = new UpdateManagerDialog("The API Level for the operating system version of the attached device is not currently installed. Would you like to install it now?", apiLevel, false, false);
- if (umd.ShowDialog() == true)
- {
- umd = new UpdateManagerDialog("The Runtime Libraries for the operating system version of the attached device are not currently installed. Would you like to install them now?", _deviceosversion, true, false);
- if (umd.ShowDialog() == true)
- {
- retVal = true;
- }
- else
- {
- retVal = false;
- }
- }
- else
- {
- retVal = false;
- }
- }
- else
- MessageBox.Show("API level not supported at this moment.\n\nAborting...", "API level not supported", MessageBoxButton.OK, MessageBoxImage.Error);
- }
- else
- {
- UpdateManagerDialog umd = new UpdateManagerDialog("The Runtime Libraries for the operating system version of the attached device are not currently installed. Would you like to install them now?", _deviceosversion, true, false);
- if (umd.ShowDialog() == true)
- {
- retVal = true;
- }
- else
- {
- retVal = false;
- }
- }
- }
- }
- }
- }
- else
- {
- retVal = true;
- }
- }
- else
- {
- retVal = false;
- }
-
- return retVal;
- }
-
- ///
- /// Get the device Info of the connected device
- ///
- /// True if successful
- public bool getDeviceInfo()
- {
- bool success = false;
-
- System.Diagnostics.Process p = new System.Diagnostics.Process();
- System.Diagnostics.ProcessStartInfo startInfo = p.StartInfo;
- startInfo.UseShellExecute = false;
- startInfo.CreateNoWindow = true;
- startInfo.RedirectStandardError = true;
- startInfo.RedirectStandardOutput = true;
- p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(p_ErrorDataReceived);
- p.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(DeviceInfoDataReceived);
-
- /// Get Device PIN
- startInfo.FileName = "cmd.exe";
- startInfo.WorkingDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + "\\BlackBerry\\VSPlugin-NDK\\qnxtools\\bin\\";
- startInfo.Arguments = string.Format("/C blackberry-deploy.bat -listDeviceInfo {0} {1}", DeviceIP, DevicePassword == "" ? "" : "-password " + DevicePassword);
-
- try
- {
- p.Start();
- p.BeginErrorReadLine();
- p.BeginOutputReadLine();
- p.WaitForExit();
- if (p.ExitCode != 0)
- {
- success = false;
- }
- else
- {
- success = true;
- }
-
- p.Close();
- if (_errors != "")
- {
- int begin = _errors.IndexOf("java.io.IOException: ");
- if (begin != -1)
- {
- begin += 20;
- int end = _errors.IndexOf("\n", begin);
- MessageBox.Show(_errors.Substring(begin, end - begin) + "\n\nSee the Debug Output window for details.", "Could not get the device Info of the connected device.", MessageBoxButton.OK, MessageBoxImage.Error);
- }
- else
- MessageBox.Show(_errors + "See the Debug Output window for details.", "Could not get the device Info of the connected device.", MessageBoxButton.OK, MessageBoxImage.Error);
-
- _errors = "";
- }
- }
- catch (Exception e)
- {
- System.Diagnostics.Debug.WriteLine(startInfo.Arguments);
- System.Diagnostics.Debug.WriteLine(e.Message);
- success = false;
- if (_errors != "")
- {
- int begin = _errors.IndexOf("java.io.IOException: ");
- if (begin != -1)
- {
- begin += 20;
- int end = _errors.IndexOf("\n", begin);
- MessageBox.Show(_errors.Substring(begin, end - begin) + "\n\nSee the Debug Output window for details.", "Could not get the device Info of the connected device.", MessageBoxButton.OK, MessageBoxImage.Error);
- }
- else
- MessageBox.Show(_errors + "See the Debug Output window for details.", "Could not get the device Info of the connected device.", MessageBoxButton.OK, MessageBoxImage.Error);
-
- _errors = "";
- }
- }
-
- return success;
-
- }
-
- ///
- /// On Data Received event handler
- ///
- ///
- ///
- private void DeviceInfoDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
- {
- if (e.Data != null)
- {
- System.Diagnostics.Debug.WriteLine(e.Data);
- if (e.Data.Contains("Error:"))
- _errors += e.Data + "\n";
- else if (e.Data.Contains("scmbundle::"))
- _deviceosversion = e.Data.Substring(e.Data.LastIndexOf("::") + 2);
- }
- } ///
- /// On Data Received event handler
- ///
- ///
- ///
- private void p_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
- {
- if (e.Data != null)
- {
- System.Diagnostics.Debug.WriteLine(e.Data);
- if (e.Data.Contains("Error:"))
- _errors += e.Data + "\n";
- else if (e.Data.Contains("scmbundle::"))
- _deviceosversion = e.Data.Substring(e.Data.LastIndexOf("::") + 2);
- }
- }
-
- ///
- /// Retrieve a list of the installed runtimes on the PC.
- ///
- ///
- private bool getInstalledRuntimeTargetList()
- {
- bool success = false;
-
- installedRuntimeList = new List();
-
- string[] directories = Directory.GetDirectories(bbndkPathConst);
-
- foreach (string directory in directories)
- {
- if (directory.Contains("runtime_"))
- {
- installedRuntimeList.Add(directory.Substring(directory.IndexOf("runtime_") + 8).Replace('_', '.'));
- success = true;
- }
- else
- {
- continue;
- }
- }
-
- return success;
-
- }
-
-
- ///
- /// Update API Level from Server
- ///
- ///
- ///
- public bool UpdateAPI(string oldversion, string newversion)
- {
- bool success = false;
-
- Status = "Updating API";
-
- if (!((oldversion.StartsWith("10.1")) || (oldversion.StartsWith("10.0"))))
- {
- UninstallAPI(oldversion, false);
- }
-
- InstallAPI(newversion, false, false);
-
- return success;
- }
-
- #endregion
-
- #region Public Properties
-
- ///
- /// Getter for the APITargets property
- ///
- public CollectionView APITargets
- {
- get { return _apiTargets; }
- set
- {
- _apiTargets = value;
- OnPropertyChanged(_colAPITargets);
- }
- }
-
- ///
- /// Getter for the Simulators property
- ///
- public CollectionView Simulators
- {
- get { return _simulators; }
- set
- {
- _simulators = value;
- OnPropertyChanged(_colSimulators);
- }
- }
-
- ///
- /// Getter for the Simulators property
- ///
- public CollectionView Simulators2
- {
- get { return _simulators2; }
- set
- {
- _simulators2 = value;
- OnPropertyChanged(_colSimulators);
- }
- }
-
- ///
- /// Errors property
- ///
- public String Errors
- {
- get { return _errors; }
- set { _errors = value; }
- }
-
- ///
- /// Error property
- ///
- public String Error
- {
- get { return _error; }
- set { _error = value; }
- }
-
- ///
- /// Status property
- ///
- public String Status
- {
- get { return _status; }
- set
- {
- _status = value;
- OnPropertyChanged(_colStatus);
- }
- }
-
- ///
- /// Is Installing property
- ///
- public bool IsInstalling
- {
- get { return isInstalling; }
- set
- {
- isInstalling = value;
- OnPropertyChanged(_colIsInstalling);
- }
- }
-
- ///
- /// Getter/Setter for the APITarget property
- ///
- public APITargetClass APITarget
- {
- get { return _apiTarget; }
- set
- {
- _apiTarget = value;
- OnPropertyChanged(_colAPITarget);
- }
- }
-
- ///
- /// Getter/Setter for the Simulator property
- ///
- public SimulatorsClass Simulator
- {
- get { return _simulator; }
- set
- {
- _simulator = value;
- OnPropertyChanged(_colSimulator);
- }
- }
-
- #endregion
-
- #region Private Member Functions
-
- ///
- /// Given the version set the selected API version
- ///
- ///
- public void SetRuntime(string version)
- {
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkNDKPath = null;
-
- try
- {
- string remotePath = bbndkPathConst + @"\runtime_" + version.Replace('.', '_') + @"\qnx6\armle-v7\";
-
- rkNDKPath = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- rkNDKPath.SetValue("NDKRemotePath", remotePath);
- }
- catch
- {
-
- }
- rkNDKPath.Close();
- rkHKCU.Close();
- }
-
- ///
- /// Given the version set the selected API version
- ///
- ///
- public void SetSelectedAPI(string version)
- {
-
- if (installedAPIList != null)
- {
- APIClass result = installedAPIList.Find(i => i.Version.Contains(version));
-
- if (result != null)
- {
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkNDKPath = null;
-
- try
- {
- rkNDKPath = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- rkNDKPath.SetValue("NDKHostPath", result.HostName);
- rkNDKPath.SetValue("NDKTargetPath", result.TargetName);
-
- string qnx_config = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK";
-
- System.Environment.SetEnvironmentVariable("QNX_TARGET", result.TargetName);
- System.Environment.SetEnvironmentVariable("QNX_HOST", result.HostName);
- System.Environment.SetEnvironmentVariable("QNX_CONFIGURATION", qnx_config);
-
- string ndkpath = string.Format(@"{0}/usr/bin;{1}\bin;{0}/usr/qde/eclipse/jre/bin;", result.HostName, qnx_config) +
- System.Environment.GetEnvironmentVariable("PATH");
- System.Environment.SetEnvironmentVariable("PATH", ndkpath);
- }
- catch
- {
-
- }
- rkNDKPath.Close();
- rkHKCU.Close();
- }
- }
-
- }
-
- ///
- /// Return the Current API Version from the registry
- ///
- /// Currently selected API Version.
- public string getCurrentAPIVersion()
- {
- string retVal = "";
-
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkNDKPath = null;
-
- try
- {
- rkNDKPath = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- retVal = rkNDKPath.GetValue("NDKTargetPath").ToString();
- retVal = retVal.Replace(bbndkPathConst.Replace("\\", @"/"), "");
- retVal = retVal.Substring(retVal.IndexOf('_') + 1);
- retVal = retVal.Substring(0, retVal.IndexOf('/'));
- retVal = retVal.Replace('_', '.');
- rkNDKPath.Close();
- rkHKCU.Close();
- }
- catch
- {
- if (rkNDKPath != null)
- rkNDKPath.Close();
- rkHKCU.Close();
- }
-
- return retVal;
- }
-
-
- ///
- /// Check to see if Runtime is installed
- ///
- /// Check version number
- /// Check API name
- /// true if installed
- public bool IsRuntimeInstalled(string version)
- {
- bool success = false;
-
- getInstalledRuntimeTargetList();
-
- if (installedRuntimeList != null)
- {
- string result = installedRuntimeList.FirstOrDefault(s => s.Contains(version));
-
- if (result != null)
- {
- success = true;
- }
- }
-
- return success;
- }
-
-
- ///
- /// Given a runtime version get the associated API Level version.
- ///
- ///
- ///
- public string GetAPILevel(string version)
- {
- string retVal = "";
-
- while ((retVal == "") && (version.Contains('.')))
- {
- if (APITargetListSingleton.Instance._tempAPITargetList != null)
- {
- APITargetClass apiLevel = APITargetListSingleton.Instance._tempAPITargetList.FindLast(i => i.TargetVersion.Contains(version));
-
- if (apiLevel != null)
- {
- retVal = apiLevel.TargetVersion;
- }
- }
-
- if (retVal == "")
- {
- version = version.Substring(0, version.LastIndexOf('.'));
- }
- }
-
- return retVal;
- }
-
- ///
- /// Event that handles the return of a process.
- ///
- ///
- ///
- private void p_Exited(object sender, System.EventArgs e)
- {
- isConfiguring = false;
-
- if (_error != "")
- {
- Status = "Error";
-
- MessageBox.Show(_error, "Update Manager", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
-
- RefreshScreen();
-
- }
- else
- {
- Status = "Complete";
-
- RefreshScreen();
-
- //if (installVersion != "")
- //{
- // SetSelectedAPI(installVersion);
-
- if (_isRuntime)
- {
- SetRuntime(installVersion);
- _isRuntime = false;
- }
-
- // installVersion = "";
-
- installVersion = "";
-
- installed = true;
- }
- // IsInstalling = false;
- }
-
- ///
- /// On Data Received event handler
- ///
- ///
- ///
- private void InstallDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
- {
- if (e.Data != null)
- {
-
- if ((e.Data.ToLower().Contains("error")) || (_error != ""))
- {
- _error = _error + e.Data + "\n";
- }
- else
- {
- if ((!isConfiguring) && (e.Data.Contains("Configuring")))
- {
- isConfiguring = true;
- }
- Status = e.Data;
- }
- }
- }
-
- ///
- /// On Error received event handler
- ///
- ///
- ///
- private void p_ErrorDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
- {
- if (e.Data != null)
- {
- System.Diagnostics.Debug.WriteLine(e.Data);
- _errors += e.Data + "\n";
-// MessageBox.Show(e.Data);
- }
- }
-
-
-
- #endregion
-
- #region INotifyPropertyChanged Implementation
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- ///
- /// Fire the PropertyChnaged event handler on change of property
- ///
- ///
- protected void OnPropertyChanged(string propName)
- {
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs(propName));
- }
- }
-
- #endregion
- }
-}
diff --git a/src/VSNDK.Package/UpdateManager/SimulatorManager.xaml b/src/VSNDK.Package/UpdateManager/SimulatorManager.xaml
deleted file mode 100644
index e276e8bf..00000000
--- a/src/VSNDK.Package/UpdateManager/SimulatorManager.xaml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Package/UpdateManager/SimulatorManager.xaml.cs b/src/VSNDK.Package/UpdateManager/SimulatorManager.xaml.cs
deleted file mode 100644
index a2bc2320..00000000
--- a/src/VSNDK.Package/UpdateManager/SimulatorManager.xaml.cs
+++ /dev/null
@@ -1,149 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-using RIM.VSNDK_Package.UpdateManager.Model;
-using Microsoft.VisualStudio.PlatformUI;
-using Microsoft.VisualStudio.Shell;
-
-namespace RIM.VSNDK_Package.UpdateManager
-{
- ///
- /// Interaction logic for UpdateManager.xaml
- ///
- public partial class SimulatorManager : Window
- {
- private UpdateManagerData umData;
-
- ///
- /// Constructor
- ///
- public SimulatorManager()
- {
- InitializeComponent();
-
- umData = new UpdateManagerData();
- gridMain.DataContext = umData;
- this.Close.IsEnabled = true;
- }
-
- ///
- /// Close button
- ///
- ///
- ///
- private void Close_Click(object sender, RoutedEventArgs e)
- {
- DialogResult = umData.installed;
- }
-
- ///
- /// Install button
- ///
- ///
- ///
- private void Install_Click(object sender, RoutedEventArgs e)
- {
- if (umData.IsInstalling)
- {
- MessageBox.Show("Visual Studio is currently already installing/uninstalling a Simulator. Please wait until completion before proceeding.", "Simulators", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
- }
- else
- {
- umData.InstallAPI(((SimulatorsClass)((StackPanel)((Button)sender).Parent).DataContext).TargetVersion, false, true);
- }
- }
-
- ///
- /// Uninstall button
- ///
- ///
- ///
- private void Uninstall_Click(object sender, RoutedEventArgs e)
- {
- if (umData.IsInstalling)
- {
- MessageBox.Show("Visual Studio is currently already installing/uninstalling a Simulator. Please wait until completion before proceeding.", "Simulators", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
- }
- else
- {
- umData.UninstallAPI(((SimulatorsClass)((StackPanel)((Button)sender).Parent).DataContext).TargetVersion, true);
- }
- }
-
- ///
- /// Prevent the user from closing
- ///
- ///
- ///
- private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
- {
- if ((!umData.installed) && (umData.IsInstalling))
- {
- if (umData.isConfiguring)
- {
- umData.waitTerminateInstallation();
- }
- else
- {
- var result = MessageBox.Show("Are you sure that you want to cancel the installation?", "Cancel installation?", MessageBoxButton.YesNo, MessageBoxImage.Question);
- if (result == MessageBoxResult.No)
- {
- e.Cancel = true;
- }
- else
- {
- if (umData.isConfiguring)
- {
- umData.waitTerminateInstallation();
- }
- else
- {
- umData.cancelInstallation();
- umData.installed = false;
- umData.Error = "Download cancelled by the user. You must be able to debug only after completing the download.";
- }
- }
- }
- }
- }
-
- ///
- /// Expansion Event
- ///
- ///
- ///
- private void grpAPILevel120_Expanded(object sender, RoutedEventArgs e)
- {
- // Init variables
- Expander ex = ((Expander)sender);
- string APIText = ((TextBlock)((StackPanel)ex.Header).Children[0]).Text;
-
- // Filter sub list and set items source
- umData.FilterSubList(APIText.Substring(APIText.LastIndexOf(' ') + 1));
- ((ItemsControl)ex.Content).ItemsSource = umData.Simulators2;
- }
- }
-}
diff --git a/src/VSNDK.Package/UpdateManager/UpdateManager.xaml b/src/VSNDK.Package/UpdateManager/UpdateManager.xaml
deleted file mode 100644
index efba0fd1..00000000
--- a/src/VSNDK.Package/UpdateManager/UpdateManager.xaml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Package/UpdateManager/UpdateManager.xaml.cs b/src/VSNDK.Package/UpdateManager/UpdateManager.xaml.cs
deleted file mode 100644
index 97633471..00000000
--- a/src/VSNDK.Package/UpdateManager/UpdateManager.xaml.cs
+++ /dev/null
@@ -1,197 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-using RIM.VSNDK_Package.UpdateManager.Model;
-using Microsoft.VisualStudio.PlatformUI;
-using Microsoft.VisualStudio.Shell;
-
-namespace RIM.VSNDK_Package.UpdateManager
-{
- ///
- /// Interaction logic for UpdateManager.xaml
- ///
- public partial class UpdateManager : Window
- {
- private UpdateManagerData data = null;
-
- ///
- /// Constructor
- ///
- private UpdateManager()
- {
-
- InitializeComponent();
-
- data = new UpdateManagerData();
-
- gridMain.DataContext = data;
- this.Close.IsEnabled = true;
- this.Simulators.IsEnabled = true;
- }
-
- public static UpdateManager create()
- {
- if (!GlobalFunctions.isOnline())
- {
- System.Windows.MessageBox.Show("You are currently experiencing internet connection issues and cannot access the Update Manager server. Please check your connection or try again later.", "Settings", MessageBoxButton.OK, MessageBoxImage.Warning, MessageBoxResult.OK);
- return null;
- }
- else
- {
- return new UpdateManager();
- }
- }
-
-
- ///
- /// Close button
- ///
- ///
- ///
- private void Close_Click(object sender, RoutedEventArgs e)
- {
- DialogResult = data.installed;
- }
-
- ///
- /// Install button
- ///
- ///
- ///
- private void Install_Click(object sender, RoutedEventArgs e)
- {
- UpdateManagerData data = gridMain.DataContext as UpdateManagerData;
-
- if (data != null)
- {
- if (data.IsInstalling)
- {
- MessageBox.Show("Visual Studio is currently already installing/uninstalling an API Level. Please wait until completion before proceeding.", "", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
- }
- else
- {
- this.Simulators.IsEnabled = false;
- data.InstallAPI(((APITargetClass)((StackPanel)((Button)sender).Parent).DataContext).TargetVersion, false, false);
- }
- }
- }
-
- ///
- /// Uninstall button
- ///
- ///
- ///
- private void Uninstall_Click(object sender, RoutedEventArgs e)
- {
- UpdateManagerData data = gridMain.DataContext as UpdateManagerData;
- if (data != null)
- {
- if (data.IsInstalling)
- {
- MessageBox.Show("Visual Studio is currently already installing/uninstalling an API Level. Please wait until completion before proceeding.", "Update Manager", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
- }
- else
- {
- if (((APITargetClass)((StackPanel)((Button)sender).Parent).DataContext).IsInstalled == 2)
- {
- MessageBox.Show("The API Level that you are currently trying to uninstall was not added via the Update Manager. Please remove via the Windows Add/Remove programs utility.", "Update Manager", MessageBoxButton.OK, MessageBoxImage.Warning, MessageBoxResult.OK);
- }
- else
- {
- this.Simulators.IsEnabled = false;
- data.UninstallAPI(((APITargetClass)((StackPanel)((Button)sender).Parent).DataContext).TargetVersion, false);
- }
- }
- }
- }
-
- ///
- /// Update
- ///
- ///
- ///
- private void Update_Click(object sender, RoutedEventArgs e)
- {
- UpdateManagerData data = gridMain.DataContext as UpdateManagerData;
- if (data != null)
- {
- if (data.IsInstalling)
- {
- MessageBox.Show("Visual Studio is currently already installing/uninstalling an API Level. Please wait until completion before proceeding.", "", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
- }
- else
- {
- this.Simulators.IsEnabled = false;
- data.UpdateAPI(((APITargetClass)((StackPanel)((Button)sender).Parent).DataContext).TargetVersion, ((APITargetClass)((StackPanel)((Button)sender).Parent).DataContext).LatestVersion);
- }
-
- }
- }
-
- ///
- /// Prevent the user from closing
- ///
- ///
- ///
- private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
- {
- if ((!data.installed) && (data.IsInstalling))
- {
- if (data.isConfiguring)
- {
- data.waitTerminateInstallation();
- }
- else
- {
- var result = MessageBox.Show("Are you sure that you want to cancel the installation?", "Cancel installation?", MessageBoxButton.YesNo, MessageBoxImage.Question);
- if (result == MessageBoxResult.No)
- {
- e.Cancel = true;
- }
- else
- {
- if (data.isConfiguring)
- {
- data.waitTerminateInstallation();
- }
- else
- {
- data.cancelInstallation();
- data.installed = false;
- data.Error = "Download cancelled by the user. You must be able to debug only after completing the download.";
- }
- }
- }
- }
- }
-
- private void Simulators_Click(object sender, RoutedEventArgs e)
- {
- SimulatorManager sm = new SimulatorManager();
- sm.ShowDialog();
- }
- }
-}
diff --git a/src/VSNDK.Package/UpdateManager/UpdateManagerDialog.xaml b/src/VSNDK.Package/UpdateManager/UpdateManagerDialog.xaml
deleted file mode 100644
index 91de6f4c..00000000
--- a/src/VSNDK.Package/UpdateManager/UpdateManagerDialog.xaml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Package/UpdateManager/UpdateManagerDialog.xaml.cs b/src/VSNDK.Package/UpdateManager/UpdateManagerDialog.xaml.cs
deleted file mode 100644
index 157fdac2..00000000
--- a/src/VSNDK.Package/UpdateManager/UpdateManagerDialog.xaml.cs
+++ /dev/null
@@ -1,151 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-using RIM.VSNDK_Package.UpdateManager.Model;
-using Microsoft.VisualStudio.PlatformUI;
-using System.Net.Sockets;
-using Microsoft.VisualStudio.Shell;
-
-namespace RIM.VSNDK_Package.UpdateManager
-{
- ///
- /// Interaction logic for UpdateManager.xaml
- ///
- public partial class UpdateManagerDialog : Window
- {
- private string _version = "";
- private bool _isRuntime = false;
- private bool _isSimulator = false;
- private UpdateManagerData data = null;
-
- ///
- /// Constructor
- ///
- public UpdateManagerDialog()
- {
- if (!GlobalFunctions.isOnline())
- {
- System.Windows.MessageBox.Show("You are currently experiencing internet connection issues and cannot access the Update Manager server. Please check your connection or try again later.", "Settings", MessageBoxButton.OK, MessageBoxImage.Warning, MessageBoxResult.OK);
- this.Close();
- }
-
- InitializeComponent();
-
- data = new UpdateManagerData();
- gridMain.DataContext = data;
- }
-
- ///
- /// Constructor
- ///
- public UpdateManagerDialog(string message, string version, bool isRuntime, bool isSimulator)
- {
- if (!GlobalFunctions.isOnline())
- {
- System.Windows.MessageBox.Show("You are currently experiencing internet connection issues and cannot access the Update Manager server. Please check your connection or try again later.", "Settings", MessageBoxButton.OK, MessageBoxImage.Warning, MessageBoxResult.OK);
- this.Close();
- }
-
- InitializeComponent();
-
- data = new UpdateManagerData();
- gridMain.DataContext = data;
-
- _version = version;
- _isRuntime = isRuntime;
- _isSimulator = isSimulator;
-
- lblMessage.Text = message;
- }
-
- ///
- /// No button
- ///
- ///
- ///
- private void Close_Click(object sender, RoutedEventArgs e)
- {
- DialogResult = data.installed;
- }
-
- ///
- /// No button
- ///
- ///
- ///
- private void Install_Click(object sender, RoutedEventArgs e)
- {
- this.Yes.IsEnabled = false;
- this.No.IsEnabled = true;
-
- if (data.IsInstalling)
- {
- MessageBox.Show("Visual Studio is currently already installing an API Level. Please wait until completion before proceeding.", "", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
- }
- else
- {
- data.InstallAPI(_version, _isRuntime, _isSimulator);
- }
- }
-
- ///
- /// Prevent the user from closing the window
- ///
- ///
- ///
- private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
- {
- if ((!this.Yes.IsEnabled) && (!data.installed))
- {
- if (data.isConfiguring)
- {
- data.waitTerminateInstallation();
- }
- else
- {
- var result = MessageBox.Show("Are you sure that you want to cancel the installation?", "Cancel installation?", MessageBoxButton.YesNo, MessageBoxImage.Question);
- if (result == MessageBoxResult.No)
- {
- e.Cancel = true;
- }
- else
- {
- if (data.isConfiguring)
- {
- data.waitTerminateInstallation();
- }
- else
- {
- data.cancelInstallation();
- data.installed = false;
- data.Error = "Download cancelled by the user. You must be able to debug only after completing the download.";
- }
- }
- }
- }
- }
- }
-}
diff --git a/src/VSNDK.Package/VSMacroRecorder.cs b/src/VSNDK.Package/VSMacroRecorder.cs
deleted file mode 100644
index c6ac235e..00000000
--- a/src/VSNDK.Package/VSMacroRecorder.cs
+++ /dev/null
@@ -1,277 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Shell.Interop;
-
-namespace RIM.VSNDK_Package
-{
- // Last command type sent to the macro recorder. Note that there are more commands
- // recorded than is implied by this list. Commands in this list (other than
- // LastMacroNone) are coalesced when multiples of the same command are received
- // consecutively.
-
- // This enum should be extended or replaced with your own command identifiers to enable
- // Coalescing of commands.
- public enum LastMacro
- {
- None,
- Text,
- DownArrowLine,
- DownArrowLineSelection,
- DownArrowPara,
- DownArrowParaSelection,
- UpArrowLine,
- UpArrowLineSelection,
- UpArrowPara,
- UpArrowParaSelection,
- LeftArrowChar,
- LeftArrowCharSelection,
- LeftArrowWord,
- LeftArrowWordSelection,
- RightArrowChar,
- RightArrowCharSelection,
- RightArrowWord,
- RightArrowWordSelection,
- DeleteChar,
- DeleteWord,
- BackspaceChar,
- BackspaceWord
- }
-
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue")]
- public enum MoveScope
- {
- Character = tom.tomConstants.tomCharacter,
- Word = tom.tomConstants.tomWord,
- Line = tom.tomConstants.tomLine,
- Paragraph = tom.tomConstants.tomParagraph
- }
-
- ///
- /// The VSMacroRecorder class implementation and the IVsMacroRecorder Interface definition
- /// were included here in this seperate class because they were not included in the
- /// interop assemblies shipped with Visual Studio 2005.
- ///
- /// When implementing a macro recorder this class should be copied into your own name space
- /// and not shared between different 3rd party packages.
- ///
- public class VSMacroRecorder
- {
- private IVsMacroRecorder m_VsMacroRecorder;
- private LastMacro m_LastMacroRecorded;
- private uint m_TimesPreviouslyRecorded;
- Guid m_GuidEmitter;
-
- public VSMacroRecorder(Guid emitter)
- {
- this.m_LastMacroRecorded = LastMacro.None;
-
- this.m_GuidEmitter = emitter;
- }
-
- // Compiler generated destructor is fine
-
- public void Reset()
- {
- m_LastMacroRecorded = LastMacro.None;
- m_TimesPreviouslyRecorded = 0;
- }
-
- public void Stop()
- {
- Reset();
- m_VsMacroRecorder = null;
- }
-
- public bool IsLastRecordedMacro(LastMacro macro)
- {
- return (macro == m_LastMacroRecorded && ObjectIsLastMacroEmitter()) ? true : false;
- }
-
- public bool IsRecording()
- {
- // If the property can not be retreived it is assumeed no macro is being recorded.
- VSRECORDSTATE recordState = VSRECORDSTATE.VSRECORDSTATE_OFF;
-
- // Retrieve the macro recording state.
- IVsShell vsShell = (IVsShell)Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(SVsShell));
- if (vsShell != null)
- {
- object var;
- if (ErrorHandler.Succeeded(vsShell.GetProperty((int)__VSSPROPID.VSSPROPID_RecordState, out var)) && null != var)
- {
- recordState = (VSRECORDSTATE)var;
- }
- }
-
- // If there is a change in the record state to OFF or ON we must either obtain
- // or release the macro recorder.
- if (recordState == VSRECORDSTATE.VSRECORDSTATE_ON && m_VsMacroRecorder == null)
- {
- // If this QueryService fails we no macro recording
- m_VsMacroRecorder = (IVsMacroRecorder)Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(IVsMacroRecorder));
- }
- else if (recordState == VSRECORDSTATE.VSRECORDSTATE_OFF && m_VsMacroRecorder != null)
- {
- // If the macro recording state has been switched off then we can release
- // the service. Note that if the state has become paused we take no action.
- Stop();
- }
-
- return (m_VsMacroRecorder != null);
- }
-
- public void RecordLine(string line)
- {
- m_VsMacroRecorder.RecordLine(line, ref m_GuidEmitter);
- Reset();
- }
-
- public bool RecordBatchedLine(LastMacro macroRecorded, string line)
- {
- if (null == line)
- line = "";
-
- return RecordBatchedLine(macroRecorded, line, 0);
- }
-
- public bool RecordBatchedLine(LastMacro macroRecorded, string line, int maxLineLength)
- {
- if (null == line)
- line = "";
-
- if (maxLineLength > 0 && line.Length >= maxLineLength)
- {
- // Reset the state after recording the line, so it will not be appended to further
- RecordLine(line);
- // Notify the caller that the this line will not be appended to further
- return true;
- }
-
- if(IsLastRecordedMacro(macroRecorded))
- {
- m_VsMacroRecorder.ReplaceLine(line, ref m_GuidEmitter);
- // m_LastMacroRecorded can stay the same
- ++m_TimesPreviouslyRecorded;
- }
- else
- {
- m_VsMacroRecorder.RecordLine(line, ref m_GuidEmitter);
- m_LastMacroRecorded = macroRecorded;
- m_TimesPreviouslyRecorded = 1;
- }
-
- return false;
- }
-
- public uint GetTimesPreviouslyRecorded(LastMacro macro)
- {
- return IsLastRecordedMacro(macro) ? m_TimesPreviouslyRecorded : 0;
- }
-
- // This function determines if the last line sent to the macro recorder was
- // sent from this emitter. Note it is not valid to call this function if
- // macro recording is switched off.
- private bool ObjectIsLastMacroEmitter()
- {
- Guid guid;
- m_VsMacroRecorder.GetLastEmitterId(out guid);
- return guid.Equals(m_GuidEmitter);
- }
- }
-
-#region "IVsMacro Interfaces"
- [StructLayout(LayoutKind.Sequential, Pack = 4), ComConversionLoss]
- internal struct _VSPROPSHEETPAGE
- {
- public uint dwSize;
- public uint dwFlags;
- [ComAliasName("vbapkg.ULONG_PTR")]
- public uint hInstance;
- public ushort wTemplateId;
- public uint dwTemplateSize;
- [ComConversionLoss]
- public IntPtr pTemplate;
- [ComAliasName("vbapkg.ULONG_PTR")]
- public uint pfnDlgProc;
- [ComAliasName("vbapkg.LONG_PTR")]
- public int lParam;
- [ComAliasName("vbapkg.ULONG_PTR")]
- public uint pfnCallback;
- [ComConversionLoss]
- public IntPtr pcRefParent;
- public uint dwReserved;
- [ComConversionLoss, ComAliasName("vbapkg.wireHWND")]
- public IntPtr hwndDlg;
- }
-
- internal enum _VSRECORDMODE
- {
- // Fields
- VSRECORDMODE_ABSOLUTE = 1,
- VSRECORDMODE_RELATIVE = 2
- }
-
- [ComImport, ComConversionLoss, InterfaceType(1), Guid("55ED27C1-4CE7-11D2-890F-0060083196C6")]
- internal interface IVsMacros
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetMacroCommands([Out] IntPtr ppsaMacroCanonicalNames);
- }
-
- [ComImport, InterfaceType(1), Guid("04BBF6A5-4697-11D2-890E-0060083196C6")]
- internal interface IVsMacroRecorder
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void RecordStart([In, MarshalAs(UnmanagedType.LPWStr)] string pszReserved);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void RecordEnd();
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void RecordLine([In, MarshalAs(UnmanagedType.LPWStr)] string pszLine, [In] ref Guid rguidEmitter);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetLastEmitterId([Out] out Guid pguidEmitter);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void ReplaceLine([In, MarshalAs(UnmanagedType.LPWStr)] string pszLine, [In] ref Guid rguidEmitter);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void RecordCancel();
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void RecordPause();
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void RecordResume();
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetCodeEmittedFlag([In] int fFlag);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetCodeEmittedFlag([Out] out int pfFlag);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetKeyWord([In] uint uiKeyWordId, [Out, MarshalAs(UnmanagedType.BStr)] out string pbstrKeyWord);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void IsValidIdentifier([In, MarshalAs(UnmanagedType.LPWStr)] string pszIdentifier);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetRecordMode([Out] out _VSRECORDMODE peRecordMode);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetRecordMode([In] _VSRECORDMODE eRecordMode);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetStringLiteralExpression([In, MarshalAs(UnmanagedType.LPWStr)] string pszStringValue, [Out, MarshalAs(UnmanagedType.BStr)] out string pbstrLiteralExpression);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void ExecuteLine([In, MarshalAs(UnmanagedType.LPWStr)] string pszLine);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void AddTypeLibRef([In] ref Guid guidTypeLib, [In] uint uVerMaj, [In] uint uVerMin);
- }
-#endregion
-}
diff --git a/src/VSNDK.Package/VSNDK.Package.csproj b/src/VSNDK.Package/VSNDK.Package.csproj
deleted file mode 100644
index 0bb961da..00000000
--- a/src/VSNDK.Package/VSNDK.Package.csproj
+++ /dev/null
@@ -1,376 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 2.0
- {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}
- {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- Library
- Properties
- RIM.VSNDK_Package
- VSNDK.Package
- true
- Key.snk
- v4.0
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- true
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
- true
- true
-
-
-
-
-
-
-
-
-
-
-
- false
-
-
-
- True
-
-
-
- ..\..\..\..\..\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.XmlEditor\v4.0_10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.XmlEditor.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2}
- 8
- 0
- 0
- primary
- False
- False
-
-
- {26AD1324-4B7C-44BC-84F8-B86AED45729F}
- 10
- 0
- 0
- primary
- False
- False
-
-
- {1A31287A-4D7D-413E-8E32-3B374931BD89}
- 8
- 0
- 0
- primary
- False
- False
-
-
- {2CE2370E-D744-4936-A090-3FFFE667B0E1}
- 9
- 0
- 0
- primary
- False
- False
-
-
- {1CBA492E-7263-47BB-87FE-639000619B15}
- 8
- 0
- 0
- primary
- False
- False
-
-
- {00020430-0000-0000-C000-000000000046}
- 2
- 0
- 0
- primary
- False
- False
-
-
-
-
-
-
- DebugTokenDialog.xaml
-
-
-
-
-
-
-
-
- Import.xaml
-
-
-
-
-
- SettingsDialog.xaml
-
-
- Form
-
-
- Browser.cs
-
-
- DeRegisterWindow.xaml
-
-
-
- RegistrationWindow.xaml
-
-
- SigningDialog.xaml
-
-
-
- SimulatorManager.xaml
-
-
- UpdateManagerDialog.xaml
-
-
-
- UpdateManager.xaml
-
-
-
- VsDesignerControl.xaml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
- true
- Always
- Designer
-
-
- Always
-
-
-
- True
- True
- Resources.resx
-
-
-
-
-
-
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
- Designer
-
-
- Browser.cs
-
-
- true
- VSPackage
- Designer
-
-
-
-
- Designer
- Always
-
-
-
-
-
-
-
- Menus.ctmenu
- Designer
-
-
-
-
-
-
-
-
- {8CC497C9-A1DF-11CE-8098-00AA0047BE5D}
- 1
- 0
- 0
- tlbimp
- False
- True
-
-
-
-
-
-
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- MSBuild:Compile
- Designer
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
-
-
- False
- Microsoft .NET Framework 4 %28x86 and x64%29
- true
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- false
-
-
- False
- Windows Installer 3.1
- true
-
-
-
- true
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Package/VSNDK.Package.csproj.user b/src/VSNDK.Package/VSNDK.Package.csproj.user
deleted file mode 100644
index e7613c65..00000000
--- a/src/VSNDK.Package/VSNDK.Package.csproj.user
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Program
- C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
- /rootsuffix Exp
-
-
- Program
- C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
- /rootsuffix Exp
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Package/VSNDK.Package.vsct b/src/VSNDK.Package/VSNDK.Package.vsct
deleted file mode 100644
index 5f12c34f..00000000
--- a/src/VSNDK.Package/VSNDK.Package.vsct
+++ /dev/null
@@ -1,202 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Package/VSNDK.PackagePackage.cs b/src/VSNDK.Package/VSNDK.PackagePackage.cs
deleted file mode 100644
index 9bcbeee5..00000000
--- a/src/VSNDK.Package/VSNDK.PackagePackage.cs
+++ /dev/null
@@ -1,1453 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Diagnostics;
-using System.Globalization;
-using System.Runtime.InteropServices;
-using System.ComponentModel.Design;
-using Microsoft.Win32;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.VCProjectEngine;
-using Microsoft.VisualStudio.Shell.Interop;
-using Microsoft.VisualStudio.OLE.Interop;
-using Microsoft.VisualStudio.Shell;
-using System.Xml;
-using System.IO;
-using System.Collections.Generic;
-using System.Linq;
-using EnvDTE;
-using System.Windows.Forms;
-using VSNDK.Package;
-using EnvDTE80;
-using System.Text.RegularExpressions;
-using System.Collections.Specialized;
-using System.Security.Cryptography;
-using System.Text;
-using RIM.VSNDK_Package.UpdateManager.Model;
-
-namespace RIM.VSNDK_Package
-{
- ///
- /// Class to store Installed APIs
- ///
- public class APIClass
- {
- public string Name { get; set; }
- public string HostName { get; set; }
- public string TargetName { get; set; }
- public string Version { get; set; }
-
- public APIClass(string name, string hostName, string targetName, string version)
- {
- Name = name;
- Version = version;
- HostName = hostName;
- TargetName = targetName;
- }
- }
-
- ///
- /// Class to store API Targets
- ///
- public class APITargetClass
- {
- public string TargetName { get; set; }
- public string TargetDescription { get; set; }
- public string TargetVersion { get; set; }
- public string LatestVersion { get; set; }
- public int IsInstalled { get; set; }
- public bool IsUpdate { get; set; }
- public bool IsBeta { get; set; }
-
- public string InstalledVisibility
- {
- get { return IsInstalled > 0 ? "visible" : "collapsed"; }
- }
-
- public string AvailableVisibility
- {
- get { return IsInstalled == 0 ? "visible" : "collapsed"; }
- }
-
- public string UpdateVisibility
- {
- get { return IsUpdate ? "visible" : "collapsed"; }
- }
-
- public string NoUpdateVisibility
- {
- get { return IsUpdate ? "collapsed" : "visible"; }
- }
-
- public APITargetClass(string name, string description, string version)
- {
- TargetName = name;
- TargetDescription = description;
- TargetVersion = version;
- LatestVersion = version;
- IsInstalled = 0;
- IsUpdate = false;
- IsBeta = false;
- }
- }
-
- ///
- /// Class to store Simulators
- ///
- public class SimulatorsClass
- {
- public string APILevel { get; set; }
- public string TargetVersion { get; set; }
- public bool LatestVersion { get; set; }
- public bool IsInstalled { get; set; }
-
- public string TargetVersionText
- {
- get { return LatestVersion ? "Latest Version " + TargetVersion : TargetVersion; }
- }
-
- public string InstalledVersionText
- {
- get { return "BlackBerry Native SDK Simulator (" + TargetVersion + ")"; }
- }
-
- public string LabelAPIVersion
- {
- get { return LatestVersion ? "visible" : "collapsed"; }
- }
-
- public string SubAPIVersion
- {
- get { return LatestVersion ? "collapsed" : "visible"; }
- }
-
- public string LabelAPIVersionText
- {
- get
- {
- return "Simulator for BlackBerry Native SDK " + APILevel;
- }
- }
-
- public string AvailableVisibility
- {
- get { return IsInstalled ? "visible" : "collapsed"; }
- }
-
- public string InstalledVisibility
- {
- get { return IsInstalled ? "collapsed" : "visible"; }
- }
-
- public SimulatorsClass(string version, string apilevel, bool latest)
- {
- TargetVersion = version;
- LatestVersion = latest;
- APILevel = apilevel;
- IsInstalled = false;
- }
- }
-
- ///
- /// Class to retrieve Installed API List
- ///
- public class InstalledAPIListSingleton
- {
- private static InstalledAPIListSingleton _instance;
- public List _installedAPIList;
-
- ///
- /// Constructor
- ///
- private InstalledAPIListSingleton()
- {
- GetInstalledAPIList();
- }
-
- ///
- /// Public property to retrieve the singleton instance
- ///
- public static InstalledAPIListSingleton Instance
- {
- get
- {
- if (_instance == null)
- {
- _instance = new InstalledAPIListSingleton();
- }
- return _instance;
- }
- }
-
- ///
- /// Get list of installed APIs
- ///
- ///
- private void GetInstalledAPIList()
- {
- try
- {
- _installedAPIList = new List();
-
- string dirPaths = GlobalFunctions.bbndkPathConst + @"\..\qconfig\";
-
- string[] filePaths = Directory.GetFiles(dirPaths, "*.xml");
- foreach (string file in filePaths)
- {
- try
- {
- XmlDocument xmlDoc = new XmlDocument();
- xmlDoc.Load(file);
- XmlNodeList name = xmlDoc.GetElementsByTagName("name");
- XmlNodeList version = xmlDoc.GetElementsByTagName("version");
- XmlNodeList hostpath = xmlDoc.GetElementsByTagName("host");
- XmlNodeList targetpath = xmlDoc.GetElementsByTagName("target");
-
- APIClass aclass = new APIClass(name.Item(0).InnerText, hostpath.Item(0).InnerText, targetpath.Item(0).InnerText, version.Item(0).InnerText);
- _installedAPIList.Add(aclass);
- }
- catch
- {
- break;
- }
- }
- }
- catch (Exception ex)
- {
-
- }
- }
-
-
- }
-
-
- ///
- /// Class to retrieve Installed API List
- ///
- public class InstalledNDKListSingleton
- {
- private static InstalledNDKListSingleton _instance;
- public List _installedNDKList;
-
- ///
- /// Constructor
- ///
- private InstalledNDKListSingleton()
- {
- GetInstalledNDKList();
- }
-
- ///
- /// Public property to retrieve the singleton instance
- ///
- public static InstalledNDKListSingleton Instance
- {
- get
- {
- if (_instance == null)
- {
- _instance = new InstalledNDKListSingleton();
- }
- return _instance;
- }
- }
-
- ///
- /// Get list of installed APIs
- ///
- ///
- private void GetInstalledNDKList()
- {
- try
- {
- _installedNDKList = new List();
-
- string dirPaths = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK\qconfig\";
-
- string[] filePaths = Directory.GetFiles(dirPaths, "*.xml");
- foreach (string file in filePaths)
- {
- try
- {
- XmlDocument xmlDoc = new XmlDocument();
- xmlDoc.Load(file);
- XmlNodeList name = xmlDoc.GetElementsByTagName("name");
- XmlNodeList version = xmlDoc.GetElementsByTagName("version");
- XmlNodeList hostpath = xmlDoc.GetElementsByTagName("host");
- XmlNodeList targetpath = xmlDoc.GetElementsByTagName("target");
-
- APIClass aclass = new APIClass(name.Item(0).InnerText, hostpath.Item(0).InnerText, targetpath.Item(0).InnerText, version.Item(0) == null ? "2.1.0" : version.Item(0).InnerText);
- _installedNDKList.Add(aclass);
- }
- catch
- {
- break;
- }
- }
- }
- catch (Exception ex)
- {
-
- }
- }
- }
-
- ///
- /// Class to retrieve API Target List
- ///
- public class APITargetListSingleton
- {
- private static APITargetListSingleton _instance;
- public List _tempAPITargetList;
- private string _error = "";
-
- private APITargetListSingleton()
- {
- GetAvailableAPIList();
- }
-
- ///
- /// Retrieve list of API's from
- ///
- ///
- private void GetAvailableAPIList()
- {
- if (GlobalFunctions.isOnline())
- {
- System.Diagnostics.Process p = new System.Diagnostics.Process();
- System.Diagnostics.ProcessStartInfo startInfo = p.StartInfo;
- startInfo.UseShellExecute = false;
- startInfo.CreateNoWindow = true;
- startInfo.RedirectStandardError = true;
- startInfo.RedirectStandardOutput = true;
- p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(ErrorDataReceived);
- p.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(APIListDataReceived);
-
-
- /// Get Device PIN
- startInfo.FileName = "cmd.exe";
- startInfo.Arguments = string.Format(@"/C " + GlobalFunctions.bbndkPathConst + @"\eclipsec --list");
-
- try
- {
- _tempAPITargetList = new List();
-
- p.Start();
- p.BeginErrorReadLine();
- p.BeginOutputReadLine();
- p.WaitForExit();
- p.Close();
- }
- catch (Exception e)
- {
- System.Diagnostics.Debug.WriteLine(startInfo.Arguments);
- System.Diagnostics.Debug.WriteLine(e.Message);
- }
- }
-
- }
-
- ///
- /// On Data Received event handler
- ///
- ///
- ///
- private void APIListDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
- {
- string name = "";
- string description = "";
- string version = "";
- APITargetClass api = null;
-
- if (e.Data != null)
- {
- if ((e.Data.ToLower().Contains("error")) || (_error != ""))
- {
- _error = _error + e.Data;
- }
- else if ((e.Data.Contains("Location:")) || (e.Data.Contains("Available")))
- {
- // Do Nothing
- }
- else
- {
- version = e.Data.Substring(0, e.Data.LastIndexOf(" - "));
- name = e.Data.Substring(e.Data.LastIndexOf(" - ") + 3);
- description = "Device Support Unknown.";
-
-
- api = _tempAPITargetList.Find(i => i.TargetName == name);
-
- if (api == null)
- {
- api = new APITargetClass(name, description, version);
- api.IsInstalled = IsAPIInstalled(version, "");
- _tempAPITargetList.Add(api);
- }
- else
- {
- switch (api.IsInstalled)
- {
- case 0:
- api.TargetVersion = version;
- api.LatestVersion = version;
- break;
- case 1:
- api.IsUpdate = true;
- api.LatestVersion = version;
- break;
- case 2:
- api.TargetVersion = version;
- api.LatestVersion = "NDK";
- break;
- }
- }
-
- api.IsBeta = name.Contains("Beta");
-
- }
- }
- }
-
- ///
- /// Check to see if API is installed
- ///
- /// Check version number
- /// Check API name
- /// true if installed
- private int IsAPIInstalled(string version, string name)
- {
- int success = 0;
-
- /// Check for 2.1 version
- if (version.StartsWith("2.1.0"))
- version = "2.1.0";
-
- if (InstalledAPIListSingleton.Instance._installedAPIList != null)
- {
- APIClass result = InstalledAPIListSingleton.Instance._installedAPIList.Find(i => i.Version.Contains(version));
-
- if (result != null)
- {
- success = 1;
- }
- }
-
- if (InstalledNDKListSingleton.Instance._installedNDKList != null)
- {
- APIClass result = InstalledNDKListSingleton.Instance._installedNDKList.Find(i => i.Version.Contains(version));
-
- if (result != null)
- {
- success = 2;
- }
- }
-
- return success;
- }
-
- ///
- /// On Error received event handler
- ///
- ///
- ///
- private void ErrorDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
- {
- if (e.Data != null)
- {
- System.Diagnostics.Debug.WriteLine(e.Data);
-
- MessageBox.Show(e.Data);
- }
- }
-
- ///
- /// Public interface for getting the singleton instance
- ///
- public static APITargetListSingleton Instance
- {
- get
- {
- if (_instance == null)
- {
- _instance = new APITargetListSingleton();
- }
- return _instance;
- }
- }
- }
-
- ///
- /// Class to retrieve Installed API List
- ///
- public class SimulatorListSingleton
- {
- private static SimulatorListSingleton _instance;
- public List _simulatorList;
- private string _error = "";
-
- ///
- /// Constructor
- ///
- private SimulatorListSingleton()
- {
- GetSimulatorList();
- }
-
- ///
- /// Public property to retrieve the singleton instance
- ///
- public static SimulatorListSingleton Instance
- {
- get
- {
- if (_instance == null)
- {
- _instance = new SimulatorListSingleton();
- }
- return _instance;
- }
- }
-
- ///
- /// Retrieve list of Available Simulators
- ///
- ///
- private void GetSimulatorList()
- {
- if (GlobalFunctions.isOnline())
- {
- System.Diagnostics.Process p = new System.Diagnostics.Process();
- System.Diagnostics.ProcessStartInfo startInfo = p.StartInfo;
- startInfo.UseShellExecute = false;
- startInfo.CreateNoWindow = true;
- startInfo.RedirectStandardError = true;
- startInfo.RedirectStandardOutput = true;
- p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(ErrorDataReceived);
- p.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(SimulatorListDataReceived);
-
- /// Get Device PIN
- startInfo.FileName = "cmd.exe";
- startInfo.Arguments = string.Format(@"/C " + GlobalFunctions.bbndkPathConst + @"\eclipsec --list-all --simulator");
-
- try
- {
- _simulatorList = new List();
-
- p.Start();
- p.BeginErrorReadLine();
- p.BeginOutputReadLine();
- p.WaitForExit();
- p.Close();
- }
- catch (Exception e)
- {
- System.Diagnostics.Debug.WriteLine(startInfo.Arguments);
- System.Diagnostics.Debug.WriteLine(e.Message);
- }
- }
- }
-
- ///
- /// On Error received event handler
- ///
- ///
- ///
- private void ErrorDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
- {
- if (e.Data != null)
- {
- System.Diagnostics.Debug.WriteLine(e.Data);
-
- MessageBox.Show(e.Data);
- }
- }
-
- ///
- /// On Data Received event handler
- ///
- ///
- ///
- private void SimulatorListDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
- {
- string apilevel = "";
- string version = "";
-
- SimulatorsClass sim = null;
-
- if (e.Data != null)
- {
- if ((e.Data.ToLower().Contains("error")) || (_error != ""))
- {
- _error = _error + e.Data;
- }
- else if ((e.Data.Contains("Location:")) || (e.Data.Contains("Available")))
- {
- // Do Nothing
- }
- else
- {
- version = e.Data.Substring(0, e.Data.LastIndexOf(" - "));
- apilevel = version.Split('.')[0] + "." + version.Split('.')[1];
-
- sim = _simulatorList.Find(i => i.APILevel == apilevel);
-
- if (sim == null)
- {
- sim = new SimulatorsClass(version, apilevel, true);
- sim.IsInstalled = IsSimulatorInstalled(version);
- _simulatorList.Add(sim);
- }
- else
- {
- //sim not the latest... mark it as false
- sim.LatestVersion = false;
-
- //create new sim
- SimulatorsClass sim2 = new SimulatorsClass(version, apilevel, true);
- sim2.IsInstalled = IsSimulatorInstalled(version);
-
- // insert before found sim.
- _simulatorList.Insert(_simulatorList.IndexOf(sim), sim2);
- }
- }
- }
- }
-
-
- ///
- /// Check to see if Simulator is installed
- ///
- /// Check version number
- /// true if installed
- private bool IsSimulatorInstalled(string version)
- {
- bool success = false;
-
- if (InstalledSimulatorListSingleton.Instance.installedSimulatorList != null)
- {
- string result = InstalledSimulatorListSingleton.Instance.installedSimulatorList.FirstOrDefault(s => s.Contains(version));
-
- if (result != null)
- {
- success = true;
- }
- }
-
- return success;
- }
-
- }
-
- ///
- /// Class to retrieve Installed API List
- ///
- public class InstalledSimulatorListSingleton
- {
- private static InstalledSimulatorListSingleton _instance;
- public List installedSimulatorList;
-
- ///
- /// Constructor
- ///
- private InstalledSimulatorListSingleton()
- {
- GetInstalledSimulatorList();
- }
-
- ///
- /// Public property to retrieve the singleton instance
- ///
- public static InstalledSimulatorListSingleton Instance
- {
- get
- {
- if (_instance == null)
- {
- _instance = new InstalledSimulatorListSingleton();
- }
- return _instance;
- }
- }
-
- ///
- /// Retrieve a list of the installed runtimes on the PC.
- ///
- ///
- public bool GetInstalledSimulatorList()
- {
- bool success = false;
-
- installedSimulatorList = new List();
-
- string[] directories = Directory.GetFiles(GlobalFunctions.bbndkPathConst, "*.vmxf", SearchOption.AllDirectories);
-
- foreach (string directory in directories)
- {
- if (directory.Contains("simulator_"))
- {
- installedSimulatorList.Add(directory.Substring(0, directory.LastIndexOf("\\")).Substring(directory.IndexOf("simulator_") + 10).Replace('_', '.'));
- success = true;
- }
- else
- {
- continue;
- }
- }
-
- return success;
- }
- }
-
-
- ///
- /// This is the class that implements the package exposed by this assembly.
- ///
- /// The minimum requirement for a class to be considered a valid package for Visual Studio
- /// is to implement the IVsPackage interface and register itself with the shell.
- /// This package uses the helper classes defined inside the Managed Package Framework (MPF)
- /// to do it: it derives from the Package class that provides the implementation of the
- /// IVsPackage interface and uses the registration attributes defined in the framework to
- /// register itself and its components with the shell.
- ///
- // This attribute tells the PkgDef creation utility (CreatePkgDef.exe) that this class is
- // a package.
- [PackageRegistration(UseManagedResourcesOnly = true)]
-
- ///Register the editor factory
- [XmlEditorDesignerViewRegistration("XML", "xml", LogicalViewID.Designer, 0x60,
- DesignerLogicalViewEditor = typeof(EditorFactory),
- Namespace = "http://www.qnx.com/schemas/application/1.0",
- MatchExtensionAndNamespace = true)]
- // And which type of files we want to handle
- [ProvideEditorExtension(typeof(EditorFactory), EditorFactory.defaultExtension, 0x40, NameResourceID = 106)]
- // We register that our editor supports LOGVIEWID_Designer logical view
- [ProvideEditorLogicalView(typeof(EditorFactory), LogicalViewID.Designer)]
-
- // Microsoft Visual C# Project
- [EditorFactoryNotifyForProject("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}", EditorFactory.defaultExtension, GuidList.guidVSNDK_PackageEditorFactoryString)]
-
- // This attribute is used to register the informations needed to show the this package
- // in the Help/About dialog of Visual Studio.
- [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
- // This attribute is needed to let the shell know that this package exposes some menus.
- [ProvideMenuResource("Menus.ctmenu", 1)]
- // This attribute registers a tool window exposed by this package.
- [ProvideAutoLoad(VSConstants.UICONTEXT.NoSolution_string)]
- [Guid(GuidList.guidVSNDK_PackagePkgString)]
- public sealed class VSNDK_PackagePackage : Package
- {
-
- #region private member variables
-
- private EnvDTE.DTE _dte;
- private VSNDKCommandEvents _commandEvents;
- private bool _isSimulator;
- private BuildEvents _buildEvents;
- private List _targetDir = null;
- private bool _hitPlay = false;
- private int _amountOfProjects = 0;
- private string _error = "";
- private bool _isDeploying = false;
- private OutputWindowPane _owP;
- private bool isDebugConfiguration = true;
-
- #endregion
-
- #region Package Members
-
- ///
- /// Default constructor of the package.
- /// Inside this method you can place any initialization code that does not require
- /// any Visual Studio service because at this point the package object is created but
- /// not sited yet inside Visual Studio environment. The place to do all the other
- /// initialization is the Initialize method.
- ///
- public VSNDK_PackagePackage()
- {
- Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString()));
- }
-
- ///
- /// Initialization of the package; this method is called right after the package is sited, so this is the place
- /// where you can put all the initilaization code that rely on services provided by VisualStudio.
- ///
- protected override void Initialize()
- {
- Trace.WriteLine (string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
- base.Initialize();
-
- //Create Editor Factory. Note that the base Package class will call Dispose on it.
- base.RegisterEditorFactory(new EditorFactory(this));
-
- _dte = (EnvDTE.DTE)GetService(typeof(EnvDTE.DTE));
-
- SetNDKPath();
-
- APITargetListSingleton api = APITargetListSingleton.Instance;
- InstalledAPIListSingleton apiList = InstalledAPIListSingleton.Instance;
- InstalledNDKListSingleton ndkList = InstalledNDKListSingleton.Instance;
- SimulatorListSingleton simList = SimulatorListSingleton.Instance;
- InstalledSimulatorListSingleton installedSimList = InstalledSimulatorListSingleton.Instance;
-
- _commandEvents = new VSNDKCommandEvents((DTE2)_dte);
- _commandEvents.RegisterCommand(GuidList.guidVSStd97String, CommandConstants.cmdidStartDebug, startDebugCommandEvents_AfterExecute, startDebugCommandEvents_BeforeExecute);
- _commandEvents.RegisterCommand(GuidList.guidVSStd97String, CommandConstants.cmdidStartDebug, startDebugCommandEvents_AfterExecute, startDebugCommandEvents_BeforeExecute);
- _commandEvents.RegisterCommand(GuidList.guidVSStd2KString, CommandConstants.cmdidStartDebugContext, startDebugCommandEvents_AfterExecute, startDebugCommandEvents_BeforeExecute);
-
- _buildEvents = _dte.Events.BuildEvents;
- _buildEvents.OnBuildBegin += new _dispBuildEvents_OnBuildBeginEventHandler(this.OnBuildBegin);
-
-
-
- // Add our command handlers for menu (commands must exist in the .vsct file)
- OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
- if ( null != mcs )
- {
- // Create the command for the tool window
- CommandID toolwndCommandID = new CommandID(GuidList.guidVSNDK_PackageCmdSet, (int)PkgCmdIDList.cmdidBlackBerryTools);
- MenuCommand menuToolWin = new MenuCommand(ShowToolWindow, toolwndCommandID);
- mcs.AddCommand( menuToolWin );
-
- // Create the command for the settings window
- CommandID wndSettingsCommandID = new CommandID(GuidList.guidVSNDK_PackageCmdSet, (int)PkgCmdIDList.cmdidBlackBerrySettings);
- MenuCommand menuSettingsWin = new MenuCommand(ShowSettingsWindow, wndSettingsCommandID);
- mcs.AddCommand(menuSettingsWin);
-
- // Create the command for the Debug Token window
- CommandID wndDebugTokenCommandID = new CommandID(GuidList.guidVSNDK_PackageCmdSet, (int)PkgCmdIDList.cmdidBlackBerryDebugToken);
- MenuCommand menuDebugTokenWin = new MenuCommand(ShowDebugTokenWindow, wndDebugTokenCommandID);
- mcs.AddCommand(menuDebugTokenWin);
-
- // Create the command for the menu item.
- CommandID projCommandID = new CommandID(GuidList.guidVSNDK_PackageCmdSet, (int)PkgCmdIDList.cmdidfooLocalBox);
- OleMenuCommand projItem = new OleMenuCommand(MenuItemCallback, projCommandID);
- mcs.AddCommand(projItem);
- }
-
- }
- #endregion
-
- #region private methods
-
- ///
- /// Set the NDK path into the registry if not already set.
- ///
- private void SetNDKPath()
- {
- //Initialize NDK if possible.
- RegistryKey rkHKCU = Registry.CurrentUser;
- RegistryKey rkNDKPath = null;
- string qnx_target = "";
- string qnx_host = "";
-
- try
- {
-
- rkNDKPath = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
- qnx_host = rkNDKPath.GetValue("NDKHostPath").ToString();
- qnx_target = rkNDKPath.GetValue("NDKHostPath").ToString();
-
- if (qnx_host == "")
- {
- string[] filePaths = Directory.GetFiles(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK\qconfig\", "*.xml");
-
- if (filePaths.Length >= 1)
- {
- XmlDocument xmlDoc = new XmlDocument();
- xmlDoc.Load(filePaths[0]);
- XmlNodeList name = xmlDoc.GetElementsByTagName("name");
- XmlNodeList hostpath = xmlDoc.GetElementsByTagName("host");
- XmlNodeList targetpath = xmlDoc.GetElementsByTagName("target");
-
- qnx_target = targetpath[0].InnerText;
- qnx_host = hostpath[0].InnerText;
-
- rkNDKPath.SetValue("NDKHostPath", qnx_host);
- rkNDKPath.SetValue("NDKTargetPath", qnx_target);
-
- }
- }
-
- string qnx_config = GlobalFunctions.bbndkPathConst + @"\features\com.qnx.tools.jre.win32_1.6.0.43\jre\bin";
-
- System.Environment.SetEnvironmentVariable("QNX_TARGET", qnx_target);
- System.Environment.SetEnvironmentVariable("QNX_HOST", qnx_host);
-
- string ndkpath = string.Format(@"{0}/usr/bin;{1}", qnx_host, qnx_config) +
- System.Environment.GetEnvironmentVariable("PATH");
- System.Environment.SetEnvironmentVariable("PATH", ndkpath);
-
-
- }
- catch (Exception ex)
- {
- string e = ex.ToString();
- }
-
- rkNDKPath.Close();
- rkHKCU.Close();
- }
-
- ///
- /// Identify the projects to be build and start the build process.
- ///
- /// TRUE if successful, FALSE if not.
- private bool BuildBar()
- {
- bool success = true;
- try
- {
- Microsoft.Win32.RegistryKey key;
- key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("VSNDK");
- key.SetValue("Run", "True");
- key.Close();
-
- _buildEvents.OnBuildDone += new _dispBuildEvents_OnBuildDoneEventHandler(this.OnBuildDone);
-
- try
- {
- Solution2 soln = (Solution2)_dte.Solution;
- List buildThese = new List();
- _targetDir = new List();
-
- foreach (String startupProject in (Array)soln.SolutionBuild.StartupProjects)
- {
- foreach (Project p1 in soln.Projects)
- {
- if (p1.UniqueName == startupProject)
- {
- buildThese.Add(p1.FullName);
-
- ConfigurationManager config = p1.ConfigurationManager;
- Configuration active = config.ActiveConfiguration;
-
- foreach (Property prop in active.Properties)
- {
- try
- {
- if (prop.Name == "OutputPath")
- {
- string[] path = new string[2];
- path[0] = p1.Name + "_" + _isSimulator.ToString();
- path[1] = prop.Value.ToString();
- _targetDir.Add(path);
- break;
- }
- }
- catch
- {
- }
- }
-
- break;
- }
- }
- }
-
- _hitPlay = true;
- _amountOfProjects = buildThese.Count; // OnBuildDone will call build() only after receiving "amountOfProjects" events
- foreach (string projectName in buildThese)
- soln.SolutionBuild.BuildProject("Debug", projectName, false);
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- success = false;
- }
- }
- catch (Exception e)
- {
- Debug.WriteLine(e.Message);
- success = false;
- }
- return success;
- }
-
- ///
- /// Verify if the build process was successful. If so, start deploying the app.
- ///
- private void Built()
- {
- string outputText = "";
-
- _owP.TextDocument.Selection.SelectAll();
- outputText = _owP.TextDocument.Selection.Text;
-
- if ((outputText == "") || (System.Text.RegularExpressions.Regex.IsMatch(outputText, ">Build succeeded.\r\n")) || (!outputText.Contains("): error :")))
- {
- if (isDebugConfiguration)
- {
- // Write file to flag the deploy task that it should use the -debugNative option
- string fileContent = "Use -debugNative.\r\n";
- string appData = Environment.GetEnvironmentVariable("AppData");
- System.IO.StreamWriter file = new System.IO.StreamWriter(appData + @"\BlackBerry\vsndk-debugNative.txt");
- file.WriteLine(fileContent);
- file.Close();
-
- _buildEvents.OnBuildDone += new _dispBuildEvents_OnBuildDoneEventHandler(this.OnBuildDone);
- }
-
- foreach (String startupProject in (Array)_dte.Solution.SolutionBuild.StartupProjects)
- {
- foreach (SolutionContext sc in _dte.Solution.SolutionBuild.ActiveConfiguration.SolutionContexts)
- {
- if (sc.ProjectName == startupProject)
- {
- sc.ShouldDeploy = true;
- }
- else
- {
- sc.ShouldDeploy = false;
- }
- }
- }
- _isDeploying = true;
- _dte.Solution.SolutionBuild.Deploy(true);
- }
- }
-
- ///
- /// Get the process ID and launch an executable using the VSNDK debug engine.
- ///
- private void Deployed()
- {
- Microsoft.Win32.RegistryKey key;
- key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("VSNDK");
- key.SetValue("Run", "False");
- key.Close();
-
- string pidString = "";
- getPID((DTE2)_dte, ref pidString);
-
- bool CancelDefault = LaunchDebugTarget(pidString);
- }
-
- ///
- /// Launch an executable using the VSNDK debug engine.
- ///
- /// Process ID in string format.
- /// TRUE if successful, False if not.
- private bool LaunchDebugTarget(string pidString)
- {
- Microsoft.VisualStudio.Shell.ServiceProvider sp =
- new Microsoft.VisualStudio.Shell.ServiceProvider((Microsoft.VisualStudio.OLE.Interop.IServiceProvider)_dte);
-
- IVsDebugger dbg = (IVsDebugger)sp.GetService(typeof(SVsShellDebugger));
-
- VsDebugTargetInfo info = new VsDebugTargetInfo();
-
- info.cbSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(info);
- info.dlo = Microsoft.VisualStudio.Shell.Interop.DEBUG_LAUNCH_OPERATION.DLO_CreateProcess;
-
- // Read debugger args from a file (it is set when the Deploy task is run)
- System.IO.StreamReader argsFile = null;
- try
- {
- string localAppData = Environment.GetEnvironmentVariable("AppData");
- argsFile = new System.IO.StreamReader(localAppData + @"\BlackBerry\vsndk-args-file.txt");
- }
- catch (Exception e)
- {
- Debug.Fail("Unexpected exception in LaunchDebugTarget");
- }
-
- // Store all debugger arguments in a string
- var nvc = new NameValueCollection();
- nvc.Add("pid", pidString);
- nvc.Add("targetIP", argsFile.ReadLine()); // The device (IP address)
- info.bstrExe = argsFile.ReadLine(); // The executable path
- nvc.Add("isSimulator", argsFile.ReadLine());
- nvc.Add("ToolsPath", argsFile.ReadLine());
- nvc.Add("PublicKeyPath", argsFile.ReadLine());
-
- // Decrypt stored password.
- byte[] data = Convert.FromBase64String(argsFile.ReadLine());
- if (data.Length > 0)
- {
- byte[] decrypted = ProtectedData.Unprotect(data, null, DataProtectionScope.LocalMachine);
- nvc.Add("Password", Encoding.Unicode.GetString(decrypted));
- }
-
- info.bstrArg = NameValueCollectionHelper.DumpToString(nvc);
- argsFile.Close();
-
- info.bstrRemoteMachine = null; // debug locally
- info.fSendStdoutToOutputWindow = 0; // Let stdout stay with the application.
- info.clsidCustom = new Guid("{E5A37609-2F43-4830-AA85-D94CFA035DD2}"); // Set the launching engine the VSNDK engine guid
- info.grfLaunch = 0;
-
- IntPtr pInfo = System.Runtime.InteropServices.Marshal.AllocCoTaskMem((int)info.cbSize);
- System.Runtime.InteropServices.Marshal.StructureToPtr(info, pInfo, false);
-
- try
- {
- int result = dbg.LaunchDebugTargets(1, pInfo);
-
- if (result != VSConstants.S_OK)
- {
- string msg;
- IVsUIShell sh = (IVsUIShell)sp.GetService(typeof(SVsUIShell));
- sh.GetErrorInfo(out msg);
- Debug.WriteLine("LaunchDebugTargets: " + msg);
-
- return true;
- }
- }
- finally
- {
- if (pInfo != IntPtr.Zero)
- {
- System.Runtime.InteropServices.Marshal.FreeCoTaskMem(pInfo);
- }
- }
-
- return false;
- }
-
- ///
- /// Get the PID of the launched native app by parsing text from the output window.
- ///
- /// Application Object.
- /// Returns the Process ID as a string.
- /// TRUE if successful, False if not.
- private bool getPID(DTE2 dte, ref string pidString)
- {
- // Select all of the text
- _owP.TextDocument.Selection.SelectAll();
- string outputText = _owP.TextDocument.Selection.Text;
-
- // Check for successful deployment
- if (System.Text.RegularExpressions.Regex.IsMatch(outputText, "Info: done"))
- {
- string pattern = @"\s+result::(\d+)\r\n.+";
- Regex r = new Regex(pattern, RegexOptions.IgnoreCase);
-
- // Match the regular expression pattern against a text string.
- Match m = r.Match(outputText);
-
- // Take first match
- if (m.Success)
- {
- Group g = m.Groups[1];
- CaptureCollection cc = g.Captures;
- Capture c = cc[0];
- pidString = c.ToString();
-
- // Store proccess name and file location into ProcessesPath.txt, so "Attach To Process" would be able to find the
- // source code for a running process.
- // First read the file.
- string processesPaths = "";
- System.IO.StreamReader readProcessesPathsFile = null;
- try
- {
- readProcessesPathsFile = new System.IO.StreamReader(System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\ProcessesPath.txt");
- processesPaths = readProcessesPathsFile.ReadToEnd();
- readProcessesPathsFile.Close();
- }
- catch (Exception e)
- {
- processesPaths = "";
- }
-
- // Updating the contents.
- int begin = outputText.IndexOf("Deploy started: Project: ") + 25;
- if (begin == -1)
- begin = outputText.IndexOf("Project: ") + 9;
- int end = outputText.IndexOf(", Configuration:", begin);
- string processName = outputText.Substring(begin, end - begin) + "_" + _isSimulator.ToString();
- begin = processesPaths.IndexOf(processName + ":>");
-
- // string currentPath = dte.ActiveDocument.Path;
- string currentPath = "";
-
- foreach (string[] paths in _targetDir)
- {
- if (paths[0] == processName)
- {
- currentPath = paths[1];
- break;
- }
- }
-
- if (begin != -1)
- {
- begin += processName.Length + 2;
- end = processesPaths.IndexOf("\r\n", begin);
- processesPaths = processesPaths.Substring(0, begin) + currentPath + processesPaths.Substring(end);
- }
- else
- {
- processesPaths = processesPaths + processName + ":>" + currentPath + "\r\n";
- }
-
- // Writing contents to file.
- System.IO.StreamWriter writeProcessesPathsFile = null;
- try
- {
- writeProcessesPathsFile = new System.IO.StreamWriter(System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\ProcessesPath.txt", false);
- writeProcessesPathsFile.Write(processesPaths);
- writeProcessesPathsFile.Close();
- }
- catch (Exception e)
- {
- }
-
- return true;
- }
- else
- {
- return false;
- }
- }
- return false;
- }
-
-
- ///
- /// Verify if the app configuration is Debug.
- ///
- /// True if Debug configuration; False otherwise.
- private bool checkDebugConfiguration()
- {
- Solution2 soln = (Solution2)_dte.Solution;
- foreach (String startupProject in (Array)soln.SolutionBuild.StartupProjects)
- {
- foreach (Project p1 in soln.Projects)
- {
- if (p1.UniqueName == startupProject)
- {
- ConfigurationManager config = p1.ConfigurationManager;
- Configuration active = config.ActiveConfiguration;
-
- if (active.ConfigurationName.ToUpper() == "DEBUG")
- return (true);
- else
- return (false);
- }
- }
- }
- return (false);
- }
-
-
- #endregion
-
-
-
- #region Event Handlers
-
- ///
- /// New Start Debug Command Events After Execution Event Handler.
- ///
- /// Command GUID.
- /// Command ID.
- /// Custom IN Object.
- /// Custom OUT Object.
- private void startDebugCommandEvents_AfterExecute(string Guid, int ID, object CustomIn, object CustomOut)
- {
- Debug.WriteLine("After Start Debug");
- }
-
-
- ///
- /// New Start Debug Command Events Before Execution Event Handler. Call the method responsible for building the app.
- ///
- /// Command GUID.
- /// Command ID.
- /// Custom IN Object.
- /// Custom OUT Object.
- /// Cancel the default execution of the command.
- private void startDebugCommandEvents_BeforeExecute(string Guid, int ID, object CustomIn, object CustomOut, ref bool CancelDefault)
- {
-
- bool bbPlatform = false;
- if (_dte.Solution.SolutionBuild.ActiveConfiguration != null)
- {
- isDebugConfiguration = checkDebugConfiguration();
-
- SolutionContexts scCollection = _dte.Solution.SolutionBuild.ActiveConfiguration.SolutionContexts;
- foreach (SolutionContext sc in scCollection)
- {
- if (sc.PlatformName == "BlackBerry" || sc.PlatformName == "BlackBerrySimulator")
- {
- bbPlatform = true;
- if (sc.PlatformName == "BlackBerrySimulator")
- _isSimulator = true;
- else
- _isSimulator = false;
- }
- }
- }
-
- Debug.WriteLine("Before Start Debug");
-
- if (VSNDK.Package.ControlDebugEngine.isDebugEngineRunning || !bbPlatform)
- {
- // Disable the override of F5 (this allows the debugged process to continue execution)
- CancelDefault = false;
- }
- else
- {
- // Create a reference to the Output window.
- // Create a tool window reference for the Output window
- // and window pane.
- OutputWindow ow = ((DTE2)_dte).ToolWindows.OutputWindow;
-
- // Select the Build pane in the Output window.
- _owP = ow.OutputWindowPanes.Item("Build");
- _owP.Activate();
-
-
- if (isDebugConfiguration)
- {
- UpdateManagerData upData = new UpdateManagerData();
-
- if (!upData.validateDeviceVersion(_isSimulator))
- {
- CancelDefault = true;
- }
- else
- {
- BuildBar();
- CancelDefault = true;
- }
- }
- else
- {
- BuildBar();
- CancelDefault = true;
- }
- }
- }
-
-
- ///
- /// This event is fired only when the build/rebuild/clean process ends.
- ///
- /// Represents the scope of the build.
- /// Represents the type of build action that is occurring, such as a build or a deploy action.
- public void OnBuildDone(EnvDTE.vsBuildScope Scope, EnvDTE.vsBuildAction Action)
- {
- if (Action == vsBuildAction.vsBuildActionBuild)
- {
- _amountOfProjects -= 1;
- if (_amountOfProjects == 0)
- {
- _buildEvents.OnBuildDone -= new _dispBuildEvents_OnBuildDoneEventHandler(this.OnBuildDone);
- Built();
- }
- }
- else if (Action == vsBuildAction.vsBuildActionDeploy)
- {
- _buildEvents.OnBuildDone -= new _dispBuildEvents_OnBuildDoneEventHandler(this.OnBuildDone);
- _isDeploying = false;
- Deployed();
- }
- }
-
- ///
- /// This event is fired only when user wants to build, rebuild or clean the project.
- ///
- /// Represents the scope of the build.
- /// Represents the type of build action that is occurring, such as a build or a deploy action.
- public void OnBuildBegin(EnvDTE.vsBuildScope Scope, EnvDTE.vsBuildAction Action)
- {
- if ((Action == vsBuildAction.vsBuildActionBuild) || (Action == vsBuildAction.vsBuildActionRebuildAll))
- {
- if ((_hitPlay == false) && (_isDeploying == false)) // means that the "play" building and deploying process was cancelled before, so we have to disable the
- // OnBuildDone event to avoid deploying in case user only wants to build.
- {
- _buildEvents.OnBuildDone -= new _dispBuildEvents_OnBuildDoneEventHandler(this.OnBuildDone);
- }
- _hitPlay = false;
- }
- }
-
- ///
- /// This function is called when the user clicks the menu item that shows the
- /// tool window. See the Initialize method to see how the menu item is associated to
- /// this function using the OleMenuCommandService service and the MenuCommand class.
- ///
- private void ShowToolWindow(object sender, EventArgs e)
- {
- // Create the dialog instance without Help support.
- var SigningToolDialog = new Signing.SigningDialog();
- // Show the dialog.
- var m = SigningToolDialog.ShowDialog();
- }
-
- ///
- /// This function is called when the user clicks the menu item that shows the
- /// tool window. See the Initialize method to see how the menu item is associated to
- /// this function using the OleMenuCommandService service and the MenuCommand class.
- ///
- private void ShowSettingsWindow(object sender, EventArgs e)
- {
- var SettingsDialog = new Settings.SettingsDialog();
- var m = SettingsDialog.ShowModal();
- }
-
- ///
- /// This function is called when the user clicks the menu item that shows the
- /// tool window. See the Initialize method to see how the menu item is associated to
- /// this function using the OleMenuCommandService service and the MenuCommand class.
- ///
- private void ShowDebugTokenWindow(object sender, EventArgs e)
- {
- // Create the dialog instance without Help support.
- var DebugTokenDialog = new DebugToken.DebugTokenDialog();
- // Show the dialog.
- if (!DebugTokenDialog.IsClosing)
- DebugTokenDialog.ShowModal();
- }
-
- private void MenuItemCallback(object sender, EventArgs e)
- {
- string filename = "";
- string folderName = "";
- string name = "";
-
- Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
- dlg.DefaultExt = ".cproject"; // Default file extension
- dlg.Filter = "Native Core Application Project Files (*.cproject, *.project)|*.cproject;*.project;";
- dlg.Title = "Open BlackBerry Core Native Application Project Files";
- dlg.Multiselect = false;
- dlg.InitialDirectory = Environment.SpecialFolder.MyComputer.ToString();
- dlg.CheckFileExists = true;
-
- bool? result = dlg.ShowDialog();
- if (result == true)
- {
- filename = dlg.FileName;
- FileInfo fi = new FileInfo(filename);
- folderName = fi.DirectoryName;
-
- Array projs = (Array)_dte.ActiveSolutionProjects;
- Project project = (Project)projs.GetValue(0);
- name = project.FullName;
-
- // Create the dialog instance without Help support.
- var ImportSummary = new Import.Import(project, folderName, name);
- ImportSummary.ShowModel2();
- }
-
- }
-
- #endregion
-
- }
-}
diff --git a/src/VSNDK.Package/VSNDKCommandEvents.cs b/src/VSNDK.Package/VSNDKCommandEvents.cs
deleted file mode 100644
index b6291609..00000000
--- a/src/VSNDK.Package/VSNDKCommandEvents.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using EnvDTE;
-using Microsoft.VisualStudio.Shell;
-using EnvDTE80;
-
-namespace VSNDK.Package
-{
-
- ///
- /// Responsible for customization of VSShell command events for VSNDK.
- ///
- public class VSNDKCommandEvents
- {
- private DTE2 dte;
- private Dictionary cmdEvents;
-
-
- ///
- ///
- ///
- /// Application Object.
- public VSNDKCommandEvents(DTE2 dte)
- {
- this.dte = dte;
- cmdEvents = new Dictionary();
- }
-
-
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public void RegisterCommand( string guid, int cmdId, _dispCommandEvents_AfterExecuteEventHandler afterHandler, _dispCommandEvents_BeforeExecuteEventHandler beforeHandler)
- {
- cmdEvents[cmdId] = dte.Events.get_CommandEvents(guid, cmdId);
- CommandEvents e = cmdEvents[cmdId];
- if ( e != null)
- {
- e.AfterExecute += afterHandler;
- e.BeforeExecute += beforeHandler;
- }
- }
- }
-}
diff --git a/src/VSNDK.Package/VSNDKConstants.cs b/src/VSNDK.Package/VSNDKConstants.cs
deleted file mode 100644
index 7640dbfd..00000000
--- a/src/VSNDK.Package/VSNDKConstants.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace VSNDK.Package
-{
- ///
- /// Command IDs exposed by VisualStudio.
- ///
- public static class CommandConstants
- {
- public const int cmdidAddSolutionSCC = 21016;
- public const int cmdidUndoCheckoutSCC = 21009;
- public const int cmdidGetLatestVersionSCC = 21011;
- public const int cmdidGetSCC = 21501;
- public const int cmdidViewHistorySCC = 21508;
- public const int cmdidStartDebug = 295;
- public const int cmdidStartDebugContext = 356;
- public const int cmdidRestartDebug = 296;
- public const int cmdidStopDebug = 179;
- public const int cmdidPreviewInBrowser = 334;
- public const int cmdidBrowseWith = 336;
- public const int cmdidStartNoDebug = 368;
- public const int cmdidSolutionCfg = 684;
- public const int cmdidSolutionPlatform = 1990;
- public const int cmdidSolutionPlatformGetList = 1991;
- public const int cmdidDebugBreakatFunction = 311;
- }
-}
diff --git a/src/VSNDK.Package/VSPackage.resx b/src/VSNDK.Package/VSPackage.resx
deleted file mode 100644
index 7c5753ad..00000000
--- a/src/VSNDK.Package/VSPackage.resx
+++ /dev/null
@@ -1,168 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
-
- VSNDK.Package
-
-
- Package provides BlackBerry Menu items and editor
-
-
- Resources\Package.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- [Read Only]
-
-
- File has been changed outside the environment. Reload the new file?
-
-
- BarDescriptorEditor
- Name of the editor to show for the Keybindings
-
-
- BarDescriptorEditor Files
-
-
- BarDescriptorEditor
-
-
- bar-descriptor
-
-
- BarDescriptorEditor File (xml)
-
-
- Resources\Images_24bit.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\File.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Package/ViewModel.cs b/src/VSNDK.Package/ViewModel.cs
deleted file mode 100644
index 7c12c640..00000000
--- a/src/VSNDK.Package/ViewModel.cs
+++ /dev/null
@@ -1,1706 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.ComponentModel;
-using Microsoft.VisualStudio.Package;
-using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider;
-using Microsoft.VisualStudio;
-using System.Runtime.InteropServices;
-using System.Xml.Serialization;
-using System.Xml.Linq;
-using System.Xml;
-using Microsoft.VisualStudio.XmlEditor;
-using Microsoft.VisualStudio.TextManager.Interop;
-using System.Reflection;
-using Microsoft.VisualStudio.Shell.Interop;
-using Microsoft.VisualStudio.Shell;
-using System.Collections;
-using System.IO;
-using System.Windows.Data;
-using System.Collections.ObjectModel;
-using RIM.VSNDK_Package.Settings.Models;
-using EnvDTE;
-
-namespace RIM.VSNDK_Package
-{
- public class OrientationItemClass
- {
- private string _name;
-
- public string Name
- {
- get { return _name; }
- set { _name = value; }
- }
-
- public OrientationItemClass(string name)
- {
- _name = name;
- }
- }
-
- public class ConfigurationItemClass
- {
- private string _name;
-
- public string Name
- {
- get { return _name; }
- set { _name = value; }
- }
-
- public ConfigurationItemClass(string name)
- {
- _name = name;
- }
- }
-
- public class AssetTypeItemClass
- {
- private string _type;
-
- public string Type
- {
- get { return _type; }
- set { _type = value; }
- }
-
- public AssetTypeItemClass(string type)
- {
- _type = type;
- }
- }
-
- public class PermissionItemClass : INotifyPropertyChanged
- {
- private bool _isChecked;
- private string _permission;
- private string _identifier;
- private string _permisionImagePath;
-
- public bool IsChecked
- {
- get { return _isChecked; }
- set {
- _isChecked = value;
- OnPropertyChanged("IsChecked");
- }
- }
-
- public string Permission
- {
- get { return _permission; }
- set
- {
- _permission = value;
- OnPropertyChanged("Permission");
- }
- }
-
- public string PermissionImagePath
- {
- get { return _permisionImagePath; }
- set
- {
- _permisionImagePath = value;
- OnPropertyChanged("PermissionImagePath");
- }
- }
-
- public string Identifier
- {
- get { return _identifier; }
- set
- {
- _identifier = value;
- OnPropertyChanged("Identifier");
- }
- }
-
- public PermissionItemClass(bool isChecked, string permission, string identifier, string permissionImagePath)
- {
- _isChecked = isChecked;
- _permission = permission;
- _identifier = identifier;
- _permisionImagePath = permissionImagePath;
- }
-
- public event PropertyChangedEventHandler PropertyChanged;
- protected void OnPropertyChanged(string propertyname)
- {
- var handler = PropertyChanged;
- if (handler != null)
- handler(this, new PropertyChangedEventArgs(propertyname));
- }
- }
-
- public class ImageItemClass
- {
- private string _imageName;
- private string _imagePath;
- private string _imageSize;
-
- public string ImageName
- {
- get { return _imageName; }
- set { _imageName = value; }
- }
-
- public string ImagePath
- {
- get { return _imagePath; }
- set { _imagePath = value; }
- }
-
- public string ImageSize
- {
- get { return _imageSize; }
- set { _imageSize = value; }
- }
-
- ///
- /// Class to store the splashscreen and icon images data.
- ///
- ///
- ///
- ///
- public ImageItemClass(string imageName, string imagePath, string activeProjectDirectory)
- {
- _imageName = imageName;
- _imagePath = imagePath;
-
- if (!File.Exists(_imagePath))
- {
- if (File.Exists(activeProjectDirectory + "\\" + _imagePath))
- {
- _imagePath = activeProjectDirectory + "\\" + _imagePath;
-
- }
- }
-
- try
- {
- System.Drawing.Image objImage = System.Drawing.Image.FromFile(_imagePath);
- _imageSize = objImage.Width.ToString() + "X" + objImage.Height.ToString();
- }
- catch
- {
-
- }
- }
- }
-
- ///
- /// ViewModel is where the interesting portion of the VsTemplate Designer lives. The View binds to an instance of this class.
- ///
- /// The View binds the various designer controls to the methods derived from IViewModel that get and set values in the XmlModel.
- /// The ViewModel and an underlying XmlModel manage how an IVsTextBuffer is shared between the designer and the XML editor (if opened).
- ///
- public class ViewModel : IViewModel, IDataErrorInfo, INotifyPropertyChanged
- {
- private static string _localRIMFolder;
- private static string _tmpAuthor = "";
- private static string _tmpAuthorID = "";
- private readonly CollectionView _orientationList;
- private OrientationItemClass _orientationItem;
- private CollectionView _iconImageList;
- private CollectionView _splashScreenImageList;
- private CollectionView _assetTypeList;
- private CollectionView _permissionList;
- private CollectionView _configurationList;
- private ConfigurationItemClass _config;
- private PermissionItemClass _permission;
- private DTE _dte;
- private string _activeProjectDirectory;
- private Package _pkg;
-
- long _dirtyTime;
- LanguageService _xmlLanguageService;
- IServiceProvider _serviceProvider;
- qnx _qnxSchema;
- bool _synchronizing;
- XmlModel _xmlModel;
- XmlStore _xmlStore;
- IVsTextLines _buffer;
-
- bool? _canEditFile;
- bool _gettingCheckoutStatus;
-
- EventHandler _editingScopeCompletedHandler;
- EventHandler _undoRedoCompletedHandler;
- EventHandler _bufferReloadedHandler;
-
- ///
- /// Constructor
- ///
- ///
- ///
- ///
- ///
- public ViewModel(Package pkg, XmlStore xmlStore, XmlModel xmlModel, IServiceProvider provider, IVsTextLines buffer)
- {
- _pkg = pkg;
- /// Initialize Asset Type List
- IList AssetTypeListItem = new List();
- AssetTypeItemClass assetType = new AssetTypeItemClass("Other");
- AssetTypeListItem.Add(assetType);
- assetType = new AssetTypeItemClass("Entry-point");
- AssetTypeListItem.Add(assetType);
- assetType = new AssetTypeItemClass("Library");
- AssetTypeListItem.Add(assetType);
- assetType = new AssetTypeItemClass("Executable");
- AssetTypeListItem.Add(assetType);
- _assetTypeList = new CollectionView(AssetTypeListItem);
-
- if (xmlModel == null)
- throw new ArgumentNullException("xmlModel");
- if (xmlStore == null)
- throw new ArgumentNullException("xmlStore");
- if (provider == null)
- throw new ArgumentNullException("provider");
- if (buffer == null)
- throw new ArgumentNullException("buffer");
-
- this.BufferDirty = false;
- this.DesignerDirty = false;
-
- this._serviceProvider = provider;
- this._buffer = buffer;
-
- _dte = (DTE)_serviceProvider.GetService(typeof(DTE));
- Array activeProjects = (Array)_dte.ActiveSolutionProjects;
- Project activeProject = (Project)activeProjects.GetValue(0);
- FileInfo activeProjectFileInfo = new FileInfo(activeProject.FullName);
- _activeProjectDirectory = activeProjectFileInfo.DirectoryName;
-
- this._xmlStore = xmlStore;
- // OnUnderlyingEditCompleted
- _editingScopeCompletedHandler = new EventHandler(OnUnderlyingEditCompleted);
- this._xmlStore.EditingScopeCompleted += _editingScopeCompletedHandler;
- // OnUndoRedoCompleted
- _undoRedoCompletedHandler = new EventHandler(OnUndoRedoCompleted);
- this._xmlStore.UndoRedoCompleted += _undoRedoCompletedHandler;
-
- this._xmlModel = xmlModel;
- // BufferReloaded
- _bufferReloadedHandler += new EventHandler(BufferReloaded);
- this._xmlModel.BufferReloaded += _bufferReloadedHandler;
-
- _localRIMFolder = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\";
-
- LoadModelFromXmlModel();
-
- IList IconImageList = new List();
- if ((_qnxSchema.icon != null) && (_qnxSchema.icon.image != null))
- {
- string iconPNG_Path = ""; //added to avoid duplication. That's because I didn't find the template to remove teh ICON.PNG.
- foreach (string iconImage in _qnxSchema.icon.image)
- {
- ImageItemClass imageItem = new ImageItemClass(iconImage, getImagePath(iconImage), _activeProjectDirectory);
- if (imageItem.ImageName != null) //added because I didn't find the template to remove teh ICON.PNG.
- if (imageItem.ImageName == "icon.png")
- {
- if (iconPNG_Path != imageItem.ImagePath) //added because I didn't find the template to remove teh ICON.PNG.
- {
- IconImageList.Add(imageItem);
- iconPNG_Path = imageItem.ImagePath;
- }
- }
- else
- IconImageList.Add(imageItem);
-
- }
- }
- _iconImageList = new CollectionView(IconImageList);
-
- LoadPermissions();
-
- IList SplashScreenImageList = new List();
- if ((_qnxSchema.splashScreens != null) && (_qnxSchema.splashScreens.image != null))
- {
- foreach (string splashScreenImage in _qnxSchema.splashScreens.image)
- {
- ImageItemClass imageItem = new ImageItemClass(splashScreenImage, getImagePath(splashScreenImage), _activeProjectDirectory);
- SplashScreenImageList.Add(imageItem);
- }
- }
- _splashScreenImageList = new CollectionView(SplashScreenImageList);
-
- IList ConfigurationList = new List();
- ConfigurationItemClass configItem = new ConfigurationItemClass("All Configurations");
- ConfigurationList.Add(configItem);
- foreach (qnxConfiguration config in _qnxSchema.configuration)
- {
- configItem = new ConfigurationItemClass(config.name);
- ConfigurationList.Add(configItem);
- }
- _configurationList = new CollectionView(ConfigurationList);
-
- IList OrientationList = new List();
- OrientationItemClass OrientationItem = new OrientationItemClass("Default");
- OrientationList.Add(OrientationItem);
- if (_qnxSchema.initialWindow.autoOrients == "")
- {
- _orientationItem = OrientationItem;
- }
-
- OrientationItem = new OrientationItemClass("Auto-orient");
- OrientationList.Add(OrientationItem);
- if (_qnxSchema.initialWindow.autoOrients == "true")
- {
- _orientationItem = OrientationItem;
- }
-
-
- OrientationItem = new OrientationItemClass("Landscape");
- OrientationList.Add(OrientationItem);
- if (_qnxSchema.initialWindow.aspectRatio == "landscape")
- {
- _orientationItem = OrientationItem;
- }
-
- OrientationItem = new OrientationItemClass("Portrait");
- OrientationList.Add(OrientationItem);
- if (_qnxSchema.initialWindow.aspectRatio == "portrait")
- {
- _orientationItem = OrientationItem;
- }
-
- _orientationList = new CollectionView(OrientationList);
- }
-
- private string getImagePath(string imgName)
- {
- string imagePath = "";
-
- foreach (asset assetItem in _qnxSchema.asset)
- {
- if (assetItem.Value == imgName)
- {
- imagePath = assetItem.path;
- }
- }
-
- return imagePath;
- }
-
- ///
- /// Close View Model
- ///
- public void Close()
- {
- //Unhook the events from the underlying XmlStore/XmlModel
- if (_xmlStore != null)
- {
- this._xmlStore.EditingScopeCompleted -= _editingScopeCompletedHandler;
- this._xmlStore.UndoRedoCompleted -= _undoRedoCompletedHandler;
- }
- if (this._xmlModel != null)
- {
- this._xmlModel.BufferReloaded -= _bufferReloadedHandler;
- }
- }
-
- ///
- /// Given the permission ID return the appropriate Icon
- ///
- ///
- ///
- private string getPermissionIcon(string ID)
- {
- string retVal = "";
-
- switch (ID)
- {
- case "bbm_connect":
- retVal = "/VSNDK.Package;component/Resources/BlackBerryMessager.bmp";
- break;
- case "access_pimdomain_calendars":
- retVal = "/VSNDK.Package;component/Resources/Calendar.bmp";
- break;
- case "use_camera":
- retVal = "/VSNDK.Package;component/Resources/Camera.bmp";
- break;
- case "access_pimdomain_contacts":
- retVal = "/VSNDK.Package;component/Resources/Contacts.bmp";
- break;
- case "read_device_identifying_information":
- retVal = "/VSNDK.Package;component/Resources/DeviceIdentifyingInfo.bmp";
- break;
- case "access_pimdomain_messages":
- retVal = "/VSNDK.Package;component/Resources/EmailPINMessages.bmp";
- break;
- case "access_internet":
- retVal = "/VSNDK.Package;component/Resources/Internet.bmp";
- break;
- case "read_geolocation":
- retVal = "/VSNDK.Package;component/Resources/GPSLocation.bmp";
- break;
- case "access_location_services":
- retVal = "/VSNDK.Package;component/Resources/Location.bmp";
- break;
- case "record_audio":
- retVal = "/VSNDK.Package;component/Resources/Mircrophone.bmp";
- break;
- case "access_pimdomain_notebooks":
- retVal = "/VSNDK.Package;component/Resources/Notebooks.bmp";
- break;
- case "post_notification":
- retVal = "/VSNDK.Package;component/Resources/PostNotifications.bmp";
- break;
- case "run_when_backgrounded":
- retVal = "/VSNDK.Package;component/Resources/RunBackgrounded.bmp";
- break;
- case "access_shared":
- retVal = "/VSNDK.Package;component/Resources/SharedFiles.bmp";
- break;
- case "access_sms_mms":
- retVal = "/VSNDK.Package;component/Resources/TextMessages.bmp";
- break;
- case "read_personally_identifiable_information":
- retVal = "/VSNDK.Package;component/Resources/MyContactInfo.bmp";
- break;
- case "access_phone":
- retVal = "/VSNDK.Package;component/Resources/Phone.bmp";
- break;
- case "control_phone":
- retVal = "/VSNDK.Package;component/Resources/PhoneControl.bmp";
- break;
- case "_sys_use_consumer_push":
- retVal = "/VSNDK.Package;component/Resources/Push.bmp";
- break;
- case "use_camera_desktop":
- retVal = "/VSNDK.Package;component/Resources/CaptureScreen.bmp";
- break;
- case "use_gamepad":
- retVal = "/VSNDK.Package;component/Resources/Gamepad.bmp";
- break;
- }
-
- return retVal;
- }
-
- ///
- /// Load the permissions list
- ///
- private void LoadPermissions()
- {
- SettingsData settingsData = new SettingsData();
- bool oldListMethod = true;
- XmlNodeList pList = null;
-
- if (settingsData.TargetPath != "")
- {
- XmlDocument xmlDoc = new XmlDocument();
- xmlDoc.Load(settingsData.TargetPath + @"\..\blackberry-sdk-descriptor.xml");
- pList = xmlDoc.GetElementsByTagName("permission");
- oldListMethod = false;
- }
-
- IList PermissionList = new List();
-
- if (oldListMethod) // Old Listing Method
- {
- PermissionItemClass permissionItem = new PermissionItemClass(isPermissionChecked("bbm_connect"), "BlackBerry Messenger", "bbm_connect", getPermissionIcon("bbm_connect"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("access_pimdomain_calendars"), "Calendar", "access_pimdomain_calendars", getPermissionIcon("access_pimdomain_calendars"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("use_camera"), "Camera", "use_camera", getPermissionIcon("use_camera"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("access_pimdomain_contacts"), "Contacts", "access_pimdomain_contacts", getPermissionIcon("access_pimdomain_contacts"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("read_device_identifying_information"), "Device Identifying Information", "read_device_identifying_information", getPermissionIcon("read_device_identifying_information"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("access_pimdomain_messages"), "Email and PIN Message", "access_pimdomain_messages", getPermissionIcon("access_pimdomain_messages"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("access_internet"), "Internet", "access_internet", getPermissionIcon("access_internet"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("read_geolocation"), "GPS Location", "read_geolocation", getPermissionIcon("read_geolocation"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("access_location_services"), "Location", "access_location_services", getPermissionIcon("access_location_services"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("record_audio"), "Microphone", "record_audio", getPermissionIcon("record_audio"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("access_pimdomain_notebooks"), "Notebooks", "access_pimdomain_notebooks", getPermissionIcon("access_pimdomain_notebooks"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("post_notification"), "Post Notifications", "post_notification", getPermissionIcon("post_notification"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("run_when_backgrounded"), "Run When Backgrounded", "run_when_backgrounded", getPermissionIcon("run_when_backgrounded"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("access_shared"), "Shared Files", "access_shared", getPermissionIcon("access_shared"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("access_sms_mms"), "Text Messages", "access_sms_mms", getPermissionIcon("access_sms_mms"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("_sys_use_consumer_push"), "Consumer Push", "_sys_use_consumer_push", getPermissionIcon("_sys_use_consumer_push"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("narrow_landscape_exit"), "Narrow Swipe Up", "narrow_landscape_exit", getPermissionIcon("narrow_landscape_exit"));
- PermissionList.Add(permissionItem);
- permissionItem = new PermissionItemClass(isPermissionChecked("access_phone"), "Phone", "access_phone", getPermissionIcon("access_phone"));
- PermissionList.Add(permissionItem);
- }
- else
- {
- foreach (XmlNode p in pList)
- {
- PermissionItemClass permissionItem = new PermissionItemClass(isPermissionChecked(p["id"].InnerText), p["name"].InnerText, p["id"].InnerText, getPermissionIcon(p["id"].InnerText));
- PermissionList.Add(permissionItem);
- }
- }
-
- _permissionList = new CollectionView(PermissionList);
- }
-
- ///
- /// Called on idle time. This is when we check if the designer is out of sync with the underlying text buffer.
- ///
- public void DoIdle()
- {
- if (BufferDirty || DesignerDirty)
- {
- int delay = 100;
-
- if ((Environment.TickCount - _dirtyTime) > delay)
- {
- // Must not try and sync while XML editor is parsing otherwise we just confuse matters.
- if (IsXmlEditorParsing)
- {
- _dirtyTime = System.Environment.TickCount;
- return;
- }
-
- //If there is contention, give the preference to the designer.
- if (DesignerDirty)
- {
- SaveModelToXmlModel(Resources.SynchronizeBuffer);
- //We don't do any merging, so just overwrite whatever was in the buffer.
- BufferDirty = false;
- }
- else if (BufferDirty)
- {
- LoadModelFromXmlModel();
- }
- }
- }
- }
-
- ///
- /// We must not try and update the XDocument while the XML Editor is parsing as this may cause
- /// a deadlock in the XML Editor!
- ///
- ///
- bool IsXmlEditorParsing
- {
- get
- {
- LanguageService langsvc = GetXmlLanguageService();
- return langsvc != null ? langsvc.IsParsing : false;
- }
- }
-
- ///
- /// Get the XML Editor language service
- ///
- ///
- LanguageService GetXmlLanguageService()
- {
- if (_xmlLanguageService == null)
- {
- IOleServiceProvider vssp = _serviceProvider.GetService(typeof(IOleServiceProvider)) as IOleServiceProvider;
- Guid xmlEditorGuid = new Guid("f6819a78-a205-47b5-be1c-675b3c7f0b8e");
- Guid iunknown = new Guid("00000000-0000-0000-C000-000000000046");
- IntPtr ptr;
- if (ErrorHandler.Succeeded(vssp.QueryService(ref xmlEditorGuid, ref iunknown, out ptr)))
- {
- try
- {
- _xmlLanguageService = Marshal.GetObjectForIUnknown(ptr) as LanguageService;
- }
- finally
- {
- Marshal.Release(ptr);
- }
- }
- }
- return _xmlLanguageService;
- }
-
- ///
- /// This method is called when it is time to save the designer values to the
- /// underlying buffer.
- ///
- ///
- void SaveModelToXmlModel(string undoEntry)
- {
- LanguageService langsvc = GetXmlLanguageService();
-
- try
- {
- //We can't edit this file (perhaps the user cancelled a SCC prompt, etc...)
- if (!CanEditFile())
- {
- DesignerDirty = false;
- BufferDirty = true;
- throw new Exception();
- }
-
- XmlSerializer serializer = new XmlSerializer(typeof(qnx));
- XDocument documentFromDesignerState = new XDocument();
- using (XmlWriter w = documentFromDesignerState.CreateWriter())
- {
- serializer.Serialize(w, _qnxSchema);
- }
-
- _synchronizing = true;
- XDocument document = GetParseTree();
- Source src = GetSource();
- if (src == null || langsvc == null)
- {
- return;
- }
-
- langsvc.IsParsing = true; // lock out the background parse thread.
-
- // Wrap the buffer sync and the formatting in one undo unit.
- using (CompoundAction ca = new CompoundAction(src, Resources.SynchronizeBuffer))
- {
- using (XmlEditingScope scope = _xmlStore.BeginEditingScope(Resources.SynchronizeBuffer, this))
- {
- //Replace the existing XDocument with the new one we just generated.
- document.Root.ReplaceWith(documentFromDesignerState.Root);
- scope.Complete();
- }
- ca.FlushEditActions();
- FormatBuffer(src);
- }
- DesignerDirty = false;
- }
- catch (Exception)
- {
- // if the synchronization fails then we'll just try again in a second.
- _dirtyTime = Environment.TickCount;
- }
- finally
- {
- langsvc.IsParsing = false;
- _synchronizing = false;
-
- LoadPermissions();
- }
- }
-
- ///
- /// Reformat the text buffer
- ///
- void FormatBuffer(Source src)
- {
- using (EditArray edits = new EditArray(src, null, false, Resources.ReformatBuffer))
- {
- TextSpan span = src.GetDocumentSpan();
- src.ReformatSpan(edits, span);
- }
- }
-
- ///
- /// Get the XML Editor Source object for this document.
- ///
- ///
- Source GetSource()
- {
- LanguageService langsvc = GetXmlLanguageService();
- if (langsvc == null)
- {
- return null;
- }
- Source src = langsvc.GetSource(_buffer);
- return src;
- }
-
- ///
- /// Get an up to date XML parse tree from the XML Editor.
- ///
- XDocument GetParseTree()
- {
- LanguageService langsvc = this.GetXmlLanguageService();
-
- // don't crash if the language service is not available
- if (langsvc != null)
- {
- Source src = langsvc.GetSource(_buffer);
-
- // We need to access this method to get the most up to date parse tree.
- // public virtual XmlDocument GetParseTree(Source source, IVsTextView view, int line, int col, ParseReason reason) {
- MethodInfo mi = langsvc.GetType().GetMethod("GetParseTree");
- int line = 0, col = 0;
- mi.Invoke(langsvc, new object[] { src, null, line, col, ParseReason.Check });
- }
-
- // Now the XmlDocument should be up to date also.
- return _xmlModel.Document;
- }
-
- ///
- /// This function asks the QueryEditQuerySave service if it is possible to edit the file.
- /// This can result in an automatic checkout of the file and may even prompt the user for
- /// permission to checkout the file. If the user says no or the file cannot be edited
- /// this returns false.
- ///
- private bool CanEditFile()
- {
- // Cache the value so we don't keep asking the user over and over.
- if (_canEditFile.HasValue)
- {
- return (bool)_canEditFile;
- }
-
- // Check the status of the recursion guard
- if (_gettingCheckoutStatus)
- return false;
-
- _canEditFile = false; // assume the worst
- try
- {
- // Set the recursion guard
- _gettingCheckoutStatus = true;
-
- // Get the QueryEditQuerySave service
- IVsQueryEditQuerySave2 queryEditQuerySave = _serviceProvider.GetService(typeof(SVsQueryEditQuerySave)) as IVsQueryEditQuerySave2;
-
- string filename = _xmlModel.Name;
-
- // Now call the QueryEdit method to find the edit status of this file
- string[] documents = { filename };
- uint result;
- uint outFlags;
-
- // Note that this function can popup a dialog to ask the user to checkout the file.
- // When this dialog is visible, it is possible to receive other request to change
- // the file and this is the reason for the recursion guard
- int hr = queryEditQuerySave.QueryEditFiles(
- 0, // Flags
- 1, // Number of elements in the array
- documents, // Files to edit
- null, // Input flags
- null, // Input array of VSQEQS_FILE_ATTRIBUTE_DATA
- out result, // result of the checkout
- out outFlags // Additional flags
- );
- if (ErrorHandler.Succeeded(hr) && (result == (uint)tagVSQueryEditResult.QER_EditOK))
- {
- // In this case (and only in this case) we can return true from this function
- _canEditFile = true;
- }
- }
- finally
- {
- _gettingCheckoutStatus = false;
- }
- return (bool)_canEditFile;
- }
-
- ///
- /// Load the model from the underlying text buffer.
- ///
- private void LoadModelFromXmlModel()
- {
- try
- {
- XmlSerializer serializer = new XmlSerializer(typeof(qnx));
-
- using (XmlReader reader = GetParseTree().CreateReader())
- {
- _qnxSchema = (qnx)serializer.Deserialize(reader);
- }
-
- if (_qnxSchema == null)
- {
- throw new Exception(Resources.InvalidVsTemplateData);
- }
- }
- catch (Exception e)
- {
- //Display error message
- ErrorHandler.ThrowOnFailure(VsShellUtilities.ShowMessageBox(_serviceProvider,
- Resources.InvalidVsTemplateData + e.Message,
- Resources.ErrorMessageBoxTitle,
- OLEMSGICON.OLEMSGICON_CRITICAL,
- OLEMSGBUTTON.OLEMSGBUTTON_OK,
- OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST));
- }
-
- BufferDirty = false;
-
- if (ViewModelChanged != null)
- {
- // Update the Designer View
- ViewModelChanged(this, new EventArgs());
-
- LoadPermissions();
- }
- }
-
- ///
- /// BufferDirty Property
- ///
- public bool BufferDirty { get; set; }
-
- ///
- /// DesignerDirty Property
- ///
- public bool DesignerDirty { get; set; }
-
-
- ///
- /// Fired when all controls should be re-bound.
- ///
- public event EventHandler ViewModelChanged;
-
- ///
- /// Handle edit scope completion event. This happens when the XML editor buffer decides to update
- /// it's XDocument parse tree.
- ///
- ///
- ///
- void OnUnderlyingEditCompleted(object sender, XmlEditingScopeEventArgs e)
- {
- if (e.EditingScope.UserState != this && !_synchronizing)
- {
- BufferDirty = true;
- _dirtyTime = Environment.TickCount;
- }
- }
-
- ///
- /// Handle undo/redo completion event. This happens when the user invokes Undo/Redo on a buffer edit operation.
- /// We need to resync when this happens.
- ///
- ///
- ///
- void OnUndoRedoCompleted(object sender, XmlEditingScopeEventArgs e)
- {
- if (!_synchronizing)
- {
- BufferDirty = true;
- _dirtyTime = Environment.TickCount;
- }
- }
-
- ///
- /// BufferReloaded event handler
- ///
- ///
- ///
- private void BufferReloaded(object sender, EventArgs e)
- {
- if (!_synchronizing)
- {
- BufferDirty = true;
- _dirtyTime = Environment.TickCount;
- }
- }
-
- ///
- /// Read the author information from the debug token and update the appropriate boxes.
- ///
- public void setAuthorInfo()
- {
- if (!File.Exists(_localRIMFolder + "DebugToken.bar"))
- {
- // Create the dialog instance without Help support.
- var DebugTokenDialog = new DebugToken.DebugTokenDialog();
- // Show the dialog.
- if (!DebugTokenDialog.IsClosing)
- DebugTokenDialog.ShowModal();
- }
-
- System.Diagnostics.Process p = new System.Diagnostics.Process();
- System.Diagnostics.ProcessStartInfo startInfo = p.StartInfo;
- startInfo.UseShellExecute = false;
- startInfo.CreateNoWindow = true;
- startInfo.RedirectStandardError = true;
- startInfo.RedirectStandardOutput = true;
- p.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(p_OutputDataReceived);
-
-
- /// Get Device PIN
- startInfo.FileName = "cmd.exe";
- startInfo.Arguments = string.Format(@"/C blackberry-airpackager.bat -listManifest ""{0}""", _localRIMFolder + "DebugToken.bar");
-
- try
- {
- p.Start();
- p.BeginErrorReadLine();
- p.BeginOutputReadLine();
- p.WaitForExit();
- p.Close();
- }
- catch (Exception e)
- {
- System.Diagnostics.Debug.WriteLine(startInfo.Arguments);
- System.Diagnostics.Debug.WriteLine(e.Message);
- }
- }
-
- ///
- /// Get the author ID
- ///
- /// REturns the author ID
- public string getAuthorID()
- {
- return _tmpAuthorID;
- }
-
- ///
- /// Get the author ID
- ///
- /// REturns the author ID
- public string getAuthor()
- {
- return _tmpAuthor;
- }
-
- ///
- /// On Data Received event handler
- ///
- ///
- ///
- private void p_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
- {
- if (e.Data != null)
- {
- if (e.Data.Contains("Package-Author-Id:"))
- AuthorID = e.Data.Substring(e.Data.LastIndexOf(": ") + 2);
- else if (e.Data.Contains("Package-Author:"))
- Author = e.Data.Substring(e.Data.LastIndexOf(": ") + 2);
- }
- }
-
- #region IViewModel
-
- ///
- /// Name property
- ///
- public string Name
- {
- get
- {
- return _qnxSchema.id;
- }
- set
- {
- if (_qnxSchema.id != value)
- {
- _qnxSchema.id = value;
- DesignerDirty = true;
- NotifyPropertyChanged("Name");
- }
- }
- }
-
- ///
- /// AppName property
- ///
- public string AppName
- {
- get
- {
- return _qnxSchema.name;
- }
- set
- {
- if (_qnxSchema.name != value)
- {
- _qnxSchema.name = value;
- DesignerDirty = true;
- NotifyPropertyChanged("AppName");
- }
- }
- }
-
- ///
- /// Description property
- ///
- public string Description
- {
- get
- {
- return _qnxSchema.description.Trim();
- }
- set
- {
- if (_qnxSchema.description != value)
- {
- _qnxSchema.description = value;
- DesignerDirty = true;
- NotifyPropertyChanged("Description");
- }
- }
- }
-
- ///
- /// Version property
- ///
- public string Version
- {
- get
- {
- return _qnxSchema.versionNumber;
- }
- set
- {
- if (_qnxSchema.versionNumber != value)
- {
- _qnxSchema.versionNumber = value;
- DesignerDirty = true;
- NotifyPropertyChanged("Version");
- }
- }
- }
-
- ///
- /// Build ID property
- ///
- public string BuildID
- {
- get
- {
- return _qnxSchema.buildId;
- }
- set
- {
- if (_qnxSchema.buildId != value)
- {
- _qnxSchema.buildId = value;
- DesignerDirty = true;
- NotifyPropertyChanged("BuildID");
- }
- }
- }
-
- ///
- /// Author property
- ///
- public string Author
- {
- get
- {
- return _qnxSchema.author;
- }
- set
- {
- if (_qnxSchema.author != value)
- {
- _qnxSchema.author = value;
- DesignerDirty = true;
- NotifyPropertyChanged("Author");
- }
- }
- }
-
- ///
- /// Build ID property
- ///
- public string AuthorID
- {
- get
- {
- return _qnxSchema.authorId;
- }
- set
- {
- if (_qnxSchema.authorId != value)
- {
- _qnxSchema.authorId = value;
- DesignerDirty = true;
- NotifyPropertyChanged("AuthorID");
- }
- }
- }
-
- ///
- /// Chrome property
- ///
- public string Chrome
- {
- get
- {
- return _qnxSchema.initialWindow.systemChrome;
- }
- set
- {
- if (_qnxSchema.initialWindow.systemChrome != value)
- {
- _qnxSchema.initialWindow.systemChrome = value;
- DesignerDirty = true;
- NotifyPropertyChanged("Chrome");
- }
- }
- }
-
- ///
- /// Return the AssetList
- ///
- public List AssetList
- {
- get
- {
- if (_config == null)
- {
- if (_qnxSchema.asset == null)
- return null;
- return _qnxSchema.asset.ToList();
- }
-
- if (_config.Name == "All Configurations")
- {
- if (_qnxSchema.asset == null)
- return null;
- return _qnxSchema.asset.ToList();
- }
- else
- {
- foreach (qnxConfiguration config in _qnxSchema.configuration)
- {
- if (config.name == _config.Name)
- {
- if (config.asset == null)
- return null;
- return config.asset.ToList();
- }
- }
-
- return null;
- }
- }
- }
-
-
- public void AddLocalAsset(string assetPath)
- {
- asset newAsset = new asset();
-
- FileInfo fileInfo = new FileInfo(assetPath);
- newAsset.Value = fileInfo.Name;
-
- string activeDir = _activeProjectDirectory;
- string back = "";
-
- // generating the relative path for the asset.
- do
- {
- if (assetPath.Contains(activeDir + "\\"))
- {
- newAsset.path = back + assetPath.Replace(activeDir + "\\", "");
- break;
- }
- else
- {
- int pos = activeDir.LastIndexOf('\\', activeDir.Length - 1);
- if (pos < 0)
- { // file is located in a different driver. Copy the entire assetPath.
- newAsset.path = assetPath;
- break;
- }
- else
- {
- back += "..\\";
- activeDir = activeDir.Remove(pos);
- }
- }
- }
- while (true);
-
- if (_config.Name == "All Configurations")
- _qnxSchema.AddLocalAsset(newAsset);
- else
- {
- foreach (qnxConfiguration config in _qnxSchema.configuration)
- {
- if (config.name == _config.Name)
- {
- config.AddAsset(newAsset);
- }
- }
- }
-
- DesignerDirty = true;
-
- if (ViewModelChanged != null)
- {
- // Update the Designer View
- ViewModelChanged(this, new EventArgs());
- }
- }
-
- public void DeleteLocalAsset(object asset)
- {
- if (_config.Name == "All Configurations")
- _qnxSchema.DeleteLocalAsset(asset as asset);
- else
- {
- foreach (qnxConfiguration config in _qnxSchema.configuration)
- {
- if (config.name == _config.Name)
- {
- config.DeleteAsset(asset as asset);
- }
- }
- }
-
- DesignerDirty = true;
-
- if (ViewModelChanged != null)
- {
- // Update the Designer View
- ViewModelChanged(this, new EventArgs());
- }
- }
-
- public void EditLocalAsset(string identifier, bool? isPublic, string assetType)
- {
- if (_config.Name == "All Configurations")
- {
- foreach (asset assetItem in _qnxSchema.asset)
- {
- if (assetItem.Value == identifier)
- {
- if (isPublic == true)
- {
- assetItem.publicAsset = "true";
- }
- else if (isPublic == false)
- {
- assetItem.publicAsset = "false";
- }
-
- if (assetType == "Other")
- {
- assetItem.type = "";
- assetItem.entry = "";
- assetItem.Value = assetItem.Value.Replace(@"lib/", "");
- }
- else if (assetType == "Entry-point")
- {
- assetItem.type = "Qnx/Elf";
- assetItem.entry = "true";
- assetItem.Value = assetItem.Value.Replace(@"lib/", "");
- }
- else if (assetType == "Executable")
- {
- assetItem.type = "Qnx/Elf";
- assetItem.entry = "";
- assetItem.Value = assetItem.Value.Replace(@"lib/", "");
- }
- else if (assetType == "Library")
- {
- assetItem.type = "";
- assetItem.entry = "";
- assetItem.Value = @"lib/" + assetItem.Value;
- }
- }
- }
- }
- else
- {
- foreach (qnxConfiguration config in _qnxSchema.configuration)
- {
- if (config.name == _config.Name)
- {
- foreach (asset assetItem in config.asset)
- {
- if (assetItem.Value == identifier)
- {
- if (isPublic == true)
- {
- assetItem.publicAsset = "true";
- }
- else if (isPublic == false)
- {
- assetItem.publicAsset = "false";
- }
-
- if (assetType == "Other")
- {
- assetItem.type = "";
- assetItem.entry = "";
- assetItem.Value = assetItem.Value.Replace(@"lib/", "");
- }
- else if (assetType == "Entry-point")
- {
- assetItem.type = "Qnx/Elf";
- assetItem.entry = "true";
- assetItem.Value = assetItem.Value.Replace(@"lib/", "");
- }
- else if (assetType == "Executable")
- {
- assetItem.type = "Qnx/Elf";
- assetItem.entry = "";
- assetItem.Value = assetItem.Value.Replace(@"lib/", "");
- }
- else if (assetType == "Library")
- {
- assetItem.type = "";
- assetItem.entry = "";
- assetItem.Value = @"lib/" + assetItem.Value;
- }
- }
- }
- }
- }
- }
-
- DesignerDirty = true;
-
- if (ViewModelChanged != null)
- {
- // Update the Designer View
- ViewModelChanged(this, new EventArgs());
- }
- }
-
- public void AddIcon(FileInfo icon)
- {
- _qnxSchema.icon.AddIconImage(icon.Name);
- DesignerDirty = true;
- IList source = (IList)_iconImageList.SourceCollection;
- ImageItemClass image = new ImageItemClass(icon.Name, icon.ToString(), _activeProjectDirectory);
- source.Add(image);
- _iconImageList = new CollectionView(source);
-
- if (ViewModelChanged != null)
- {
- // Update the Designer View
- ViewModelChanged(this, new EventArgs());
- }
- }
-
- public void DeleteIcon(object iconName)
- {
- ImageItemClass item = (ImageItemClass)iconName;
- _qnxSchema.icon.DeleteIconImage(item.ImageName);
- DesignerDirty = true;
- IList source = (IList)_iconImageList.SourceCollection;
- source.Remove(item);
- _iconImageList = new CollectionView(source);
-
- if (ViewModelChanged != null)
- {
- // Update the Designer View
- ViewModelChanged(this, new EventArgs());
- }
- }
-
- public void AddSplashScreen(FileInfo splashScreen)
- {
- qnxSplashScreens qnxSS;
-
- if (_qnxSchema.splashScreens == null)
- {
- qnxSS = new qnxSplashScreens();
- _qnxSchema.splashScreens = qnxSS;
- }
- else
- {
- qnxSS = _qnxSchema.splashScreens;
- }
-
- qnxSS.AddSplashScreenImage(splashScreen.Name);
- DesignerDirty = true;
- IList source = (IList)_splashScreenImageList.SourceCollection;
- ImageItemClass image = new ImageItemClass(splashScreen.Name, splashScreen.ToString(), _activeProjectDirectory);
- source.Add(image);
- _splashScreenImageList = new CollectionView(source);
-
- if (ViewModelChanged != null)
- {
- // Update the Designer View
- ViewModelChanged(this, new EventArgs());
- }
- }
-
- public void DeleteSplashScreen(object splashScreenName)
- {
- ImageItemClass item = (ImageItemClass)splashScreenName;
- _qnxSchema.splashScreens.DeleteSplashScreenImage(item.ImageName);
- DesignerDirty = true;
- IList source = (IList)_splashScreenImageList.SourceCollection;
- source.Remove(item);
- _splashScreenImageList = new CollectionView(source);
-
- if (ViewModelChanged != null)
- {
- // Update the Designer View
- ViewModelChanged(this, new EventArgs());
- }
- }
-
- public void CheckPermission(string identifier)
- {
-
- /// add new perm to xml
- qnxPermission perm = new qnxPermission();
- perm.Value = identifier;
- _qnxSchema.AddPermission(perm);
- DesignerDirty = true;
- }
-
- public void UnCheckPermission(string identifier)
- {
- /// add new perm to xml
- qnxPermission perm = new qnxPermission();
- perm.Value = identifier;
- _qnxSchema.DeletePermission(perm);
- DesignerDirty = true;
- }
-
- public bool isPermissionChecked(string identifier)
- {
- bool result = false;
-
- if (_qnxSchema.permission != null)
- {
- foreach (qnxPermission permEntry in _qnxSchema.permission)
- {
- if (permEntry.Value == identifier)
- {
- result = true;
- }
- }
- }
- return result;
- }
-
-
- public CollectionView OrientationList
- {
- get { return _orientationList; }
- }
-
- public CollectionView ConfigurationList
- {
- get { return _configurationList; }
- }
-
- public CollectionView PermissionList
- {
- get { return _permissionList; }
- }
-
- public CollectionView IconImageList
- {
- get { return _iconImageList; }
- }
-
-
- public CollectionView SplashScreenImageList
- {
- get { return _splashScreenImageList; }
- }
-
- public PermissionItemClass PermissionItem
- {
- get
- {
- return _permission;
- }
- set
- {
- _permission = value;
- NotifyPropertyChanged("permission");
- }
- }
-
- public ConfigurationItemClass ConfigurationItemClass
- {
- get
- {
- return _config;
- }
- set
- {
- if (_config == value) return;
- _config = value;
-
-
- if (ViewModelChanged != null)
- {
- // Update the Designer View
- ViewModelChanged(this, new EventArgs());
- }
-
- NotifyPropertyChanged("ConfigurationItemClass");
- }
- }
-
- public OrientationItemClass OrientationItemClass
- {
- get {
- return _orientationItem; }
- set
- {
- if (_orientationItem == value) return;
- _orientationItem = value;
-
- if (_orientationItem.Name == "Default")
- {
- _qnxSchema.initialWindow.autoOrients = "";
- _qnxSchema.initialWindow.aspectRatio = "";
- }
- else if (_orientationItem.Name == "Auto-orient")
- {
- _qnxSchema.initialWindow.autoOrients = "true";
- _qnxSchema.initialWindow.aspectRatio = "";
- }
- else if (_orientationItem.Name == "Landscape")
- {
- _qnxSchema.initialWindow.autoOrients = "false";
- _qnxSchema.initialWindow.aspectRatio = "landscape";
- }
- else if (_orientationItem.Name == "Portrait")
- {
- _qnxSchema.initialWindow.autoOrients = "false";
- _qnxSchema.initialWindow.aspectRatio = "portrait";
- }
-
- DesignerDirty = true;
- NotifyPropertyChanged("OrientationItemClass");
- }
- }
-
- public XmlModel Model
- {
- get
- {
- return _xmlModel;
- }
- }
- ///
- /// Transparent property
- ///
- public bool Transparent
- {
- get
- {
- if (_qnxSchema.initialWindow.transparent == "true")
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- set
- {
- if (value)
- {
- if (_qnxSchema.initialWindow.transparent != "true")
- {
- _qnxSchema.initialWindow.transparent = "true";
- DesignerDirty = true;
- NotifyPropertyChanged("Chrome");
- }
- }
- else
- {
- if (_qnxSchema.initialWindow.transparent == "true")
- {
- _qnxSchema.initialWindow.transparent = "false";
- DesignerDirty = true;
- NotifyPropertyChanged("Chrome");
- }
- }
- }
- }
-
- #endregion
-
- #region IDataErrorInfo
-
- ///
- /// Error Property
- ///
- public string Error
- {
- get
- {
- throw new NotImplementedException();
- }
- }
-
- ///
- ///
- ///
- ///
- ///
- public string this[string columnName]
- {
- get
- {
- string error = null;
- return error;
- }
- }
-
-
- #endregion
-
- #region INotifyPropertyChanged
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- protected void NotifyPropertyChanged(string propertyName)
- {
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
- }
- }
-
- #endregion
-
- #region TreeView SelectionChanged
-
- private ITrackSelection trackSel;
- private ITrackSelection TrackSelection
- {
- get
- {
- if (trackSel == null)
- trackSel = _serviceProvider.GetService(typeof(STrackSelection)) as ITrackSelection;
- return trackSel;
- }
- }
-
- private Microsoft.VisualStudio.Shell.SelectionContainer selContainer;
- public void OnSelectChanged(object p)
- {
- selContainer = new Microsoft.VisualStudio.Shell.SelectionContainer(true, false);
- ArrayList items = new ArrayList();
- items.Add(p);
- selContainer.SelectableObjects = items;
- selContainer.SelectedObjects = items;
-
- ITrackSelection track = TrackSelection;
- if (track != null)
- track.OnSelectChange((ISelectionContainer)selContainer);
- }
-
- #endregion
-
- }
-}
diff --git a/src/VSNDK.Package/VsDesignerControl.xaml b/src/VSNDK.Package/VsDesignerControl.xaml
deleted file mode 100644
index 2095cb83..00000000
--- a/src/VSNDK.Package/VsDesignerControl.xaml
+++ /dev/null
@@ -1,196 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Package/VsDesignerControl.xaml.cs b/src/VSNDK.Package/VsDesignerControl.xaml.cs
deleted file mode 100644
index 7de1ae8c..00000000
--- a/src/VSNDK.Package/VsDesignerControl.xaml.cs
+++ /dev/null
@@ -1,323 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-using EnvDTE;
-using Microsoft.VisualStudio.Shell;
-using System.IO;
-
-namespace RIM.VSNDK_Package
-{
- ///
- /// Interaction logic for VsDesignerControl.xaml
- ///
- public partial class VsDesignerControl : UserControl
- {
- private ServiceProvider _serviceProvider;
- ///
- /// Primary Constructor
- ///
- public VsDesignerControl()
- {
- InitializeComponent();
- }
-
- ///
- /// Overloaded Constructor
- ///
- ///
- public VsDesignerControl(ServiceProvider serviceProvider, IViewModel viewModel)
- {
- _serviceProvider = serviceProvider;
- DataContext = viewModel;
- InitializeComponent();
- // wait until we're initialized to handle events
- viewModel.ViewModelChanged += new EventHandler(ViewModelChanged);
- }
-
- internal void DoIdle()
- {
- // only call the view model DoIdle if this control has focus
- // otherwise, we should skip and this will be called again
- // once focus is regained
- IViewModel viewModel = DataContext as IViewModel;
- if (viewModel != null && this.IsKeyboardFocusWithin)
- {
- viewModel.DoIdle();
- }
- }
-
- ///
- /// ViewModel Changerd Event
- ///
- ///
- ///
- private void ViewModelChanged(object sender, EventArgs e)
- {
- // this gets called when the view model is updated because the Xml Document was updated
- // since we don't get individual PropertyChanged events, just re-set the DataContext
- IViewModel viewModel = DataContext as IViewModel;
- DataContext = null; // first, set to null so that we see the change and rebind
- DataContext = viewModel;
- }
-
- ///
- /// Check to see if the inputed text is allowed
- ///
- ///
- ///
- private Boolean IsTextAllowed(String text)
- {
- return Array.TrueForAll(text.ToCharArray(),
- delegate(Char c) { return Char.IsDigit(c) || Char.IsControl(c); });
- }
-
- ///
- /// Use the PreviewTextInputHandler to respond to key presses
- ///
- ///
- ///
-
- private void PreviewTextInputHandler(object sender, TextCompositionEventArgs e)
- {
- e.Handled = !IsTextAllowed(e.Text);
- }
-
- ///
- /// Use the DataObject.Pasting Handler
- ///
- ///
- ///
- private void PastingHandler(object sender, DataObjectPastingEventArgs e)
- {
- if (e.DataObject.GetDataPresent(typeof(String)))
- {
- String text = (String)e.DataObject.GetData(typeof(String));
- if (!IsTextAllowed(text)) e.CancelCommand();
- }
- else e.CancelCommand();
- }
-
- ///
- /// GetAuthor Button Click Event
- ///
- ///
- ///
- private void btGetAuthor_Click(object sender, RoutedEventArgs e)
- {
- IViewModel viewModel = DataContext as IViewModel;
- viewModel.setAuthorInfo();
- }
-
- private void btnAddIC_Click(object sender, RoutedEventArgs e)
- {
- string filename = string.Empty;
- Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
- dlg.DefaultExt = ".png"; // Default file extension
- dlg.Filter = "Image Files (*.png, *.jpg, *.gif)|*.png;*.jpg;*.gif";
- bool? result = dlg.ShowDialog();
- if (result == true)
- {
- filename = dlg.FileName;
-
- AddIconToProject(filename);
-
- IViewModel viewModel = DataContext as IViewModel;
- if (viewModel != null)
- {
- FileInfo fileInfo = new FileInfo(filename);
- viewModel.AddIcon(fileInfo);
- }
- }
- }
-
- private void AddIconToProject(string path)
- {
- try
- {
- DTE dte = (DTE)_serviceProvider.GetService(typeof(DTE));
- string solutionDir = System.IO.Path.GetDirectoryName(dte.Solution.FullName);
-
-
- Projects projs = dte.Solution.Projects;
- foreach (Project proj in projs)
- {
- IViewModel viewModel = DataContext as IViewModel;
- if (viewModel != null)
- {
-
- FileInfo fileInfo1 = new FileInfo(proj.FullName);
- FileInfo fileInfo2 = new FileInfo(viewModel.Model.Name);
- FileInfo fileInfo3 = new FileInfo(path);
-
- if (viewModel.AppName == proj.Name)
- {
- proj.ProjectItems.AddFromFile(path);
- viewModel.AddLocalAsset(path);
- }
- }
- }
- }
- catch (Exception e)
- {
-
- }
- }
-
- private void btnRemoveIC_Click(object sender, RoutedEventArgs e)
- {
- if (grdIcon.SelectedItem != null)
- {
- IViewModel viewModel = DataContext as IViewModel;
- if (viewModel != null)
- {
- viewModel.DeleteIcon(grdIcon.SelectedItem);
- }
- }
- }
-
-
- private void btnAddSS_Click(object sender, RoutedEventArgs e)
- {
- string filename = string.Empty;
- Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
- dlg.DefaultExt = ".png"; // Default file extension
- dlg.Filter = "Image Files (*.png, *.jpg, *.gif)|*.png;*.jpg;*.gif";
- bool? result = dlg.ShowDialog();
- if (result == true)
- {
- filename = dlg.FileName;
-
- AddIconToProject(filename);
-
- IViewModel viewModel = DataContext as IViewModel;
- if (viewModel != null)
- {
- FileInfo fileInfo = new FileInfo(filename);
- viewModel.AddSplashScreen(fileInfo);
- }
- }
-
- }
-
- private void btnRemoveSS_Click(object sender, RoutedEventArgs e)
- {
- if (grdSplashScreen.SelectedItem != null)
- {
- IViewModel viewModel = DataContext as IViewModel;
- if (viewModel != null)
- {
- viewModel.DeleteSplashScreen(grdSplashScreen.SelectedItem);
- }
- }
- }
-
- private void CheckBox_Click(object sender, RoutedEventArgs e)
- {
- if ((sender as CheckBox).IsChecked == true)
- {
- IViewModel viewModel = DataContext as IViewModel;
- if (viewModel != null)
- {
- viewModel.CheckPermission((grdPermissions.SelectedItem as PermissionItemClass).Identifier);
- };
- }
- else
- {
- IViewModel viewModel = DataContext as IViewModel;
- if (viewModel != null)
- {
- viewModel.UnCheckPermission((grdPermissions.SelectedItem as PermissionItemClass).Identifier);
- };
- }
-
- }
-
- private void btnAddAsset_Click(object sender, RoutedEventArgs e)
- {
- string filename = string.Empty;
- Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
-
- bool? result = dlg.ShowDialog();
- if (result == true)
- {
- filename = dlg.FileName;
-
-
- IViewModel viewModel = DataContext as IViewModel;
- if (viewModel != null)
- {
- viewModel.AddLocalAsset(filename);
- }
- }
-
- }
-
- private void btnRemoveAsset_Click(object sender, RoutedEventArgs e)
- {
- if (grdAssets.SelectedItem != null)
- {
- IViewModel viewModel = DataContext as IViewModel;
- if (viewModel != null)
- {
- viewModel.DeleteLocalAsset(grdAssets.SelectedItem);
- }
- }
- }
-
- private void CheckBox_Click_1(object sender, RoutedEventArgs e)
- {
- bool isPublic = false;
-
- IViewModel viewModel = DataContext as IViewModel;
- if (viewModel != null)
- {
- isPublic = (sender as CheckBox).IsChecked == true;
- viewModel.EditLocalAsset((grdAssets.SelectedItem as asset).Value, isPublic, "");
- }
- }
-
- private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- string assetType = "";
-
- if (e.RemovedItems.Count != 0)
- {
- if (grdAssets.SelectedItems.Count != 0)
- {
- IViewModel viewModel = DataContext as IViewModel;
- if (viewModel != null)
- {
- assetType = (sender as ComboBox).SelectedValue.ToString();
- viewModel.EditLocalAsset((grdAssets.SelectedItem as asset).Value, null, assetType);
- }
- }
- }
- }
-
-
- }
-}
diff --git a/src/VSNDK.Package/XmlEditorDesignerViewRegistration.cs b/src/VSNDK.Package/XmlEditorDesignerViewRegistration.cs
deleted file mode 100644
index aa8f25ac..00000000
--- a/src/VSNDK.Package/XmlEditorDesignerViewRegistration.cs
+++ /dev/null
@@ -1,205 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.VisualStudio.Shell;
-using System.IO;
-using Microsoft.VisualStudio;
-
-namespace RIM.VSNDK_Package
-{
- ///
- /// Register our bardescriptor.xml custom editor
- ///
- [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
- public sealed class XmlEditorDesignerViewRegistrationAttribute : RegistrationAttribute
- {
- /// Declare Constants
- const string XmlChooserFactory = "XmlChooserFactory";
- const string XmlChooserEditorExtensionsKeyPath = @"Editors\{32CC8DFA-2D70-49b2-94CD-22D57349B778}\Extensions";
- const string XmlEditorFactoryGuid = "{FA3CD31E-987B-443A-9B81-186104E8DAC1}";
-
- /// Declare Private Member Variables
- private string keyName;
- private string defaultExtension;
- private Guid defaultLogicalView;
- private int xmlChooserPriority;
-
- ///
- /// Construtor
- ///
- /// Registry key name
- /// Default extension for editor
- /// Default Editor Factory
- /// XML Priority
- public XmlEditorDesignerViewRegistrationAttribute(string keyName, string defaultExtension, object defaultLogicalViewEditorFactory, int xmlChooserPriority)
- {
- /// Validate parameter input
- if (string.IsNullOrWhiteSpace(keyName))
- {
- throw new ArgumentException("Editor description cannot be null or empty.", "editorDescription");
- }
- if (string.IsNullOrWhiteSpace(defaultExtension))
- {
- throw new ArgumentException("Extension cannot be null or empty.", "extension");
- }
- if (defaultLogicalViewEditorFactory == null)
- {
- throw new ArgumentNullException("defaultLogicalViewEditorFactory");
- }
-
- /// Set Member Variables
- this.keyName = keyName;
- this.defaultExtension = defaultExtension;
- this.defaultLogicalView = TryGetGuidFromObject(defaultLogicalViewEditorFactory);
- this.xmlChooserPriority = xmlChooserPriority;
-
- this.CodeLogicalViewEditor = XmlEditorFactoryGuid;
- this.DebuggingLogicalViewEditor = XmlEditorFactoryGuid;
- this.DesignerLogicalViewEditor = XmlEditorFactoryGuid;
- this.TextLogicalViewEditor = XmlEditorFactoryGuid;
- }
-
- ///
- /// Register the custom editor
- ///
- ///
- public override void Register(RegistrationAttribute.RegistrationContext context)
- {
- /// Validate parameter input
- if (context == null)
- {
- throw new ArgumentNullException("context");
- }
-
- /// Set extension key
- Key extensionKey = context.CreateKey(XmlChooserEditorExtensionsKeyPath);
- extensionKey.SetValue(defaultExtension, xmlChooserPriority);
- extensionKey.Close();
-
- /// set editor key
- Key editorKey = context.CreateKey(Path.Combine(XmlChooserFactory, keyName));
- editorKey.SetValue("DefaultLogicalView", defaultLogicalView.ToString("B").ToUpperInvariant());
- editorKey.SetValue("Extension", defaultExtension);
- if (!string.IsNullOrWhiteSpace(Namespace))
- {
- editorKey.SetValue("Namespace", Namespace);
- }
- if (MatchExtensionAndNamespace)
- {
- editorKey.SetValue("Match", "both");
- }
- if (IsDataSet.HasValue)
- {
- editorKey.SetValue("IsDataSet", Convert.ToInt32(IsDataSet.Value));
- }
- /// Set DebuggingLogicalViewEditor Mapping
- if (DebuggingLogicalViewEditor != null)
- {
- editorKey.SetValue(VSConstants.LOGVIEWID_Debugging.ToString("B").ToUpperInvariant(), TryGetGuidFromObject(DebuggingLogicalViewEditor).ToString("B").ToUpperInvariant());
- }
- /// Set CodeLogicalViewEditor Mapping
- if (CodeLogicalViewEditor != null)
- {
- editorKey.SetValue(VSConstants.LOGVIEWID_Code.ToString("B").ToUpperInvariant(), TryGetGuidFromObject(CodeLogicalViewEditor).ToString("B").ToUpperInvariant());
- }
- /// Set DesignerLogicalViewEditor Mapping
- if (DesignerLogicalViewEditor != null)
- {
- editorKey.SetValue(VSConstants.LOGVIEWID_Designer.ToString("B").ToUpperInvariant(), TryGetGuidFromObject(DesignerLogicalViewEditor).ToString("B").ToUpperInvariant());
- }
- /// Set TextLogicalViewEditor Mapping
- if (TextLogicalViewEditor != null)
- {
- editorKey.SetValue(VSConstants.LOGVIEWID_TextView.ToString("B").ToUpperInvariant(), TryGetGuidFromObject(TextLogicalViewEditor).ToString("B").ToUpperInvariant());
- }
- editorKey.Close();
- }
-
- ///
- /// Unregister the custom editor
- ///
- ///
- public override void Unregister(RegistrationContext context)
- {
- /// Validate parameter input
- if (context == null)
- {
- throw new ArgumentNullException("context");
- }
-
- /// Remove Key
- context.RemoveKey(Path.Combine(XmlChooserFactory, keyName));
- context.RemoveValue(XmlChooserEditorExtensionsKeyPath, defaultExtension);
- context.RemoveKeyIfEmpty(XmlChooserEditorExtensionsKeyPath);
- }
-
-
- ///
- /// Private member function to return the GUID of an object.
- ///
- ///
- ///
- private Guid TryGetGuidFromObject(object guidObject)
- {
- // figure out what type of object they passed in and get the GUID from it
- if (guidObject is string)
- return new Guid((string)guidObject);
- else if (guidObject is Type)
- return ((Type)guidObject).GUID;
- else if (guidObject is Guid)
- return (Guid)guidObject;
- else
- throw new ArgumentException("Could not determine Guid from supplied object.", "guidObject");
- }
-
- ///
- /// The editor factor for the Code View Editor
- ///
- public object CodeLogicalViewEditor { get; set; }
-
- ///
- /// The editor factory for the Debugging View Editor
- ///
- public object DebuggingLogicalViewEditor { get; set; }
-
- ///
- /// The editor factor for the Designer View Editor
- ///
- public object DesignerLogicalViewEditor { get; set; }
-
- ///
- /// The edtior factgory for the Text View Editor
- ///
- public object TextLogicalViewEditor { get; set; }
-
- ///
- /// Namespace property
- ///
- public string Namespace { get; set; }
-
- ///
- /// Property
- ///
- public bool MatchExtensionAndNamespace { get; set; }
-
- ///
- /// Special value used only by the DataSet designer.
- ///
- public bool? IsDataSet { get; set; }
- }
-}
diff --git a/src/VSNDK.Package/bar-descriptor.cs b/src/VSNDK.Package/bar-descriptor.cs
deleted file mode 100644
index 5ab7560d..00000000
--- a/src/VSNDK.Package/bar-descriptor.cs
+++ /dev/null
@@ -1,919 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-namespace RIM.VSNDK_Package
-{
- using System.Xml.Serialization;
- using System;
- using System.Collections;
- using System.Collections.Generic;
-
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- [System.Xml.Serialization.XmlRootAttribute(Namespace="http://www.qnx.com/schemas/application/1.0", IsNullable=true)]
- public partial class asset : object, System.ComponentModel.INotifyPropertyChanged {
-
- private string pathField;
-
- private string publicAssetField;
-
- private string entryField;
-
- private string typeField;
-
- private string[] _assettypeList = {"Other", "Library", "Executable", "Entry-point"};
-
- private string _assettype = "Other";
-
- private string valueField;
-
- [System.Xml.Serialization.XmlIgnore]
- public string assettype
- {
- get
- {
- _assettype = getAssetType();
- return _assettype;
- }
- set
- {
- if (value != _assettype)
- _assettype = value;
- }
- }
-
- [System.Xml.Serialization.XmlIgnore]
- public string[] assettypelist
- {
- get
- {
- return this._assettypeList;
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string path {
- get {
- return this.pathField;
- }
- set {
- this.pathField = value;
- this.RaisePropertyChanged("path");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute("public")]
- public string publicAsset
- {
- get
- {
- return this.publicAssetField;
- }
- set
- {
- this.publicAssetField = value;
- this.RaisePropertyChanged("publicAsset");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string entry {
- get {
- return this.entryField;
- }
- set {
- this.entryField = value;
- this.RaisePropertyChanged("entry");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string type {
- get {
- return this.typeField;
- }
- set {
- this.typeField = value;
- this.RaisePropertyChanged("type");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlTextAttribute()]
- public string Value {
- get {
- return this.valueField;
- }
- set {
- this.valueField = value;
- this.RaisePropertyChanged("Value");
- }
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName)
- {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null)) {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
-
- private string getAssetType()
- {
- if (this.valueField.StartsWith("lib/"))
- {
- return "Library";
- }
- else if (this.typeField == "Qnx/Elf")
- {
- if (this.entry == "true")
- {
- return "Entry-point";
- }
- else
- {
- return "Executable";
- }
- }
- else
- {
- return "Other";
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- [System.Xml.Serialization.XmlRootAttribute(Namespace="http://www.qnx.com/schemas/application/1.0", IsNullable=false)]
- public partial class qnx : object, System.ComponentModel.INotifyPropertyChanged {
-
- private string idField;
-
- private string nameField;
-
- private string versionNumberField;
-
- private string buildIdField;
-
- private string descriptionField;
-
- private string authorField;
-
- private string authorIdField;
-
- private string categoryField;
-
- private qnxInitialWindow initialWindowField;
-
- private asset[] assetField;
-
- private qnxConfiguration[] configurationField;
-
- private qnxPermission[] permissionField;
-
- private qnxIcon iconField;
-
- private qnxSplashScreens splashScreenField;
-
- private qnxAction[] actionField;
-
- private qnxEnv[] envField;
-
- ///
- public string id {
- get {
- return this.idField;
- }
- set {
- this.idField = value;
- this.RaisePropertyChanged("id");
- }
- }
-
- ///
- public string name {
- get {
- return this.nameField;
- }
- set {
- this.nameField = value;
- this.RaisePropertyChanged("name");
- }
- }
-
- ///
- public string versionNumber {
- get {
- return this.versionNumberField;
- }
- set {
- this.versionNumberField = value;
- this.RaisePropertyChanged("versionNumber");
- }
- }
-
- ///
- public string buildId {
- get {
- return this.buildIdField;
- }
- set {
- this.buildIdField = value;
- this.RaisePropertyChanged("buildId");
- }
- }
-
- ///
- public string description {
- get {
- return this.descriptionField;
- }
- set {
- this.descriptionField = value;
- this.RaisePropertyChanged("description");
- }
- }
-
- ///
- public string author {
- get {
- return this.authorField;
- }
- set {
- this.authorField = value;
- this.RaisePropertyChanged("author");
- }
- }
-
- ///
- public string authorId
- {
- get
- {
- return this.authorIdField;
- }
- set
- {
- this.authorIdField = value;
- this.RaisePropertyChanged("authorId");
- }
- }
-
- ///
- public string category {
- get {
- return this.categoryField;
- }
- set {
- this.categoryField = value;
- this.RaisePropertyChanged("category");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("initialWindow")]
- public qnxInitialWindow initialWindow {
- get {
- return this.initialWindowField;
- }
- set {
- this.initialWindowField = value;
- this.RaisePropertyChanged("initialWindow");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("asset", IsNullable=true)]
- public asset[] asset {
- get {
- return this.assetField;
- }
- set {
- this.assetField = value;
- this.RaisePropertyChanged("asset");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("configuration")]
- public qnxConfiguration[] configuration {
- get {
- return this.configurationField;
- }
- set {
- this.configurationField = value;
- this.RaisePropertyChanged("configuration");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("permission", IsNullable = true)]
- public qnxPermission[] permission
- {
- get
- {
- return this.permissionField;
- }
- set
- {
- this.permissionField = value;
- this.RaisePropertyChanged("permission");
- }
- }
-
- public void AddPermission(qnxPermission newPermission)
- {
- if (permission == null)
- {
- permission = new qnxPermission[0];
- }
-
- var newPermissionsList = permission;
- Array.Resize(ref newPermissionsList, newPermissionsList.Length + 1);
- newPermissionsList[newPermissionsList.Length - 1] = newPermission;
- permission = newPermissionsList;
- }
-
- public void DeletePermission(qnxPermission oldPermission)
- {
- foreach (qnxPermission perm in permission)
- {
- if (perm.Value == oldPermission.Value)
- {
- List permissionList = new List(permission);
- permissionList.Remove(perm);
- permission = permissionList.ToArray();
- }
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("icon")]
- public qnxIcon icon {
- get {
- return this.iconField;
- }
- set {
- this.iconField = value;
- this.RaisePropertyChanged("icon");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("splashScreens")]
- public qnxSplashScreens splashScreens
- {
- get
- {
- return this.splashScreenField;
- }
- set
- {
- this.splashScreenField = value;
- this.RaisePropertyChanged("splashScreens");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("action", IsNullable=true)]
- public qnxAction[] action {
- get {
- return this.actionField;
- }
- set {
- this.actionField = value;
- this.RaisePropertyChanged("action");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("env")]
- public qnxEnv[] env {
- get {
- return this.envField;
- }
- set {
- this.envField = value;
- this.RaisePropertyChanged("env");
- }
- }
-
- public void AddLocalAsset(asset newAsset)
- {
- if (asset == null)
- {
- asset = new asset[0];
- }
-
- var local_asset = asset;
- Array.Resize(ref local_asset, local_asset.Length + 1);
- local_asset[local_asset.Length - 1] = newAsset;
- asset = local_asset;
- }
-
- public void DeleteLocalAsset(asset removeAsset)
- {
- List assetList = new List(asset);
- assetList.Remove(removeAsset);
- asset = assetList.ToArray();
- }
-
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName) {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null)) {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxInitialWindow : object, System.ComponentModel.INotifyPropertyChanged {
-
- private string autoOrientsField;
-
- private string aspectRatioField;
-
- private string systemChromeField;
-
- private string transparentField;
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("autoOrients", IsNullable = true)]
- public string autoOrients
- {
- get
- {
- return this.autoOrientsField;
- }
- set
- {
- this.autoOrientsField = value;
- this.RaisePropertyChanged("autoOrients");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("aspectRatio", IsNullable = true)]
- public string aspectRatio
- {
- get
- {
- return this.aspectRatioField;
- }
- set
- {
- this.aspectRatioField = value;
- this.RaisePropertyChanged("aspectRatio");
- }
- }
-
- ///
- public string systemChrome {
- get {
- return this.systemChromeField;
- }
- set {
- this.systemChromeField = value;
- this.RaisePropertyChanged("systemChrome");
- }
- }
-
- ///
- public string transparent {
- get {
- return this.transparentField;
- }
- set {
- this.transparentField = value;
- this.RaisePropertyChanged("transparent");
- }
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName) {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null)) {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxConfiguration : object, System.ComponentModel.INotifyPropertyChanged {
-
- private string platformArchitectureField;
-
- private asset[] assetField;
-
- private string idField;
-
- private string nameField;
-
- ///
- public string platformArchitecture {
- get {
- return this.platformArchitectureField;
- }
- set {
- this.platformArchitectureField = value;
- this.RaisePropertyChanged("platformArchitecture");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("asset", IsNullable=true)]
- public asset[] asset {
- get {
- return this.assetField;
- }
- set {
- this.assetField = value;
- this.RaisePropertyChanged("asset");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string id {
- get {
- return this.idField;
- }
- set {
- this.idField = value;
- this.RaisePropertyChanged("id");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string name {
- get {
- return this.nameField;
- }
- set {
- this.nameField = value;
- this.RaisePropertyChanged("name");
- }
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName) {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null)) {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
-
- public void AddAsset(asset newAsset)
- {
- if (asset == null)
- {
- asset = new asset[0];
- }
-
- var local_asset = asset;
- Array.Resize(ref local_asset, local_asset.Length + 1);
- local_asset[local_asset.Length - 1] = newAsset;
- asset = local_asset;
- }
-
- public void DeleteAsset(asset removeAsset)
- {
- List assetList = new List(asset);
- assetList.Remove(removeAsset);
- asset = assetList.ToArray();
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxPermission : object, System.ComponentModel.INotifyPropertyChanged
- {
-
- private string systemField;
-
- private string valueField;
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string system
- {
- get
- {
- return this.systemField;
- }
- set
- {
- this.systemField = value;
- this.RaisePropertyChanged("system");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlTextAttribute()]
- public string Value
- {
- get
- {
- return this.valueField;
- }
- set
- {
- this.valueField = value;
- this.RaisePropertyChanged("Value");
- }
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName)
- {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null))
- {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxIcon : object, System.ComponentModel.INotifyPropertyChanged {
-
- private string[] imageField;
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("image", IsNullable = true)]
- public string[] image {
- get {
- return this.imageField;
- }
- set {
- this.imageField = value;
- this.RaisePropertyChanged("image");
- }
- }
-
- public void AddIconImage(string iconImage)
- {
- if (image == null)
- {
- image = new string[0];
- }
-
- var iconImages = image;
- Array.Resize(ref iconImages, iconImages.Length + 1);
- iconImages[iconImages.Length - 1] = iconImage;
- image = iconImages;
- }
-
- public void DeleteIconImage(string iconImage)
- {
- List iconList = new List(image);
- iconList.Remove(iconImage);
- image = iconList.ToArray();
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName) {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null)) {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxSplashScreens : object, System.ComponentModel.INotifyPropertyChanged
- {
-
- private string[] imageField;
-
- [System.Xml.Serialization.XmlElementAttribute("image", IsNullable = true)]
- public string[] image
- {
- get
- {
- return this.imageField;
- }
- set
- {
- this.imageField = value;
- this.RaisePropertyChanged("image");
- }
- }
-
- public void AddSplashScreenImage(string iconImage)
- {
- if (image == null)
- {
- image = new string[0];
- }
-
- var iconImages = image;
- Array.Resize(ref iconImages, iconImages.Length + 1);
- iconImages[iconImages.Length - 1] = iconImage;
- image = iconImages;
- }
-
- public void DeleteSplashScreenImage(string iconImage)
- {
- List iconList = new List(image);
- iconList.Remove(iconImage);
- image = iconList.ToArray();
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName)
- {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null))
- {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
- }
-
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxAction : object, System.ComponentModel.INotifyPropertyChanged {
-
- private string systemField;
-
- private string valueField;
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string system {
- get {
- return this.systemField;
- }
- set {
- this.systemField = value;
- this.RaisePropertyChanged("system");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlTextAttribute()]
- public string Value {
- get {
- return this.valueField;
- }
- set {
- this.valueField = value;
- this.RaisePropertyChanged("Value");
- }
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName) {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null)) {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxEnv : object, System.ComponentModel.INotifyPropertyChanged {
-
- private string varField;
-
- private string valueField;
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string var {
- get {
- return this.varField;
- }
- set {
- this.varField = value;
- this.RaisePropertyChanged("var");
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string value {
- get {
- return this.valueField;
- }
- set {
- this.valueField = value;
- this.RaisePropertyChanged("value");
- }
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName) {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null)) {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- [System.Xml.Serialization.XmlRootAttribute(Namespace="http://www.qnx.com/schemas/application/1.0", IsNullable=false)]
- public partial class NewDataSet : object, System.ComponentModel.INotifyPropertyChanged {
-
- private object[] itemsField;
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("asset", typeof(asset), IsNullable=true)]
- [System.Xml.Serialization.XmlElementAttribute("qnx", typeof(qnx))]
- public object[] Items {
- get {
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- this.RaisePropertyChanged("Items");
- }
- }
-
- public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
-
- protected void RaisePropertyChanged(string propertyName) {
- System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
- if ((propertyChanged != null)) {
- propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
- }
- }
- }
-}
diff --git a/src/VSNDK.Package/source.extension.vsixmanifest b/src/VSNDK.Package/source.extension.vsixmanifest
deleted file mode 100644
index fab92149..00000000
--- a/src/VSNDK.Package/source.extension.vsixmanifest
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
- VSNDK.Package
- Research In Motion Ltd.
- 1.0.0031
- Package provides BlackBerry Menu items and editor
- 1033
- false
-
-
- Pro
-
-
-
-
-
-
- Visual Studio MPF
-
-
-
- |%CurrentProject%;PkgdefProjectOutputGroup|
-
-
diff --git a/src/VSNDK.Tasks.Test/MakeAllAndFormatOutputMessagesTestClass.cs b/src/VSNDK.Tasks.Test/MakeAllAndFormatOutputMessagesTestClass.cs
deleted file mode 100644
index 9893878c..00000000
--- a/src/VSNDK.Tasks.Test/MakeAllAndFormatOutputMessagesTestClass.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using VSNDK.Tasks;
-using Microsoft.Build.Framework;
-using NUnit.Framework;
-
-namespace VSNDK.Tasks.Test
-{
- [TestFixture]
- public class MakeAllAndFormatOutputMessagesTestClass
- {
- [TestCase]
- public void MakeAllAndFormatOutputMessagesConstructorTest()
- {
- MakeAllAndFormatOutputMessages target = new MakeAllAndFormatOutputMessages();
- Assert.IsNotNull(target);
- }
-
- }
-}
diff --git a/src/VSNDK.Tasks.Test/Properties/AssemblyInfo.cs b/src/VSNDK.Tasks.Test/Properties/AssemblyInfo.cs
deleted file mode 100644
index 884a1d76..00000000
--- a/src/VSNDK.Tasks.Test/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("VSNDK.Tasks.Test")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("VSNDK.Tasks.Test")]
-[assembly: AssemblyCopyright("Copyright © 2013")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("de27a838-9bb2-4ffc-b350-8cba94994fdd")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/src/VSNDK.Tasks.Test/VSNDK.Tasks.Test.csproj b/src/VSNDK.Tasks.Test/VSNDK.Tasks.Test.csproj
deleted file mode 100644
index fb0a0c4a..00000000
--- a/src/VSNDK.Tasks.Test/VSNDK.Tasks.Test.csproj
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {BDA81519-4AC1-4B1B-9EA0-18124E3C5E4E}
- Library
- Properties
- VSNDK.Tasks.Test
- VSNDK.Tasks.Test
- v4.0
- 512
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}
- VSNDK.Tasks
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks.Test/WriteDebuggerArgsTestClass.cs b/src/VSNDK.Tasks.Test/WriteDebuggerArgsTestClass.cs
deleted file mode 100644
index f4c8b30d..00000000
--- a/src/VSNDK.Tasks.Test/WriteDebuggerArgsTestClass.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using NUnit.Framework;
-using VSNDK.Tasks;
-using System.IO;
-
-namespace VSNDK.Tasks.Test
-{
- [TestFixture]
- class WriteDebuggerArgsTestClass
- {
-/* private WriteDebuggerArgs target;
-
- [SetUp]
- public void setup()
- {
- target = new WriteDebuggerArgs();
- target.AppName = "HelloWorld";
- target.Device = "169.254.0.1";
- target.isSimulator = false;
- target.OutDir = @"\Device-Debug";
- target.Password = "AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA7fSRRS7m1Em+yoK0ioAYhwQAAAACAAAAAAADZgAAwAAAABAAAABtBZa+ZRR0uoriYLDYxqPlAAAAAASAAACgAAAAEAAAAGJAoUM+qvmrXoLeokZQinMQAAAAS1JPN9qlZFQbSZmgaa509xQAAADKl++zEjFNnrI1aKXGrvvmgLRkeQ==";
- target.ProjectDir = @"C:\Users\dburgess\Desktop\HelloWorld\HelloWorld";
- target.PublicKeyPath = @"C:\Users\dburgess\AppData\Local/Research In Motion/bbt_id_rsa.pub";
- target.ToolsPath = @"C:\bbndk-2.0.0\host\win32\x86usr\bin";
- }
-
- ///
- /// Constructor Test
- ///
- [TestCase]
- public void WriteDebuggerArgsConstructorTest()
- {
- Assert.IsNotNull(target);
- }
-
- ///
- /// Perform Task Execute test case
- ///
- [TestCase]
- public void ExecuteTest()
- {
- /// Prepare test case
- bool result = target.Execute();
-
- /// Verify test case
- Assert.IsTrue(result);
- }
-
- ///
- /// Perform Task Execute test case
- ///
- [TestCase]
- public void ExecuteFileExistsTest()
- {
- /// Prepare test case
- WriteDebuggerArgs target = new WriteDebuggerArgs();
- bool targetResult = target.Execute();
- bool result = File.Exists(target.AppData);
-
- /// Verify test case
- Assert. IsTrue(result);
- }*/
- }
-}
diff --git a/src/VSNDK.Tasks/AsyncExec.cs b/src/VSNDK.Tasks/AsyncExec.cs
deleted file mode 100644
index 27156d93..00000000
--- a/src/VSNDK.Tasks/AsyncExec.cs
+++ /dev/null
@@ -1,116 +0,0 @@
-//* Copyright 2010-2011 BlackBerry Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Build.Tasks;
-using System.Diagnostics;
-using System.Collections;
-using System.Collections.Specialized;
-using Microsoft.Build.Framework;
-using System.Security.Cryptography;
-
-namespace VSNDK.Tasks
-{
- // This task overrides Exec in order to run commands such as blackberry-connect asynchronously.
- public class AsyncExec : Exec
- {
- private int _processId;
-
- ///
- /// Execute given command asynchronously.
- ///
- /// Path of executable to be run.
- /// Response file commands
- /// Command Line Arguments
- ///
- protected override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands)
- {
- string comm = "/Q /C " + Command + " -password " + Decrypt(Password);
-
- Process process = new Process();
- process.StartInfo = GetProcessStartInfo(pathToTool, comm);
- process.StartInfo.UseShellExecute = false;
- process.Start();
- _processId = process.Id;
- return 0;
- }
-
- ///
- /// Helper function to create the ProcessStartInfo object for the running process.
- ///
- /// Path of executable to be run.
- /// Command Line Arguments
- ///
- protected virtual ProcessStartInfo GetProcessStartInfo(string executable, string arguments)
- {
- if (arguments.Length > 0x7d00)
- {
- this.Log.LogWarningWithCodeFromResources("ToolTask.CommandTooLong", new object[] { base.GetType().Name });
- }
-
- ProcessStartInfo startInfo = new ProcessStartInfo(executable, arguments);
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.CreateNoWindow = true;
- startInfo.UseShellExecute = true;
-
- string workingDirectory = this.GetWorkingDirectory();
- if (workingDirectory != null)
- {
- startInfo.WorkingDirectory = workingDirectory;
- }
-
- StringDictionary environmentOverride = this.EnvironmentOverride;
- if (environmentOverride != null)
- {
- foreach (DictionaryEntry entry in environmentOverride)
- {
- startInfo.EnvironmentVariables.Remove(entry.Key.ToString());
- startInfo.EnvironmentVariables.Add(entry.Key.ToString(), entry.Value.ToString());
- }
- }
-
- return startInfo;
- }
-
- ///
- /// Getter/Setter for Password Property
- ///
- public virtual string Password
- {
- set;
- get;
- }
-
- ///
- /// Helper Function to Decrypt Password
- ///
- ///
- ///
- public string Decrypt(string cipher)
- {
- if (cipher == null) throw new ArgumentNullException("cipher");
-
- //parse base64 string
- byte[] data = Convert.FromBase64String(cipher);
-
- //decrypt data
- byte[] decrypted = ProtectedData.Unprotect(data, null, DataProtectionScope.LocalMachine);
-
- return Encoding.Unicode.GetString(decrypted);
- }
- }
-}
diff --git a/src/VSNDK.Tasks/BBDeploy.cs b/src/VSNDK.Tasks/BBDeploy.cs
deleted file mode 100644
index 41bd1e26..00000000
--- a/src/VSNDK.Tasks/BBDeploy.cs
+++ /dev/null
@@ -1,700 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-using System.Resources;
-using Microsoft.Build.CPPTasks;
-using System.Collections;
-using Microsoft.Build.Framework;
-using System.IO;
-using Microsoft.Build.Utilities;
-using System.Security.Cryptography;
-
-namespace VSNDK.Tasks
-{
- public class BBDeploy : TrackedVCToolTask
- {
- #region Member Variable Declaration
- protected ArrayList switchOrderList;
- private string _localManifest;
- private const string TRACKER_LOG_DIRECTORY = "TrackerLogDirectory";
- private const string GET_FILE = "GetFile";
- private const string GET_FILE_SAVE_AS = "GetFileSaveAs";
- private const string PUT_FILE = "PutFile";
- private const string PUT_FILE_SAVE_AS = "PutFileSaveAs";
- private const string DEVICE = "Device";
- private const string PASSWORD = "Password";
- private const string PACKAGE_ID = "PackageId";
- private const string PACKAGE_NAME = "PackageName";
- private const string LAUNCH_APP = "LaunchApp";
- private const string INSTALL_APP = "InstallApp";
- private const string LIST_INSTALLED_APPS = "ListInstalledApps";
- private const string DEBUG_NATIVE = "DebugNative";
- private const string PACKAGE = "Package";
- private const string WORKSPACE_LOC = "${workspace_loc:/";
- private string _flagFile;
-
- #endregion
-
- ///
- /// BBDeploy Constructor
- ///
- public BBDeploy()
- : base(new ResourceManager("VSNDK.Tasks.Properties.Resources", Assembly.GetExecutingAssembly()))
- {
- this.switchOrderList = new ArrayList();
- this.switchOrderList.Add(INSTALL_APP);
- this.switchOrderList.Add(LAUNCH_APP);
- this.switchOrderList.Add(LIST_INSTALLED_APPS);
- this.switchOrderList.Add(DEBUG_NATIVE);
- this.switchOrderList.Add(DEVICE);
- this.switchOrderList.Add(PASSWORD);
- this.switchOrderList.Add(PACKAGE);
- this.switchOrderList.Add(PACKAGE_ID);
- this.switchOrderList.Add(PACKAGE_NAME);
- this.switchOrderList.Add(GET_FILE);
- this.switchOrderList.Add(GET_FILE_SAVE_AS);
- this.switchOrderList.Add(PUT_FILE);
- this.switchOrderList.Add(PUT_FILE_SAVE_AS);
- }
-
- #region overrides
-
- ///
- /// Helper function to return Response File Switch
- ///
- /// Path to response file.
- /// Return response file switch
- protected override string GetResponseFileSwitch(string responseFilePath)
- {
- return string.Empty;
- }
-
- ///
- /// Helper function to generte the command line argument string.
- ///
- /// command line argument string
- protected override string GenerateCommandLineCommands()
- {
- return GenerateResponseFileCommands();
- }
-
- ///
- /// Helper function to generate response file string
- ///
- /// response file command line string
- protected override string GenerateResponseFileCommands()
- {
- string cmd = base.GenerateResponseFileCommands();
-
- if (ListInstalledApps)
- {
- cmd += " > installedApps.txt";
- }
-
- return cmd;
- }
-
- ///
- /// Getter for the SwitchOrderList property
- ///
- protected override ArrayList SwitchOrderList
- {
- get
- {
- return this.switchOrderList;
- }
- }
-
- ///
- /// Getter for the CommandTLogName property
- ///
- protected override string CommandTLogName
- {
- get { return "BBDeploy.command.1.tlog"; }
- }
-
- ///
- /// Getter for the ReadTLogNames property
- ///
- protected override string[] ReadTLogNames
- {
- get { return new string[] { "BBDeploy.read.1.tlog", "BBDeploy.*.read.1.tlog" }; }
- }
-
- ///
- /// Getter for the WriteTLogNames property
- ///
- protected override string[] WriteTLogNames
- {
- get
- {
- return new string[] { "BBDeploy.write.1.tlog", "BBDeploy.*.write.1.tlog" };
- }
- }
-
- ///
- /// Getter for the TrackedInputFiles property
- ///
- protected override Microsoft.Build.Framework.ITaskItem[] TrackedInputFiles
- {
- get
- {
- // I don't know what this method does but we need to return something other than 'null' or the task doesn't run,
- // and adding something like "localManifest.mf" to the list of items causes other problems.
- ITaskItem[] items = new ITaskItem[1];
- return items;
- }
- }
-
- ///
- /// Getter for the ToolName property
- ///
- protected override string ToolName
- {
- get
- {
- return ToolExe;
- }
- }
-
- ///
- /// Getter for the TrackerIntermediateDirectory property
- ///
- protected override string TrackerIntermediateDirectory
- {
- get
- {
- if (this.TrackerLogDirectory != null)
- {
- return this.TrackerLogDirectory;
- }
- return string.Empty;
- }
- }
-
- ///
- /// Function to return the full path to the tool.
- ///
- ///
- protected override string GenerateFullPathToTool()
- {
- return this.ToolName;
- }
-
- #endregion overrides
-
- #region properties
-
- ///
- /// Getter/Setter for the GetFile property
- /// Retrieve specified file from default application directory
- ///
- public virtual string GetFile
- {
- get
- {
- if (base.IsPropertySet(GET_FILE))
- {
- return base.ActiveToolSwitches[GET_FILE].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(GET_FILE);
-
- // Value passed in is the file to get, relative to our app's directory.
- // We determine the app's directory from the PackageName and PackageId.
- String toolValue = "../../../../apps/" + PackageName + "." + PackageId + "/" + value;
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.String)
- {
- Name = GET_FILE,
- DisplayName = "GetFile",
- Description = "Get the given file from the application's directory.",
- SwitchValue = "-getFile ",
- Value = toolValue
- };
- base.ActiveToolSwitches.Add(GET_FILE, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for the GetFileSaveAs property
- /// Retrieve specified file from location.
- ///
- public virtual string GetFileSaveAs
- {
- get
- {
- if (base.IsPropertySet(GET_FILE_SAVE_AS))
- {
- return base.ActiveToolSwitches[GET_FILE_SAVE_AS].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(GET_FILE_SAVE_AS);
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.String)
- {
- Name = GET_FILE_SAVE_AS,
- DisplayName = "GetFileSaveAs",
- Description = "Save a file retrieved using GetFile to the given location.",
- Value = value
- };
- base.ActiveToolSwitches.Add(GET_FILE_SAVE_AS, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for the PutFile property
- /// Save given file to default application directory.
- ///
- public virtual string PutFile
- {
- get
- {
- if (base.IsPropertySet(PUT_FILE))
- {
- return base.ActiveToolSwitches[PUT_FILE].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(PUT_FILE);
- //value = value.Replace(".exe", "");
-
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.String)
- {
- Name = PUT_FILE,
- DisplayName = "PutFile",
- Description = "Put the given file into the application's directory.",
- SwitchValue = "-putFile ",
- Value = value
- };
- base.ActiveToolSwitches.Add(PUT_FILE, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for the PutFileSaveAs property
- /// Save given file to specified location
- ///
- public virtual string PutFileSaveAs
- {
- get
- {
- if (base.IsPropertySet(PUT_FILE_SAVE_AS))
- {
- return base.ActiveToolSwitches[PUT_FILE_SAVE_AS].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(PUT_FILE_SAVE_AS);
-
- // We determine the app's directory from the PackageName and PackageId.
- String toolValue = "../../../../apps/" + PackageName + "." + PackageId + "/" + value;
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.String)
- {
- Name = PUT_FILE_SAVE_AS,
- DisplayName = "PutFileSaveAs",
- Description = "Save a file retrieved using PutFile to the given location.",
- Value = toolValue
- };
- base.ActiveToolSwitches.Add(PUT_FILE_SAVE_AS, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for the InstallApp property - Switch to cause deploy to install a given application
- ///
- public virtual bool InstallApp
- {
- get
- {
- return (base.IsPropertySet(INSTALL_APP) && base.ActiveToolSwitches[INSTALL_APP].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(INSTALL_APP);
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.Boolean)
- {
- Name = INSTALL_APP,
- DisplayName = "Install App",
- Description = "The -installApp option installs an app from a given package.",
- SwitchValue = "-installApp",
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(INSTALL_APP, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for the LaunchApp Property - Switch to launch given application.
- ///
- public virtual bool LaunchApp
- {
- get
- {
- return (base.IsPropertySet(LAUNCH_APP) && base.ActiveToolSwitches[LAUNCH_APP].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(LAUNCH_APP);
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.Boolean)
- {
- Name = LAUNCH_APP,
- DisplayName = "Launch App",
- Description = "The -launchApp option allows an app to be launched with or without being installed.",
- SwitchValue = "-launchApp ",
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(LAUNCH_APP, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for ListInstalledApps Property.
- /// Switch for command to retrieve the list of installed apps.
- ///
- public virtual bool ListInstalledApps
- {
- get
- {
- return (base.IsPropertySet(LIST_INSTALLED_APPS) && base.ActiveToolSwitches[LIST_INSTALLED_APPS].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(LIST_INSTALLED_APPS);
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.Boolean)
- {
- Name = LIST_INSTALLED_APPS,
- DisplayName = "List Installed Apps",
- Description = "The -listInstalledApps option does just that.",
- SwitchValue = "-listInstalledApps ",
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(LIST_INSTALLED_APPS, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Setter for FlagFile property
- ///
- public string FlagFile
- {
- set
- {
- _flagFile = value;
- }
- }
-
- ///
- /// Getter/Setter for DebugNative property
- /// Switch to cause task to install application in debug configuration.
- ///
- public virtual bool DebugNative
- {
- get
- {
- return (base.IsPropertySet(DEBUG_NATIVE) && base.ActiveToolSwitches[DEBUG_NATIVE].BooleanValue);
- }
-
- set
- {
- if (File.Exists(_flagFile))
- value = true;
-
- base.ActiveToolSwitches.Remove(DEBUG_NATIVE);
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.Boolean)
- {
- Name = DEBUG_NATIVE,
- DisplayName = "Launch for debugging",
- Description = "The -debugNative option launches the app in suspended, ready-to-debug state.",
- SwitchValue = "-debugNative ",
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(DEBUG_NATIVE, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for Device property.
- /// Device property designates the IP of the target device.
- ///
- public virtual string Device
- {
- get
- {
- if (base.IsPropertySet(DEVICE))
- {
- return base.ActiveToolSwitches[DEVICE].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(DEVICE);
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.String)
- {
- Name = DEVICE,
- DisplayName = "Device IP",
- Description = "The -device option specifies the target device's IP address.",
- SwitchValue = "-device ",
- Value = value
- };
- base.ActiveToolSwitches.Add(DEVICE, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for Password property.
- /// Password property specifies the target device password.
- ///
- public virtual string Password
- {
- get
- {
- if (base.IsPropertySet(PASSWORD))
- {
- return base.ActiveToolSwitches[PASSWORD].Value;
- }
- return null;
- }
- set
- {
-
- base.ActiveToolSwitches.Remove(PASSWORD);
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.String)
- {
- Name = PASSWORD,
- DisplayName = "Device Password",
- Description = "The -password option specifies the target device's password.",
- SwitchValue = "-password ",
- Value = Decrypt(value)
- };
-
- base.ActiveToolSwitches.Add(PASSWORD, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for Package property.
- /// Package property specified package to be installed/launched on task execution.
- ///
- public virtual string Package
- {
- get
- {
- if (base.IsPropertySet(PACKAGE))
- {
- return base.ActiveToolSwitches[PACKAGE].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(PACKAGE);
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.String)
- {
- Name = PACKAGE,
- DisplayName = "Package",
- Description = "The -package option specifies a .bar package.",
- SwitchValue = "-package ",
- Value = value
- };
- base.ActiveToolSwitches.Add(PACKAGE, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for PackageId property
- ///
- [Output]
- public virtual string PackageId
- {
- get
- {
- if (base.IsPropertySet(PACKAGE_ID))
- {
- return base.ActiveToolSwitches[PACKAGE_ID].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(PACKAGE_ID);
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.String)
- {
- Name = PACKAGE_ID,
- DisplayName = "Package ID",
- Description = "The -package-id option specifies the application's package id.",
- SwitchValue = "-package-id ",
- Value = value
- };
- base.ActiveToolSwitches.Add(PACKAGE_ID, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for PackageName property
- ///
- [Output]
- public virtual string PackageName
- {
- get
- {
- if (base.IsPropertySet(PACKAGE_NAME))
- {
- return base.ActiveToolSwitches[PACKAGE_NAME].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(PACKAGE_NAME);
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.String)
- {
- Name = PACKAGE_NAME,
- DisplayName = "Package Name",
- Description = "The -package-name option specifies the application's package name.",
- SwitchValue = "-package-name ",
- Value = value
- };
- base.ActiveToolSwitches.Add(PACKAGE_NAME, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for LocalManifestFile property
- /// We need the local manifest in order to determine PackageId and PackageName.
- ///
- public virtual string LocalManifestFile
- {
- get
- {
- return _localManifest;
- }
- set
- {
- _localManifest = value;
-
- string[] lines = File.ReadAllLines(_localManifest);
-
- for (int i = 0; i < lines.Length; i++)
- {
- if (lines[i].StartsWith("Package-Name: "))
- {
- string name = lines[i].Substring(14);
- if (PackageName != name)
- PackageName = name;
- }
- else if (lines[i].StartsWith("Package-Id: "))
- {
- string id = lines[i].Substring(12);
- if (PackageId != id)
- PackageId = id;
- }
- }
- }
- }
-
- ///
- /// Getter/Setter for the TargetManifestFile
- ///
- [Output]
- public virtual string TargetManifestFile
- {
- get
- {
- return null;
- }
- }
-
- ///
- /// Getter/Setter for the TrackerLogDirectory property
- ///
- public virtual string TrackerLogDirectory
- {
- get
- {
- if (base.IsPropertySet(TRACKER_LOG_DIRECTORY))
- {
- return base.ActiveToolSwitches[TRACKER_LOG_DIRECTORY].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(TRACKER_LOG_DIRECTORY);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Directory)
- {
- DisplayName = "Tracker Log Directory",
- Description = "Tracker Log Directory.",
- Value = VCToolTask.EnsureTrailingSlash(value)
- };
- base.ActiveToolSwitches.Add(TRACKER_LOG_DIRECTORY, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- #endregion
-
- ///
- /// Decrypts a given string.
- ///
- /// A base64 encoded string that was created
- /// through the or
- /// extension methods.
- /// The decrypted string.
- /// Keep in mind that the decrypted string remains in memory
- /// and makes your application vulnerable per se. If runtime protection
- /// is essential, should be used.
- /// If
- /// is a null reference.
- public string Decrypt(string cipher)
- {
- if (cipher == null) throw new ArgumentNullException("cipher");
-
- //parse base64 string
- byte[] data = Convert.FromBase64String(cipher);
-
- //decrypt data
- byte[] decrypted = ProtectedData.Unprotect(data, null, DataProtectionScope.LocalMachine);
-
- return Encoding.Unicode.GetString(decrypted);
- }
- }
-}
diff --git a/src/VSNDK.Tasks/BBNativePackager.cs b/src/VSNDK.Tasks/BBNativePackager.cs
deleted file mode 100644
index 5d02c207..00000000
--- a/src/VSNDK.Tasks/BBNativePackager.cs
+++ /dev/null
@@ -1,739 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-using System.Resources;
-using Microsoft.Build.CPPTasks;
-using System.Collections;
-using Microsoft.Build.Framework;
-using System.IO;
-using Microsoft.Build.Utilities;
-
-namespace VSNDK.Tasks
-{
- public class BBNativePackager : TrackedVCToolTask
- {
- #region Member Variable and Constant Declarations
- protected ArrayList switchOrderList;
- private static BarDescriptor.qnx _descriptor = null;
- private string _projDir;
- private string _appName;
- private string _barDescriptorPath = "";
- private const string OUTPUT_FILE = "OutputFiles";
- private const string APP_DESCRIPTOR = "ApplicationDescriptorXml";
- private const string TARGET_FORMAT = "TargetFormat";
- private const string BUILD_ID = "BuildId";
- private const string BUILD_ID_FILE = "BuildIdFile";
- private const string DEV_MODE = "DevMode";
- private const string PACKAGE_MANIFEST_ONLY = "PackageManifestOnly";
- private const string DEBUG_TOKEN = "DebugToken";
- private const string SOURCES = "Sources";
- private const string TRACKER_LOG_DIRECTORY = "TrackerLogDirectory";
- private const string GET_TARGET_FILE_MAP = "GetTargetFileMap";
- private const string WORKSPACE_LOC = "${workspace_loc:/";
- #endregion
-
- ///
- /// BBNativePackager Constructor
- ///
- public BBNativePackager()
- : base(new ResourceManager("VSNDK.Tasks.Properties.Resources", Assembly.GetExecutingAssembly()))
- {
- this.switchOrderList = new ArrayList();
- this.switchOrderList.Add(TARGET_FORMAT);
- this.switchOrderList.Add(BUILD_ID);
- this.switchOrderList.Add(BUILD_ID_FILE);
- this.switchOrderList.Add(DEV_MODE);
- this.switchOrderList.Add(GET_TARGET_FILE_MAP);
- this.switchOrderList.Add(PACKAGE_MANIFEST_ONLY);
- this.switchOrderList.Add(OUTPUT_FILE);
- this.switchOrderList.Add(APP_DESCRIPTOR);
- this.switchOrderList.Add(TRACKER_LOG_DIRECTORY);
- }
-
- #region overrides
-
-
- ///
- /// Return the response file switch.
- /// Note: Don't use response file for msbuild because it is removed before qcc to run GCC compiler
- ///
- /// Response File Path
- /// Response File Switch
- protected override string GetResponseFileSwitch(string responseFilePath)
- {
- return string.Empty;
- }
-
- ///
- /// Return the Command Line String.
- /// Note: pass the response file to command line commands
- ///
- /// Command Line String
- protected override string GenerateCommandLineCommands()
- {
- return GenerateResponseFileCommands();
- }
-
- ///
- /// Return the Response File Command String
- ///
- ///
- protected override string GenerateResponseFileCommands()
- {
- string cmd = base.GenerateResponseFileCommands();
- PackagerCmdBuilder clb = new PackagerCmdBuilder();
- AppendResources(clb);
- cmd += " " + clb.ToString();
-
- // Output the .bar file's manifest to a file so we can parse it.
- if (PackageManifestOnly)
- {
- cmd += " > localManifest.mf";
- }
- else if (GetTargetFileMap)
- {
- cmd += " > targetFileMap.txt";
- }
-
- return cmd;
- }
-
- ///
- /// Helper function to read the assets from the bar-descriptor.xml file and
- /// generate the command line listing the resources to be packaged into the bar file.
- ///
- /// Command Line Builder object
- private void AppendResources(CommandLineBuilder clb)
- {
- ITaskItem[] sources = GetAssetsFile();
- foreach (ITaskItem item in sources)
- {
- string target = item.GetMetadata("target");
- if (item.ItemSpec == target)
- clb.AppendFileNameIfNotNull(item);
- else
- {
- clb.AppendSwitchIfNotNull("-e ", item);
- clb.AppendFileNameIfNotNull(target);
- }
- }
- }
-
- ///
- /// Return the assets from the bardescriptor.xml
- ///
- ///
- private ITaskItem[] GetAssetsFile()
- {
-
- //make sure the _descriptor is loaded
- if (_descriptor == null)
- {
- _descriptor = BarDescriptor.Parser.Load(Path.Combine(ProjectDir, ApplicationDescriptorXml));
- }
- BarDescriptor.asset[] globalAssets = _descriptor.assets;
- BarDescriptor.asset[] configAssets = null;
-
- // You can call a configuration whatever you like, but these are the ones Momentics uses for its various
- // platform + configuration combinations. Usually this is the same as the output directory, but asset paths
- // don't have anything to do with the configuration name. I've based the config names on the platform
- // + configuration combination, not the output directory.
- BarDescriptor.qnxConfiguration[] configs = _descriptor.configurations;
- foreach (BarDescriptor.qnxConfiguration config in configs)
- {
- if (Configuration == "Debug" && Platform == "BlackBerry" && config.name == "Device-Debug")
- {
- configAssets = config.asset;
- break;
- }
- else if (Configuration == "Release" && Platform == "BlackBerry" && config.name == "Device-Release")
- {
- configAssets = config.asset;
- break;
- }
- else if (Configuration == "Profile" && Platform == "BlackBerry" && config.name == "Device-Profile")
- {
- configAssets = config.asset;
- break;
- }
- else if (Configuration == "Coverage" && Platform == "BlackBerry" && config.name == "Device-Coverage")
- {
- configAssets = config.asset;
- break;
- }
- else if (Configuration == "Debug" && Platform == "BlackBerrySimulator" && (config.name == "Simulator" || config.name == "Simulator-Debug"))
- {
- configAssets = config.asset;
- break;
- }
- else if (Configuration == "Profile" && Platform == "BlackBerrySimulator" && config.name == "Simulator-Profile")
- {
- configAssets = config.asset;
- break;
- }
- else if (Configuration == "Coverage" && Platform == "BlackBerrySimulator" && config.name == "Simulator-Coverage")
- {
- configAssets = config.asset;
- break;
- }
- else if (Configuration == "Release" && Platform == "BlackBerrySimulator" && config.name == "Simulator-Release")
- {
- configAssets = config.asset;
- break;
- }
- }
-
- ITaskItem[] items = null;
-
-
- int clen = (configAssets == null) ? 0 : configAssets.Length;
- int glen = (globalAssets == null) ? 0 : globalAssets.Length;
-
- items = new ITaskItem[glen + clen];
-
- for (int i = 0; i < glen; i++)
- {
- string path = globalAssets[i].path;
- path = path.Replace("}", string.Empty).Replace(WORKSPACE_LOC, SolutionDir);
- string target = globalAssets[i].Value;
- items[i] = new TaskItem(path);
- items[i].SetMetadata("target", target);
- }
-
-
- if (configAssets != null)
- {
- for (int i = 0; i < configAssets.Length; i++)
- {
- string path = configAssets[i].path;
- path = path.Replace("}", string.Empty).Replace(WORKSPACE_LOC, SolutionDir);
- string target = configAssets[i].Value;
- items[i + glen] = new TaskItem(path);
- items[i + glen].SetMetadata("target", target);
- }
- }
-
- return items;
-
- }
-
- ///
- /// Getter for the SwitchOrderList property
- ///
- protected override ArrayList SwitchOrderList
- {
- get
- {
- return this.switchOrderList;
- }
- }
-
- ///
- /// Getter for the CommandTLogName property
- ///
- protected override string CommandTLogName
- {
- get { return "BBNativePackager.command.1.tlog"; }
- }
-
- ///
- /// Getter for the ReadTLogNames property.
- ///
- protected override string[] ReadTLogNames
- {
- get { return new string[] { "BBNativePackager.read.1.tlog", "BBNativePackager.*.read.1.tlog" }; }
- }
-
- ///
- /// Getter for the WriteTLogNames property
- ///
- protected override string[] WriteTLogNames
- {
- get
- {
- return new string[] { "BBNativePackager.write.1.tlog", "BBNativePackager.*.write.1.tlog" };
- }
- }
-
- ///
- /// Getter for the ToolName property
- ///
- protected override string ToolName
- {
- get
- {
- return ToolExe;
- }
- }
-
- #endregion overrides
-
- #region properties
-
- ///
- /// Getter/Setter for Device property
- ///
- [Output]
- public virtual string Device { get; set; }
-
- ///
- /// Getter/Setter for Password property
- ///
- [Output]
- public virtual string Password { get; set;}
-
- ///
- /// Getter/Setter for BarDeploy property
- ///
- [Output]
- public virtual string BarDeploy { get; set; }
-
- ///
- /// Getter/Setter for OutputFile property
- ///
- [Required]
- [Output]
- public virtual string OutputFile
- {
- get
- {
- if (base.IsPropertySet(OUTPUT_FILE) && base.IsExplicitlySetToFalse(PACKAGE_MANIFEST_ONLY))
- {
- return base.ActiveToolSwitches[OUTPUT_FILE].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(OUTPUT_FILE);
-
- String switchValue = "";
- if (base.IsPropertySet(OUTPUT_FILE) && base.IsExplicitlySetToFalse(PACKAGE_MANIFEST_ONLY))
- {
- switchValue = "-package ";
- }
-
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.File)
- {
- DisplayName = "Output bar file name, for example, out.bar",
- Description = "The -package option specifies the bar file name.",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = switchValue,
- Name = OUTPUT_FILE,
- Value = value
- };
- base.ActiveToolSwitches.Add(OUTPUT_FILE, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for ProjectDir property
- ///
- [Required]
- public virtual string ProjectDir
- {
- get
- {
- return _projDir;
- }
- set
- {
- _projDir = value;
- _descriptor = BarDescriptor.Parser.Load(Path.Combine(ProjectDir, ApplicationDescriptorXml));
- }
- }
-
- ///
- /// Getter/Setter for AppName property
- ///
- [Required]
- public virtual string AppName
- {
- get
- {
- return _appName;
- }
- set
- {
- _appName = value;
-
- if (_barDescriptorPath == "")
- {
- // Default location of bar-descriptor file, if not specified in the Properties Configurations.
- _barDescriptorPath = "BlackBerry-" + _appName + "\\bar-descriptor.xml";
- if (!File.Exists(_barDescriptorPath))
- {
- // Just to support the default locations of bar-descriptor from previous versions of the plug-in.
- _barDescriptorPath = _appName + "_barDescriptor\\bar-descriptor.xml";
- if (!File.Exists(_barDescriptorPath))
- {
- _barDescriptorPath = "bar-descriptor.xml";
- }
- }
- }
-
- base.ActiveToolSwitches.Remove(APP_DESCRIPTOR);
-
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.File)
- {
- DisplayName = "Application descriptor file name, for example, bar-descriptor.xml",
- Description = "Application descriptor file name, for example, bar-descriptor.xml, it must follows the out.bar file",
- ArgumentRelationList = new ArrayList(),
- Name = APP_DESCRIPTOR,
- Value = _barDescriptorPath
- };
- base.ActiveToolSwitches.Add(APP_DESCRIPTOR, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for SolutionDir property
- ///
- [Required]
- public virtual string SolutionDir { get; set; }
-
- public virtual string ApplicationDescriptorXml
- {
- get
- {
- if (base.IsPropertySet(APP_DESCRIPTOR))
- {
- return base.ActiveToolSwitches[APP_DESCRIPTOR].Value;
- }
- return null;
- }
- set
- {
- _barDescriptorPath = value;
- }
- }
-
- ///
- /// Getter/Setter for TargetFormat property
- ///
- public virtual string TargetFormat
- {
- get
- {
- if (base.IsPropertySet(TARGET_FORMAT))
- {
- return base.ActiveToolSwitches[TARGET_FORMAT].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(TARGET_FORMAT);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.String)
- {
- DisplayName = "Target format",
- Description = "Select the build target format( -target bar -target bar-debug)",
- ArgumentRelationList = new ArrayList()
- };
- string[][] switchMap = new string[][]
- {
- new string[] { "bar", "-target bar" },
- new string[] { "bar-debug", "-target bar-debug" }
- };
- switch2.SwitchValue = base.ReadSwitchMap(TARGET_FORMAT, switchMap, value);
- switch2.Name = TARGET_FORMAT;
- switch2.Value = value;
- switch2.MultiValues = true;
- base.ActiveToolSwitches.Add(TARGET_FORMAT, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for BuildID property
- ///
- public virtual int BuildID
- {
- get
- {
- if (base.IsPropertySet(BUILD_ID))
- {
- return base.ActiveToolSwitches[BUILD_ID].Number;
- }
- return 0;
- }
- set
- {
- base.ActiveToolSwitches.Remove(BUILD_ID);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Integer)
- {
- DisplayName = "Build Id",
- Description = "set the build id ( the fourth segment of the version ). Must be a number from 0 to 65535"
- };
- switch2.ArgumentRelationList = new ArrayList();
- switch2.IsValid = base.ValidateInteger(BUILD_ID, 0, 65535, value);
- switch2.Name = BUILD_ID;
- switch2.Number = value;
- switch2.SwitchValue = "-buildId ";
- base.ActiveToolSwitches.Add(BUILD_ID, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for BuildIDFile property
- ///
- public virtual string BuildIDFile
- {
- get
- {
- if (base.IsPropertySet(BUILD_ID_FILE))
- {
- return base.ActiveToolSwitches[BUILD_ID_FILE].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(BUILD_ID_FILE);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.File)
- {
- DisplayName = "Build ID File",
- Description = "set the build ID from an existing file",
- ArgumentRelationList = new ArrayList(),
- Name = BUILD_ID_FILE,
- SwitchValue = "-buildIdFile ",
- Value = value
- };
- base.ActiveToolSwitches.Add(BUILD_ID_FILE, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for DevMode property
- ///
- public virtual bool DevMode
- {
- get
- {
- return (base.IsPropertySet(DEV_MODE) && base.ActiveToolSwitches[DEV_MODE].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(DEV_MODE);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- Name = DEV_MODE,
- DisplayName = "Development mode",
- Description = "Package in development mode ( -devMode)",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-devMode",
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(DEV_MODE, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for PackageManifestOnly property
- ///
- public virtual bool PackageManifestOnly
- {
- get
- {
- return (base.IsPropertySet(PACKAGE_MANIFEST_ONLY) && base.ActiveToolSwitches[PACKAGE_MANIFEST_ONLY].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(PACKAGE_MANIFEST_ONLY);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Package manifest only.",
- Description = "Package only the manifest file ( -packageManifest)",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-packageManifest -listManifest ",
- Name = PACKAGE_MANIFEST_ONLY,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(PACKAGE_MANIFEST_ONLY, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for GetTargetFileMap property
- ///
- public virtual bool GetTargetFileMap
- {
- get
- {
- return (base.IsPropertySet(GET_TARGET_FILE_MAP) && base.ActiveToolSwitches[GET_TARGET_FILE_MAP].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(GET_TARGET_FILE_MAP);
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.Boolean)
- {
- Name = GET_TARGET_FILE_MAP,
- DisplayName = "Get target file map",
- Description = "Get the mapping between local and target files with the -targetFileMap option.",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-targetFileMap ",
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(GET_TARGET_FILE_MAP, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for DebugToken property
- ///
- public virtual string DebugToken
- {
- get
- {
- if (base.IsPropertySet(DEBUG_TOKEN))
- {
- return base.ActiveToolSwitches[DEBUG_TOKEN].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(DEBUG_TOKEN);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Directory)
- {
- DisplayName = "Debug Token",
- Description = "Use debug token to generate author and author id ( -debugToken only usable with -devMode)",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-debugToken ",
- Value = value
- };
- switch2.Parents.AddLast(DEV_MODE);
- base.ActiveToolSwitches.Add(DEBUG_TOKEN, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for TrackerLogDirectory property.
- ///
- public virtual string TrackerLogDirectory
- {
- get
- {
- if (base.IsPropertySet(TRACKER_LOG_DIRECTORY))
- {
- return base.ActiveToolSwitches[TRACKER_LOG_DIRECTORY].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(TRACKER_LOG_DIRECTORY);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Directory)
- {
- DisplayName = "Tracker Log Directory",
- Description = "Tracker Log Directory.",
- ArgumentRelationList = new ArrayList(),
- Value = VCToolTask.EnsureTrailingSlash(value)
- };
- base.ActiveToolSwitches.Add(TRACKER_LOG_DIRECTORY, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- #endregion properties
-
- ///
- /// Getter for the TrackedInputFiles
- ///
- protected override Microsoft.Build.Framework.ITaskItem[] TrackedInputFiles
- {
- get
- {
- return Sources;
- }
- }
-
- ///
- /// Getter for the TrackerIntermediateDirectory
- ///
- protected override string TrackerIntermediateDirectory
- {
- get
- {
- if (this.TrackerLogDirectory != null)
- {
- return this.TrackerLogDirectory;
- }
- return string.Empty;
- }
- }
-
- ///
- /// Getter/Seter for the Sources property
- ///
- [Required]
- public virtual ITaskItem[] Sources
- {
- get
- {
- if (base.IsPropertySet(SOURCES))
- {
- return base.ActiveToolSwitches[SOURCES].TaskItemArray;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(SOURCES);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.ITaskItemArray)
- {
- Separator = " ",
- Required = true,
- ArgumentRelationList = new ArrayList(),
- TaskItemArray = value
- };
- base.ActiveToolSwitches.Add(SOURCES, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the Configuration property
- ///
- [Required]
- public string Configuration
- {
- get;
- set;
- }
-
- ///
- /// Getter/Setter for the Platform property
- ///
- [Required]
- public string Platform
- {
- get;
- set;
- }
- }
-}
diff --git a/src/VSNDK.Tasks/BBSigner.cs b/src/VSNDK.Tasks/BBSigner.cs
deleted file mode 100644
index 5a1cc04a..00000000
--- a/src/VSNDK.Tasks/BBSigner.cs
+++ /dev/null
@@ -1,411 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-using System.Resources;
-using Microsoft.Build.CPPTasks;
-using System.Collections;
-using Microsoft.Build.Framework;
-using System.IO;
-using Microsoft.Build.Utilities;
-using System.Security.Cryptography;
-
-namespace VSNDK.Tasks
-{
- ///
- /// MSBuild Task responsible for the signing of the BlackBerry Bar files
- /// for deploy to a secure device not in development mode.
- ///
- public class BBSigner : TrackedVCToolTask
- {
- #region Member Variables and Constants Declaration
- protected ArrayList switchOrderList;
- private const string REGISTER = "Register";
- private const string KEYSTOREPASSWORD = "KeyStorePassword";
- private const string CSJPIN = "CSJPin";
- private const string CSJFILES = "Signing_AND_DEBUGTOKEN_CSJFiles";
- private const string SOURCES = "Sources";
- private const string OUTPUT_FILE = "OutputFiles";
- private const string TRACKER_LOG_DIRECTORY = "TrackerLogDirectory";
- #endregion
-
- ///
- /// BBSigner Constructor Fuction
- ///
- public BBSigner()
- : base(new ResourceManager("VSNDK.Tasks.Properties.Resources", Assembly.GetExecutingAssembly()))
- {
- this.switchOrderList = new ArrayList();
- this.switchOrderList.Add("AlwaysAppend");
- this.switchOrderList.Add(REGISTER);
- this.switchOrderList.Add(CSJPIN);
- this.switchOrderList.Add(KEYSTOREPASSWORD);
- this.switchOrderList.Add(CSJFILES);
- this.switchOrderList.Add(OUTPUT_FILE);
- this.switchOrderList.Add(TRACKER_LOG_DIRECTORY);
- }
-
-
- #region overrides
-
- ///
- /// Return the GetResposeFile Switch
- /// Note: don't use response file for msbuild because it is removed before qcc to run GCC compiler
- ///
- ///
- ///
- protected override string GetResponseFileSwitch(string responseFilePath)
- {
- return string.Empty;
- }
-
- ///
- /// Return the command line argument string
- /// Note: pass the response file to command line commands
- ///
- ///
- protected override string GenerateCommandLineCommands()
- {
- return GenerateResponseFileCommands();
- }
-
- ///
- /// Return the Response File Commands string.
- ///
- ///
- protected override string GenerateResponseFileCommands()
- {
- if (!Register)
- {
- switchOrderList.Remove(REGISTER);
- switchOrderList.Remove(CSJPIN);
- switchOrderList.Remove(CSJFILES);
- }
- else
- switchOrderList.Remove(OUTPUT_FILE);
- return base.GenerateResponseFileCommands();
- }
-
- ///
- /// Getter for the SwitchOrderList property
- ///
- protected override ArrayList SwitchOrderList
- {
- get
- {
- return this.switchOrderList;
- }
- }
-
- ///
- /// Getter for the CommandTLogName property
- ///
- protected override string CommandTLogName
- {
- get { return "BBSigner.command.1.tlog"; }
- }
-
- ///
- /// Getter for the ReadTLogNames property
- ///
- protected override string[] ReadTLogNames
- {
- get { return new string[] { "BBSigner.read.1.tlog", "BBSigner.*.read.1.tlog" }; }
- }
- protected override string[] WriteTLogNames
- {
- get
- {
- return new string[] { "BBSigner.write.1.tlog", "BBSigner.*.write.1.tlog" };
- }
- }
-
- ///
- /// Getter for the ToolName property
- ///
- protected override string ToolName
- {
- get
- {
- return ToolExe;
- }
- }
-
- ///
- /// Getter for the TrackerIntermediateDirectory property
- ///
- protected override string TrackerIntermediateDirectory
- {
- get
- {
- if (this.TrackerLogDirectory != null)
- {
- return this.TrackerLogDirectory;
- }
- return string.Empty;
- }
- }
-
- ///
- /// Getter for the TrackedInputFiles property
- ///
- protected override ITaskItem[] TrackedInputFiles
- {
- get { return Sources; }
- }
-
- #endregion overrides
-
- #region properties
-
- ///
- /// Getter/Setter for the Register property
- ///
- [Required]
- public virtual bool Register
- {
- get
- {
- return (base.IsPropertySet(REGISTER) && base.ActiveToolSwitches[REGISTER].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(REGISTER);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Register",
- Description = "Register the computer with CSJ file to sign application( -register)",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-register",
- Name = REGISTER,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(REGISTER, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the Sources property
- ///
- [Required]
- public virtual ITaskItem[] Sources
- {
- get
- {
- if (base.IsPropertySet(SOURCES))
- {
- return base.ActiveToolSwitches[SOURCES].TaskItemArray;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(SOURCES);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.ITaskItemArray)
- {
- Separator = " ",
- Required = true,
- ArgumentRelationList = new ArrayList(),
- TaskItemArray = value
- };
- base.ActiveToolSwitches.Add(SOURCES, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the CSJFiles property
- ///
- public virtual ITaskItem[] CSJFiles
- {
- get
- {
- if (base.IsPropertySet(CSJFILES))
- {
- return base.ActiveToolSwitches[CSJFILES].TaskItemArray;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(CSJFILES);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.ITaskItemArray)
- {
- Separator = " ",
- Required = true,
- ArgumentRelationList = new ArrayList(),
- Name = CSJFILES,
- TaskItemArray = value
- };
- base.ActiveToolSwitches.Add(CSJFILES, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the KeyStorePassword property
- ///
- public virtual string KeyStorePassword
- {
- get
- {
- if (base.IsPropertySet(KEYSTOREPASSWORD))
- {
- return base.ActiveToolSwitches[KEYSTOREPASSWORD].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(KEYSTOREPASSWORD);
-
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.File)
- {
- DisplayName = "Keystore password",
- Description = "The -storepass option specifies the password.",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-storepass ",
- Name = KEYSTOREPASSWORD,
- Value = Decrypt(value)
- };
-
- base.ActiveToolSwitches.Add(KEYSTOREPASSWORD, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Decrypts a given string.
- ///
- /// A base64 encoded string that was created
- /// through the or
- /// extension methods.
- /// The decrypted string.
- /// Keep in mind that the decrypted string remains in memory
- /// and makes your application vulnerable per se. If runtime protection
- /// is essential, should be used.
- /// If
- /// is a null reference.
- public string Decrypt(string cipher)
- {
- if (cipher == null) throw new ArgumentNullException("cipher");
-
- //parse base64 string
- byte[] data = Convert.FromBase64String(cipher);
-
- //decrypt data
- byte[] decrypted = ProtectedData.Unprotect(data, null, DataProtectionScope.LocalMachine);
-
- return Encoding.Unicode.GetString(decrypted);
- }
-
- ///
- /// Getter/Setter for the CSJPin property
- ///
- public virtual string CSJPin
- {
- get
- {
- if (base.IsPropertySet(CSJPIN))
- {
- return base.ActiveToolSwitches[CSJPIN].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(CSJPIN);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.File)
- {
- DisplayName = "Keystore password",
- Description = "The -csjpin option specifies the password.",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-csjpin ",
- Name = CSJPIN,
- Value = value
- };
- base.ActiveToolSwitches.Add(CSJPIN, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the OutputFile property
- ///
- [Required]
- [Output]
- public virtual string OutputFile
- {
- get
- {
- if (base.IsPropertySet(OUTPUT_FILE))
- {
- return base.ActiveToolSwitches[OUTPUT_FILE].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(OUTPUT_FILE);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.File)
- {
- DisplayName = "Output bar file name to be signed",
- Description = "Specifies the bar file name to be signed",
- ArgumentRelationList = new ArrayList(),
- Name = OUTPUT_FILE,
- Value = value
- };
- base.ActiveToolSwitches.Add(OUTPUT_FILE, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the TrackerLogDirectory property
- ///
- public virtual string TrackerLogDirectory
- {
- get
- {
- if (base.IsPropertySet(TRACKER_LOG_DIRECTORY))
- {
- return base.ActiveToolSwitches[TRACKER_LOG_DIRECTORY].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(TRACKER_LOG_DIRECTORY);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Directory)
- {
- DisplayName = "Tracker Log Directory",
- Description = "Tracker Log Directory.",
- ArgumentRelationList = new ArrayList(),
- Value = VCToolTask.EnsureTrailingSlash(value)
- };
- base.ActiveToolSwitches.Add(TRACKER_LOG_DIRECTORY, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- #endregion properties
-
- }
-}
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/BarDescriptor/Parser.cs b/src/VSNDK.Tasks/BarDescriptor/Parser.cs
deleted file mode 100644
index a3ed76de..00000000
--- a/src/VSNDK.Tasks/BarDescriptor/Parser.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.IO;
-using System.Xml;
-using System.Xml.Serialization;
-using System.Diagnostics;
-
-namespace VSNDK.Tasks.BarDescriptor
-{
- public class Parser
- {
- ///
- /// Helper function to to deserialize the bar-descriptor.xml file for read.
- ///
- /// Path to the bar-descriptor.xml file
- /// BarDescriptor.qnx object containing the deserialized data from the bar-descriptor.
- public static BarDescriptor.qnx Load(string filename)
- {
- if (!string.IsNullOrEmpty(filename))
- {
- try
- {
- using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read))
- {
- XmlTextReader reader = new XmlTextReader(fs);
- XmlSerializer serializer = new XmlSerializer(typeof(BarDescriptor.qnx));
- return serializer.Deserialize(reader) as BarDescriptor.qnx;
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- }
- }
- return null;
- }
- }
-}
diff --git a/src/VSNDK.Tasks/BarDescriptor/Schema/bar-descriptor.cs b/src/VSNDK.Tasks/BarDescriptor/Schema/bar-descriptor.cs
deleted file mode 100644
index 75f4b3a0..00000000
--- a/src/VSNDK.Tasks/BarDescriptor/Schema/bar-descriptor.cs
+++ /dev/null
@@ -1,459 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.239
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-//
-// This source code was auto-generated by xsd, Version=4.0.30319.1.
-//
-namespace VSNDK.Tasks.BarDescriptor {
- using System.Xml.Serialization;
-
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- [System.Xml.Serialization.XmlRootAttribute(Namespace="http://www.qnx.com/schemas/application/1.0", IsNullable=true)]
- public partial class asset {
-
- private string pathField;
-
- private string entryField;
-
- private string typeField;
-
- private string valueField;
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string path {
- get {
- return this.pathField;
- }
- set {
- this.pathField = value;
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string entry {
- get {
- return this.entryField;
- }
- set {
- this.entryField = value;
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string type {
- get {
- return this.typeField;
- }
- set {
- this.typeField = value;
- }
- }
-
- ///
- [System.Xml.Serialization.XmlTextAttribute()]
- public string Value {
- get {
- return this.valueField;
- }
- set {
- this.valueField = value;
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- [System.Xml.Serialization.XmlRootAttribute(Namespace="http://www.qnx.com/schemas/application/1.0", IsNullable=false)]
- public partial class qnx {
-
- private string idField;
-
- private string nameField;
-
- private string versionNumberField;
-
- private string buildIdField;
-
- private string descriptionField;
-
- private string authorField;
-
- private string categoryField;
-
- private qnxInitialWindow[] initialWindowField;
-
- private asset[] assetField;
-
- private qnxConfiguration[] configurationField;
-
- private qnxIcon[] iconField;
-
- private qnxAction[] actionField;
-
- private qnxEnv[] envField;
-
- ///
- public string id {
- get {
- return this.idField;
- }
- set {
- this.idField = value;
- }
- }
-
- ///
- public string name {
- get {
- return this.nameField;
- }
- set {
- this.nameField = value;
- }
- }
-
- ///
- public string versionNumber {
- get {
- return this.versionNumberField;
- }
- set {
- this.versionNumberField = value;
- }
- }
-
- ///
- public string buildId {
- get {
- return this.buildIdField;
- }
- set {
- this.buildIdField = value;
- }
- }
-
- ///
- public string description {
- get {
- return this.descriptionField;
- }
- set {
- this.descriptionField = value;
- }
- }
-
- ///
- public string author {
- get {
- return this.authorField;
- }
- set {
- this.authorField = value;
- }
- }
-
- ///
- public string category {
- get {
- return this.categoryField;
- }
- set {
- this.categoryField = value;
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("initialWindow")]
- public qnxInitialWindow[] initialWindows {
- get {
- return this.initialWindowField;
- }
- set {
- this.initialWindowField = value;
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("asset", IsNullable=true)]
- public asset[] assets {
- get {
- return this.assetField;
- }
- set {
- this.assetField = value;
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("configuration")]
- public qnxConfiguration[] configurations {
- get {
- return this.configurationField;
- }
- set {
- this.configurationField = value;
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("icon")]
- public qnxIcon[] icons {
- get {
- return this.iconField;
- }
- set {
- this.iconField = value;
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("action", IsNullable=true)]
- public qnxAction[] actions {
- get {
- return this.actionField;
- }
- set {
- this.actionField = value;
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("env")]
- public qnxEnv[] envs {
- get {
- return this.envField;
- }
- set {
- this.envField = value;
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxInitialWindow {
-
- private string aspectRatioField;
-
- private string autoOrientsField;
-
- private string systemChromeField;
-
- private string transparentField;
-
- ///
- public string aspectRatio {
- get {
- return this.aspectRatioField;
- }
- set {
- this.aspectRatioField = value;
- }
- }
-
- ///
- public string autoOrients {
- get {
- return this.autoOrientsField;
- }
- set {
- this.autoOrientsField = value;
- }
- }
-
- ///
- public string systemChrome {
- get {
- return this.systemChromeField;
- }
- set {
- this.systemChromeField = value;
- }
- }
-
- ///
- public string transparent {
- get {
- return this.transparentField;
- }
- set {
- this.transparentField = value;
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxConfiguration {
-
- private string platformArchitectureField;
-
- private asset[] assetField;
-
- private string idField;
-
- private string nameField;
-
- ///
- public string platformArchitecture {
- get {
- return this.platformArchitectureField;
- }
- set {
- this.platformArchitectureField = value;
- }
- }
-
- ///
- [System.Xml.Serialization.XmlElementAttribute("asset", IsNullable=true)]
- public asset[] asset {
- get {
- return this.assetField;
- }
- set {
- this.assetField = value;
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string id {
- get {
- return this.idField;
- }
- set {
- this.idField = value;
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string name {
- get {
- return this.nameField;
- }
- set {
- this.nameField = value;
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxIcon {
-
- private string imageField;
-
- ///
- public string image {
- get {
- return this.imageField;
- }
- set {
- this.imageField = value;
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxAction {
-
- private string systemField;
-
- private string valueField;
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string system {
- get {
- return this.systemField;
- }
- set {
- this.systemField = value;
- }
- }
-
- ///
- [System.Xml.Serialization.XmlTextAttribute()]
- public string Value {
- get {
- return this.valueField;
- }
- set {
- this.valueField = value;
- }
- }
- }
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.qnx.com/schemas/application/1.0")]
- public partial class qnxEnv {
-
- private string varField;
-
- private string valueField;
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string var {
- get {
- return this.varField;
- }
- set {
- this.varField = value;
- }
- }
-
- ///
- [System.Xml.Serialization.XmlAttributeAttribute()]
- public string value {
- get {
- return this.valueField;
- }
- set {
- this.valueField = value;
- }
- }
- }
-}
diff --git a/src/VSNDK.Tasks/BarDescriptor/Schema/bar-descriptor.xml b/src/VSNDK.Tasks/BarDescriptor/Schema/bar-descriptor.xml
deleted file mode 100644
index 3255bb8c..00000000
--- a/src/VSNDK.Tasks/BarDescriptor/Schema/bar-descriptor.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
-
-
- com.rim.sample00_mesh
-
-
- Mesh
-
-
- 1.0.0
-
-
- 1
-
-
-
-
-
- Mesh Sample
-
-
-
-
-
- BlackBerry
-
-
-
-
-
- landscape
- false
- none
- false
-
-
-
- core.games
-
- res
- res/shaders/diffuse-specular.fsh
- res/shaders/diffuse-specular.vsh
-
-
- armle-v7
- sample00-mesh
-
-
- armle-v7
- sample00-mesh
-
-
- armle-v7
- sample00-mesh
-
-
- armle-v7
- sample00-mesh
-
-
- x86
- sample00-mesh
-
-
- x86
- sample00-mesh
-
-
- x86
- sample00-mesh
-
-
-
-
-
-
-
-
-
-
- run_native
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Tasks/BarDescriptor/Schema/bar-descriptor.xsd b/src/VSNDK.Tasks/BarDescriptor/Schema/bar-descriptor.xsd
deleted file mode 100644
index 5601be8a..00000000
--- a/src/VSNDK.Tasks/BarDescriptor/Schema/bar-descriptor.xsd
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.Packager.bak b/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.Packager.bak
deleted file mode 100644
index 9b820843..00000000
--- a/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.Packager.bak
+++ /dev/null
@@ -1,422 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
- true
-
-
-
- true
-
-
-
-
- $(BuildLinkTargets);
-
- $(CommonBuildOnlyTargets);$(BeforeBuildLinkTargets);$(BuildLinkTargets);$(AfterBuildLinkTargets)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(ProjectDir),$(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)))
- $([System.IO.Path]::GetFileName('$(TargetPath)'))
- $([System.IO.Path]::GetDirectoryName('$(TargetPath)'))
- $(LibPrefix)$(ProjectName)
- false
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- false
- true
- $(BuildBarToolPath)
- $(OptimizedDeployToolPath)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- false
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.Packager.targets b/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.Packager.targets
deleted file mode 100644
index 5eb31d68..00000000
--- a/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.Packager.targets
+++ /dev/null
@@ -1,412 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
- true
-
-
-
- true
-
-
-
-
- $(BuildLinkTargets);
-
- $(CommonBuildOnlyTargets);$(BeforeBuildLinkTargets);$(BuildLinkTargets);$(AfterBuildLinkTargets)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(ProjectDir),$(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)))
- $([System.IO.Path]::GetFileName('$(TargetPath)'))
- $([System.IO.Path]::GetDirectoryName('$(TargetPath)'))
- $(LibPrefix)$(ProjectName)
- false
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- false
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- false
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.bak b/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.bak
deleted file mode 100644
index 5d62f2b8..00000000
--- a/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.bak
+++ /dev/null
@@ -1,146 +0,0 @@
-
-
-
-
-
-
-
-
-
- QCC;__QCC__;__QNX__
- false
-
-
-
-
- true
- false
-
-
-
-
- true
- .a
- lib
-
-
-
- true
-
-
-
-
-
- true
- .so
- true
- lib
-
-
-
-
- $([System.IO.Path]::Combine($(ProjectDir),$(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)))
- $([System.IO.Path]::GetFileName('$(TargetPath)'))
- $([System.IO.Path]::GetDirectoryName('$(TargetPath)'))
- $(LibPrefix)$(ProjectName)
-
-
-
-
-
- $(IntDir)%(FileName).o
- $(QccDefines)
- WIN32;_WINDOWS
- NormalWarnings
- false
- false
-
- true
-
- false
- false
- Default
- true
-
-
-
-
-
-
- O2
- true
-
-
-
-
-
-
- O2
- false
-
-
-
-
-
-
- $(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)
- $(TargetPath)
-
-
- false
- false
- true
- false
- true
- Default
-
-
-
-
-
-
- $(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)
- false
-
-
-
-
-
-
- $(IntDir)
- true
- $(OutDir)$(TargetName).bar
- true
- false
- bar-debug
- bar
- true
- false
- None
- Install
- false
- 1
-
-
-
-
- 169.254.0.1
-
- bar-descriptor.xml
- $(AppData)
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.default.bak b/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.default.bak
deleted file mode 100644
index 40c79c30..00000000
--- a/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.default.bak
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
- BlackBerry
- qcc
-
- $(IntermediateOutputPath)
- Device-$(Configuration)\
- Device-$(Configuration)\
- $(IntDir)
-
-
diff --git a/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.default.props b/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.default.props
deleted file mode 100644
index 40c79c30..00000000
--- a/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.default.props
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
- BlackBerry
- qcc
-
- $(IntermediateOutputPath)
- Device-$(Configuration)\
- Device-$(Configuration)\
- $(IntDir)
-
-
diff --git a/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.props b/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.props
deleted file mode 100644
index 5d62f2b8..00000000
--- a/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.props
+++ /dev/null
@@ -1,146 +0,0 @@
-
-
-
-
-
-
-
-
-
- QCC;__QCC__;__QNX__
- false
-
-
-
-
- true
- false
-
-
-
-
- true
- .a
- lib
-
-
-
- true
-
-
-
-
-
- true
- .so
- true
- lib
-
-
-
-
- $([System.IO.Path]::Combine($(ProjectDir),$(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)))
- $([System.IO.Path]::GetFileName('$(TargetPath)'))
- $([System.IO.Path]::GetDirectoryName('$(TargetPath)'))
- $(LibPrefix)$(ProjectName)
-
-
-
-
-
- $(IntDir)%(FileName).o
- $(QccDefines)
- WIN32;_WINDOWS
- NormalWarnings
- false
- false
-
- true
-
- false
- false
- Default
- true
-
-
-
-
-
-
- O2
- true
-
-
-
-
-
-
- O2
- false
-
-
-
-
-
-
- $(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)
- $(TargetPath)
-
-
- false
- false
- true
- false
- true
- Default
-
-
-
-
-
-
- $(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)
- false
-
-
-
-
-
-
- $(IntDir)
- true
- $(OutDir)$(TargetName).bar
- true
- false
- bar-debug
- bar
- true
- false
- None
- Install
- false
- 1
-
-
-
-
- 169.254.0.1
-
- bar-descriptor.xml
- $(AppData)
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.targets b/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.targets
deleted file mode 100644
index 8ed03106..00000000
--- a/src/VSNDK.Tasks/BlackBerry/Microsoft.Cpp.BlackBerry.targets
+++ /dev/null
@@ -1,188 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
- CompileAsC
- CompileAsCpp
- false
-
-
-
-
-
-
- $(DefaultToolArchitecture)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- false
-
-
-
-
- $(DefaultToolArchitecture)
-
-
-
-
-
-
-
-
-
-
-
-
- false
- false
- true
- $(DefaultToolArchitecture)
- true
-
-
-
-
-
- CompileAsC
- CompileAsCpp
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $(CleanDependsOn);
- MakeClean;
-
-
-
-
-
-
-
-
-
-
-
- PlatformPrepareForBuild;$(PrepareForBuildDependsOn)
- PlatformPrepareForBuild;$(PrepareForBuildDependsOn)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/BlackBerry/Microsoft.CppBuild.BlackBerry.targets b/src/VSNDK.Tasks/BlackBerry/Microsoft.CppBuild.BlackBerry.targets
deleted file mode 100644
index 196ff386..00000000
--- a/src/VSNDK.Tasks/BlackBerry/Microsoft.CppBuild.BlackBerry.targets
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
- false
- false
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PropertySheet
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Project
-
-
- PropertySheet
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerry/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerry.qcc.bak b/src/VSNDK.Tasks/BlackBerry/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerry.qcc.bak
deleted file mode 100644
index 0f92e06d..00000000
--- a/src/VSNDK.Tasks/BlackBerry/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerry.qcc.bak
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
- $(Registry:HKEY_CURRENT_USER\SOFTWARE\Research In Motion\BlackBerryVSPlugin@NDKPath)
- $(NativeSDKDir)\target\qnx6
- $(NativeSDKDir)\host\win32\x86
- $(QNX_HOST)\etc\qcc\gcc
- armle-v7
- 4.6.3
- gcc_ntoarmv7le
- $(QNX_TARGET)\$(CPUVARDIR)\lib
-
-
-
- qcc2.0
- $(QNX_HOST)\usr\bin
- qcc.exe
- qcc.exe
- qcc.exe
- blackberry-nativepackager.bat
- blackberry-signer.bat
- blackberry-deploy.bat
- $(QccToolsPath)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VC@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Setup\VC@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\10.0\Setup\VC@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VCExpress\10.0\Setup\VC@ProductDir)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VS@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Setup\VS@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\10.0\Setup\VS@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VCExpress\10.0\Setup\VS@ProductDir)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework@InstallRoot)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework@InstallRoot)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
-
- $(QNX_HOST)\usr\bin;$(PATH);
- $(QNX_TARGET)\usr\include;$(QNX_TARGET)\usr\include\freetype2;$(QNX_TARGET)\..\target-override\usr\include;
- $(QccLibPath);$(QNX_TARGET)\..\target-override\$(CPUVARDIR)\lib;$(QNX_TARGET)\..\target-override\$(CPUVARDIR)\usr\lib;
- $(ExecutablePath)
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerry/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerry.qcc.props b/src/VSNDK.Tasks/BlackBerry/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerry.qcc.props
deleted file mode 100644
index 3ae3e8c3..00000000
--- a/src/VSNDK.Tasks/BlackBerry/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerry.qcc.props
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
- $(Registry:HKEY_CURRENT_USER\SOFTWARE\BlackBerry\BlackBerryVSPlugin@NDKTargetPath)
- $(Registry:HKEY_CURRENT_USER\SOFTWARE\BlackBerry\BlackBerryVSPlugin@NDKHostPath)
- $([System.IO.File]::ReadAllText("$(QNX_HOST)\etc\qcc\gcc\default").Substring(4,5))
- $(QNX_HOST)\etc\qcc\gcc
- armle-v7
- $(from_file)
- gcc_ntoarmv7le
- $(QNX_TARGET)\$(CPUVARDIR)\lib
- $(AppData)
- $(AppDataPath)/BlackBerry/bbt_id_rsa.pub
- $(AppDataPath)/BlackBerry/bbt_id_rsa
-
-
-
- VSNDKDebugEngine
-
-
-
- qcc2.0
- $(QNX_HOST)\usr\bin
- qcc.exe
- qcc.exe
- qcc.exe
- blackberry-nativepackager.bat
- $(MSBuildProgramFiles32)\BlackBerry\VSPlugin-NDK\qnxtools\bin\blackberry-signer.bat
- blackberry-deploy.bat
- $(QccToolsPath)
- ssh.exe
- $(QccToolsPath)
- $(QccToolsPath)\ssh-keygen.exe
- $(QccToolsPath)\blackberry-connect.bat
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VC@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Setup\VC@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\10.0\Setup\VC@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VCExpress\10.0\Setup\VC@ProductDir)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VS@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Setup\VS@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\10.0\Setup\VS@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VCExpress\10.0\Setup\VS@ProductDir)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework@InstallRoot)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework@InstallRoot)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
-
- $(QNX_HOST)\usr\bin;$(PATH);
- $(QNX_TARGET)\usr\include;$(QNX_TARGET)\usr\include\freetype2;$(QNX_TARGET)\..\target-override\usr\include;$(QNX_TARGET)\usr\include\cpp;$(QNX_TARGET)\usr\include\cpp\c
- $(QccLibPath);$(QNX_TARGET)\..\target-override\$(CPUVARDIR)\lib;$(QNX_TARGET)\..\target-override\$(CPUVARDIR)\usr\lib;
-
- $(ExecutablePath)
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerry/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerrySimulator.qcc.targets b/src/VSNDK.Tasks/BlackBerry/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerrySimulator.qcc.targets
deleted file mode 100644
index 55b83ab2..00000000
--- a/src/VSNDK.Tasks/BlackBerry/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerrySimulator.qcc.targets
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerry/Rules/debugger_ndk.xml b/src/VSNDK.Tasks/BlackBerry/Rules/debugger_ndk.xml
deleted file mode 100644
index cb53a5b7..00000000
--- a/src/VSNDK.Tasks/BlackBerry/Rules/debugger_ndk.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerry/Rules/ndk_general.xml b/src/VSNDK.Tasks/BlackBerry/Rules/ndk_general.xml
deleted file mode 100644
index 2b834759..00000000
--- a/src/VSNDK.Tasks/BlackBerry/Rules/ndk_general.xml
+++ /dev/null
@@ -1,155 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerry/Rules/ndk_general_ps.xml b/src/VSNDK.Tasks/BlackBerry/Rules/ndk_general_ps.xml
deleted file mode 100644
index d7389bc0..00000000
--- a/src/VSNDK.Tasks/BlackBerry/Rules/ndk_general_ps.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerry/Rules/packager.xml b/src/VSNDK.Tasks/BlackBerry/Rules/packager.xml
deleted file mode 100644
index 22e801e8..00000000
--- a/src/VSNDK.Tasks/BlackBerry/Rules/packager.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/BlackBerry/Rules/qcc_cl.xml b/src/VSNDK.Tasks/BlackBerry/Rules/qcc_cl.xml
deleted file mode 100644
index 90de68d9..00000000
--- a/src/VSNDK.Tasks/BlackBerry/Rules/qcc_cl.xml
+++ /dev/null
@@ -1,196 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/BlackBerry/Rules/qcc_lib.xml b/src/VSNDK.Tasks/BlackBerry/Rules/qcc_lib.xml
deleted file mode 100644
index aa53f443..00000000
--- a/src/VSNDK.Tasks/BlackBerry/Rules/qcc_lib.xml
+++ /dev/null
@@ -1,154 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/BlackBerry/Rules/qcc_link.xml b/src/VSNDK.Tasks/BlackBerry/Rules/qcc_link.xml
deleted file mode 100644
index c35bcb63..00000000
--- a/src/VSNDK.Tasks/BlackBerry/Rules/qcc_link.xml
+++ /dev/null
@@ -1,390 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.Packager.bak b/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.Packager.bak
deleted file mode 100644
index daea93ed..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.Packager.bak
+++ /dev/null
@@ -1,360 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
- true
-
-
-
- true
-
-
-
-
- $(BuildLinkTargets);
-
- $(CommonBuildOnlyTargets);$(BeforeBuildLinkTargets);$(BuildLinkTargets);$(AfterBuildLinkTargets)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(ProjectDir),$(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)))
- $([System.IO.Path]::GetFileName('$(TargetPath)'))
- $([System.IO.Path]::GetDirectoryName('$(TargetPath)'))
- $(LibPrefix)$(ProjectName)
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- false
- true
- $(BuildBarToolPath)
- $(OptimizedDeployToolPath)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.Packager.targets b/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.Packager.targets
deleted file mode 100644
index 1fa145fb..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.Packager.targets
+++ /dev/null
@@ -1,350 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
- true
-
-
-
- true
-
-
-
-
- $(BuildLinkTargets);
-
- $(CommonBuildOnlyTargets);$(BeforeBuildLinkTargets);$(BuildLinkTargets);$(AfterBuildLinkTargets)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(ProjectDir),$(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)))
- $([System.IO.Path]::GetFileName('$(TargetPath)'))
- $([System.IO.Path]::GetDirectoryName('$(TargetPath)'))
- $(LibPrefix)$(ProjectName)
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- false
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.bak b/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.bak
deleted file mode 100644
index 4c83562c..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.bak
+++ /dev/null
@@ -1,160 +0,0 @@
-
-
-
-
-
-
-
-
-
- QCC;__QCC__;__QNX__
- false
-
-
-
-
- true
- false
-
-
-
-
- true
- .a
- lib
-
-
-
- true
-
-
-
-
-
- true
- .so
- true
- lib
-
-
-
- x86
-
-
- armle-v7
-
-
-
- $(from_file)
- gcc_ntox86
- gcc_ntoarmv7le
- $(QNX_TARGET)\$(CPUVARDIR)\lib
-
-
-
-
- $([System.IO.Path]::Combine($(ProjectDir),$(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)))
- $([System.IO.Path]::GetFileName('$(TargetPath)'))
- $([System.IO.Path]::GetDirectoryName('$(TargetPath)'))
- $(LibPrefix)$(ProjectName)
-
-
-
-
-
- $(IntDir)%(FileName).o
- $(QccDefines)
- WIN32;_WINDOWS
- NormalWarnings
- false
- false
-
- true
-
- false
- false
- Default
- true
-
-
-
-
-
-
- O2
- true
-
-
-
-
-
-
- O2
- false
-
-
-
-
-
-
- $(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)
- $(TargetPath)
-
-
- false
- false
- true
- false
- true
- Default
-
-
-
-
-
-
- $(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)
- false
-
-
-
-
-
-
- $(IntDir)
- true
- $(OutDir)$(TargetName).bar
- true
- false
- bar-debug
- bar
- true
- false
- None
- Install
- false
- 1
-
-
-
-
- 169.254.0.1
-
- bar-descriptor.xml
- $(AppData)
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.default.bak b/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.default.bak
deleted file mode 100644
index 9f18d577..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.default.bak
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
- BlackBerrySimulator
- qcc
-
- $(IntermediateOutputPath)
- Simulator-$(Configuration)\
- Simulator-$(Configuration)\
- $(IntDir)
-
-
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.default.props b/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.default.props
deleted file mode 100644
index 9f18d577..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.default.props
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
- BlackBerrySimulator
- qcc
-
- $(IntermediateOutputPath)
- Simulator-$(Configuration)\
- Simulator-$(Configuration)\
- $(IntDir)
-
-
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.props b/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.props
deleted file mode 100644
index 4c83562c..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.props
+++ /dev/null
@@ -1,160 +0,0 @@
-
-
-
-
-
-
-
-
-
- QCC;__QCC__;__QNX__
- false
-
-
-
-
- true
- false
-
-
-
-
- true
- .a
- lib
-
-
-
- true
-
-
-
-
-
- true
- .so
- true
- lib
-
-
-
- x86
-
-
- armle-v7
-
-
-
- $(from_file)
- gcc_ntox86
- gcc_ntoarmv7le
- $(QNX_TARGET)\$(CPUVARDIR)\lib
-
-
-
-
- $([System.IO.Path]::Combine($(ProjectDir),$(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)))
- $([System.IO.Path]::GetFileName('$(TargetPath)'))
- $([System.IO.Path]::GetDirectoryName('$(TargetPath)'))
- $(LibPrefix)$(ProjectName)
-
-
-
-
-
- $(IntDir)%(FileName).o
- $(QccDefines)
- WIN32;_WINDOWS
- NormalWarnings
- false
- false
-
- true
-
- false
- false
- Default
- true
-
-
-
-
-
-
- O2
- true
-
-
-
-
-
-
- O2
- false
-
-
-
-
-
-
- $(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)
- $(TargetPath)
-
-
- false
- false
- true
- false
- true
- Default
-
-
-
-
-
-
- $(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)
- false
-
-
-
-
-
-
- $(IntDir)
- true
- $(OutDir)$(TargetName).bar
- true
- false
- bar-debug
- bar
- true
- false
- None
- Install
- false
- 1
-
-
-
-
- 169.254.0.1
-
- bar-descriptor.xml
- $(AppData)
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.targets b/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.targets
deleted file mode 100644
index 78ba5e84..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.Cpp.BlackBerrySimulator.targets
+++ /dev/null
@@ -1,195 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
- CompileAsC
- CompileAsCpp
- false
-
-
-
-
-
-
- $(DefaultToolArchitecture)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- false
-
-
-
-
- $(DefaultToolArchitecture)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- false
- false
- true
- $(DefaultToolArchitecture)
- true
-
-
-
-
-
- CompileAsC
- CompileAsCpp
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $(CleanDependsOn);
- MakeClean;
-
-
-
-
-
-
-
-
-
-
-
-
- PlatformPrepareForBuild;$(PrepareForBuildDependsOn)
- PlatformPrepareForBuild;$(PrepareForBuildDependsOn)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.CppBuild.BlackBerrySimulator.targets b/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.CppBuild.BlackBerrySimulator.targets
deleted file mode 100644
index 4ab9e314..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Microsoft.CppBuild.BlackBerrySimulator.targets
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
- false
- false
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PropertySheet
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Project
-
-
- PropertySheet
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerrySimulator.qcc.bak b/src/VSNDK.Tasks/BlackBerrySimulator/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerrySimulator.qcc.bak
deleted file mode 100644
index a83fb376..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerrySimulator.qcc.bak
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
- $(Registry:HKEY_CURRENT_USER\SOFTWARE\Research In Motion\BlackBerryVSPlugin@NDKPath)
- $(NativeSDKDir)\target\qnx6
- $(NativeSDKDir)\host\win32\x86
- $(QNX_HOST)\etc\qcc\gcc
- x86
- 4.6.3
- gcc_ntox86
- $(QNX_TARGET)\$(CPUVARDIR)\lib
-
-
-
- qcc2.0
- $(QNX_HOST)\usr\bin
- qcc.exe
- qcc.exe
- qcc.exe
- blackberry-nativepackager.bat
- blackberry-deploy.bat
- $(QccToolsPath)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VC@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Setup\VC@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\10.0\Setup\VC@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VCExpress\10.0\Setup\VC@ProductDir)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VS@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Setup\VS@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\10.0\Setup\VS@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VCExpress\10.0\Setup\VS@ProductDir)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework@InstallRoot)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework@InstallRoot)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
-
- $(QNX_HOST)\usr\bin;$(PATH);
- $(QNX_TARGET)\usr\include;$(QNX_TARGET)\usr\include\freetype2;$(QNX_TARGET)\..\target-override\usr\include;
- $(QccLibPath);$(QNX_TARGET)\..\target-override\$(CPUVARDIR)\lib;$(QNX_TARGET)\..\target-override\$(CPUVARDIR)\usr\lib;
- $(ExecutablePath)
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerrySimulator.qcc.props b/src/VSNDK.Tasks/BlackBerrySimulator/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerrySimulator.qcc.props
deleted file mode 100644
index 1d95dcea..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerrySimulator.qcc.props
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
- $(Registry:HKEY_CURRENT_USER\SOFTWARE\BlackBerry\BlackBerryVSPlugin@NDKTargetPath)
- $(Registry:HKEY_CURRENT_USER\SOFTWARE\BlackBerry\BlackBerryVSPlugin@NDKHostPath)
- $([System.IO.File]::ReadAllText("$(QNX_HOST)\etc\qcc\gcc\default").Substring(4,5))
- $(QNX_HOST)\etc\qcc\gcc
- x86
- $(from_file)
- gcc_ntox86
- $(QNX_TARGET)\$(CPUVARDIR)\lib
- $(AppData)
- $(AppDataPath)/BlackBerry/bbt_id_rsa.pub
- $(AppDataPath)/BlackBerry/bbt_id_rsa
-
-
-
- VSNDKDebugEngine
-
-
-
- qcc2.0
- $(QNX_HOST)\usr\bin
- qcc.exe
- qcc.exe
- qcc.exe
- blackberry-nativepackager.bat
- $(MSBuildProgramFiles32)\BlackBerry\VSPlugin-NDK\qnxtools\bin\blackberry-signer.bat
- blackberry-deploy.bat
- $(QccToolsPath)
- $(QccToolsPath)
- $(QccToolsPath)
- ssh.exe
- $(QccToolsPath)
- $(QccToolsPath)\ssh-keygen.exe
- $(QccToolsPath)\blackberry-connect.bat
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VC@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Setup\VC@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\10.0\Setup\VC@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VCExpress\10.0\Setup\VC@ProductDir)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VS@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Setup\VS@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\10.0\Setup\VS@ProductDir)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VCExpress\10.0\Setup\VS@ProductDir)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework@InstallRoot)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework@InstallRoot)
-
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
- $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
-
- $(QNX_HOST)\usr\bin;$(PATH);
- $(QNX_TARGET)\usr\include;$(QNX_TARGET)\usr\include\freetype2;$(QNX_TARGET)\..\target-override\usr\include;
- $(QccLibPath);$(QNX_TARGET)\..\target-override\$(CPUVARDIR)\lib;$(QNX_TARGET)\..\target-override\$(CPUVARDIR)\usr\lib;
-
- $(ExecutablePath)
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerrySimulator.qcc.targets b/src/VSNDK.Tasks/BlackBerrySimulator/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerrySimulator.qcc.targets
deleted file mode 100644
index 55b83ab2..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerrySimulator.qcc.targets
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/debugger_ndk.xml b/src/VSNDK.Tasks/BlackBerrySimulator/Rules/debugger_ndk.xml
deleted file mode 100644
index cb53a5b7..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/debugger_ndk.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/ndkProjectItemsSchema.xml b/src/VSNDK.Tasks/BlackBerrySimulator/Rules/ndkProjectItemsSchema.xml
deleted file mode 100644
index ec753493..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/ndkProjectItemsSchema.xml
+++ /dev/null
@@ -1,299 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/ndk_directories.xml b/src/VSNDK.Tasks/BlackBerrySimulator/Rules/ndk_directories.xml
deleted file mode 100644
index ed52f452..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/ndk_directories.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/ndk_general.xml b/src/VSNDK.Tasks/BlackBerrySimulator/Rules/ndk_general.xml
deleted file mode 100644
index 4a7e8cb8..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/ndk_general.xml
+++ /dev/null
@@ -1,174 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/ndk_general_ps.xml b/src/VSNDK.Tasks/BlackBerrySimulator/Rules/ndk_general_ps.xml
deleted file mode 100644
index 5b40a328..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/ndk_general_ps.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/packager.xml b/src/VSNDK.Tasks/BlackBerrySimulator/Rules/packager.xml
deleted file mode 100644
index 22e801e8..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/packager.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/qcc_cl.xml b/src/VSNDK.Tasks/BlackBerrySimulator/Rules/qcc_cl.xml
deleted file mode 100644
index 9a799fa8..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/qcc_cl.xml
+++ /dev/null
@@ -1,196 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/qcc_lib.xml b/src/VSNDK.Tasks/BlackBerrySimulator/Rules/qcc_lib.xml
deleted file mode 100644
index aa53f443..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/qcc_lib.xml
+++ /dev/null
@@ -1,154 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/qcc_link.xml b/src/VSNDK.Tasks/BlackBerrySimulator/Rules/qcc_link.xml
deleted file mode 100644
index c35bcb63..00000000
--- a/src/VSNDK.Tasks/BlackBerrySimulator/Rules/qcc_link.xml
+++ /dev/null
@@ -1,390 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/VSNDK.Tasks/CheckIfInstalled.cs b/src/VSNDK.Tasks/CheckIfInstalled.cs
deleted file mode 100644
index 88266c3d..00000000
--- a/src/VSNDK.Tasks/CheckIfInstalled.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.IO;
-using System.Collections;
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-
-namespace VSNDK.Tasks
-{
- ///
- /// MSBuild Task to check to see if the application was previously installed.
- ///
- public class CheckIfInstalled : Task
- {
- #region Member Variables and Constants
- private string _listFile;
- private string _appName;
- private bool _isAppInstalled;
- #endregion
-
- ///
- /// Execute the MSBuild task
- ///
- /// True on successful execution
- public override bool Execute()
- {
-
- try
- {
- _isAppInstalled = false;
-
- string[] installedApps = File.ReadAllLines(_listFile);
- foreach (string app in installedApps)
- {
- if (app.Contains(_appName))
- {
- _isAppInstalled = true;
- break;
- }
- }
-
- return true;
- }
- catch (Exception ex)
- {
- return false;
- }
-
-
- }
-
- ///
- /// Setter for the ListFile property
- ///
- [Required]
- public string ListFile
- {
- set
- {
- _listFile = value;
- }
- }
-
- ///
- /// Setter for the AppName property
- ///
- [Required]
- public string AppName
- {
- set
- {
- _appName = value;
- }
- }
-
- ///
- /// Getter for the IsAppInstalled property
- ///
- [Output]
- public bool IsAppInstalled
- {
- get
- {
- return _isAppInstalled;
- }
- }
- }
-}
diff --git a/src/VSNDK.Tasks/DiffManifests.cs b/src/VSNDK.Tasks/DiffManifests.cs
deleted file mode 100644
index bb0ede14..00000000
--- a/src/VSNDK.Tasks/DiffManifests.cs
+++ /dev/null
@@ -1,239 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.IO;
-using System.Collections;
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-
-namespace VSNDK.Tasks
-{
- ///
- /// MSBuild task to compare the manifest file from the bar file being uploaded against the one already installed on the device.
- ///
- public class DiffManifests : Task
- {
- #region Member Variables and Constants
- private string _localManifestFile;
- private string _targetManifestFile;
- private string _targetFileMap;
- private ArrayList _modifiedFiles;
- private ArrayList _deletedFiles;
- private int _modifiedFilesCount;
- private int _deletedFilesCount;
- #endregion
-
- ///
- /// Execute the MSBuild Task.
- ///
- ///
- public override bool Execute()
- {
- _modifiedFiles = new ArrayList();
- _deletedFiles = new ArrayList();
-
- // Parse local manifest to retrieve list of files and their hashes.
- string[] localManifest = File.ReadAllLines(_localManifestFile);
- Dictionary localFiles = new Dictionary();
- for (int i = 0; i < localManifest.Length; i++)
- {
- if (localManifest[i].StartsWith("Archive-Asset-Name: "))
- {
- string assetName = localManifest[i].Substring(20);
- i++;
- if (localManifest[i].StartsWith("Archive-Asset-SHA-512-Digest: "))
- {
- string assetHash = localManifest[i].Substring(30);
- localFiles.Add(assetName, assetHash);
- }
- else
- {
- return false;
- }
- }
- }
-
- // Do the same for the target manifest.
- string[] targetManifest = File.ReadAllLines(_targetManifestFile);
- Dictionary targetFiles = new Dictionary();
- for (int i = 0; i < targetManifest.Length; i++)
- {
- if (targetManifest[i].StartsWith("Archive-Asset-Name: "))
- {
- string assetName = targetManifest[i].Substring(20);
- i++;
- if (targetManifest[i].StartsWith("Archive-Asset-SHA-512-Digest: "))
- {
- string assetHash = targetManifest[i].Substring(30);
- targetFiles.Add(assetName, assetHash);
- }
- else
- {
- return false;
- }
- }
- }
-
- // Compare hashes and populate the lists of modified and deleted files.
- string[] targetFileMap = File.ReadAllLines(_targetFileMap);
- foreach (KeyValuePair file in localFiles)
- {
- // For some reason this MANIFEST.bbr file appears in the manifest, even though
- // it doesn't actually exist anywhere...? It doesn't seem to correspond to
- // MANIFEST.MF either.
- if (file.Key == "META-INF/MANIFEST.bbr")
- {
- continue;
- }
-
- // If the target manifest doesn't contain the same key/value pair,
- // that means the local file has been either added or modified.
- if (!targetFiles.Contains(file))
- {
- TaskItem item = new TaskItem(file.Key);
- item.SetMetadata("SourcePath", getSourcePath(file.Key, targetFileMap));
- _modifiedFiles.Add(item);
- }
- }
-
- IDictionaryEnumerator targetEnum = targetFiles.GetEnumerator();
- while (targetEnum.MoveNext())
- {
- // If the local manifest doesn't contain the same key,
- // that means the target file has been deleted from the project.
- if (!localFiles.ContainsKey((string)targetEnum.Key))
- {
- TaskItem item = new TaskItem((string)targetEnum.Key);
- _deletedFiles.Add(item);
- }
- }
-
- // For some reason the manifest file doesn't show up in the target file map
- // or the manifest itself, so we add it manually here and always upload it.
- TaskItem manifestItem = new TaskItem("META-INF/MANIFEST.MF");
- manifestItem.SetMetadata("SourcePath", "localManifest.mf");
- _modifiedFiles.Add(manifestItem);
-
- return true;
- }
-
- ///
- /// Helper function to parse the target file map to add the source path of each modified file as metadata.
- ///
- /// Path to the source file
- /// Target file map
- ///
- private string getSourcePath(string sourcePath, string[] targetFileMap)
- {
- foreach (string line in targetFileMap)
- {
- if (line.Contains(sourcePath))
- {
- int startIndex = line.IndexOf('=');
- return line.Substring(startIndex + 1);
- }
- }
-
- return "";
- }
-
- ///
- /// Getter for the ModifiedFiles property.
- ///
- [Output]
- public ITaskItem[] ModifiedFiles
- {
- get
- {
- ITaskItem[] items = (ITaskItem[])_modifiedFiles.ToArray(typeof(ITaskItem));
- _modifiedFilesCount = items.Length;
- return items;
- }
- }
-
- ///
- /// Getter for the ModifiedFilesCount property
- ///
- [Output]
- public int ModifiedFilesCount
- {
- get { return _modifiedFilesCount; }
- set { _modifiedFilesCount = value; }
- }
-
- ///
- /// Getter for the DeletedFiles property
- ///
- [Output]
- public ITaskItem[] DeletedFiles
- {
- get
- {
- ITaskItem[] items = (ITaskItem[])_deletedFiles.ToArray(typeof(ITaskItem));
- _deletedFilesCount = items.Length;
- return items;
- }
- }
-
- ///
- /// Getter/Setter for the DeletedFilesCount property
- ///
- [Output]
- public int DeletedFilesCount
- {
- get { return _deletedFilesCount; }
- set { _deletedFilesCount = value; }
- }
-
- ///
- /// Setter for the LocalManifestFile property
- ///
- [Required]
- public string LocalManifestFile
- {
- set
- {
- _localManifestFile = value;
- }
- }
-
- ///
- /// Setter for the TargetManifestFile property
- ///
- [Required]
- public string TargetManifestFile
- {
- set
- {
- _targetManifestFile = value;
- }
- }
-
- ///
- /// Setter for the targetFileMap property
- ///
- [Required]
- public string targetFileMap
- {
- set
- {
- _targetFileMap = value;
- }
- }
- }
-}
diff --git a/src/VSNDK.Tasks/GenerateMakefile.cs b/src/VSNDK.Tasks/GenerateMakefile.cs
deleted file mode 100644
index 9f523095..00000000
--- a/src/VSNDK.Tasks/GenerateMakefile.cs
+++ /dev/null
@@ -1,521 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Collections;
-using System.IO;
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-using System.Runtime.InteropServices;
-
-namespace VSNDK.Tasks
-{
- ///
- /// MSBuild Task for generating a make file for packaging the bar file.
- ///
- public class GenerateMakefile : Task
- {
- #region Member Variables and Constants
- private string _projectDir;
- private string _intDir;
- private string _outDir;
-
- private const string INITIAL_DEFINITIONS =
- "RM := rm -rf\n\n" +
-
- "# Empty variable definitions.\n" +
- "O_SRCS := \n" +
- "CPP_SRCS := \n" +
- "C_UPPER_SRCS := \n" +
- "C_SRCS := \n" +
- "S_UPPER_SRCS := \n" +
- "OBJ_SRCS := \n" +
- "II_SRCS := \n" +
- "ASM_SRCS := \n" +
- "CXX_SRCS := \n" +
- "I_SRCS := \n" +
- "CC_SRCS := \n" +
- "OBJS := \n" +
- "C_DEPS := \n" +
- "CC_DEPS := \n" +
- "ARCHIVES := \n" +
- "CPP_DEPS := \n" +
- "I_DEPS := \n" +
- "CXX_DEPS := \n" +
- "C_UPPER_DEPS := \n" +
- "II_DEPS := \n\n" +
-
- "USER_OBJS := \n" +
- "LIBS := \n\n";
-
- private const string DEPENDENCY_INCLUDES =
- "# Include all dependency files\n" +
- "ifneq ($(MAKECMDGOALS),clean)\n" +
- "ifneq ($(strip $(C_DEPS)),)\n" +
- "-include $(C_DEPS)\n" +
- "endif\n" +
- "ifneq ($(strip $(CC_DEPS)),)\n" +
- "-include $(CC_DEPS)\n" +
- "endif\n" +
- "ifneq ($(strip $(CPP_DEPS)),)\n" +
- "-include $(CPP_DEPS)\n" +
- "endif\n" +
- "ifneq ($(strip $(I_DEPS)),)\n" +
- "-include $(I_DEPS)\n" +
- "endif\n" +
- "ifneq ($(strip $(CXX_DEPS)),)\n" +
- "-include $(CXX_DEPS)\n" +
- "endif\n" +
- "ifneq ($(strip $(C_UPPER_DEPS)),)\n" +
- "-include $(C_UPPER_DEPS)\n" +
- "endif\n" +
- "ifneq ($(strip $(II_DEPS)),)\n" +
- "-include $(II_DEPS)\n" +
- "endif\n" +
- "endif\n\n";
- #endregion
-
- #region properties
-
- ///
- /// Getter/Setter for CompileItems property
- ///
- public ITaskItem[] CompileItems
- {
- set;
- get;
- }
-
- ///
- /// Getter/Setter for LinkItems
- ///
- public ITaskItem[] LinkItems
- {
- set;
- get;
- }
-
- ///
- /// Getter/Setter for ProjectDir property
- ///
- public string ProjectDir
- {
- set { _projectDir = value.Replace('\\', '/'); }
- get { return _projectDir; }
- }
-
- ///
- /// Getter/Setter for IntDir property
- ///
- public string IntDir
- {
- set { _intDir = value.Replace('\\', '/'); }
- get { return _intDir; }
- }
-
- ///
- /// Getter/Setter for OutDir property
- ///
- public string OutDir
- {
- set { _outDir = value.Replace('\\', '/'); }
- get { return _outDir; }
- }
-
- ///
- /// Getter/Setter for AdditionalIncludeDirectories property
- ///
- public string[] AdditionalIncludeDirectories
- {
- set;
- get;
- }
-
- ///
- /// Getter/Setter for AdditionLibraryDirectories
- ///
- public string[] AdditionalLibraryDirectories
- {
- set;
- get;
- }
-
- ///
- /// Getter/Setter for ExcludeDirectories
- ///
- public string[] ExcludeDirectories
- {
- set;
- get;
- }
-
-
- ///
- /// Getter/Setter for TargetName property
- ///
- public string TargetName
- {
- set;
- get;
- }
-
- ///
- /// Getter/Setter for TargetExtension property
- ///
- public string TargetExtension
- {
- set;
- get;
- }
-
- ///
- /// Getter/Setter for ConfigurationType property
- ///
- public string ConfigurationType
- {
- set;
- get;
- }
-
- ///
- /// Getter/Setter for CompilerVersion property
- ///
- public string CompilerVersion
- {
- set;
- get;
- }
-
- ///
- /// Getter/Setter for Platform property
- ///
- public string Platform
- {
- set;
- get;
- }
-
- #endregion
-
- ///
- /// Interface to unmanaged code for getting the SHortPathName for a given directory.
- ///
- /// Path to be converted
- /// Returned ShortPathName
- /// Length of the ShortPathName
- ///
- [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
- public static extern int GetShortPathName(
- [MarshalAs(UnmanagedType.LPTStr)]
- string path,
- [MarshalAs(UnmanagedType.LPTStr)]
- StringBuilder shortPath,
- int shortPathLength
- );
-
- ///
- /// Execute MSBuild Task
- ///
- ///
- public override bool Execute()
- {
- string targetString = TargetName + TargetExtension;
- targetString = targetString.Replace(".exe", "");
- string compilerFlag = "-V\"" + CompilerVersion;
-
- if (Platform == "BlackBerry")
- compilerFlag += ",gcc_ntoarmv7le\"";
- else if (Platform == "BlackBerrySimulator")
- compilerFlag += ",gcc_ntox86\"";
-
- using (StreamWriter outFile = new StreamWriter(IntDir + "makefile"))
- {
- outFile.Write(INITIAL_DEFINITIONS);
- // System.Diagnostics.Debugger.Launch();
- foreach (ITaskItem compileItem in CompileItems)
- {
- // Get the metadata we need from this compile item.
- string id = compileItem.GetMetadata("Identity").Replace('\\', '/');
- string filename = compileItem.GetMetadata("Filename");
- string extension = compileItem.GetMetadata("Extension");
- string relativeDir = compileItem.GetMetadata("RelativeDir").Replace('\\', '/');
- string compileAs = compileItem.GetMetadata("CompileAs");
- string warningLevel = compileItem.GetMetadata("WarningLevel");
- string ansi = compileItem.GetMetadata("Ansi");
- string optimizationLevel = compileItem.GetMetadata("OptimizationLevel");
- string generateDebugInfo = compileItem.GetMetadata("GenerateDebugInformation");
- string runtimeTypeInfo = compileItem.GetMetadata("RuntimeTypeInfo");
- string enhancedSecurity = compileItem.GetMetadata("EnhancedSecurity");
- string additionalOptions = compileItem.GetMetadata("AdditionalOptions");
- string fullPath = compileItem.GetMetadata("FullPath").Replace('\\', '/');
-
- /// if CompileItem is in the ExcludedPath then continue.
- if (isExcludedPath(fullPath))
- {
-
- continue;
- }
-
- StringBuilder shortPath = new StringBuilder(1024);
- GetShortPathName(fullPath, shortPath, shortPath.Capacity);
- string fullPathShortened = shortPath.ToString();
-
- string handleExceptions = compileItem.GetMetadata("GccExceptionHandling");
-
- string[] preprocessorDefs = compileItem.GetMetadata("PreprocessorDefinitions").Split(';');
- string[] preprocessorUndefs = compileItem.GetMetadata("UndefinePreprocessorDefinitions").Split(';');
-
- string[] additionalIncludeDirs = compileItem.GetMetadata("AdditionalIncludeDirectories").Split(';');
- for (int i = 0; i < additionalIncludeDirs.Length; i++)
- {
- // Prepend ProjectDir to relative paths -- otherwise they will be interpreted
- // as being relative to the build dir, e.g. ProjectDir/BlackBerry/Debug
- if (additionalIncludeDirs[i] != "" && !additionalIncludeDirs[i].Contains(':'))
- additionalIncludeDirs[i] = ProjectDir + additionalIncludeDirs[i];
- }
-
- // Add this compile item to the source definition.
- if (compileAs == "CompileAsC")
- outFile.Write("C_SRCS += ");
- else if (compileAs == "CompileAsCpp")
- outFile.Write("CPP_SRCS += ");
-
- // Source file location.
- outFile.WriteLine(fullPathShortened);
-
- // Add this compile item's dependency file to the DEPS definition.
- if (compileAs == "CompileAsC")
- outFile.Write("C_DEPS += ");
- else if (compileAs == "CompileAsCpp")
- outFile.Write("CPP_DEPS += ");
-
- outFile.WriteLine("./" + filename + ".d");
-
- // Add the object file to the OBJS definition.
- outFile.WriteLine("OBJS += ./" + filename + ".o\n");
-
- // Now add a compile rule for this item.
- outFile.WriteLine(filename + ".o: " + fullPathShortened);
- outFile.Write("\tqcc -o $@ " + fullPathShortened + " " + compilerFlag + " -c -Wp,-MMD,$(basename $@).d -Wp,-MT,$@ ");
-
- if (generateDebugInfo == "true")
- outFile.Write("-g ");
-
- Dictionary warningMap = new Dictionary();
- warningMap.Add("TurnOffAllWarnings", "-w0 ");
- warningMap.Add("Level1", "-w1 ");
- warningMap.Add("Level2", "-w2 ");
- warningMap.Add("Level3", "-w3 ");
- warningMap.Add("Level4", "-w4 ");
- warningMap.Add("Level5", "-w5 ");
- warningMap.Add("Level6", "-w6 ");
- warningMap.Add("Level7", "-w7 ");
- warningMap.Add("Level8", "-w8 ");
- warningMap.Add("Level9", "-w9 ");
- warningMap.Add("EnableAllWarnings", "-Wall ");
-
- string warningLevelSwitch;
- warningMap.TryGetValue(warningLevel, out warningLevelSwitch);
- outFile.Write(warningLevelSwitch);
-
- if (compileAs == "CompileAsC")
- outFile.Write("-lang-c ");
- else if (compileAs == "CompileAsCpp")
- outFile.Write("-lang-c++ ");
-
- if (runtimeTypeInfo == "false" && compileAs == "CompileAsCpp")
- outFile.Write("-fno-rtti ");
-
- if (handleExceptions == "true")
- outFile.Write("-fexceptions ");
- else
- outFile.Write("-fno-exceptions ");
-
- if (enhancedSecurity == "true")
- outFile.Write("-fstack-protector-all ");
-
- // Note: Consider letting user decide between "-fpic" and "-fPIC"
- // For now we use the safe, cross-platform "-fPIC"
- if (ConfigurationType == "DynamicLibrary")
- outFile.Write("-fPIC ");
-
- foreach (string includeDir in AdditionalIncludeDirectories)
- {
- if (includeDir != "")
- outFile.Write("-I\"" + includeDir + "\" ");
- }
-
- foreach (string includeDir in additionalIncludeDirs)
- {
- if (includeDir != "")
- outFile.Write("-I\"" + includeDir + "\" ");
- }
-
- foreach (string def in preprocessorDefs)
- {
- if (def != "")
- outFile.Write("-D" + def + " ");
- }
-
- foreach (string undef in preprocessorUndefs)
- {
- if (undef != "")
- outFile.Write("-U" + undef + " ");
- }
-
- outFile.WriteLine(additionalOptions);
- outFile.WriteLine();
- }
-
- outFile.Write(DEPENDENCY_INCLUDES);
-
- // Now write out all the targets.
- outFile.WriteLine("all: " + targetString);
- outFile.WriteLine();
- outFile.Write(targetString + ": $(OBJS) $(USER_OBJS) $(LIB_DEPS) ");
- outFile.WriteLine();
-
- string rootedOutDir = (Path.IsPathRooted(OutDir)) ? OutDir : ProjectDir + OutDir;
-
- StringBuilder shortOutPath = new StringBuilder(1024);
- GetShortPathName(rootedOutDir, shortOutPath, shortOutPath.Capacity);
- rootedOutDir = shortOutPath.ToString();
-
- if (ConfigurationType == "StaticLibrary")
- {
- outFile.Write("\tqcc -A " + rootedOutDir + targetString + " $(OBJS) $(USER_OBJS) $(LIBS) " + compilerFlag + " -w1");
- }
- else if (ConfigurationType == "DynamicLibrary")
- {
- // In case of reverse dependencies, may need to add "-Wl,-export-dynamic"
- // Also note that the soname is currently the same as the target name, and no version information is added.
- outFile.Write("\tqcc -shared -Wl,-soname," + targetString +
- " -o " + rootedOutDir + targetString +
- " $(OBJS) $(USER_OBJS) $(LIBS) " + compilerFlag);
- }
- else if (ConfigurationType == "Utility")
- {
- // As far as I know, we don't support utilities.
- }
- else if (ConfigurationType == "Application")
- {
- // For now, collect linker metadata from the first link item.
- // (Why do we have multiple link items anyhow?)
- string[] libs = LinkItems[0].GetMetadata("AdditionalDependencies").Split(';');
- string generateDebugInfo = LinkItems[0].GetMetadata("GenerateDebugInformation");
- string compileAs = LinkItems[0].GetMetadata("CompileAs");
-
- string[] libDirs = LinkItems[0].GetMetadata("AdditionalLibraryDirectories").Split(';');
- for (int i = 0; i < libDirs.Length; i++)
- {
- // Prepend ProjectDir to relative paths.
- if (libDirs[i] != "" && !libDirs[i].Contains(':'))
- libDirs[i] = ProjectDir + libDirs[i];
- }
-
- // This is the linker's tool invocation.
- outFile.Write("\tqcc -o " + rootedOutDir + targetString + " $(OBJS) $(USER_OBJS) $(LIBS) " + compilerFlag + " ");
-
- if (compileAs == "CompileAsCpp")
- outFile.Write("-lang-c++ ");
- else if (compileAs == "CompileAsC")
- outFile.Write("-lang-c ");
-
- if (generateDebugInfo == "true")
- outFile.Write("-g ");
-
- // For added security, remap some sections of ELF as read-only.
- outFile.Write("-Wl,-z,relro,-z,now ");
-
- // Visual Studio doesn't have separate lists for static vs. dynamic dependencies.
- // To differentiate between the two, include the extension in the list.
- // (.a for static, .so for dynamic)
- // If no extension is included in the name it will be treated as the same type
- // as the last declared type, and the default type is static. This is the way
- // qcc would work if you were using it from the command line with the
- // "-Bstatic" and "-Bdynamic" flags.
- for (int i = 0; i < libs.Length; i++)
- {
- if (libs[i].EndsWith(".so"))
- {
- outFile.Write("-Bdynamic ");
- libs[i] = libs[i].Remove(libs[i].Length - 3);
- }
- else if (libs[i].EndsWith(".a"))
- {
- outFile.Write("-Bstatic ");
- libs[i] = libs[i].Remove(libs[i].Length - 2);
- }
-
- if (libs[i] != "")
- outFile.Write("-l" + libs[i] + " ");
- }
-
- foreach (string libDir in libDirs)
- {
- if (libDir != "")
- outFile.Write("-L\"" + libDir + "\" ");
- }
-
- foreach (string libDir in AdditionalLibraryDirectories)
- {
- if (libDir != "")
- outFile.Write("-L\"" + libDir + "\" ");
- }
- }
-
- outFile.WriteLine("\n");
- outFile.WriteLine("clean:");
- outFile.Write("\t-$(RM) $(OBJS)$(C_DEPS)$(CC_DEPS)$(COM_QNX_QCC_OUTPUTTYPE_LINKER_OUTPUTS)$(CPP_DEPS)$(I_DEPS)$(CXX_DEPS)$(C_UPPER_DEPS)$(II_DEPS) " + rootedOutDir + targetString);
-
- if (ConfigurationType == "Application")
- {
- outFile.WriteLine(" " + rootedOutDir + TargetName + ".bar");
- }
-
- outFile.WriteLine();
- outFile.WriteLine(".PHONY: all clean dependents\n");
- }
-
- return true;
- }
-
- ///
- /// Check to see if path is in the excluded list
- ///
- ///
- ///
- private bool isExcludedPath(string path)
- {
- if (ExcludeDirectories != null)
- {
- foreach (string exDir in ExcludeDirectories)
- {
- if (Path.GetFullPath(path).Contains(Path.GetFullPath(exDir)))
- {
- return true;
- }
-/* else
- {
- return false;
- }*/
- }
- }
- return false;
- }
- }
-}
diff --git a/src/VSNDK.Tasks/GetAppInfo.cs b/src/VSNDK.Tasks/GetAppInfo.cs
deleted file mode 100644
index 353f09de..00000000
--- a/src/VSNDK.Tasks/GetAppInfo.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.IO;
-using System.Xml;
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-
-namespace VSNDK.Tasks
-{
- ///
- /// MSBuid Task to retrieve the application info
- ///
- public class GetAppInfo : Task
- {
- #region Member Variables and Constants
- private string _projectDir;
- private string _appName;
- private string _barDescriptorPath = "";
- private string _appId;
- #endregion
-
- ///
- /// Execute the MSBuild Task
- ///
- ///
- public override bool Execute()
- {
- string rootedOutDir = (Path.IsPathRooted(_barDescriptorPath)) ? _barDescriptorPath : _projectDir + _barDescriptorPath;
- XmlReader reader = XmlReader.Create(rootedOutDir);
- reader.ReadToFollowing("id");
- _appId = reader.ReadElementContentAsString();
-
- return true;
- }
-
- ///
- /// Getter/Setter for the ApplicationDescriptorXml property
- ///
- public string ApplicationDescriptorXml
- {
- set
- {
- _barDescriptorPath = value;
- }
- get
- {
- return _barDescriptorPath;
- }
- }
-
- ///
- /// Getter/Setter for the ProjectDir property
- ///
- public string ProjectDir
- {
- set
- {
- _projectDir = value;
- }
- get
- {
- return _projectDir;
- }
- }
-
- ///
- /// Getter/Setter for the AppName property
- ///
- public string AppName
- {
- set
- {
- _appName = value;
-
- if (_barDescriptorPath == "")
- {
- // Default location of bar-descriptor file, if not specified in the Properties Configurations.
- _barDescriptorPath = "BlackBerry-" + _appName + "\\bar-descriptor.xml";
- if (!File.Exists(_barDescriptorPath))
- {
- // Just to support the default locations of bar-descriptor from previous versions of the plug-in.
- _barDescriptorPath = _appName + "_barDescriptor\\bar-descriptor.xml";
- if (!File.Exists(_barDescriptorPath))
- {
- _barDescriptorPath = "bar-descriptor.xml";
- }
- }
- }
- }
- get
- {
- return _appName;
- }
- }
-
- ///
- /// Getter/Setter for the AppId property
- ///
- [Output]
- public string AppId
- {
- get
- {
- return _appId;
- }
- }
- }
-}
diff --git a/src/VSNDK.Tasks/LaunchDebugEngine.cs b/src/VSNDK.Tasks/LaunchDebugEngine.cs
deleted file mode 100644
index bd688a79..00000000
--- a/src/VSNDK.Tasks/LaunchDebugEngine.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Build.Utilities;
-using Microsoft.Build.Framework;
-
-using EnvDTE;
-using EnvDTE80;
-using Microsoft.VisualStudio.Shell;
-using Microsoft.VisualStudio.Shell.Interop;
-using Microsoft.VisualStudio.OLE.Interop;
-using System.Runtime.InteropServices;
-
-namespace VSNDK.Tasks
-{
- /*[ComImport]
- [Guid("23EB4AF8-BE9C-4b49-B3A4-24F4FF657B27")]
- * */
-
- public abstract class LaunchDebugEngine : Microsoft.Build.Utilities.Task
- {
- /*
- [DllImport("ole32.dll")]
- static extern int CoInitializeEx(IntPtr pvReserved, uint dwCoInit);
- */
- private DTE2 _applicationObject;
- private string _filePath;
-
- public override bool Execute()
- {
- System.Diagnostics.Debugger.Launch();
- //CoInitializeEx(NULL, COINIT_MULTITHREADED);
- //enum comEnum = {COINIT_MULTITHREADED=0};
- //CoInitializeEx((IntPtr)null, (uint)0);
-
- _applicationObject = (EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.10.0");
-
- Microsoft.VisualStudio.Shell.ServiceProvider sp =
- new Microsoft.VisualStudio.Shell.ServiceProvider((Microsoft.VisualStudio.OLE.Interop.IServiceProvider)_applicationObject);
-
- IVsDebugger dbg = (IVsDebugger)sp.GetService(typeof(SVsShellDebugger));
-
- VsDebugTargetInfo info = new VsDebugTargetInfo();
- info.cbSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(info);
- info.dlo = Microsoft.VisualStudio.Shell.Interop.DEBUG_LAUNCH_OPERATION.DLO_CreateProcess;
-
- info.bstrExe = _filePath;
- info.bstrCurDir = System.IO.Path.GetDirectoryName(info.bstrExe);
- info.bstrArg = null; // no command line parameters
- info.bstrRemoteMachine = null; // debug locally
- info.fSendStdoutToOutputWindow = 0; // Let stdout stay with the application.
- info.clsidCustom = new Guid("{D951924A-4999-42a0-9217-1EB5233D1D5A}"); // Set the launching engine the sample engine guid
- info.grfLaunch = 0;
-
- IntPtr pInfo = System.Runtime.InteropServices.Marshal.AllocCoTaskMem((int)info.cbSize);
- System.Runtime.InteropServices.Marshal.StructureToPtr(info, pInfo, false);
-
- try
- {
- dbg.LaunchDebugTargets(1, pInfo);
- }
- finally
- {
- if (pInfo != IntPtr.Zero)
- {
- System.Runtime.InteropServices.Marshal.FreeCoTaskMem(pInfo);
- }
- }
-
- return true;
- }
-
- [Required]
- public string FilePath
- {
- set
- {
- _filePath = value;
- }
- }
- }
-}
diff --git a/src/VSNDK.Tasks/MakeAllAndFormatOutputMessages.cs b/src/VSNDK.Tasks/MakeAllAndFormatOutputMessages.cs
deleted file mode 100644
index 2dfcefe2..00000000
--- a/src/VSNDK.Tasks/MakeAllAndFormatOutputMessages.cs
+++ /dev/null
@@ -1,556 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using EnvDTE;
-using EnvDTE80;
-using System.Runtime.InteropServices;
-using System.IO;
-using System.Runtime.Serialization.Formatters.Binary;
-using System.Runtime.Serialization;
-using System.Diagnostics;
-using Microsoft.Build.Utilities;
-using Microsoft.Build.Framework;
-using System.Text.RegularExpressions;
-
-namespace VSNDK.Tasks
-{
- ///
- /// Cancelabe MSBuild Task for Running the Make file for the build.
- ///
- public class MakeAllAndFormatOutputMessages : ICancelableTask
- {
- #region Member Variables and Constants
-
- private string _projectDir;
- private string _intDir;
- private string _outDir;
-
- private static StringBuilder stdOutput = null;
- private static StringBuilder errorOutput = null;
- private IBuildEngine buildEngine;
- private System.Diagnostics.Process proc = null;
- private ITaskHost hostObject;
-
- private string _numProcessors;
-
- #endregion
-
- ///
- /// Getter/Setter for the BuildEngine property
- ///
- public IBuildEngine BuildEngine
- {
- get { return buildEngine; }
- set { buildEngine = value; }
- }
-
- ///
- /// Getter/Setter for the HostObject property
- ///
- public ITaskHost HostObject
- {
- get { return hostObject; }
- set { hostObject = value; }
- }
-
- ///
- /// Getter/Setter for CompileItems property
- ///
- public ITaskItem[] CompileItems
- {
- set;
- get;
- }
-
- ///
- /// Getter/Setter for the number of processors property.
- ///
- public string numProcessors
- {
- get
- {
- _numProcessors = Environment.ProcessorCount.ToString();
- return _numProcessors;
- }
- set { _numProcessors = value; }
- }
-
- ///
- /// Perform Task Execution
- ///
- /// Return true on successful task completion
- public bool Execute()
- {
- string pCommand = "";
- string pArgs = "";
- bool mprocess = false;
-
- try
- {
- foreach (ITaskItem compileItem in CompileItems)
- {
- // Get the metadata we need from this compile item.
- mprocess = (compileItem.GetMetadata("MultiProcess") == "true");
- }
-
- pCommand = "cmd";
- if (mprocess)
- pArgs = "/c " + ToolsPath + @"\make -j" + numProcessors + " all";
- else
- pArgs = "/c " + ToolsPath + @"\make all";
-
- System.Diagnostics.ProcessStartInfo procStartInfo = new System.Diagnostics.ProcessStartInfo(pCommand, pArgs);
-
- // Set UseShellExecute to false for redirection.
- procStartInfo.UseShellExecute = false;
-
- // The following commands are needed to redirect the standard and error outputs.
- // These streams are read asynchronously using an event handler.
- procStartInfo.RedirectStandardOutput = true;
- stdOutput = new StringBuilder("");
- procStartInfo.RedirectStandardError = true;
- errorOutput = new StringBuilder("");
-
- // Setting the work directory.
- string rootedOutDir = (Path.IsPathRooted(OutDir)) ? OutDir : ProjectDir + OutDir;
- procStartInfo.WorkingDirectory = rootedOutDir;
-
- // Do not create the black window.
- procStartInfo.CreateNoWindow = true;
-
- // Create a process and assign its ProcessStartInfo
- proc = new System.Diagnostics.Process();
- proc.StartInfo = procStartInfo;
-
- // Set ours events handlers to asynchronously read the standard and error outputs.
- proc.OutputDataReceived += new DataReceivedEventHandler(StdOutputHandler);
- proc.ErrorDataReceived += new DataReceivedEventHandler(ErrorOutputHandler);
-
- // Start the process
- proc.Start();
-
- // Start the asynchronous read of the standard and error output stream.
- proc.BeginOutputReadLine();
- proc.BeginErrorReadLine();
-
- do
- {
- // Wait until finished
- // This code is correct, don't remove it. WaitForExit freezes the IDE while waiting for the end of the build process.
- // With this loop and the time out, the IDE won't be frozen enabling the build process to be cancelled.
- }
- while (!proc.WaitForExit(1000));
-
- }
- catch (Exception e)
- {
- Console.WriteLine("Failed to execute make all. Reason: " + e.Message);
- return false;
- }
-
- if (errorOutput.ToString().IndexOf(": error:") == -1)
- {
- int pos = errorOutput.ToString().LastIndexOf("\\make:");
- if (pos == -1)
- return true;
- else
- {
- pos = errorOutput.ToString().IndexOf("Error ", pos);
- if (pos == -1)
- return true;
- }
- }
-
- return false;
-
- }
-
- ///
- /// Standard Output Event Handler
- ///
- /// Sending Process
- /// Output Text
- private void StdOutputHandler(object sendingProcess, DataReceivedEventArgs outLine)
- {
- if (!String.IsNullOrEmpty(outLine.Data))
- {
- string outputText = outLine.Data;
-
- int tilde = outputText.IndexOf("~");
- while (tilde != -1)
- {
- int end = outputText.IndexOf(':', tilde);
- int end1 = outputText.IndexOf(' ', tilde);
- int end2 = outputText.IndexOf('\n', tilde);
- if ((end == -1) && (end1 == -1) && (end2 == -1))
- break;
- if (end == -1)
- end = outputText.Length - 1;
- if (end1 == -1)
- end1 = outputText.Length - 1;
- if (end2 == -1)
- end2 = outputText.Length - 1;
- if (end > end1)
- end = end1;
- if (end > end2)
- end = end2;
- int begin = outputText.LastIndexOf('\n', tilde) + 1;
- int begin1 = outputText.LastIndexOf(' ', tilde) + 1;
- if (begin < begin1)
- begin = begin1;
- StringBuilder longPathName = new StringBuilder(1024);
- string shortPathName = outputText.Substring(begin, end - begin);
- GetLongPathName(shortPathName, longPathName, longPathName.Capacity);
- if (longPathName.ToString() == "")
- {
- int sep = shortPathName.LastIndexOf('/');
- int sep2 = shortPathName.LastIndexOf('\\');
- if (sep2 > sep)
- sep = sep2;
- if (sep != -1)
- {
- shortPathName = shortPathName.Remove(sep + 1);
- GetLongPathName(shortPathName, longPathName, longPathName.Capacity);
- }
- }
- if (longPathName.ToString() != "")
- outputText = outputText.Replace(shortPathName, longPathName.ToString());
-
- tilde = outputText.IndexOf("~", tilde + 1);
- }
-
-
- BuildMessageEventArgs taskEvent = new BuildMessageEventArgs(outputText, "", "", MessageImportance.High);
- BuildEngine.LogMessageEvent(taskEvent);
-
- }
- }
-
- ///
- /// Error Output Event Handler
- ///
- /// Sending process
- /// Error Message
- private void ErrorOutputHandler(object sendingProcess, DataReceivedEventArgs outLine)
- {
- if (!String.IsNullOrEmpty(outLine.Data))
- {
- string outputText = outLine.Data;
- int pos = outputText.IndexOf(": warning:");
- if (pos == -1)
- pos = outputText.IndexOf(": note:");
- int diff = 10;
- int tilde;
- while (pos != -1)
- {
- if (outputText[pos - 1] != ')')
- {
- int end = pos;
- int begin = outputText.LastIndexOf('\n', end) + 1;
- string oldPath = outputText.Substring(begin, end - begin + 1);
- string newPath = oldPath;
- newPath = newPath.Insert(newPath.Length - 1, ")");
- end = newPath.LastIndexOf(":", newPath.Length - 2);
- if (end != -1)
- {
- newPath = newPath.Remove(end, 1);
- newPath = newPath.Insert(end, ",");
- end = newPath.LastIndexOf(":", end - 1);
- if (end != -1)
- {
- if (end > 5)
- {
- newPath = newPath.Remove(end, 1);
- newPath = newPath.Insert(end, "(");
- }
- else
- {
- end = newPath.IndexOf(",", end);
- newPath = newPath.Remove(end, 1);
- newPath = newPath.Insert(end, "(");
- }
-
- tilde = newPath.IndexOf("~");
- if (tilde != -1)
- {
- StringBuilder longPathName = new StringBuilder(1024);
- string shortPathName = newPath.Substring(0, end);
- GetLongPathName(shortPathName, longPathName, longPathName.Capacity);
- newPath = longPathName.ToString() + newPath.Substring(end);
- }
-
- diff += (newPath.Length - oldPath.Length);
- outputText = outputText.Replace(oldPath, newPath);
- }
- }
- }
- pos = outputText.IndexOf(": warning:", pos + diff);
- }
-
- pos = outputText.IndexOf(": error:");
- diff = 8;
- while (pos != -1)
- {
- if (outputText[pos - 1] != ')')
- {
- int end = pos;
- int begin = outputText.LastIndexOf('\n', end) + 1;
- string oldPath = outputText.Substring(begin, end - begin + 1);
- string newPath = oldPath;
- newPath = newPath.Insert(newPath.Length - 1, ")");
- end = newPath.LastIndexOf(":", newPath.Length - 2);
- if (end != -1)
- {
- newPath = newPath.Remove(end, 1);
- newPath = newPath.Insert(end, ",");
- end = newPath.LastIndexOf(":", end - 1);
- if (end != -1)
- {
- if (end > 5)
- {
- newPath = newPath.Remove(end, 1);
- newPath = newPath.Insert(end, "(");
- }
- else
- {
- end = newPath.IndexOf(",", end);
- newPath = newPath.Remove(end, 1);
- newPath = newPath.Insert(end, "(");
- }
-
- tilde = newPath.IndexOf("~");
- if (tilde != -1)
- {
- StringBuilder longPathName = new StringBuilder(1024);
- string shortPathName = newPath.Substring(0, end);
- GetLongPathName(shortPathName, longPathName, longPathName.Capacity);
- newPath = longPathName.ToString() + newPath.Substring(end);
- }
-
- diff += (newPath.Length - oldPath.Length);
- outputText = outputText.Replace(oldPath, newPath);
- }
- }
- }
- pos = outputText.IndexOf(": error:", pos + diff);
- }
-
- tilde = outputText.IndexOf("~");
- while (tilde != -1)
- {
- int end = outputText.IndexOf(':', tilde);
- int end1 = outputText.IndexOf(' ', tilde);
- int end2 = outputText.IndexOf('\n', tilde);
- if ((end == -1) && (end1 == -1) && (end2 == -1))
- break;
- if (end == -1)
- end = outputText.Length - 1;
- if (end1 == -1)
- end1 = outputText.Length - 1;
- if (end2 == -1)
- end2 = outputText.Length - 1;
- if (end > end1)
- end = end1;
- if (end > end2)
- end = end2;
- int begin = outputText.LastIndexOf('\n', tilde) + 1;
- int begin1 = outputText.LastIndexOf(' ', tilde) + 1;
- if (begin < begin1)
- begin = begin1;
- StringBuilder longPathName = new StringBuilder(1024);
- string shortPathName = outputText.Substring(begin, end - begin);
- GetLongPathName(shortPathName, longPathName, longPathName.Capacity);
- if (longPathName.ToString() == "")
- {
- int sep = shortPathName.LastIndexOf('/');
- int sep2 = shortPathName.LastIndexOf('\\');
- if (sep2 > sep)
- sep = sep2;
- if (sep != -1)
- {
- shortPathName = shortPathName.Remove(sep + 1);
- GetLongPathName(shortPathName, longPathName, longPathName.Capacity);
- }
- }
- if (longPathName.ToString() != "")
- outputText = outputText.Replace(shortPathName, longPathName.ToString());
-
- tilde = outputText.IndexOf("~", tilde + 1);
- }
-
- /// Send build output to the Output window and to the ErrorList window
- if (outputText.IndexOf(": error:") > 0)
- {
- string fileName = outputText.Substring(0, outputText.IndexOf(": error:"));
- int lineNum = 0;
-
- int ini = fileName.IndexOf('(') + 1;
- int end = fileName.IndexOf(')');
-
- if (fileName.IndexOf(',', ini) > 0)
- {
- if (fileName.IndexOf(',', ini) < end)
- {
- end = fileName.IndexOf(',', ini);
- }
- }
- end = end - fileName.IndexOf('(') - 1;
-
- try
- {
- lineNum = Convert.ToInt16(fileName.Substring(ini, end));
- }
- catch
- {
- lineNum = 0;
- }
-
- int colNum = 0;
- string messageErr = outputText.Substring(outputText.IndexOf(": error:") + 9);
- fileName = fileName.Substring(0, fileName.IndexOf('('));
- BuildErrorEventArgs errorEvent = new BuildErrorEventArgs("", "", fileName, lineNum, colNum, 0, 0, messageErr, "", "");
- BuildEngine.LogErrorEvent(errorEvent);
- }
- else if (outputText.IndexOf(": warning:") > 0)
- {
- string fileName = outputText.Substring(0, outputText.IndexOf(": warning:"));
- int lineNum = 0;
-
- int ini = fileName.IndexOf('(') + 1;
- int end = fileName.IndexOf(')');
- if (fileName.IndexOf(',', ini) > 0)
- {
- if (fileName.IndexOf(',', ini) < end)
- {
- end = fileName.IndexOf(',', ini);
- }
- }
- end = end - fileName.IndexOf('(') - 1;
-
- try
- {
- lineNum = Convert.ToInt16(fileName.Substring(ini, end));
- }
- catch
- {
- lineNum = 0;
- }
-
- int colNum = 0;
- string messageErr = outputText.Substring(outputText.IndexOf(": warning:") + 11);
- fileName = fileName.Substring(0, fileName.IndexOf('('));
- BuildWarningEventArgs warningEvent = new BuildWarningEventArgs("", "", fileName, lineNum, colNum, 0, 0, messageErr, "", "");
- BuildEngine.LogWarningEvent(warningEvent);
- }
- else if (outputText.Contains("undefined reference"))
- {
- Regex re = new Regex(@":\d+:");
- Match m = re.Match(outputText);
- string fileName = "";
- int lineNum = 0;
- string message = "";
-
- if (m.Success)
- {
- fileName = outputText.Substring(0, m.Index);
- try
- {
- lineNum = Convert.ToInt16(m.Value.Trim(':'));
- }
- catch
- {
- lineNum = 0;
- }
- message = outputText.Substring(m.Index + m.Length).Trim();
- }
- else
- {
- lineNum = 0;
- fileName = outputText.Substring(0, outputText.IndexOf(':'));
- message = outputText.Substring(outputText.LastIndexOf(':') + 1).Trim();
- }
-
- BuildErrorEventArgs errorEvent = new BuildErrorEventArgs("", "", fileName, lineNum, 1, 0, 0, message, "", "");
- BuildEngine.LogErrorEvent(errorEvent);
- }
- else
- {
- BuildMessageEventArgs taskEvent = new BuildMessageEventArgs(outputText, "", "", MessageImportance.High);
- BuildEngine.LogMessageEvent(taskEvent);
- }
-
- // Add the text to the collected output.
- errorOutput.Append(Environment.NewLine + outputText);
- }
- }
-
-
- /// GDB works with short path names only, which requires converting the path names to/from long ones. This function
- /// returns the long path name for a given short one.
- /// Short path name.
- /// Returns this long path name.
- /// Lenght of this long path name.
- ///
- [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
- public static extern int GetLongPathName(
- [MarshalAs(UnmanagedType.LPTStr)]
- string path,
- [MarshalAs(UnmanagedType.LPTStr)]
- StringBuilder longPath,
- int longPathLength
- );
-
- [Required]
- public string ProjectDir
- {
- set { _projectDir = value.Replace('\\', '/'); }
- get { return _projectDir; }
- }
-
- [Required]
- public string OutDir
- {
- set { _outDir = value.Replace('\\', '/'); }
- get { return _outDir; }
- }
-
- [Required]
- public string ToolsPath
- {
- get;
- set;
- }
-
- ///
- /// Perform Cancel Code
- ///
- public void Cancel()
- {
- try
- {
- proc.Kill();
- }
- catch (Exception ex)
- {
- BuildMessageEventArgs taskEvent2 = new BuildMessageEventArgs(ex.Message, "", "", MessageImportance.High);
- BuildEngine.LogMessageEvent(taskEvent2);
- }
-
- }
- }
-}
diff --git a/src/VSNDK.Tasks/PackagerCmdBuilder.cs b/src/VSNDK.Tasks/PackagerCmdBuilder.cs
deleted file mode 100644
index 37b9b905..00000000
--- a/src/VSNDK.Tasks/PackagerCmdBuilder.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Build.Utilities;
-
-namespace VSNDK.Tasks
-{
- class PackagerCmdBuilder : CommandLineBuilder
- {
-
- ///
- /// Constructor
- ///
- public PackagerCmdBuilder()
- : base(true)
- {
- }
-
- ///
- /// Override of IsQuotingRequired function. Always return true.
- ///
- ///
- ///
- protected override bool IsQuotingRequired(string parameter)
- {
- return true;
- }
- }
-}
diff --git a/src/VSNDK.Tasks/Properties/AssemblyInfo.cs b/src/VSNDK.Tasks/Properties/AssemblyInfo.cs
deleted file mode 100644
index ebb81dcb..00000000
--- a/src/VSNDK.Tasks/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("VSNDK.Tasks")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("BlackBerry")]
-[assembly: AssemblyProduct("VSNDK.Tasks")]
-[assembly: AssemblyCopyright("Copyright © BlackBerry 2011")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("d4362271-7b17-4734-86bb-39564f3e29fc")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/src/VSNDK.Tasks/Properties/Resources.Designer.cs b/src/VSNDK.Tasks/Properties/Resources.Designer.cs
deleted file mode 100644
index fac27f14..00000000
--- a/src/VSNDK.Tasks/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.18408
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace VSNDK.Tasks.Properties {
- using System;
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources() {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VSNDK.Tasks.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- ///
- /// Looks up a localized string similar to # This file is automatically generated by vs-ndk.
- ///# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
- ///#
- ///# This file must *NOT* be checked in Version Control Systems,
- ///# as it contains information specific to your local configuration.
- ///
- ///# location of the SDK. This is only used by Ant
- ///# For customization when using a Version Control System, please read the
- ///# header note.
- ///sdk.dir={SDKDIR}.
- ///
- internal static string localproperties_ant_file {
- get {
- return ResourceManager.GetString("localproperties_ant_file", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Tracking command:.
- ///
- internal static string Native_TrackingCommandMessage {
- get {
- return ResourceManager.GetString("Native_TrackingCommandMessage", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to MSB8016: Can not turn on Unicode output for "{0}". Some Unicode characters will be improperly displayed..
- ///
- internal static string TrackedVCToolTask_CreateUnicodeOutputPipeFailed {
- get {
- return ResourceManager.GetString("TrackedVCToolTask.CreateUnicodeOutputPipeFailed", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Forcing rebuild of all source files due to a change in the command line since the last build..
- ///
- internal static string TrackedVCToolTask_RebuildingAllSourcesCommandLineChanged {
- get {
- return ResourceManager.GetString("TrackedVCToolTask.RebuildingAllSourcesCommandLineChanged", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to MSB8014: Forcing a rebuild of all sources due to an error with the tracking logs. {0}.
- ///
- internal static string TrackedVCToolTask_RebuildingDueToInvalidTLog {
- get {
- return ResourceManager.GetString("TrackedVCToolTask.RebuildingDueToInvalidTLog", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to MSB8015: Forcing a rebuild of all source files due to the contents of "{0}" being invalid..
- ///
- internal static string TrackedVCToolTask_RebuildingDueToInvalidTLogContents {
- get {
- return ResourceManager.GetString("TrackedVCToolTask.RebuildingDueToInvalidTLogContents", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Forcing rebuild of all source files due to missing command tlog "{0}"..
- ///
- internal static string TrackedVCToolTask_RebuildingNoCommandTLog {
- get {
- return ResourceManager.GetString("TrackedVCToolTask.RebuildingNoCommandTLog", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Forcing rebuild of source file "{0}" due to a change in the command line since the last build..
- ///
- internal static string TrackedVCToolTask_RebuildingSourceCommandLineChanged {
- get {
- return ResourceManager.GetString("TrackedVCToolTask.RebuildingSourceCommandLineChanged", resourceCulture);
- }
- }
- }
-}
diff --git a/src/VSNDK.Tasks/QccCompiler.cs b/src/VSNDK.Tasks/QccCompiler.cs
deleted file mode 100644
index 45fc19bd..00000000
--- a/src/VSNDK.Tasks/QccCompiler.cs
+++ /dev/null
@@ -1,513 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Build.Utilities;
-using Microsoft.Build.CPPTasks;
-using System.Resources;
-using System.Reflection;
-using Microsoft.Build.Framework;
-using System.Collections;
-using System.IO;
-
-namespace VSNDK.Tasks
-{
- public class QccCompiler : VSNDKTasks
- {
- #region fields
- // Fields
- private ITaskItem[] preprocessOutput;
-
- //constant fields
- private const string ADDITIONAL_INCLUDEDIRECTORIES = "AdditionalIncludeDirectories";
- private const string PREPROCESSOR_DEFINITIONS = "PreprocessorDefinitions";
- private const string UNDEFINE_PREPROCESSOR_DEFINITION = "UndefinePreprocessorDefinition";
- private const string PREPROCESS_TO_FILE = "PreprocessToFile";
- private const string PREPROCESS_TO_STDOUT = "PreprocessToStdout";
- private const string PREPROCESS_KEEP_COMMENTS = "PreprocessKeepComments";
- private const string RUNTIME_TYPE_INFO = "RuntimeTypeInfo";
- private const string OBJECT_FILE_NAME = "ObjectFileName";
- private const string ANSI = "Ansi";
- #endregion
-
- #region ctors
- public QccCompiler()
- : base(new ResourceManager("VSNDK.Tasks.Properties.Resources", Assembly.GetExecutingAssembly()))
- {
- this.preprocessOutput = new ITaskItem[0];
- this.switchOrderList.Add(ADDITIONAL_INCLUDEDIRECTORIES);
- this.switchOrderList.Add(ANSI);
- this.switchOrderList.Add(PREPROCESSOR_DEFINITIONS);
- this.switchOrderList.Add(UNDEFINE_PREPROCESSOR_DEFINITION);
- this.switchOrderList.Add(PREPROCESS_TO_FILE);
- this.switchOrderList.Add(PREPROCESS_TO_STDOUT);
- this.switchOrderList.Add(PREPROCESS_KEEP_COMMENTS);
- this.switchOrderList.Add(RUNTIME_TYPE_INFO);
- this.switchOrderList.Add(OBJECT_FILE_NAME);
- this.switchOrderList.Add(SOURCES);
- }
- #endregion
-
- #region overrides
- ///
- /// Getter/Setter for the AlwaysAppend property
- ///
- protected override string AlwaysAppend
- {
- get
- {
- return LinkSharedLibrary ? "-c -shared" : "-c";
- }
- }
-
- ///
- /// Getter/Setter for the AttributeFileTracking property
- ///
- public override bool AttributeFileTracking
- {
- get
- {
- return true;
- }
- }
-
- ///
- /// Getter/Setter for the TrackedInputFiles property
- ///
- protected override Microsoft.Build.Framework.ITaskItem[] TrackedInputFiles
- {
- get
- {
- return Sources;
- }
- }
-
- ///
- /// Execute the specified tool for building
- ///
- ///
- ///
- ///
- ///
- protected override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands)
- {
- foreach (ITaskItem item in this.Sources)
- {
- string source = item.ItemSpec;
- base.LogEventsFromTextOutput(source, MessageImportance.High);
- }
- return base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands);
- }
-
- ///
- /// Getter/Setter for the WriteTLogNames property
- ///
- protected override string[] WriteTLogNames
- {
- get
- {
- return new string[] { "qcc_compiler.write.1.tlog", "qcc_compiler.*.write.1.tlog" };
- }
- }
-
- ///
- /// Getter/Setter for the CommandTLogName property
- ///
- protected override string CommandTLogName
- {
- get
- {
- return "qcc_compiler.command.1.tlog";
- }
- }
-
- ///
- /// Getter/Setter for the ReadTLogNames property
- ///
- protected override string[] ReadTLogNames
- {
- get
- {
- return new string[] { "qcc_compiler.read.1.tlog", "qcc_compiler.*.read.1.tlog" };
- }
- }
- #endregion //override
-
- #region properties
-
- ///
- /// GetterSetter for the AdditionalIncludeDirectories property.
- ///
- public string[] AdditionalIncludeDirectories
- {
- get
- {
- if (base.IsPropertySet(ADDITIONAL_INCLUDEDIRECTORIES))
- {
- return base.ActiveToolSwitches[ADDITIONAL_INCLUDEDIRECTORIES].StringList;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(ADDITIONAL_INCLUDEDIRECTORIES);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.StringArray)
- {
- DisplayName = "Additional Include Directories",
- Description = "Specifies one or more directories to add to the include path; separate with semi-colons if more than one. (-I[path])",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-I",
- Name = ADDITIONAL_INCLUDEDIRECTORIES,
- StringList = value
- };
- base.ActiveToolSwitches.Add(ADDITIONAL_INCLUDEDIRECTORIES, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the Ansi property
- ///
- public bool Ansi
- {
- get
- {
- return (base.IsPropertySet(ANSI) && base.ActiveToolSwitches[ANSI].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(ANSI);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Compile ANSI code",
- Description = "Compile ansi code",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-ansi",
- Name = ANSI,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(ANSI, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the MinimalRebuild property
- ///
- public virtual bool MinimalRebuild
- {
- get
- {
- return (base.IsPropertySet("MinimalRebuild") && base.ActiveToolSwitches["MinimalRebuild"].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove("MinimalRebuild");
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Enable Minimal Rebuild",
- Description = "Enables minimal rebuild, which determines whether C++ source files that include changed C++ class definitions (stored in header (.h) files) need to be recompiled.",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "/Gm",
- ReverseSwitchValue = "/Gm-",
- Name = "MinimalRebuild",
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add("MinimalRebuild", switch2);
- base.AddActiveSwitchToolValue(switch2);
- switch2.Overrides.AddLast(new KeyValuePair("Gm", "Gm-"));
- switch2.Overrides.AddLast(new KeyValuePair("Gm-", "Gm"));
- }
- }
-
- ///
- /// Getter/Setter for the ObjectFileName property
- ///
- public string ObjectFileName
- {
- get
- {
- if (base.IsPropertySet(OBJECT_FILE_NAME))
- {
- return base.ActiveToolSwitches[OBJECT_FILE_NAME].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(OBJECT_FILE_NAME);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.File)
- {
- DisplayName = "Object File Name",
- Description = "Specifies a name to override the default object file name; can be file or directory name. (-o[name])",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-o",
- Name = OBJECT_FILE_NAME,
- Value = value
- };
- base.ActiveToolSwitches.Add(OBJECT_FILE_NAME, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the ExpandAttributedSource property
- ///
- public bool ExpandAttributedSource
- {
- get
- {
- return (base.IsPropertySet("ExpandAttributedSource") && base.ActiveToolSwitches["ExpandAttributedSource"].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove("ExpandAttributedSource");
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Expand Attributed Source",
- Description = "Create listing file with expanded attributes injected into source file. (/Fx)",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "/Fx",
- Name = "ExpandAttributedSource",
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add("ExpandAttributedSource", switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the FavorSizeOrSpeed property
- ///
- public string FavorSizeOrSpeed
- {
- get
- {
- if (base.IsPropertySet("FavorSizeOrSpeed"))
- {
- return base.ActiveToolSwitches["FavorSizeOrSpeed"].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove("FavorSizeOrSpeed");
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.String)
- {
- DisplayName = "Favor Size Or Speed",
- Description = "Whether to favor code size or code speed; 'Global Optimization' must be turned on. (/Ot, /Os)",
- ArgumentRelationList = new ArrayList()
- };
- string[][] switchMap = new string[][] { new string[] { "Size", "/Os" }, new string[] { "Speed", "/Ot" }, new string[] { "Neither", "" } };
- switch2.SwitchValue = base.ReadSwitchMap("FavorSizeOrSpeed", switchMap, value);
- switch2.Name = "FavorSizeOrSpeed";
- switch2.Value = value;
- switch2.MultiValues = true;
- base.ActiveToolSwitches.Add("FavorSizeOrSpeed", switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the PreprocessKeepComments property
- ///
- public bool PreprocessKeepComments
- {
- get
- {
- return (base.IsPropertySet(PREPROCESS_KEEP_COMMENTS) && base.ActiveToolSwitches[PREPROCESS_KEEP_COMMENTS].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(PREPROCESS_KEEP_COMMENTS);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Keep Comments",
- Description = "Suppresses comment strip from source code; requires that one of the 'Preprocessing' options be set. (-C)",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-C",
- Name = PREPROCESS_KEEP_COMMENTS,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(PREPROCESS_KEEP_COMMENTS, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for hte PreprocessorDefinitions property
- ///
- public string[] PreprocessorDefinitions
- {
- get
- {
- if (base.IsPropertySet(PREPROCESSOR_DEFINITIONS))
- {
- return base.ActiveToolSwitches[PREPROCESSOR_DEFINITIONS].StringList;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(PREPROCESSOR_DEFINITIONS);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.StringArray)
- {
- DisplayName = "Preprocessor Definitions",
- Description = "Defines a preprocessing symbols for your source file.",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-D",
- Name = PREPROCESSOR_DEFINITIONS,
- StringList = value
- };
- base.ActiveToolSwitches.Add(PREPROCESSOR_DEFINITIONS, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the PreprocessOutput property
- ///
- [Output]
- public ITaskItem[] PreprocessOutput
- {
- get
- {
- return this.preprocessOutput;
- }
- set
- {
- this.preprocessOutput = value;
- }
- }
-
- ///
- /// Getter/Setter for the PreprocessOutputPath
- ///
- public string PreprocessOutputPath
- {
- get
- {
- if (base.IsPropertySet(PREPROCESS_TO_STDOUT))
- {
- return base.ActiveToolSwitches[PREPROCESS_TO_STDOUT].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(PREPROCESS_TO_STDOUT);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.String)
- {
- DisplayName = "Preprocess Output Path",
- Description = "Specify the output path for the preprocesser. The default location is the same as the source file(s).",
- ArgumentRelationList = new ArrayList(),
- Name = PREPROCESS_TO_STDOUT,
- Value = value,
- SwitchValue = "E"
- };
- base.ActiveToolSwitches.Add(PREPROCESS_TO_STDOUT, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the PreprocessSuppressLineNumbers property
- ///
- public bool PreprocessSuppressLineNumbers
- {
- get
- {
- return (base.IsPropertySet("PreprocessSuppressLineNumbers") && base.ActiveToolSwitches["PreprocessSuppressLineNumbers"].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove("PreprocessSuppressLineNumbers");
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Preprocess Suppress Line Numbers",
- Description = "Preprocess without #line directives.",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "/EP",
- Name = "PreprocessSuppressLineNumbers",
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add("PreprocessSuppressLineNumbers", switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the PreprocessToFile property
- ///
- public bool PreprocessToFile
- {
- get
- {
- return (base.IsPropertySet(PREPROCESS_TO_FILE) && base.ActiveToolSwitches[PREPROCESS_TO_FILE].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(PREPROCESS_TO_FILE);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Preprocess to a File",
- Description = "Preprocesses C and C++ source files and writes the preprocessed output to a file. This option suppresses compilation, thus it does not produce an .obj file.",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-P",
- Name = PREPROCESS_TO_FILE,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(PREPROCESS_TO_FILE, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the UndefinePreprocessorDefinition property
- ///
- public string[] UndefinePreprocessorDefinition
- {
- get
- {
- if (base.IsPropertySet(UNDEFINE_PREPROCESSOR_DEFINITION))
- {
- return base.ActiveToolSwitches[UNDEFINE_PREPROCESSOR_DEFINITION].StringList;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(UNDEFINE_PREPROCESSOR_DEFINITION);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.StringArray)
- {
- DisplayName = "Undefine Preprocessor Definitions",
- Description = "Specifies one or more preprocessor undefines. (-U[macro])",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-U",
- Name = UNDEFINE_PREPROCESSOR_DEFINITION,
- StringList = value
- };
- base.ActiveToolSwitches.Add(UNDEFINE_PREPROCESSOR_DEFINITION, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- public bool RuntimeTypeInfo { get; set; }
- public bool ShortEnums { get; set; }
- #endregion //properties
- }
-}
diff --git a/src/VSNDK.Tasks/QccLib.cs b/src/VSNDK.Tasks/QccLib.cs
deleted file mode 100644
index e446e89b..00000000
--- a/src/VSNDK.Tasks/QccLib.cs
+++ /dev/null
@@ -1,244 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Build.CPPTasks;
-using System.Resources;
-using System.Reflection;
-using System.Collections;
-
-namespace VSNDK.Tasks
-{
- public class QccLib : VSNDKTasks
- {
- #region Member Variables and Constants
- private const string ADDITIONAL_DEPENDENCIES = "AdditionalDependencies";
- private const string ADDITIONAL_LIB_DIR = "AdditionalLibraryDirectories";
- private const string OUTPUT_FILE = "OutputFile";
- private const string LINK_STATIC = "LinkStatic";
- private const string TREAT_LIB_WARNING_AS_ERROR = "TreatLibWarningAsErrors";
- #endregion
-
- ///
- /// QccLib Constructor
- ///
- public QccLib()
- : base(new ResourceManager("VSNDK.Tasks.Properties.Resources", Assembly.GetExecutingAssembly()))
- {
- this.switchOrderList.Add(ADDITIONAL_DEPENDENCIES);
- this.switchOrderList.Add(ADDITIONAL_LIB_DIR);
- this.switchOrderList.Add(TREAT_LIB_WARNING_AS_ERROR);
- this.switchOrderList.Add(OUTPUT_FILE);
- this.switchOrderList.Add(SOURCES);
- }
-
- #region overrides
-
- ///
- /// Getter/Setter for the AlwaysAppend property
- ///
- protected override string AlwaysAppend
- {
- get
- {
- return string.Empty;
- }
- }
-
- ///
- /// Getter/Setter for the CommandTLogName property
- ///
- protected override string CommandTLogName
- {
- get { return "qcc_lib.command.1.tlog"; }
- }
-
- ///
- /// Getter/Setter for the ReadTLogNames property
- ///
- protected override string[] ReadTLogNames
- {
- get { return new string[] { "qcc_lib.read.1.tlog", "qcc_lib.*.read.1.tlog" }; }
- }
-
- ///
- /// Getter/Setter for the WriteTLogNames
- ///
- protected override string[] WriteTLogNames
- {
- get
- {
- return new string[] { "qcc_lib.write.1.tlog", "qcc_lib.*.write.1.tlog" };
- }
- }
-
- ///
- /// Method return the EnhancedSecuritySwitch
- ///
- ///
- protected override string GetEnhancedSecuritySwitchValue()
- {
- return string.Empty;
- }
- #endregion overrides
-
- #region properties
- ///
- /// Getter/Setter for the LinkStatic property
- ///
- public bool LinkStatic
- {
- get
- {
- return (base.IsPropertySet(LINK_STATIC) && base.ActiveToolSwitches[LINK_STATIC].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(LINK_STATIC);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Link Static",
- Description = "Static link Lib",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-static",
- Name = LINK_STATIC,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(LINK_STATIC, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the AdditionalDependencies property
- ///
- public virtual string[] AdditionalDependencies
- {
- get
- {
- if (base.IsPropertySet(ADDITIONAL_DEPENDENCIES))
- {
- return base.ActiveToolSwitches[ADDITIONAL_DEPENDENCIES].StringList;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(ADDITIONAL_DEPENDENCIES);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.StringArray)
- {
- DisplayName = "Additional Dependencies",
- Description = "Specifies additional items to add to the link command line [i.e. bps] ",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-l",
- Name = ADDITIONAL_DEPENDENCIES,
- StringList = value
- };
- base.ActiveToolSwitches.Add(ADDITIONAL_DEPENDENCIES, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the AdditionalLibraryDirectories property
- ///
- public virtual string[] AdditionalLibraryDirectories
- {
- get
- {
- if (base.IsPropertySet(ADDITIONAL_LIB_DIR))
- {
- return base.ActiveToolSwitches[ADDITIONAL_LIB_DIR].StringList;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(ADDITIONAL_LIB_DIR);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.StringArray)
- {
- DisplayName = "Additional Library Directories",
- Description = "Allows the user to override the environmental library path (-Lfolder)",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-L",
- Name = ADDITIONAL_LIB_DIR,
- StringList = value
- };
- base.ActiveToolSwitches.Add(ADDITIONAL_LIB_DIR, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the TreatLibWarningAsErrors property
- ///
- public virtual bool TreatLibWarningAsErrors
- {
- get
- {
- return (base.IsPropertySet(TREAT_LIB_WARNING_AS_ERROR) && base.ActiveToolSwitches[TREAT_LIB_WARNING_AS_ERROR].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(TREAT_LIB_WARNING_AS_ERROR);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Treat Lib Warning As Errors",
- Description = "-Werror causes no output file to be generated if lib generates a warning.",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-Werror",
- Name = TREAT_LIB_WARNING_AS_ERROR,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(TREAT_LIB_WARNING_AS_ERROR, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// GetterSetter for the OutputFile property
- ///
- public virtual string OutputFile
- {
- get
- {
- if (base.IsPropertySet(OUTPUT_FILE))
- {
- return base.ActiveToolSwitches[OUTPUT_FILE].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(OUTPUT_FILE);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.File)
- {
- //Separator = ":",
- DisplayName = "Output File",
- Description = "The -A option overrides the default name and location of the program that the linker creates.",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-A ",
- Name = OUTPUT_FILE,
- Value = value
- };
- base.ActiveToolSwitches.Add(OUTPUT_FILE, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
- #endregion properties
- }
-}
diff --git a/src/VSNDK.Tasks/QccLink.cs b/src/VSNDK.Tasks/QccLink.cs
deleted file mode 100644
index cc8eda2f..00000000
--- a/src/VSNDK.Tasks/QccLink.cs
+++ /dev/null
@@ -1,401 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Build.CPPTasks;
-using System.Resources;
-using System.Reflection;
-using Microsoft.Build.Framework;
-using System.Collections;
-using Microsoft.Build.Utilities;
-using System.IO;
-
-namespace VSNDK.Tasks
-{
- public class QccLink : VSNDKTasks
- {
- #region Member Variables and Constants
- private const string ADDITIONAL_DEPENDENCIES = "AdditionalDependencies";
- private const string LINK_ERROR_REPORTING = "LinkErrorReporting";
- private const string ADDITIONAL_LIB_DIR = "AdditionalLibraryDirectories";
- private const string GENERATE_MAP_FILE = "GenerateMapFile";
- private const string IGNORE_ALL_DEFAULT_LIB = "IgnoreAllDefaultLibraries";
- private const string IGNOR_ALL_DEFAULT_CPP_LIB = "IgnoreAllDefaultCppLibraries";
- private const string LINK_INCREMENTAL = "LinkIncremental";
- private const string LINK_STATUS = "LinkStatus";
- private const string LINK_LIB_DEP = "LinkLibraryDependencies";
- private const string OUTPUT_FILE = "OutputFile";
- private const string TREAT_LINK_WARNING_AS_ERR = "TreatLinkerWarningAsErrors";
- #endregion
-
- ///
- /// QccLink Constructor
- ///
- public QccLink()
- : base(new ResourceManager("VSNDK.Tasks.Properties.Resources", Assembly.GetExecutingAssembly()))
- {
- this.switchOrderList.Add(ADDITIONAL_DEPENDENCIES);
- this.switchOrderList.Add(LINK_ERROR_REPORTING);
- this.switchOrderList.Add(ADDITIONAL_LIB_DIR);
- this.switchOrderList.Add(GENERATE_MAP_FILE);
- this.switchOrderList.Add(IGNORE_ALL_DEFAULT_LIB);
- this.switchOrderList.Add(IGNOR_ALL_DEFAULT_CPP_LIB);
- this.switchOrderList.Add(LINK_INCREMENTAL);
- this.switchOrderList.Add(LINK_STATUS);
- this.switchOrderList.Add(LINK_LIB_DEP);
- this.switchOrderList.Add(OUTPUT_FILE);
- this.switchOrderList.Add(TREAT_LINK_WARNING_AS_ERR);
- this.switchOrderList.Add(SOURCES);
- }
-
- #region overrides
-
- ///
- /// Getter/Setter for AlwaysAppend property
- ///
- protected override string AlwaysAppend
- {
- get
- {
- return LinkSharedLibrary? "-shared" : string.Empty;
- }
- }
-
- ///
- /// Getter/Setter for CommandTLogName property
- ///
- protected override string CommandTLogName
- {
- get { return "qcc_linker.command.1.tlog"; }
- }
-
- ///
- /// Getter/Setter for ReadTLog
- ///
- protected override string[] ReadTLogNames
- {
- get { return new string[] { "qcc_linker.read.1.tlog", "qcc_linker.*.read.1.tlog" }; }
- }
-
- ///
- /// Getter/Setter WriteTLogNames property
- ///
- protected override string[] WriteTLogNames
- {
- get
- {
- return new string[] { "qcc_linker.write.1.tlog", "qcc_linker.*.write.1.tlog" };
- }
- }
-
- ///
- /// Function to return the Enhanced Security value.
- ///
- ///
- protected override string GetEnhancedSecuritySwitchValue()
- {
- return "-Wl,-z,relro -Wl,-z,now";
- }
- #endregion
-
- #region properties
-
- ///
- /// Getter/Setter for the AdditionalDependencies property
- ///
- public virtual string[] AdditionalDependencies
- {
- get
- {
- if (base.IsPropertySet(ADDITIONAL_DEPENDENCIES))
- {
- return base.ActiveToolSwitches[ADDITIONAL_DEPENDENCIES].StringList;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(ADDITIONAL_DEPENDENCIES);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.StringArray)
- {
- DisplayName = "Additional Dependencies",
- Description = "Specifies additional items to add to the link command line [i.e. bps] ",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-l",
- Name = ADDITIONAL_DEPENDENCIES,
- StringList = value
- };
- base.ActiveToolSwitches.Add(ADDITIONAL_DEPENDENCIES, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the AdditionalLibraryDirectories property
- ///
- public virtual string[] AdditionalLibraryDirectories
- {
- get
- {
- if (base.IsPropertySet(ADDITIONAL_LIB_DIR))
- {
- return base.ActiveToolSwitches[ADDITIONAL_LIB_DIR].StringList;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(ADDITIONAL_LIB_DIR);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.StringArray)
- {
- DisplayName = "Additional Library Directories",
- Description = "Allows the user to override the environmental library path (-Lfolder)",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-L",
- Name = ADDITIONAL_LIB_DIR,
- StringList = value
- };
- base.ActiveToolSwitches.Add(ADDITIONAL_LIB_DIR, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the GenerateMapFile property
- ///
- public virtual bool GenerateMapFile
- {
- get
- {
- return (base.IsPropertySet(GENERATE_MAP_FILE) && base.ActiveToolSwitches[GENERATE_MAP_FILE].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(GENERATE_MAP_FILE);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Generate Map File",
- Description = "The -M option tells the linker to create a mapfile.",
- ArgumentRelationList = new ArrayList()
- };
- switch2.ArgumentRelationList.Add(new ArgumentRelation("MapFileName", "true", false, ""));
- switch2.SwitchValue = "-M";
- switch2.Name = GENERATE_MAP_FILE;
- switch2.BooleanValue = value;
- base.ActiveToolSwitches.Add(GENERATE_MAP_FILE, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the IgnoreAllDefaultLibraries
- ///
- public virtual bool IgnoreAllDefaultLibraries
- {
- get
- {
- return (base.IsPropertySet(IGNORE_ALL_DEFAULT_LIB) && base.ActiveToolSwitches[IGNORE_ALL_DEFAULT_LIB].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(IGNORE_ALL_DEFAULT_LIB);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Ignore All Default Libraries",
- Description = "The -nostdlib option tells the linker to remove one or more default libraries from the list of libraries it searches when resolving external references. ",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-nostdlib",
- Name = IGNORE_ALL_DEFAULT_LIB,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(IGNORE_ALL_DEFAULT_LIB, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the IgnoreAllDefaultCppLibraries property
- ///
- public virtual bool IgnoreAllDefaultCppLibraries
- {
- get
- {
- return (base.IsPropertySet(IGNOR_ALL_DEFAULT_CPP_LIB) && base.ActiveToolSwitches[IGNOR_ALL_DEFAULT_CPP_LIB].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(IGNOR_ALL_DEFAULT_CPP_LIB);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Ignore All Default C++ Libraries",
- Description = "The -nostdlib++ option tells the linker to remove one or more default libraries from the list of libraries it searches when resolving external references. ",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-nostdlib++",
- Name = IGNOR_ALL_DEFAULT_CPP_LIB,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(IGNOR_ALL_DEFAULT_CPP_LIB, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the LinkIncremental Property
- ///
- public virtual bool LinkIncremental
- {
- get
- {
- return (base.IsPropertySet(LINK_INCREMENTAL) && base.ActiveToolSwitches[LINK_INCREMENTAL].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(LINK_INCREMENTAL);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Enable Incremental Linking",
- Description = "Enables incremental linking. (/INCREMENTAL, /INCREMENTAL:NO)",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "/INCREMENTAL",
- ReverseSwitchValue = "/INCREMENTAL:NO",
- Name = LINK_INCREMENTAL,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(LINK_INCREMENTAL, switch2);
- base.AddActiveSwitchToolValue(switch2);
- switch2.Overrides.AddLast(new KeyValuePair("INCREMENTAL", "INCREMENTAL:NO"));
- switch2.Overrides.AddLast(new KeyValuePair("INCREMENTAL:NO", "INCREMENTAL"));
- }
- }
-
- ///
- /// Getter/Setter for the LinkStatus property
- ///
- public virtual bool LinkStatus
- {
- get
- {
- return (base.IsPropertySet(LINK_STATUS) && base.ActiveToolSwitches[LINK_STATUS].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(LINK_STATUS);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Link Status",
- Description = "Specifies whether the linker should display a progress indicator showing what percentage of the link is complete. The default is to not display this status information. (/LTCG:STATUS|LTCG:NOSTATUS)",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "/LTCG:STATUS",
- ReverseSwitchValue = "/LTCG:NOSTATUS",
- Name = LINK_STATUS,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(LINK_STATUS, switch2);
- base.AddActiveSwitchToolValue(switch2);
- switch2.Overrides.AddLast(new KeyValuePair("LTCG:STATUS", "LTCG:NOSTATUS"));
- switch2.Overrides.AddLast(new KeyValuePair("LTCG:NOSTATUS", "LTCG:STATUS"));
- }
- }
-
- ///
- /// Getter/Setter for the LinkLibraryDependencies
- ///
- public virtual bool LinkLibraryDependencies
- {
- get
- {
- return (base.IsPropertySet(LINK_LIB_DEP) && base.ActiveToolSwitches[LINK_LIB_DEP].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(LINK_LIB_DEP);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Link Library Dependencies",
- Description = "Specifies whether or not library outputs from project dependencies are automatically linked in.",
- ArgumentRelationList = new ArrayList(),
- Name = LINK_LIB_DEP,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(LINK_LIB_DEP, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the OutputFile property
- ///
- public virtual string OutputFile
- {
- get
- {
- if (base.IsPropertySet(OUTPUT_FILE))
- {
- return base.ActiveToolSwitches[OUTPUT_FILE].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(OUTPUT_FILE);
-
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.File)
- {
- DisplayName = "Output File",
- Description = "The -o option overrides the default name and location of the program that the linker creates.",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-o ",
- Name = OUTPUT_FILE,
- Value = value
- };
- base.ActiveToolSwitches.Add(OUTPUT_FILE, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the TreatLinkerWarningAsErrors property.
- ///
- public virtual bool TreatLinkerWarningAsErrors
- {
- get
- {
- return (base.IsPropertySet(TREAT_LINK_WARNING_AS_ERR) && base.ActiveToolSwitches[TREAT_LINK_WARNING_AS_ERR].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(TREAT_LINK_WARNING_AS_ERR);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Treat Linker Warning As Errors",
- Description = "/WX causes no output file to be generated if the linker generates a warning.",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "/WX",
- ReverseSwitchValue = "/WX:NO",
- Name = TREAT_LINK_WARNING_AS_ERR,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(TREAT_LINK_WARNING_AS_ERR, switch2);
- base.AddActiveSwitchToolValue(switch2);
- switch2.Overrides.AddLast(new KeyValuePair("WX", "WX:NO"));
- switch2.Overrides.AddLast(new KeyValuePair("WX:NO", "WX"));
- }
- }
- #endregion
-
- }
-}
diff --git a/src/VSNDK.Tasks/RemoveFlagFile.cs b/src/VSNDK.Tasks/RemoveFlagFile.cs
deleted file mode 100644
index a8034e56..00000000
--- a/src/VSNDK.Tasks/RemoveFlagFile.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.IO;
-using System.Collections;
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-
-namespace VSNDK.Tasks
-{
-
- ///
- /// MSBuild Task for reading in the flag file from the start debugging button.
- ///
- public class RemoveFlagFile : Task
- {
- #region Member Variables and Constants.
- private string _flagFile;
- #endregion
-
- ///
- /// Execute the MSBuild Task
- ///
- ///
- public override bool Execute()
- {
- bool removed;
- try
- {
- File.Delete(_flagFile);
- removed = true;
- }
- catch (DirectoryNotFoundException dirNotFound)
- {
- Console.WriteLine(dirNotFound.Message);
- removed = false;
- }
-
- return removed;
- }
-
- ///
- /// Setter for FlagFile property
- ///
- [Required]
- public string FlagFile
- {
- set
- {
- _flagFile = value;
- }
- }
- }
-}
diff --git a/src/VSNDK.Tasks/SSHDelete.cs b/src/VSNDK.Tasks/SSHDelete.cs
deleted file mode 100644
index 6eeff091..00000000
--- a/src/VSNDK.Tasks/SSHDelete.cs
+++ /dev/null
@@ -1,325 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Build.CPPTasks;
-using System.Resources;
-using System.Reflection;
-using System.Collections;
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-
-namespace VSNDK.Tasks
-{
- public class SSHDelete : TrackedVCToolTask
- {
- #region Member Variables and Constants
- protected ArrayList switchOrderList;
-
- private const string DEVICE = "Device";
- private const string PRIVATE_KEY_PATH = "PrivateKeyPath";
- private const string DELETE_FILES = "DeleteFiles";
- private const string PACKAGE_ID = "PackageId";
- private const string PACKAGE_NAME = "PackageName";
- #endregion
-
- ///
- /// SSHDelete Constructor
- ///
- public SSHDelete()
- : base(new ResourceManager("VSNDK.Tasks.Properties.Resources", Assembly.GetExecutingAssembly()))
- {
- this.switchOrderList = new ArrayList();
- this.switchOrderList.Add(PRIVATE_KEY_PATH);
- }
-
- ///
- /// Return the Response File Switch string
- ///
- ///
- ///
- protected override string GetResponseFileSwitch(string responseFilePath)
- {
- return string.Empty;
- }
-
- ///
- /// Return the command line string
- ///
- ///
- protected override string GenerateCommandLineCommands()
- {
- return GenerateResponseFileCommands();
- }
-
- ///
- /// Getter/Setter for the CommandTLogName property
- ///
- protected override string CommandTLogName
- {
- get { return "SSHDelete.command.1.tlog"; }
- }
-
- ///
- /// Getter/Setter for the ReadTLogNames string
- ///
- protected override string[] ReadTLogNames
- {
- get { return new string[] { "SSHDelete.read.1.tlog", "SSHDelete.*.read.1.tlog" }; }
- }
-
- ///
- /// Getter/Setter for the WriteTLogNames string
- ///
- protected override string[] WriteTLogNames
- {
- get
- {
- return new string[] { "SSHDelete.write.1.tlog", "SSHDelete.*.write.1.tlog" };
- }
- }
-
- ///
- /// Getter/Setter for the TrackedInputFiles string
- ///
- protected override Microsoft.Build.Framework.ITaskItem[] TrackedInputFiles
- {
- get
- {
- if (base.IsPropertySet(DELETE_FILES))
- {
- return base.ActiveToolSwitches[DELETE_FILES].TaskItemArray;
- }
- return null;
- }
- }
-
- ///
- /// Getter/Setter for the ToolName property
- ///
- protected override string ToolName
- {
- get
- {
- return ToolExe;
- }
- }
-
- ///
- /// Getter/Setter for the TrackerIntermediateDirectory property
- ///
- protected override string TrackerIntermediateDirectory
- {
- get
- {
- return string.Empty;
- }
- }
-
- ///
- /// Function to generate the response file commands string
- ///
- ///
- protected override string GenerateResponseFileCommands()
- {
- string cmd = base.GenerateResponseFileCommands();
-
- cmd += " -o \"StrictHostKeyChecking no\"";
-
- if (base.IsPropertySet(DEVICE))
- {
- cmd += " devuser@" + base.ActiveToolSwitches[DEVICE].Value;
- }
-
- if (base.IsPropertySet(DELETE_FILES))
- {
- string path = "../../../../apps/" + PackageName + "." + PackageId + "/";
- cmd += " '";
- foreach (ITaskItem taskItem in base.ActiveToolSwitches[DELETE_FILES].TaskItemArray)
- {
- cmd += "rm " + path + taskItem.GetMetadata("Identity") + "; ";
- }
- cmd += "'";
- }
- else
- {
- cmd += "'pwd;'";
- }
-
- return cmd;
- }
-
- ///
- /// Getter/Setter for the SwitchOrderList property.
- ///
- protected override ArrayList SwitchOrderList
- {
- get
- {
- return this.switchOrderList;
- }
- }
-
- ///
- /// Getter/Setter for the Device property
- ///
- public virtual string Device
- {
- get
- {
- if (base.IsPropertySet(DEVICE))
- {
- return base.ActiveToolSwitches[DEVICE].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(DEVICE);
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.String)
- {
- Name = DEVICE,
- DisplayName = "Device IP",
- Description = "Specifies the target device's IP address.",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "devuser@",
- Value = value
- };
- base.ActiveToolSwitches.Add(DEVICE, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for the PrivateKeyPath property
- ///
- public virtual string PrivateKeyPath
- {
- get
- {
- if (base.IsPropertySet(PRIVATE_KEY_PATH))
- {
- return base.ActiveToolSwitches[PRIVATE_KEY_PATH].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(PRIVATE_KEY_PATH);
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.String)
- {
- Name = PRIVATE_KEY_PATH,
- DisplayName = "Path to public key",
- Description = "The -i option specifies the public SSH key to use.",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-i ",
- Value = value
- };
- base.ActiveToolSwitches.Add(PRIVATE_KEY_PATH, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for the PackageId property
- ///
- public virtual string PackageId
- {
- get
- {
- if (base.IsPropertySet(PACKAGE_ID))
- {
- return base.ActiveToolSwitches[PACKAGE_ID].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(PACKAGE_ID);
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.String)
- {
- Name = PACKAGE_ID,
- DisplayName = "Package ID",
- Description = "The -package-id option specifies the application's package id.",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-package-id ",
- Value = value
- };
- base.ActiveToolSwitches.Add(PACKAGE_ID, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for the PackageName property
- ///
- public virtual string PackageName
- {
- get
- {
- if (base.IsPropertySet(PACKAGE_NAME))
- {
- return base.ActiveToolSwitches[PACKAGE_NAME].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(PACKAGE_NAME);
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.String)
- {
- Name = PACKAGE_NAME,
- DisplayName = "Package Name",
- Description = "The -package-name option specifies the application's package name.",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-package-name ",
- Value = value
- };
- base.ActiveToolSwitches.Add(PACKAGE_NAME, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
-
- ///
- /// Getter/Setter for the DeleteFiles property
- ///
- public virtual ITaskItem[] DeleteFiles
- {
- get
- {
- if (base.IsPropertySet(DELETE_FILES))
- {
- return base.ActiveToolSwitches[DELETE_FILES].TaskItemArray;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(DELETE_FILES);
- ToolSwitch toolSwitch = new ToolSwitch(ToolSwitchType.ITaskItemArray)
- {
- Name = DELETE_FILES,
- DisplayName = "Files to delete",
- Description = "Delete all items in the array from the device.",
- TaskItemArray = value
- };
- base.ActiveToolSwitches.Add(DELETE_FILES, toolSwitch);
- base.AddActiveSwitchToolValue(toolSwitch);
- }
- }
- }
-}
diff --git a/src/VSNDK.Tasks/VSNDK.Tasks.csproj b/src/VSNDK.Tasks/VSNDK.Tasks.csproj
deleted file mode 100644
index da22f1de..00000000
--- a/src/VSNDK.Tasks/VSNDK.Tasks.csproj
+++ /dev/null
@@ -1,274 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}
- Library
- Properties
- VSNDK.Tasks
- VSNDK.Tasks
- v4.0
- 512
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- True
-
-
- True
-
-
-
- False
- ..\..\..\..\..\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Build.CPPTasks.Common.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- bar-descriptor.xsd
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- True
- True
- Resources.resx
-
-
-
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
- Designer
-
-
-
-
- Designer
-
-
- Designer
- Always
-
-
- Designer
- Always
-
-
- Designer
- Always
-
-
- Designer
- Always
-
-
- Designer
- Always
-
-
- Designer
- Always
-
-
- Designer
- Always
-
-
- Always
-
-
- Designer
- Always
-
-
- Designer
- Always
-
-
- Designer
- Always
-
-
- Designer
- Always
-
-
- Always
- Designer
-
-
- Always
-
-
-
-
- Designer
-
-
- Always
-
-
- Always
-
-
- Always
- Designer
-
-
- Always
- Designer
-
-
- Designer
- Always
-
-
- Always
-
-
- Designer
- Always
-
-
- Designer
- Always
-
-
- Designer
- Always
-
-
- Always
- Designer
-
-
- Always
-
-
- Always
-
-
- Designer
- Always
-
-
- Always
-
-
- Always
- Designer
-
-
- Designer
- Always
-
-
- Designer
- Always
-
-
- Designer
- Always
-
-
-
-
- False
- Microsoft .NET Framework 4 %28x86 and x64%29
- true
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- false
-
-
- False
- Windows Installer 3.1
- true
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/VSNDK.Tasks.csproj.user b/src/VSNDK.Tasks/VSNDK.Tasks.csproj.user
deleted file mode 100644
index e7613c65..00000000
--- a/src/VSNDK.Tasks/VSNDK.Tasks.csproj.user
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Program
- C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
- /rootsuffix Exp
-
-
- Program
- C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
- /rootsuffix Exp
-
-
\ No newline at end of file
diff --git a/src/VSNDK.Tasks/VSNDKTasks.cs b/src/VSNDK.Tasks/VSNDKTasks.cs
deleted file mode 100644
index 13c4ad04..00000000
--- a/src/VSNDK.Tasks/VSNDKTasks.cs
+++ /dev/null
@@ -1,680 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Build.Utilities;
-using Microsoft.Build.CPPTasks;
-using System.Resources;
-using System.Reflection;
-using Microsoft.Build.Framework;
-using System.Collections;
-using System.IO;
-
-namespace VSNDK.Tasks
-{
- public abstract class VSNDKTasks : TrackedVCToolTask
- {
- #region fields
- // Fields
- protected ArrayList switchOrderList;
-
- //constant fields
- protected const string GENERATE_DEBUG_INFORMATION = "GenerateDebugInformation";
- protected const string WARING_LEVEL = "WarningLevel";
- protected const string TREAT_WARNING_AS_ERROR = "TreatWarningAsError";
- protected const string TRACKER_LOG_DIRECTORY = "TrackerLogDirectory";
- protected const string OPTIMIZATION = "Optimization";
- protected const string GCC_EXCEPTION_HANDLING = "GccExceptionHandling";
- protected const string SOURCES = "Sources";
- protected const string ADDITIONAL_OPTIONS = "AdditionalOptions";
- protected const string BUILDING_IN_IDE = "BuildingInIDE";
- protected const string ENHANCED_SECURITY = "EnhancedSecurity";
- protected const string POSITION_INDEPENDENT_EXECUTABLE = "PIE";
- protected const string COMPILER_VERSION_TARGET = "CompilerVersionTarget";
- protected const string VERBOSE = "Verbose";
- protected const string COMPILE_AS = "CompileAs";
-
- private static string ERROR = " error:";
- private static string WARNING = " warning:";
- #endregion
-
- #region ctors
-
- ///
- /// VSNDKTasks Constructor
- ///
- ///
- public VSNDKTasks(ResourceManager res)
- : base(res)
- {
- this.switchOrderList = new ArrayList();
- this.switchOrderList.Add(COMPILER_VERSION_TARGET);
- this.switchOrderList.Add("AlwaysAppend");
- this.switchOrderList.Add(GENERATE_DEBUG_INFORMATION);
- this.switchOrderList.Add(VERBOSE);
- this.switchOrderList.Add(WARING_LEVEL);
- this.switchOrderList.Add(TREAT_WARNING_AS_ERROR);
- this.switchOrderList.Add(TRACKER_LOG_DIRECTORY);
- this.switchOrderList.Add(OPTIMIZATION);
- this.switchOrderList.Add(GCC_EXCEPTION_HANDLING);
- this.switchOrderList.Add(ADDITIONAL_OPTIONS);
- this.switchOrderList.Add(BUILDING_IN_IDE);
- this.switchOrderList.Add(ENHANCED_SECURITY);
- this.switchOrderList.Add(POSITION_INDEPENDENT_EXECUTABLE);
- this.switchOrderList.Add(COMPILE_AS);
- }
- #endregion
-
- #region overrides
- ///
- /// don't use response file for msbuild because it is removed before qcc to run GCC compiler
- ///
- ///
- ///
- protected override string GetResponseFileSwitch(string responseFilePath)
- {
- return string.Empty;
- }
-
- ///
- /// instead pass the response file to command line commands
- ///
- ///
- protected override string GenerateCommandLineCommands()
- {
- string cmd = GenerateResponseFileCommands();
- return cmd;
- }
-
- ///
- /// Function to assign out of date sources
- ///
- ///
- ///
- protected override ITaskItem[] AssignOutOfDateSources(ITaskItem[] sources)
- {
- base.ActiveToolSwitches[SOURCES].TaskItemArray = sources;
- return sources;
- }
-
- ///
- /// Getter/Setter for SwitchOrderList property
- ///
- protected override ArrayList SwitchOrderList
- {
- get
- {
- return this.switchOrderList;
- }
- }
-
- ///
- /// Getter/Setter for TrackedInputFiles property
- ///
- protected override Microsoft.Build.Framework.ITaskItem[] TrackedInputFiles
- {
- get
- {
- return Sources;
- }
- }
-
- ///
- /// Getter/Setter for TrackerIntermediateDirectory
- ///
- protected override string TrackerIntermediateDirectory
- {
- get
- {
- if (this.TrackerLogDirectory != null)
- {
- return this.TrackerLogDirectory;
- }
- return string.Empty;
- }
- }
-
- ///
- /// Getter/Setter for ToolName property
- ///
- protected override string ToolName
- {
- get { return QccExe; }
- }
-
- ///
- /// Getter/Setter for LogEventsFromTextOutput
- ///
- ///
- ///
- protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
- {
- base.LogEventsFromTextOutput(Reformat(singleLine), messageImportance);
- }
-
-
-
- ///
- /// Reformat the qcc compiler error to msbuild known error format
- /// singeLine: main.c:53: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
- /// or main.c:38:19: error: hello.h: No such file or directory
- /// output: main.c(53): error QCC001: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
- /// TODO: this method need to be updated in case any more error formats of qcc compiler
- ///
- ///
- ///
- private string Reformat(string singleLine)
- {
- string msbuilError = singleLine;
- string[] separators = { ERROR, WARNING };
- string errCode = singleLine.Contains(ERROR) ? "error qcc" : "warning qcc";
- string[] parts = singleLine.Split(separators, StringSplitOptions.None);
- if (parts != null && parts.Length > 1)
- {
- string[] segments = parts[0].Split(new Char[]{':'}, StringSplitOptions.RemoveEmptyEntries);
- if (segments.Length == 3)
- msbuilError = String.Format("{0}({1}-{2}): {3}: {4}", segments[0], segments[1], segments[2], errCode, parts[1]);
- if ( segments.Length == 2 )
- msbuilError = String.Format("{0}({1}): {2}: {3}", segments[0], segments[1], errCode, parts[1]);
- }
- return msbuilError;
- }
-
- ///
- /// getter/setter for UseUnicodeOutput
- ///
- protected override bool UseUnicodeOutput
- {
- get
- {
- return this.BuildingInIDE;
- }
- }
-
- #endregion //override
-
- #region properties
-
- ///
- /// Getter/Setter for GenerateDebugInformation property
- ///
- public virtual bool GenerateDebugInformation
- {
- get
- {
- if (base.IsPropertySet(GENERATE_DEBUG_INFORMATION))
- {
- return base.ActiveToolSwitches[GENERATE_DEBUG_INFORMATION].BooleanValue;
- }
- return false;
- }
- set
- {
- base.ActiveToolSwitches.Remove(GENERATE_DEBUG_INFORMATION);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Generate Debug Info",
- Description = "Generate Debug Info (-g)",
- ArgumentRelationList = new ArrayList()
- };
- switch2.SwitchValue = "-g";
- switch2.Name = GENERATE_DEBUG_INFORMATION;
- switch2.BooleanValue = value;
- base.ActiveToolSwitches.Add(GENERATE_DEBUG_INFORMATION, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for WarningLevel property
- ///
- public virtual string WarningLevel
- {
- get
- {
- if (base.IsPropertySet(WARING_LEVEL))
- {
- return base.ActiveToolSwitches[WARING_LEVEL].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(WARING_LEVEL);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.String)
- {
- DisplayName = "Warning Level",
- Description = "Select how strict you want the compiler to be about code errors. (-w0 - -w4)",
- ArgumentRelationList = new ArrayList()
- };
- string[][] switchMap = new string[][]
- { new string[] { "TurnOffAllWarnings", "-w0" },
- new string[] { "Level1", "-w1" },
- new string[] { "Level2", "-w2" },
- new string[] { "Level3", "-w3" },
- new string[] { "Level4", "-w4" },
- new string[] { "Level5", "-w5" },
- new string[] { "Level6", "-w6" },
- new string[] { "Level7", "-w7" },
- new string[] { "Level8", "-w8" },
- new string[] { "Level9", "-w9" },
- new string[] { "EnableAllWarnings", "-Wall" } };
- switch2.SwitchValue = base.ReadSwitchMap(WARING_LEVEL, switchMap, value);
- switch2.Name = WARING_LEVEL;
- switch2.Value = value;
- switch2.MultiValues = true;
- base.ActiveToolSwitches.Add(WARING_LEVEL, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for TreatWarningAsError property
- ///
- public virtual bool TreatWarningAsError
- {
- get
- {
- if (base.IsPropertySet(TREAT_WARNING_AS_ERROR))
- {
- return base.ActiveToolSwitches[TREAT_WARNING_AS_ERROR].BooleanValue;
- }
- return false;
- }
- set
- {
- base.ActiveToolSwitches.Remove(TREAT_WARNING_AS_ERROR);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Treat Warnings as Errors",
- Description = "Treat Warnings as Errors",
- ArgumentRelationList = new ArrayList()
- };
- switch2.ArgumentRelationList.Add(new ArgumentRelation(TREAT_WARNING_AS_ERROR, "true", false, ""));
- switch2.SwitchValue = "-Werror";
- switch2.Name = TREAT_WARNING_AS_ERROR;
- switch2.BooleanValue = value;
- base.ActiveToolSwitches.Add(TREAT_WARNING_AS_ERROR, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for BuildingInIDE property
- ///
- public virtual bool BuildingInIDE
- {
- get
- {
- return (base.IsPropertySet(BUILDING_IN_IDE) && base.ActiveToolSwitches[BUILDING_IN_IDE].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(BUILDING_IN_IDE);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- ArgumentRelationList = new ArrayList(),
- Name = BUILDING_IN_IDE,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(BUILDING_IN_IDE, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for GccExceptHandling property
- ///
- public virtual string GccExceptionHandling
- {
- get
- {
- if (base.IsPropertySet("ExceptionHandling"))
- {
- return base.ActiveToolSwitches["ExceptionHandling"].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove("ExceptionHandling");
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.String)
- {
- DisplayName = "Enable C++ Exceptions",
- Description = "Specifies the model of exception handling to be used by the compiler.",
- ArgumentRelationList = new ArrayList()
- };
- string[][] switchMap = new string[][] { new string[] { "Async", "/EHa" }, new string[] { "Sync", "/EHsc" }, new string[] { "SyncCThrow", "/EHs" }, new string[] { "false", "" } };
- switch2.SwitchValue = base.ReadSwitchMap("ExceptionHandling", switchMap, value);
- switch2.Name = "ExceptionHandling";
- switch2.Value = value;
- switch2.MultiValues = true;
- base.ActiveToolSwitches.Add("ExceptionHandling", switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for Optimization property
- ///
- public virtual string Optimization
- {
- get
- {
- if (base.IsPropertySet(OPTIMIZATION))
- {
- return base.ActiveToolSwitches[OPTIMIZATION].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(OPTIMIZATION);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.String)
- {
- DisplayName = OPTIMIZATION,
- Description = "Select option for code optimization; choose Custom to use specific optimization options. (-O0, -O1, -O2, -O3)",
- ArgumentRelationList = new ArrayList()
- };
- string[][] switchMap = new string[][] { new string[] { "Disabled", "-O0" }, new string[] { "MinSpace", "-O1" },
- new string[] { "MaxSpeed", "-O2" }, new string[] { "Full", "-O3" } };
- switch2.SwitchValue = base.ReadSwitchMap(OPTIMIZATION, switchMap, value);
- switch2.Name = OPTIMIZATION;
- switch2.Value = value;
- switch2.MultiValues = true;
- base.ActiveToolSwitches.Add(OPTIMIZATION, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for PlatformToolset property
- ///
- public virtual string PlatformToolset
- {
- get
- {
- return "qcc";
- }
- }
-
- ///
- /// Getter/Setter for TrackerLogDirectory
- ///
- public virtual string TrackerLogDirectory
- {
- get
- {
- if ( base.IsPropertySet( TRACKER_LOG_DIRECTORY ) )
- {
- return base.ActiveToolSwitches[TRACKER_LOG_DIRECTORY].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove( TRACKER_LOG_DIRECTORY );
- ToolSwitch switch2 = new ToolSwitch( ToolSwitchType.Directory )
- {
- DisplayName = "Tracker Log Directory",
- Description = "Tracker Log Directory.",
- ArgumentRelationList = new ArrayList(),
- Value = VCToolTask.EnsureTrailingSlash( value )
- };
- base.ActiveToolSwitches.Add( TRACKER_LOG_DIRECTORY, switch2 );
- base.AddActiveSwitchToolValue( switch2 );
- }
- }
-
- ///
- /// Getter/Setter for TargetMachine property
- ///
- public virtual string TargetMachine
- {
- get
- {
- if (base.IsPropertySet("TargetMachine"))
- {
- return base.ActiveToolSwitches["TargetMachine"].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove("TargetMachine");
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.String)
- {
- DisplayName = "Target Machine",
- Description = "The /MACHINE option specifies the target platform for the program.",
- ArgumentRelationList = new ArrayList()
- };
- string[][] switchMap = new string[][] { new string[] { "MachineARM", "/MACHINE:ARM" }, new string[] { "MachineEBC", "/MACHINE:EBC" }, new string[] { "MachineIA64", "/MACHINE:IA64" }, new string[] { "MachineMIPS", "/MACHINE:MIPS" }, new string[] { "MachineMIPS16", "/MACHINE:MIPS16" }, new string[] { "MachineMIPSFPU", "/MACHINE:MIPSFPU" }, new string[] { "MachineMIPSFPU16", "/MACHINE:MIPSFPU16" }, new string[] { "MachineSH4", "/MACHINE:SH4" }, new string[] { "MachineTHUMB", "/MACHINE:THUMB" }, new string[] { "MachineX64", "/MACHINE:X64" }, new string[] { "MachineX86", "/MACHINE:X86" } };
- switch2.SwitchValue = base.ReadSwitchMap("TargetMachine", switchMap, value);
- switch2.Name = "TargetMachine";
- switch2.Value = value;
- switch2.MultiValues = true;
- base.ActiveToolSwitches.Add("TargetMachine", switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for CompileAs property
- ///
- public virtual string CompileAs
- {
- get
- {
- if (base.IsPropertySet(COMPILE_AS))
- {
- return base.ActiveToolSwitches[COMPILE_AS].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(COMPILE_AS);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.String)
- {
- DisplayName = "Compile As",
- Description = "Select compile language option for .c and .cpp files. (-lang-c, -lang-c++)",
- ArgumentRelationList = new ArrayList()
- };
- string[][] switchMap = new string[][] { new string[] { "CompileAsC", "-lang-c" }, new string[] { "CompileAsCpp", "-lang-c++" } };
- switch2.SwitchValue = base.ReadSwitchMap(COMPILE_AS, switchMap, value);
- switch2.Name = COMPILE_AS;
- switch2.Value = value;
- switch2.MultiValues = true;
- base.ActiveToolSwitches.Add(COMPILE_AS, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for Verbose property
- ///
- public bool Verbose
- {
- get
- {
- return (base.IsPropertySet(VERBOSE) && base.ActiveToolSwitches[VERBOSE].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(VERBOSE);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Verbose",
- Description = "Verbose",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-v",
- Name = VERBOSE,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(VERBOSE, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for EnhancedSecutiry property
- ///
- public virtual bool EnhancedSecurity
- {
- get
- {
- return (base.IsPropertySet(ENHANCED_SECURITY) && base.ActiveToolSwitches[ENHANCED_SECURITY].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(ENHANCED_SECURITY);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Enhanced Security(-fstack-protector-all)",
- Description = " ",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = GetEnhancedSecuritySwitchValue(),
- Name = ENHANCED_SECURITY,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(ENHANCED_SECURITY, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Return the Get Enhanced Security string.
- ///
- ///
- protected virtual string GetEnhancedSecuritySwitchValue()
- {
- return "-fstack-protector-all";
- }
-
- ///
- /// Getter/Setter for the PIE property
- ///
- public bool PIE
- {
- get
- {
- return (base.IsPropertySet(POSITION_INDEPENDENT_EXECUTABLE) && base.ActiveToolSwitches[POSITION_INDEPENDENT_EXECUTABLE].BooleanValue);
- }
- set
- {
- base.ActiveToolSwitches.Remove(POSITION_INDEPENDENT_EXECUTABLE);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.Boolean)
- {
- DisplayName = "Position Independent Executable(fPIE)",
- Description = " ",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-fPIE",
- Name = POSITION_INDEPENDENT_EXECUTABLE,
- BooleanValue = value
- };
- base.ActiveToolSwitches.Add(POSITION_INDEPENDENT_EXECUTABLE, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the ProfilingCall property
- ///
- public bool ProfilingCall { get; set; }
-
- ///
- /// Getter/Setter for the CodeCoverage property
- ///
- public bool CodeCoverage { get; set; }
-
- ///
- /// Getter/Setter for the Mudflap property
- ///
- public bool Mudflap { get; set; }
-
- ///
- /// Getter/Setter for the QccExe property
- ///
- public string QccExe { get; set; }
-
- ///
- /// Getter/Setter for the CompilerVersionTarget property
- ///
- public string CompilerVersionTarget
- {
- get
- {
- if (base.IsPropertySet(COMPILER_VERSION_TARGET))
- {
- return base.ActiveToolSwitches[COMPILER_VERSION_TARGET].Value;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(COMPILER_VERSION_TARGET);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.String)
- {
- DisplayName = "Compiler version and target",
- Description = " ",
- ArgumentRelationList = new ArrayList(),
- SwitchValue = "-V",
- };
- switch2.Name = COMPILER_VERSION_TARGET;
- switch2.Value = value;
-
- base.ActiveToolSwitches.Add(COMPILER_VERSION_TARGET, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
-
- ///
- /// Getter/Setter for the LinkSharedLibrary property
- ///
- public virtual bool LinkSharedLibrary { get; set; }
-
- ///
- /// Getter/Setter for the Sources property
- ///
- [Required]
- public virtual ITaskItem[] Sources
- {
- get
- {
- if (base.IsPropertySet(SOURCES))
- {
- return base.ActiveToolSwitches[SOURCES].TaskItemArray;
- }
- return null;
- }
- set
- {
- base.ActiveToolSwitches.Remove(SOURCES);
- ToolSwitch switch2 = new ToolSwitch(ToolSwitchType.ITaskItemArray)
- {
- Separator = " ",
- Required = true,
- ArgumentRelationList = new ArrayList(),
- TaskItemArray = value
- };
- base.ActiveToolSwitches.Add(SOURCES, switch2);
- base.AddActiveSwitchToolValue(switch2);
- }
- }
- #endregion //properties
- }
-}
diff --git a/src/VSNDK.Tasks/WriteDebuggerArgs.cs b/src/VSNDK.Tasks/WriteDebuggerArgs.cs
deleted file mode 100644
index c712be98..00000000
--- a/src/VSNDK.Tasks/WriteDebuggerArgs.cs
+++ /dev/null
@@ -1,174 +0,0 @@
-//* Copyright 2010-2011 Research In Motion Limited.
-//*
-//* Licensed under the Apache License, Version 2.0 (the "License");
-//* you may not use this file except in compliance with the License.
-//* You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.IO;
-using System.Collections;
-using System.Text.RegularExpressions;
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-
-namespace VSNDK.Tasks
-{
- public class WriteDebuggerArgs : Task
- {
- #region Member Variables and Constants
-
- private string _projectDir;
- private string _outDir;
- private string _appName;
- private string _device;
- private bool _isSimulator;
- private string _appData;
-
- #endregion
-
- #region Public Propeties
-
- ///
- /// Getter/Setter for the ProjectDir property
- ///
- [Required]
- public string ProjectDir
- {
- set { _projectDir = value.Replace('\\', '/'); }
- get { return _projectDir; }
- }
-
- ///
- /// Getter/Setter for the _appData property
- ///
-// [Required]
- public string AppData
- {
- set { _appData = value; }
- get { return _appData; }
- }
-
- ///
- /// Getter/Setter for the OutDir property
- ///
- [Required]
- public string OutDir
- {
- set { _outDir = value.Replace('\\', '/'); }
- get { return _outDir; }
- }
-
- ///
- /// Getter/Setter for the AppName property
- ///
- [Required]
- public string AppName
- {
- set { _appName = value; }
- get { return _appName; }
- }
-
- ///
- /// Getter/Setter for the Device property
- ///
- [Required]
- public string Device
- {
- set
- {
- _device = value;
- }
- }
-
- ///
- /// Getter/Setter for the isSimulator property
- ///
- [Required]
- public bool isSimulator
- {
- set
- {
- _isSimulator = value;
- }
- }
-
- ///
- /// Getter/Setter for the ToolsPath property
- ///
- [Required]
- public string ToolsPath
- {
- get;
- set;
- }
-
- ///
- /// Getter/Setter for the PublicKeyPath property
- ///
- [Required]
- public string PublicKeyPath
- {
- get;
- set;
- }
-
- ///
- /// Getter/Setter for the Password property
- ///
- public string Password
- {
- get;
- set;
- }
-
- #endregion
-
- ///
- /// Execute MSBuild function
- ///
- ///
- public override bool Execute()
- {
- /// Initialize Variables
- bool result;
-
- try
- {
- // Setting the work directory.
- string rootedOutDir = (Path.IsPathRooted(OutDir)) ? OutDir + AppName : ProjectDir + OutDir + AppName;
-
- AppData = Environment.GetEnvironmentVariable("AppData") + @"\BlackBerry\vsndk-args-file.txt";
-
- System.IO.StreamWriter file = new System.IO.StreamWriter(AppData);
-
- file.WriteLine(_device);
- file.WriteLine(rootedOutDir.Replace(@"\\", @"\\\\"));
- file.WriteLine(_isSimulator);
- file.WriteLine(ToolsPath);
- file.WriteLine(PublicKeyPath);
- file.WriteLine(Password);
- file.Close();
-
- result = true;
- }
- catch (Exception ex)
- {
- result = false;
- }
- return result;
- }
-
-
- }
-}
diff --git a/src/VSNDK.sln b/src/VSNDK.sln
deleted file mode 100644
index e417934d..00000000
--- a/src/VSNDK.sln
+++ /dev/null
@@ -1,126 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSNDK.Tasks", "VSNDK.Tasks\VSNDK.Tasks.csproj", "{328CAD98-F4E5-444A-B5DF-AD102C67BA3C}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSNDK.AddIn", "VSNDK.AddIn\VSNDK.AddIn.csproj", "{D4644752-F6B1-47EE-A0FB-1197355A525E}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSNDK.Package", "VSNDK.Package\VSNDK.Package.csproj", "{3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GDBParser", "GDBParser\GDBParser.vcxproj", "{CC7B28E0-CB31-44F7-A380-E7072F670F38}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GDBWrapper", "GDBWrapper\GDBWrapper.vcxproj", "{9A560339-44DB-413F-868C-403962C2CF01}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSNDK.DebugEngine", "VSNDK.DebugEngine\VSNDK.DebugEngine.csproj", "{59A7B188-E307-4495-A3AF-4ED76B086A87}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GDBParser_UnitTests", "GDBParser.UnitTests\GDBParser_UnitTests.csproj", "{6451DFCD-1CCD-4796-A832-A45FB95D994F}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSNDK.Tasks.Test", "VSNDK.Tasks.Test\VSNDK.Tasks.Test.csproj", "{BDA81519-4AC1-4B1B-9EA0-18124E3C5E4E}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSNDK.Package.Test", "VSNDK.Package.Test\VSNDK.Package.Test.csproj", "{EA581F35-1EE6-4C7B-89FF-C3C7D886869D}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|Mixed Platforms = Debug|Mixed Platforms
- Debug|Win32 = Debug|Win32
- Release|Any CPU = Release|Any CPU
- Release|Mixed Platforms = Release|Mixed Platforms
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Debug|Win32.ActiveCfg = Debug|Any CPU
- {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Release|Any CPU.Build.0 = Release|Any CPU
- {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Release|Win32.ActiveCfg = Release|Any CPU
- {D4644752-F6B1-47EE-A0FB-1197355A525E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D4644752-F6B1-47EE-A0FB-1197355A525E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D4644752-F6B1-47EE-A0FB-1197355A525E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {D4644752-F6B1-47EE-A0FB-1197355A525E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {D4644752-F6B1-47EE-A0FB-1197355A525E}.Debug|Win32.ActiveCfg = Debug|Any CPU
- {D4644752-F6B1-47EE-A0FB-1197355A525E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D4644752-F6B1-47EE-A0FB-1197355A525E}.Release|Any CPU.Build.0 = Release|Any CPU
- {D4644752-F6B1-47EE-A0FB-1197355A525E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {D4644752-F6B1-47EE-A0FB-1197355A525E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {D4644752-F6B1-47EE-A0FB-1197355A525E}.Release|Win32.ActiveCfg = Release|Any CPU
- {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Debug|Win32.ActiveCfg = Debug|Any CPU
- {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Release|Any CPU.Build.0 = Release|Any CPU
- {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Release|Win32.ActiveCfg = Release|Any CPU
- {CC7B28E0-CB31-44F7-A380-E7072F670F38}.Debug|Any CPU.ActiveCfg = Debug|Win32
- {CC7B28E0-CB31-44F7-A380-E7072F670F38}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
- {CC7B28E0-CB31-44F7-A380-E7072F670F38}.Debug|Mixed Platforms.Build.0 = Debug|Win32
- {CC7B28E0-CB31-44F7-A380-E7072F670F38}.Debug|Win32.ActiveCfg = Debug|Win32
- {CC7B28E0-CB31-44F7-A380-E7072F670F38}.Debug|Win32.Build.0 = Debug|Win32
- {CC7B28E0-CB31-44F7-A380-E7072F670F38}.Release|Any CPU.ActiveCfg = Release|Win32
- {CC7B28E0-CB31-44F7-A380-E7072F670F38}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {CC7B28E0-CB31-44F7-A380-E7072F670F38}.Release|Mixed Platforms.Build.0 = Release|Win32
- {CC7B28E0-CB31-44F7-A380-E7072F670F38}.Release|Win32.ActiveCfg = Release|Win32
- {CC7B28E0-CB31-44F7-A380-E7072F670F38}.Release|Win32.Build.0 = Release|Win32
- {9A560339-44DB-413F-868C-403962C2CF01}.Debug|Any CPU.ActiveCfg = Debug|Win32
- {9A560339-44DB-413F-868C-403962C2CF01}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
- {9A560339-44DB-413F-868C-403962C2CF01}.Debug|Mixed Platforms.Build.0 = Debug|Win32
- {9A560339-44DB-413F-868C-403962C2CF01}.Debug|Win32.ActiveCfg = Debug|Win32
- {9A560339-44DB-413F-868C-403962C2CF01}.Debug|Win32.Build.0 = Debug|Win32
- {9A560339-44DB-413F-868C-403962C2CF01}.Release|Any CPU.ActiveCfg = Release|Win32
- {9A560339-44DB-413F-868C-403962C2CF01}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {9A560339-44DB-413F-868C-403962C2CF01}.Release|Mixed Platforms.Build.0 = Release|Win32
- {9A560339-44DB-413F-868C-403962C2CF01}.Release|Win32.ActiveCfg = Release|Win32
- {9A560339-44DB-413F-868C-403962C2CF01}.Release|Win32.Build.0 = Release|Win32
- {59A7B188-E307-4495-A3AF-4ED76B086A87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {59A7B188-E307-4495-A3AF-4ED76B086A87}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {59A7B188-E307-4495-A3AF-4ED76B086A87}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {59A7B188-E307-4495-A3AF-4ED76B086A87}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {59A7B188-E307-4495-A3AF-4ED76B086A87}.Debug|Win32.ActiveCfg = Debug|Any CPU
- {59A7B188-E307-4495-A3AF-4ED76B086A87}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {59A7B188-E307-4495-A3AF-4ED76B086A87}.Release|Any CPU.Build.0 = Release|Any CPU
- {59A7B188-E307-4495-A3AF-4ED76B086A87}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {59A7B188-E307-4495-A3AF-4ED76B086A87}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {59A7B188-E307-4495-A3AF-4ED76B086A87}.Release|Win32.ActiveCfg = Release|Any CPU
- {6451DFCD-1CCD-4796-A832-A45FB95D994F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6451DFCD-1CCD-4796-A832-A45FB95D994F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6451DFCD-1CCD-4796-A832-A45FB95D994F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {6451DFCD-1CCD-4796-A832-A45FB95D994F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {6451DFCD-1CCD-4796-A832-A45FB95D994F}.Debug|Win32.ActiveCfg = Debug|Any CPU
- {6451DFCD-1CCD-4796-A832-A45FB95D994F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6451DFCD-1CCD-4796-A832-A45FB95D994F}.Release|Any CPU.Build.0 = Release|Any CPU
- {6451DFCD-1CCD-4796-A832-A45FB95D994F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {6451DFCD-1CCD-4796-A832-A45FB95D994F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {6451DFCD-1CCD-4796-A832-A45FB95D994F}.Release|Win32.ActiveCfg = Release|Any CPU
- {BDA81519-4AC1-4B1B-9EA0-18124E3C5E4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BDA81519-4AC1-4B1B-9EA0-18124E3C5E4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BDA81519-4AC1-4B1B-9EA0-18124E3C5E4E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {BDA81519-4AC1-4B1B-9EA0-18124E3C5E4E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {BDA81519-4AC1-4B1B-9EA0-18124E3C5E4E}.Debug|Win32.ActiveCfg = Debug|Any CPU
- {BDA81519-4AC1-4B1B-9EA0-18124E3C5E4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BDA81519-4AC1-4B1B-9EA0-18124E3C5E4E}.Release|Any CPU.Build.0 = Release|Any CPU
- {BDA81519-4AC1-4B1B-9EA0-18124E3C5E4E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {BDA81519-4AC1-4B1B-9EA0-18124E3C5E4E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {BDA81519-4AC1-4B1B-9EA0-18124E3C5E4E}.Release|Win32.ActiveCfg = Release|Any CPU
- {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Debug|Win32.ActiveCfg = Debug|Any CPU
- {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Release|Any CPU.Build.0 = Release|Any CPU
- {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Release|Win32.ActiveCfg = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/src_vs2010/BlackBerry.NativePlugin.sln b/src_vs2010/BlackBerry.NativePlugin.sln
new file mode 100644
index 00000000..e7f0d8bc
--- /dev/null
+++ b/src_vs2010/BlackBerry.NativePlugin.sln
@@ -0,0 +1,90 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlackBerry.BuildTasks", "BuildTasks\BlackBerry.BuildTasks.csproj", "{328CAD98-F4E5-444A-B5DF-AD102C67BA3C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlackBerry.Package", "Package\BlackBerry.Package.csproj", "{3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlackBerry.DebugEngine", "DebugEngine\BlackBerry.DebugEngine.csproj", "{59A7B188-E307-4495-A3AF-4ED76B086A87}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{EA581F35-1EE6-4C7B-89FF-C3C7D886869D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlackBerry.NativeCore", "NativeCore\BlackBerry.NativeCore.csproj", "{36D4495B-9A92-478F-BF95-AEA13804A7BA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BlackBerry.GDBHost", "GDBHost\BlackBerry.GDBHost.vcxproj", "{9A560339-44DB-413F-868C-403962C2CF01}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|Mixed Platforms = Debug|Mixed Platforms
+ Debug|Win32 = Debug|Win32
+ Release|Any CPU = Release|Any CPU
+ Release|Mixed Platforms = Release|Mixed Platforms
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}.Release|Win32.ActiveCfg = Release|Any CPU
+ {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}.Release|Win32.ActiveCfg = Release|Any CPU
+ {59A7B188-E307-4495-A3AF-4ED76B086A87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {59A7B188-E307-4495-A3AF-4ED76B086A87}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {59A7B188-E307-4495-A3AF-4ED76B086A87}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {59A7B188-E307-4495-A3AF-4ED76B086A87}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {59A7B188-E307-4495-A3AF-4ED76B086A87}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {59A7B188-E307-4495-A3AF-4ED76B086A87}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {59A7B188-E307-4495-A3AF-4ED76B086A87}.Release|Any CPU.Build.0 = Release|Any CPU
+ {59A7B188-E307-4495-A3AF-4ED76B086A87}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {59A7B188-E307-4495-A3AF-4ED76B086A87}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {59A7B188-E307-4495-A3AF-4ED76B086A87}.Release|Win32.ActiveCfg = Release|Any CPU
+ {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {EA581F35-1EE6-4C7B-89FF-C3C7D886869D}.Release|Win32.ActiveCfg = Release|Any CPU
+ {36D4495B-9A92-478F-BF95-AEA13804A7BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {36D4495B-9A92-478F-BF95-AEA13804A7BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {36D4495B-9A92-478F-BF95-AEA13804A7BA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {36D4495B-9A92-478F-BF95-AEA13804A7BA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {36D4495B-9A92-478F-BF95-AEA13804A7BA}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {36D4495B-9A92-478F-BF95-AEA13804A7BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {36D4495B-9A92-478F-BF95-AEA13804A7BA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {36D4495B-9A92-478F-BF95-AEA13804A7BA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {36D4495B-9A92-478F-BF95-AEA13804A7BA}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {36D4495B-9A92-478F-BF95-AEA13804A7BA}.Release|Win32.ActiveCfg = Release|Any CPU
+ {9A560339-44DB-413F-868C-403962C2CF01}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {9A560339-44DB-413F-868C-403962C2CF01}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+ {9A560339-44DB-413F-868C-403962C2CF01}.Debug|Mixed Platforms.Build.0 = Debug|Win32
+ {9A560339-44DB-413F-868C-403962C2CF01}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9A560339-44DB-413F-868C-403962C2CF01}.Debug|Win32.Build.0 = Debug|Win32
+ {9A560339-44DB-413F-868C-403962C2CF01}.Release|Any CPU.ActiveCfg = Release|Win32
+ {9A560339-44DB-413F-868C-403962C2CF01}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+ {9A560339-44DB-413F-868C-403962C2CF01}.Release|Mixed Platforms.Build.0 = Release|Win32
+ {9A560339-44DB-413F-868C-403962C2CF01}.Release|Win32.ActiveCfg = Release|Win32
+ {9A560339-44DB-413F-868C-403962C2CF01}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/src_vs2010/BuildTasks/BlackBerry.BuildTasks.csproj b/src_vs2010/BuildTasks/BlackBerry.BuildTasks.csproj
new file mode 100644
index 00000000..69a8cd87
--- /dev/null
+++ b/src_vs2010/BuildTasks/BlackBerry.BuildTasks.csproj
@@ -0,0 +1,290 @@
+
+
+
+ Debug
+ AnyCPU
+ 8.0.30703
+ 2.0
+ {328CAD98-F4E5-444A-B5DF-AD102C67BA3C}
+ Library
+ Properties
+ BlackBerry.BuildTasks
+ BlackBerry.BuildTasks
+ v4.0
+ 512
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
+
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ TRACE;DEBUG;PLATFORM_VS2010
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE;PLATFORM_VS2010
+ prompt
+ 4
+
+
+
+
+ False
+ C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Build.CPPTasks.Common.dll
+
+
+
+
+
+
+
+
+
+
+
+
+ AsyncExec.cs
+
+
+ BarDescriptor\Parser.cs
+
+
+ BBDeploy.cs
+
+
+ BBNativePackager.cs
+
+
+ BBSigner.cs
+
+
+ BBTask.cs
+
+
+ CheckIfInstalled.cs
+
+
+ DiffManifests.cs
+
+
+ GenerateMakefile.cs
+
+
+ GetAppInfo.cs
+
+
+ Helpers\ProcessSetupHelper.cs
+
+
+ Helpers\TemplateHelper.cs
+
+
+ MakeAllAndFormatOutputMessages.cs
+
+
+ PackagerCmdBuilder.cs
+
+
+ Properties\Resources.Designer.cs
+ True
+ True
+ Resources.resx
+
+
+ QccCompiler.cs
+
+
+ QccExec.cs
+
+
+ QccLib.cs
+
+
+ QccLink.cs
+
+
+ QccTask.cs
+
+
+ RemoveFlagFile.cs
+
+
+ SSHDelete.cs
+
+
+ Templates\ConfigPriTemplate.cs
+ True
+ True
+ ConfigPriTemplate.tt
+
+
+ Templates\ConfigPriTemplate.Properties.cs
+
+
+ Templates\MakefileTemplate.cs
+ True
+ True
+ MakefileTemplate.tt
+
+
+ Templates\MakefileTemplate.Properties.cs
+
+
+ ConfigDefaults.cs
+
+
+ Helpers\GlobalHelper.cs
+
+
+ NativeMethods.cs
+
+
+ BarDescriptor\Schema\bar-descriptor.cs
+
+
+ BarDescriptor\Schema\bar-descriptor.Extensions.cs
+
+
+
+
+
+ Templates\ConfigPriTemplate.tt
+ TextTemplatingFilePreprocessor
+ ConfigPriTemplate.cs
+
+
+ Templates\MakefileTemplate.tt
+ TextTemplatingFilePreprocessor
+ MakefileTemplate.cs
+
+
+ Designer
+ Always
+
+
+ Designer
+ Always
+
+
+ Designer
+ Always
+
+
+ Designer
+ Always
+
+
+ Designer
+ Always
+
+
+ Designer
+ Always
+
+
+ Always
+
+
+
+
+ BlackBerry\PlatformToolsets\qcc\1033\cl.xml
+ Always
+
+
+ BlackBerry\PlatformToolsets\qcc\1033\debugger_general.xml
+ Always
+
+
+ BlackBerry\PlatformToolsets\qcc\1033\directories.xml
+ Always
+
+
+ BlackBerry\PlatformToolsets\qcc\1033\general.xml
+ Always
+
+
+ BlackBerry\PlatformToolsets\qcc\1033\lib.xml
+ Always
+
+
+ BlackBerry\PlatformToolsets\qcc\1033\link.xml
+ Always
+
+
+ BlackBerry\PlatformToolsets\qcc\1033\packager.xml
+ Always
+
+
+ BlackBerry\PlatformToolsets\qcc\1033\ProjectItemsSchema.xml
+ Always
+
+
+
+
+ False
+ Microsoft .NET Framework 4 %28x86 and x64%29
+ true
+
+
+ False
+ .NET Framework 3.5 SP1 Client Profile
+ false
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
+ False
+ Windows Installer 3.1
+ true
+
+
+
+
+
+
+
+ Properties\Resources.resx
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src_vs2010/BuildTasks/BlackBerry/Microsoft.Cpp.BlackBerry.Packager.targets b/src_vs2010/BuildTasks/BlackBerry/Microsoft.Cpp.BlackBerry.Packager.targets
new file mode 100644
index 00000000..bed3b761
--- /dev/null
+++ b/src_vs2010/BuildTasks/BlackBerry/Microsoft.Cpp.BlackBerry.Packager.targets
@@ -0,0 +1,425 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+ true
+
+
+
+ true
+
+
+
+
+ $(BuildLinkTargets);
+
+ $(CommonBuildOnlyTargets);$(BeforeBuildLinkTargets);$(BuildLinkTargets);$(AfterBuildLinkTargets)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $([System.IO.Path]::Combine($(ProjectDir),$(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)))
+ $([System.IO.Path]::GetFileName('$(TargetPath)'))
+ $([System.IO.Path]::GetDirectoryName('$(TargetPath)'))
+ $(LibPrefix)$(ProjectName)
+ false
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+ true
+ $(IsAppInstalled)
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(Registry:HKEY_CURRENT_USER\SOFTWARE\BlackBerry\VSPlugin@CSKPass)
+ false
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src_vs2010/BuildTasks/BlackBerry/Microsoft.Cpp.BlackBerry.default.props b/src_vs2010/BuildTasks/BlackBerry/Microsoft.Cpp.BlackBerry.default.props
new file mode 100644
index 00000000..58536401
--- /dev/null
+++ b/src_vs2010/BuildTasks/BlackBerry/Microsoft.Cpp.BlackBerry.default.props
@@ -0,0 +1,31 @@
+
+
+
+
+ BlackBerry
+ qcc
+ Regular
+ all
+ armle-v7
+ Unicode
+
+
+
+
+ $(IntermediateOutputPath)
+ $(Configuration)\
+ $(Configuration)\
+ $(IntDir)
+
+
diff --git a/src_vs2010/BuildTasks/BlackBerry/Microsoft.Cpp.BlackBerry.props b/src_vs2010/BuildTasks/BlackBerry/Microsoft.Cpp.BlackBerry.props
new file mode 100644
index 00000000..7c96ed94
--- /dev/null
+++ b/src_vs2010/BuildTasks/BlackBerry/Microsoft.Cpp.BlackBerry.props
@@ -0,0 +1,179 @@
+
+
+
+
+
+
+ $(IntermediateOutputPath)
+ Device-$(Configuration)\
+ Device-$(Configuration)\
+ $(IntDir)
+
+ gcc_ntoarmv7le
+ Device
+ $(Registry:HKEY_CURRENT_USER\SOFTWARE\BlackBerry\VSPlugin@device_IP)
+ $(Registry:HKEY_CURRENT_USER\SOFTWARE\BlackBerry\VSPlugin@device_password)
+ armle-v7
+ arm
+ .le-v7
+
+
+
+ $(IntermediateOutputPath)
+ Simulator-$(Configuration)\
+ Simulator-$(Configuration)\
+ $(IntDir)
+
+ gcc_ntox86
+ Simulator
+ $(Registry:HKEY_CURRENT_USER\SOFTWARE\BlackBerry\VSPlugin@simulator_IP)
+ $(Registry:HKEY_CURRENT_USER\SOFTWARE\BlackBerry\VSPlugin@simulator_password)
+ x86
+ x86
+
+
+
+
+
+
+
+
+ QCC;__QCC__;__QNX__;QNX_DEVICE=1;QNX_FAMILY=device
+ QCC;__QCC__;__QNX__;QNX_DEVICE=2;QNX_TABLET=1;QNX_FAMILY=tablet
+ false
+
+
+ QCC;__QCC__;__QNX__;QNX_SIMULATOR=1;QNX_FAMILY=device-simulator
+ QCC;__QCC__;__QNX__;QNX_SIMULATOR=2;QNX_TABLET=1;QNX_FAMILY=tablet-simulator
+ false
+
+
+
+
+ true
+ false
+
+
+
+
+ true
+ .a
+ lib
+
+
+
+ true
+
+
+
+
+
+ true
+ .so
+ true
+ lib
+
+
+
+
+ $([System.IO.Path]::Combine($(ProjectDir),$(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)))
+ $(TargetPath.TrimEnd('\'))
+ $([System.IO.Path]::GetFileName('$(TargetPath)'))
+ $([System.IO.Path]::GetDirectoryName('$(TargetPath)'))
+ $(LibPrefix)$(ProjectName)
+
+
+
+
+
+ $(IntDir)%(FileName).o
+ $(QccDefines)
+ WIN32;_WINDOWS
+ NormalWarnings
+ false
+ false
+
+ true
+
+ false
+ false
+ Default
+ true
+
+
+
+
+
+
+ O2
+ true
+
+
+
+
+
+
+ O2
+ false
+
+
+
+
+
+
+ $(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)
+ $(TargetPath)
+
+
+ false
+ false
+ true
+ false
+ true
+ Default
+
+
+
+
+
+
+ $(OutDir)$(LibPrefix)$(TargetName)$(TargetExt)
+ false
+
+
+
+
+
+
+ $(IntDir)
+ true
+ $(OutDir)$(TargetName).bar
+ true
+ false
+ false
+ bar-debug
+ bar
+ true
+ false
+ None
+ Install
+ false
+ 1
+ bar-descriptor.xml
+
+
+
+
+
diff --git a/src_vs2010/BuildTasks/BlackBerry/Microsoft.Cpp.BlackBerry.targets b/src_vs2010/BuildTasks/BlackBerry/Microsoft.Cpp.BlackBerry.targets
new file mode 100644
index 00000000..0893a7d2
--- /dev/null
+++ b/src_vs2010/BuildTasks/BlackBerry/Microsoft.Cpp.BlackBerry.targets
@@ -0,0 +1,228 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CompileAsC
+ CompileAsCpp
+ false
+
+
+
+
+
+
+ $(DefaultToolArchitecture)
+
+
+
+
+
+
+
+ false
+
+
+
+
+ $(DefaultToolArchitecture)
+
+
+
+
+
+
+
+
+
+
+ false
+ false
+ true
+ $(DefaultToolArchitecture)
+ true
+
+
+
+
+
+ CompileAsC
+ CompileAsCpp
+
+
+
+
+
+
+
+
+
+
+
+
+ $(CleanDependsOn);
+ MakeClean;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PlatformPrepareForBuild;$(PrepareForBuildDependsOn)
+ PlatformPrepareForBuild;$(PrepareForBuildDependsOn)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src_vs2010/BuildTasks/BlackBerry/Microsoft.CppBuild.BlackBerry.targets b/src_vs2010/BuildTasks/BlackBerry/Microsoft.CppBuild.BlackBerry.targets
new file mode 100644
index 00000000..5e412b2c
--- /dev/null
+++ b/src_vs2010/BuildTasks/BlackBerry/Microsoft.CppBuild.BlackBerry.targets
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+ false
+ false
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PropertySheet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Project
+
+
+ PropertySheet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src_vs2010/BuildTasks/BlackBerry/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerry.qcc.props b/src_vs2010/BuildTasks/BlackBerry/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerry.qcc.props
new file mode 100644
index 00000000..15c665e8
--- /dev/null
+++ b/src_vs2010/BuildTasks/BlackBerry/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerry.qcc.props
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+ $(Registry:HKEY_CURRENT_USER\SOFTWARE\BlackBerry\VSPlugin@NDKTargetPath)
+ $(Registry:HKEY_CURRENT_USER\SOFTWARE\BlackBerry\VSPlugin@NDKHostPath)
+ $(Registry:HKEY_CURRENT_USER\SOFTWARE\BlackBerry\VSPlugin@NDKFamilyType)
+ $([System.IO.File]::ReadAllText("$(QNX_HOST)\etc\qcc\gcc\default").Substring(4,5))
+ $(QNX_HOST)\etc\qcc\gcc
+ $(from_file)
+ gcc_ntoarmv7le
+ armle-v7
+ Regular
+ Unicode
+ $(QNX_TARGET)\$(CPUVARDIR)\lib
+ $(LocalAppData)
+
+
+ $(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion@CurrentVersion)
+ $(HomeDrive)$(HomePath)\Local Settings\Application Data
+
+ $(AppDataPath)\Research In Motion
+ $(SSHKeyDir)\bbt_id_rsa.pub
+ $(SSHKeyDir)\bbt_id_rsa
+
+
+
+ BlackBerryDebugEngine
+
+
+
+ qcc2.0
+ $(QNX_HOST)\usr\bin
+ qcc.exe
+ qcc.exe
+ qcc.exe
+ $(registry:HKEY_CURRENT_USER\SOFTWARE\BlackBerry\VSPlugin@QNXToolsPath)
+ $(QNX_HOST)\usr\bin
+ $(MSBuildProgramFiles32)\MSBuild\BlackBerry\QnxTools\bin
+ $(QnxToolsPath)\blackberry-signer.bat
+ $(QnxToolsPath)
+ $(QnxToolsPath)\blackberry-nativepackager.bat
+ $(QnxToolsPath)
+ $(QnxToolsPath)\blackberry-deploy.bat
+ $(QnxToolsPath)\blackberry-connect.bat
+ ssh.exe
+ $(QccToolsPath)
+ $(QccToolsPath)\ssh-keygen.exe
+
+
+
+ $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VC@ProductDir)
+ $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Setup\VC@ProductDir)
+ $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\10.0\Setup\VC@ProductDir)
+ $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VCExpress\10.0\Setup\VC@ProductDir)
+
+ $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VS@ProductDir)
+ $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Setup\VS@ProductDir)
+ $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\10.0\Setup\VS@ProductDir)
+ $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VCExpress\10.0\Setup\VS@ProductDir)
+
+ $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
+ $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
+
+ $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework@InstallRoot)
+ $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework@InstallRoot)
+
+ $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
+ $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
+
+
+
+ $(QNX_HOST)\usr\bin;$(PATH);
+ $(QNX_TARGET)\usr\include;$(QNX_TARGET)\usr\include\freetype2;$(QNX_TARGET)\usr\include\qt4\QtCore;$(QNX_TARGET)\usr\include\qt4\QtDeclarative;$(QNX_TARGET)\usr\include\qt4;$(QNX_TARGET)\..\target-override\usr\include;$(QNX_TARGET)\usr\include\cpp;$(QNX_TARGET)\usr\include\cpp\c;$(ProjectDir)\arm\o.le-v7-g\.moc;$(ProjectDir)\arm\o.le-v7\.moc;$(ProjectDir)\x86\o-g\.moc
+ $(QccLibPath);$(QNX_TARGET)\..\target-override\$(CPUVARDIR)\lib;$(QNX_TARGET)\..\target-override\$(CPUVARDIR)\usr\lib;
+
+ $(ExecutablePath)
+
+
+
+
diff --git a/src/VSNDK.Tasks/BlackBerry/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerry.qcc.targets b/src_vs2010/BuildTasks/BlackBerry/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerry.qcc.targets
similarity index 100%
rename from src/VSNDK.Tasks/BlackBerry/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerry.qcc.targets
rename to src_vs2010/BuildTasks/BlackBerry/PlatformToolsets/qcc/Microsoft.Cpp.BlackBerry.qcc.targets
diff --git a/src_vs2010/BuildTasks/Properties/AssemblyInfo.cs b/src_vs2010/BuildTasks/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..5c553b9e
--- /dev/null
+++ b/src_vs2010/BuildTasks/Properties/AssemblyInfo.cs
@@ -0,0 +1,51 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+using BlackBerry.NativeCore;
+
+[assembly: AssemblyTitle("BlackBerry Native SDK Build Tasks")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("BlackBerry")]
+[assembly: AssemblyProduct("BlackBerry.BuildTasks")]
+[assembly: AssemblyCopyright("Copyright © BlackBerry 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("d4362271-7b17-4734-86bb-39564f3e29fc")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion(ConfigDefaults.VersionString)]
+[assembly: AssemblyFileVersion(ConfigDefaults.VersionString)]
diff --git a/src_vs2010/DebugEngine/AD7.Definitions/AD7Enums.cs b/src_vs2010/DebugEngine/AD7.Definitions/AD7Enums.cs
new file mode 100644
index 00000000..f6cf0c11
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Definitions/AD7Enums.cs
@@ -0,0 +1,100 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// Flags passed by the debugger to the engine to describe the desired format and execution options for properties
+ /// (locals, arguments, etc...)
+ ///
+ public enum DEBUGPROP_INFO_FLAGS
+ {
+ DEBUGPROP_INFO_FULLNAME = 0x00000001,
+ DEBUGPROP_INFO_NAME = 0x00000002,
+ DEBUGPROP_INFO_TYPE = 0x00000004,
+ DEBUGPROP_INFO_VALUE = 0x00000008,
+ DEBUGPROP_INFO_ATTRIB = 0x00000010,
+ DEBUGPROP_INFO_PROP = 0x00000020,
+
+ DEBUGPROP_INFO_VALUE_AUTOEXPAND = 0x00010000,
+ DEBUGPROP_INFO_NOFUNCEVAL = 0x00020000, // Tell EE not to perform ANY type of func-eval.
+ DEBUGPROP_INFO_VALUE_RAW = 0x00040000, // Tell EE not to return any beautified values or members.
+ DEBUGPROP_INFO_VALUE_NO_TOSTRING = 0x00080000, // Tell EE not to return any special synthesized values (ToString() for instance).
+ DEBUGPROP_INFO_NO_NONPUBLIC_MEMBERS = 0x00100000, // Tell EE to return non-public members for non-user objects.
+
+ DEBUGPROP_INFO_NONE = 0x00000000,
+ DEBUGPROP_INFO_STANDARD = DEBUGPROP_INFO_ATTRIB | DEBUGPROP_INFO_NAME | DEBUGPROP_INFO_TYPE | DEBUGPROP_INFO_VALUE,
+ }
+
+ public static class DBG_ATTRIB_FLAGS
+ {
+ public static readonly ulong DBG_ATTRIB_NONE = 0x0000000000000000;
+ public static readonly ulong DBG_ATTRIB_ALL = 0x00000000ffffffff;
+
+ // Attributes about the object itself
+ public static readonly ulong DBG_ATTRIB_OBJ_IS_EXPANDABLE = 0x0000000000000001;
+ public static readonly ulong DBG_ATTRIB_OBJ_HAS_ID = 0x0000000000000002;
+ public static readonly ulong DBG_ATTRIB_OBJ_CAN_HAVE_ID = 0x0000000000000004;
+
+ // Attributes about the value of the object
+ public static readonly ulong DBG_ATTRIB_VALUE_READONLY = 0x0000000000000010;
+ public static readonly ulong DBG_ATTRIB_VALUE_ERROR = 0x0000000000000020;
+ public static readonly ulong DBG_ATTRIB_VALUE_SIDE_EFFECT= 0x0000000000000040;
+ public static readonly ulong DBG_ATTRIB_OVERLOADED_CONTAINER = 0x0000000000000080;
+ public static readonly ulong DBG_ATTRIB_VALUE_BOOLEAN = 0x0000000000000100;
+ public static readonly ulong DBG_ATTRIB_VALUE_BOOLEAN_TRUE = 0x0000000000000200;
+ public static readonly ulong DBG_ATTRIB_VALUE_INVALID = 0x0000000000000400;
+ public static readonly ulong DBG_ATTRIB_VALUE_NAT = 0x0000000000000800;
+ public static readonly ulong DBG_ATTRIB_VALUE_AUTOEXPANDED = 0x0000000000001000;
+ public static readonly ulong DBG_ATTRIB_VALUE_TIMEOUT = 0x0000000000002000;
+ public static readonly ulong DBG_ATTRIB_VALUE_RAW_STRING = 0x0000000000004000;
+ public static readonly ulong DBG_ATTRIB_VALUE_CUSTOM_VIEWER = 0x0000000000008000;
+
+ // Attributes about field access types for the object
+ public static readonly ulong DBG_ATTRIB_ACCESS_NONE = 0x0000000000010000;
+ public static readonly ulong DBG_ATTRIB_ACCESS_PUBLIC = 0x0000000000020000;
+ public static readonly ulong DBG_ATTRIB_ACCESS_PRIVATE = 0x0000000000040000;
+ public static readonly ulong DBG_ATTRIB_ACCESS_PROTECTED = 0x0000000000080000;
+ public static readonly ulong DBG_ATTRIB_ACCESS_FINAL = 0x0000000000100000;
+ public static readonly ulong DBG_ATTRIB_ACCESS_ALL = 0x00000000001f0000;
+
+ // Attributes for the storage types of the object
+ public static readonly ulong DBG_ATTRIB_STORAGE_NONE = 0x0000000001000000;
+ public static readonly ulong DBG_ATTRIB_STORAGE_GLOBAL = 0x0000000002000000;
+ public static readonly ulong DBG_ATTRIB_STORAGE_STATIC = 0x0000000004000000;
+ public static readonly ulong DBG_ATTRIB_STORAGE_REGISTER = 0x0000000008000000;
+ public static readonly ulong DBG_ATTRIB_STORAGE_ALL= 0x000000000f000000;
+
+ // Attributes for the type modifiers on the object
+ public static readonly ulong DBG_ATTRIB_TYPE_NONE = 0x0000000100000000;
+ public static readonly ulong DBG_ATTRIB_TYPE_VIRTUAL = 0x0000000200000000;
+ public static readonly ulong DBG_ATTRIB_TYPE_CONSTANT = 0x0000000400000000;
+ public static readonly ulong DBG_ATTRIB_TYPE_SYNCHRONIZED = 0x0000000800000000;
+ public static readonly ulong DBG_ATTRIB_TYPE_VOLATILE = 0x0000001000000000;
+ public static readonly ulong DBG_ATTRIB_TYPE_ALL = 0x0000001f00000000;
+
+ // Attributes that describe the type of object
+ public static readonly ulong DBG_ATTRIB_DATA = 0x0000010000000000;
+ public static readonly ulong DBG_ATTRIB_METHOD = 0x0000020000000000;
+ public static readonly ulong DBG_ATTRIB_PROPERTY = 0x0000040000000000;
+ public static readonly ulong DBG_ATTRIB_CLASS = 0x0000080000000000;
+ public static readonly ulong DBG_ATTRIB_BASECLASS = 0x0000100000000000;
+ public static readonly ulong DBG_ATTRIB_INTERFACE = 0x0000200000000000;
+ public static readonly ulong DBG_ATTRIB_INNERCLASS = 0x0000400000000000;
+ public static readonly ulong DBG_ATTRIB_MOSTDERIVED = 0x0000800000000000;
+ public static readonly ulong DBG_ATTRIB_CHILD_ALL = 0x0000ff0000000000;
+
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Definitions/AD7Guids.cs b/src_vs2010/DebugEngine/AD7.Definitions/AD7Guids.cs
new file mode 100644
index 00000000..5574dd38
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Definitions/AD7Guids.cs
@@ -0,0 +1,68 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// These are well-known guids in AD7. Most of these are used to specify filters in what the debugger UI is requesting.
+ /// For instance, guidFilterLocals can be passed to IDebugStackFrame2::EnumProperties to specify only locals are requested.
+ ///
+ static class AD7Guids
+ {
+ static private Guid _guidFilterRegisters = new Guid("223ae797-bd09-4f28-8241-2763bdc5f713");
+ static public Guid guidFilterRegisters
+ {
+ get { return _guidFilterRegisters; }
+ }
+
+ static private Guid _guidFilterLocals = new Guid("b200f725-e725-4c53-b36a-1ec27aef12ef");
+ static public Guid guidFilterLocals
+ {
+ get { return _guidFilterLocals; }
+ }
+
+ static private Guid _guidFilterAllLocals = new Guid("196db21f-5f22-45a9-b5a3-32cddb30db06");
+ static public Guid guidFilterAllLocals
+ {
+ get { return _guidFilterAllLocals; }
+ }
+
+ static private Guid _guidFilterArgs = new Guid("804bccea-0475-4ae7-8a46-1862688ab863");
+ static public Guid guidFilterArgs
+ {
+ get { return _guidFilterArgs; }
+ }
+
+ static private Guid _guidFilterLocalsPlusArgs = new Guid("e74721bb-10c0-40f5-807f-920d37f95419");
+ static public Guid guidFilterLocalsPlusArgs
+ {
+ get { return _guidFilterLocalsPlusArgs; }
+ }
+
+ static private Guid _guidFilterAllLocalsPlusArgs = new Guid("939729a8-4cb0-4647-9831-7ff465240d5f");
+ static public Guid guidFilterAllLocalsPlusArgs
+ {
+ get { return _guidFilterAllLocalsPlusArgs; }
+ }
+
+ // Language guid for C++. Used when the language for a document context or a stack frame is requested.
+ static private Guid _guidLanguageCpp = new Guid("3a12d0b7-c26c-11d0-b442-00a0244a1dd2");
+ static public Guid guidLanguageCpp
+ {
+ get { return _guidLanguageCpp; }
+ }
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Definitions/AD7Hresult.cs b/src_vs2010/DebugEngine/AD7.Definitions/AD7Hresult.cs
new file mode 100644
index 00000000..1efbb9ad
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Definitions/AD7Hresult.cs
@@ -0,0 +1,254 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// These are managed definitions of the well-known AD7 HRESULTS. Defined in msdbg.idl.
+ ///
+ static public class AD7_HRESULT
+ {
+ public const int S_ATTACH_DEFERRED=unchecked((int)0x40004);
+ public const int S_ATTACH_IGNORED=unchecked((int)0x40005);
+ public const int S_JIT_USERCANCELLED=unchecked((int)0x400B0);
+ public const int S_JIT_NOT_REG_FOR_ENGINE=unchecked((int)0x400B5);
+ public const int S_TERMINATE_PROCESSES_STILL_DETACHING=unchecked((int)0x400C0);
+ public const int S_TERMINATE_PROCESSES_STILL_TERMINATING=unchecked((int)0x400C1);
+ public const int S_ENC_SETIP_REQUIRES_CONTINUE=unchecked((int)0x40106);
+ public const int S_WEBDBG_UNABLE_TO_DIAGNOSE=unchecked((int)0x40120);
+ public const int S_WEBDBG_DEBUG_VERB_BLOCKED=unchecked((int)0x40121);
+ public const int S_ASP_USER_ACCESS_DENIED=unchecked((int)0x40125);
+ public const int S_JMC_LIMITED_SUPPORT=unchecked((int)0x40146);
+ public const int S_CANNOT_REMAP_IN_EXCEPTION=unchecked((int)0x40150);
+ public const int S_CANNOT_REMAP_NOT_AT_SEQUENCE_POINT=unchecked((int)0x40151);
+ public const int S_GETPARENT_NO_PARENT=unchecked((int)0x40531);
+ public const int S_GETDERIVEDMOST_NO_DERIVED_MOST=unchecked((int)0x40541);
+ public const int S_GETMEMORYBYTES_NO_MEMORY_BYTES=unchecked((int)0x40551);
+ public const int S_GETMEMORYCONTEXT_NO_MEMORY_CONTEXT=unchecked((int)0x40561);
+ public const int S_GETSIZE_NO_SIZE=unchecked((int)0x40571);
+ public const int S_GETEXTENDEDINFO_NO_EXTENDEDINFO=unchecked((int)0x40591);
+ public const int S_ASYNC_STOP=unchecked((int)0x40B02);
+ public const int E_ATTACH_DEBUGGER_ALREADY_ATTACHED=unchecked((int)0x80040001);
+ public const int E_ATTACH_DEBUGGEE_PROCESS_SECURITY_VIOLATION=unchecked((int)0x80040002);
+ public const int E_ATTACH_CANNOT_ATTACH_TO_DESKTOP=unchecked((int)0x80040003);
+ public const int E_LAUNCH_NO_INTEROP=unchecked((int)0x80040005);
+ public const int E_LAUNCH_DEBUGGING_NOT_POSSIBLE=unchecked((int)0x80040006);
+ public const int E_LAUNCH_KERNEL_DEBUGGER_ENABLED=unchecked((int)0x80040007);
+ public const int E_LAUNCH_KERNEL_DEBUGGER_PRESENT=unchecked((int)0x80040008);
+ public const int E_INTEROP_NOT_SUPPORTED=unchecked((int)0x80040009);
+ public const int E_TOO_MANY_PROCESSES=unchecked((int)0x8004000A);
+ public const int E_MSHTML_SCRIPT_DEBUGGING_DISABLED=unchecked((int)0x8004000B);
+ public const int E_SCRIPT_PDM_NOT_REGISTERED=unchecked((int)0x8004000C);
+ public const int E_DE_CLR_DBG_SERVICES_NOT_INSTALLED=unchecked((int)0x8004000D);
+ public const int E_ATTACH_NO_CLR_PROGRAMS=unchecked((int)0x8004000E);
+ public const int E_REMOTE_SERVER_CLOSED=unchecked((int)0x80040010);
+ public const int E_CLR_NOT_SUPPORTED=unchecked((int)0x80040016);
+ public const int E_64BIT_CLR_NOT_SUPPORTED=unchecked((int)0x80040017);
+ public const int E_CANNOT_MIX_MINDUMP_DEBUGGING=unchecked((int)0x80040018);
+ public const int E_DEBUG_ENGINE_NOT_REGISTERED=unchecked((int)0x80040019);
+ public const int E_LAUNCH_SXS_ERROR=unchecked((int)0x8004001A);
+ public const int E_REMOTE_SERVER_DOES_NOT_EXIST=unchecked((int)0x80040020);
+ public const int E_REMOTE_SERVER_ACCESS_DENIED=unchecked((int)0x80040021);
+ public const int E_REMOTE_SERVER_MACHINE_DOES_NOT_EXIST=unchecked((int)0x80040022);
+ public const int E_DEBUGGER_NOT_REGISTERED_PROPERLY=unchecked((int)0x80040023);
+ public const int E_FORCE_GUEST_MODE_ENABLED=unchecked((int)0x80040024);
+ public const int E_GET_IWAM_USER_FAILURE=unchecked((int)0x80040025);
+ public const int E_REMOTE_SERVER_INVALID_NAME=unchecked((int)0x80040026);
+ public const int E_REMOTE_SERVER_MACHINE_NO_DEFAULT=unchecked((int)0x80040027);
+ public const int E_AUTO_LAUNCH_EXEC_FAILURE=unchecked((int)0x80040028);
+ public const int E_SERVICE_ACCESS_DENIED=unchecked((int)0x80040029);
+ public const int E_SERVICE_ACCESS_DENIED_ON_CALLBACK=unchecked((int)0x8004002A);
+ public const int E_REMOTE_COMPONENTS_NOT_REGISTERED=unchecked((int)0x8004002B);
+ public const int E_DCOM_ACCESS_DENIED=unchecked((int)0x8004002C);
+ public const int E_SHARE_LEVEL_ACCESS_CONTROL_ENABLED=unchecked((int)0x8004002D);
+ public const int E_WORKGROUP_REMOTE_LOGON_FAILURE=unchecked((int)0x8004002E);
+ public const int E_WINAUTH_CONNECT_NOT_SUPPORTED=unchecked((int)0x8004002F);
+ public const int E_EVALUATE_BUSY_WITH_EVALUATION=unchecked((int)0x80040030);
+ public const int E_EVALUATE_TIMEOUT=unchecked((int)0x80040031);
+ public const int E_INTEROP_NOT_SUPPORTED_FOR_THIS_CLR=unchecked((int)0x80040032);
+ public const int E_CLR_INCOMPATIBLE_PROTOCOL=unchecked((int)0x80040033);
+ public const int E_CLR_CANNOT_DEBUG_FIBER_PROCESS=unchecked((int)0x80040034);
+ public const int E_PROCESS_OBJECT_ACCESS_DENIED=unchecked((int)0x80040035);
+ public const int E_PROCESS_TOKEN_ACCESS_DENIED=unchecked((int)0x80040036);
+ public const int E_PROCESS_TOKEN_ACCESS_DENIED_NO_TS=unchecked((int)0x80040037);
+ public const int E_OPERATION_REQUIRES_ELEVATION=unchecked((int)0x80040038);
+ public const int E_ATTACH_REQUIRES_ELEVATION=unchecked((int)0x80040039);
+ public const int E_MEMORY_NOTSUPPORTED=unchecked((int)0x80040040);
+ public const int E_DISASM_NOTSUPPORTED=unchecked((int)0x80040041);
+ public const int E_DISASM_BADADDRESS=unchecked((int)0x80040042);
+ public const int E_DISASM_NOTAVAILABLE=unchecked((int)0x80040043);
+ public const int E_BP_DELETED=unchecked((int)0x80040060);
+ public const int E_PROCESS_DESTROYED=unchecked((int)0x80040070);
+ public const int E_PROCESS_DEBUGGER_IS_DEBUGGEE=unchecked((int)0x80040071);
+ public const int E_TERMINATE_FORBIDDEN=unchecked((int)0x80040072);
+ public const int E_THREAD_DESTROYED=unchecked((int)0x80040075);
+ public const int E_PORTSUPPLIER_NO_PORT=unchecked((int)0x80040080);
+ public const int E_PORT_NO_REQUEST=unchecked((int)0x80040090);
+ public const int E_COMPARE_CANNOT_COMPARE=unchecked((int)0x800400A0);
+ public const int E_JIT_INVALID_PID=unchecked((int)0x800400B1);
+ public const int E_JIT_VSJITDEBUGGER_NOT_REGISTERED=unchecked((int)0x800400B3);
+ public const int E_JIT_APPID_NOT_REGISTERED=unchecked((int)0x800400B4);
+ public const int E_SESSION_TERMINATE_DETACH_FAILED=unchecked((int)0x800400C2);
+ public const int E_SESSION_TERMINATE_FAILED=unchecked((int)0x800400C3);
+ public const int E_DETACH_NO_PROXY=unchecked((int)0x800400D0);
+ public const int E_DETACH_TS_UNSUPPORTED=unchecked((int)0x800400E0);
+ public const int E_DETACH_IMPERSONATE_FAILURE=unchecked((int)0x800400F0);
+ public const int E_CANNOT_SET_NEXT_STATEMENT_ON_NONLEAF_FRAME=unchecked((int)0x80040100);
+ public const int E_TARGET_FILE_MISMATCH=unchecked((int)0x80040101);
+ public const int E_IMAGE_NOT_LOADED=unchecked((int)0x80040102);
+ public const int E_FIBER_NOT_SUPPORTED=unchecked((int)0x80040103);
+ public const int E_CANNOT_SETIP_TO_DIFFERENT_FUNCTION=unchecked((int)0x80040104);
+ public const int E_CANNOT_SET_NEXT_STATEMENT_ON_EXCEPTION=unchecked((int)0x80040105);
+ public const int E_ENC_SETIP_REQUIRES_CONTINUE=unchecked((int)0x80040107);
+ public const int E_CANNOT_SET_NEXT_STATEMENT_INTO_FINALLY=unchecked((int)0x80040108);
+ public const int E_CANNOT_SET_NEXT_STATEMENT_OUT_OF_FINALLY=unchecked((int)0x80040109);
+ public const int E_CANNOT_SET_NEXT_STATEMENT_INTO_CATCH=unchecked((int)0x8004010A);
+ public const int E_CANNOT_SET_NEXT_STATEMENT_GENERAL=unchecked((int)0x8004010B);
+ public const int E_CANNOT_SET_NEXT_STATEMENT_INTO_OR_OUT_OF_FILTER=unchecked((int)0x8004010C);
+ public const int E_ASYNCBREAK_NO_PROGRAMS=unchecked((int)0x80040110);
+ public const int E_ASYNCBREAK_DEBUGGEE_NOT_INITIALIZED=unchecked((int)0x80040111);
+ public const int E_WEBDBG_DEBUG_VERB_BLOCKED=unchecked((int)0x80040121);
+ public const int E_ASP_USER_ACCESS_DENIED=unchecked((int)0x80040125);
+ public const int E_AUTO_ATTACH_NOT_REGISTERED=unchecked((int)0x80040126);
+ public const int E_AUTO_ATTACH_DCOM_ERROR=unchecked((int)0x80040127);
+ public const int E_AUTO_ATTACH_NOT_SUPPORTED=unchecked((int)0x80040128);
+ public const int E_AUTO_ATTACH_CLASSNOTREG=unchecked((int)0x80040129);
+ public const int E_CANNOT_CONTINUE_DURING_PENDING_EXPR_EVAL=unchecked((int)0x80040130);
+ public const int E_REMOTE_REDIRECTION_UNSUPPORTED=unchecked((int)0x80040135);
+ public const int E_INVALID_WORKING_DIRECTORY=unchecked((int)0x80040136);
+ public const int E_LAUNCH_FAILED_WITH_ELEVATION=unchecked((int)0x80040137);
+ public const int E_LAUNCH_ELEVATION_REQUIRED=unchecked((int)0x80040138);
+ public const int E_CANNOT_FIND_INTERNET_EXPLORER=unchecked((int)0x80040139);
+ public const int E_EXCEPTION_CANNOT_BE_INTERCEPTED=unchecked((int)0x80040140);
+ public const int E_EXCEPTION_CANNOT_UNWIND_ABOVE_CALLBACK=unchecked((int)0x80040141);
+ public const int E_INTERCEPT_CURRENT_EXCEPTION_NOT_SUPPORTED=unchecked((int)0x80040142);
+ public const int E_INTERCEPT_CANNOT_UNWIND_LASTCHANCE_INTEROP=unchecked((int)0x80040143);
+ public const int E_JMC_CANNOT_SET_STATUS=unchecked((int)0x80040145);
+ public const int E_DESTROYED=unchecked((int)0x80040201);
+ public const int E_REMOTE_NOMSVCMON=unchecked((int)0x80040202);
+ public const int E_REMOTE_BADIPADDRESS=unchecked((int)0x80040203);
+ public const int E_REMOTE_MACHINEDOWN=unchecked((int)0x80040204);
+ public const int E_REMOTE_MACHINEUNSPECIFIED=unchecked((int)0x80040205);
+ public const int E_CRASHDUMP_ACTIVE=unchecked((int)0x80040206);
+ public const int E_ALL_THREADS_SUSPENDED=unchecked((int)0x80040207);
+ public const int E_LOAD_DLL_TL=unchecked((int)0x80040208);
+ public const int E_LOAD_DLL_SH=unchecked((int)0x80040209);
+ public const int E_LOAD_DLL_EM=unchecked((int)0x8004020A);
+ public const int E_LOAD_DLL_EE=unchecked((int)0x8004020B);
+ public const int E_LOAD_DLL_DM=unchecked((int)0x8004020C);
+ public const int E_LOAD_DLL_MD=unchecked((int)0x8004020D);
+ public const int E_IOREDIR_BADFILE=unchecked((int)0x8004020E);
+ public const int E_IOREDIR_BADSYNTAX=unchecked((int)0x8004020F);
+ public const int E_REMOTE_BADVERSION=unchecked((int)0x80040210);
+ public const int E_CRASHDUMP_UNSUPPORTED=unchecked((int)0x80040211);
+ public const int E_REMOTE_BAD_CLR_VERSION=unchecked((int)0x80040212);
+ public const int E_UNSUPPORTED_BINARY=unchecked((int)0x80040215);
+ public const int E_DEBUGGEE_BLOCKED=unchecked((int)0x80040216);
+ public const int E_REMOTE_NOUSERMSVCMON=unchecked((int)0x80040217);
+ public const int E_STEP_WIN9xSYSCODE=unchecked((int)0x80040218);
+ public const int E_INTEROP_ORPC_INIT=unchecked((int)0x80040219);
+ public const int E_CANNOT_DEBUG_WIN32=unchecked((int)0x8004021B);
+ public const int E_CANNOT_DEBUG_WIN64=unchecked((int)0x8004021C);
+ public const int E_MINIDUMP_READ_WIN9X=unchecked((int)0x8004021D);
+ public const int E_CROSS_TSSESSION_ATTACH=unchecked((int)0x8004021E);
+ public const int E_STEP_BP_SET_FAILED=unchecked((int)0x8004021F);
+ public const int E_LOAD_DLL_TL_INCORRECT_VERSION=unchecked((int)0x80040220);
+ public const int E_LOAD_DLL_DM_INCORRECT_VERSION=unchecked((int)0x80040221);
+ public const int E_REMOTE_NOMSVCMON_PIPE=unchecked((int)0x80040222);
+ public const int E_LOAD_DLL_DIA=unchecked((int)0x80040223);
+ public const int E_DUMP_CORRUPTED=unchecked((int)0x80040224);
+ public const int E_INTEROP_WIN64=unchecked((int)0x80040225);
+ public const int E_CRASHDUMP_DEPRECATED=unchecked((int)0x80040227);
+ public const int E_DEVICEBITS_NOT_SIGNED=unchecked((int)0x80040401);
+ public const int E_ATTACH_NOT_ENABLED=unchecked((int)0x80040402);
+ public const int E_REMOTE_DISCONNECT=unchecked((int)0x80040403);
+ public const int E_BREAK_ALL_FAILED=unchecked((int)0x80040404);
+ public const int E_DEVICE_ACCESS_DENIED_SELECT_YES=unchecked((int)0x80040405);
+ public const int E_DEVICE_ACCESS_DENIED=unchecked((int)0x80040406);
+ public const int E_DEVICE_CONNRESET=unchecked((int)0x80040407);
+ public const int E_BAD_NETCF_VERSION=unchecked((int)0x80040408);
+ public const int E_REFERENCE_NOT_VALID=unchecked((int)0x80040501);
+ public const int E_PROPERTY_NOT_VALID=unchecked((int)0x80040511);
+ public const int E_SETVALUE_VALUE_CANNOT_BE_SET=unchecked((int)0x80040521);
+ public const int E_SETVALUE_VALUE_IS_READONLY=unchecked((int)0x80040522);
+ public const int E_SETVALUEASREFERENCE_NOTSUPPORTED=unchecked((int)0x80040523);
+ public const int E_CANNOT_GET_UNMANAGED_MEMORY_CONTEXT=unchecked((int)0x80040561);
+ public const int E_GETREFERENCE_NO_REFERENCE=unchecked((int)0x80040581);
+ public const int E_CODE_CONTEXT_OUT_OF_SCOPE=unchecked((int)0x800405A1);
+ public const int E_INVALID_SESSIONID=unchecked((int)0x800405A2);
+ public const int E_SERVER_UNAVAILABLE_ON_CALLBACK=unchecked((int)0x800405A3);
+ public const int E_ACCESS_DENIED_ON_CALLBACK=unchecked((int)0x800405A4);
+ public const int E_UNKNOWN_AUTHN_SERVICE_ON_CALLBACK=unchecked((int)0x800405A5);
+ public const int E_NO_SESSION_AVAILABLE=unchecked((int)0x800405A6);
+ public const int E_CLIENT_NOT_LOGGED_ON=unchecked((int)0x800405A7);
+ public const int E_OTHER_USERS_SESSION=unchecked((int)0x800405A8);
+ public const int E_USER_LEVEL_ACCESS_CONTROL_REQUIRED=unchecked((int)0x800405A9);
+ public const int E_SCRIPT_CLR_EE_DISABLED=unchecked((int)0x800405B0);
+ public const int E_HTTP_SERVERERROR=unchecked((int)0x80040700);
+ public const int E_HTTP_UNAUTHORIZED=unchecked((int)0x80040701);
+ public const int E_HTTP_SENDREQUEST_FAILED=unchecked((int)0x80040702);
+ public const int E_HTTP_FORBIDDEN=unchecked((int)0x80040703);
+ public const int E_HTTP_NOT_SUPPORTED=unchecked((int)0x80040704);
+ public const int E_HTTP_NO_CONTENT=unchecked((int)0x80040705);
+ public const int E_HTTP_NOT_FOUND=unchecked((int)0x80040706);
+ public const int E_HTTP_BAD_REQUEST=unchecked((int)0x80040707);
+ public const int E_HTTP_ACCESS_DENIED=unchecked((int)0x80040708);
+ public const int E_HTTP_CONNECT_FAILED=unchecked((int)0x80040709);
+ public const int E_HTTP_EXCEPTION=unchecked((int)0x8004070A);
+ public const int E_HTTP_TIMEOUT=unchecked((int)0x8004070B);
+ public const int E_64BIT_COMPONENTS_NOT_INSTALLED=unchecked((int)0x80040750);
+ public const int E_UNMARSHAL_SERVER_FAILED=unchecked((int)0x80040751);
+ public const int E_UNMARSHAL_CALLBACK_FAILED=unchecked((int)0x80040752);
+ public const int E_RPC_REQUIRES_AUTHENTICATION=unchecked((int)0x80040755);
+ public const int E_LOGON_FAILURE_ON_CALLBACK=unchecked((int)0x80040756);
+ public const int E_REMOTE_SERVER_UNAVAILABLE=unchecked((int)0x80040757);
+ public const int E_FIREWALL_USER_CANCELED=unchecked((int)0x80040758);
+ public const int E_REMOTE_CREDENTIALS_PROHIBITED=unchecked((int)0x80040759);
+ public const int E_FIREWALL_NO_EXCEPTIONS=unchecked((int)0x8004075A);
+ public const int E_FIREWALL_CANNOT_OPEN_APPLICATION=unchecked((int)0x8004075B);
+ public const int E_FIREWALL_CANNOT_OPEN_PORT=unchecked((int)0x8004075C);
+ public const int E_FIREWALL_CANNOT_OPEN_FILE_SHARING=unchecked((int)0x8004075D);
+ public const int E_REMOTE_DEBUGGING_UNSUPPORTED=unchecked((int)0x8004075E);
+ public const int E_REMOTE_BAD_MSDBG2=unchecked((int)0x8004075F);
+ public const int E_ATTACH_USER_CANCELED=unchecked((int)0x80040760);
+ public const int E_FUNCTION_NOT_JITTED=unchecked((int)0x80040800);
+ public const int E_NO_CODE_CONTEXT=unchecked((int)0x80040801);
+ public const int E_BAD_CLR_DIASYMREADER=unchecked((int)0x80040802);
+ public const int E_CLR_SHIM_ERROR=unchecked((int)0x80040803);
+ public const int E_AUTOATTACH_ACCESS_DENIED=unchecked((int)0x80040900);
+ public const int E_AUTOATTACH_WEBSERVER_NOT_FOUND=unchecked((int)0x80040901);
+ public const int E_DBGEXTENSION_NOT_FOUND=unchecked((int)0x80040910);
+ public const int E_DBGEXTENSION_FUNCTION_NOT_FOUND=unchecked((int)0x80040911);
+ public const int E_DBGEXTENSION_FAULTED=unchecked((int)0x80040912);
+ public const int E_DBGEXTENSION_RESULT_INVALID=unchecked((int)0x80040913);
+ public const int E_PROGRAM_IN_RUNMODE=unchecked((int)0x80040914);
+ public const int E_CAUSALITY_NO_SERVER_RESPONSE=unchecked((int)0x80040920);
+ public const int E_CAUSALITY_REMOTE_NOT_REGISTERED=unchecked((int)0x80040921);
+ public const int E_CAUSALITY_BREAKPOINT_NOT_HIT=unchecked((int)0x80040922);
+ public const int E_CAUSALITY_BREAKPOINT_BIND_ERROR=unchecked((int)0x80040923);
+ public const int E_CAUSALITY_PROJECT_DISABLED=unchecked((int)0x80040924);
+ public const int E_NO_ATTACH_WHILE_DDD=unchecked((int)0x80040A00);
+ public const int E_SQLLE_ACCESSDENIED=unchecked((int)0x80040A01);
+ public const int E_SQL_SP_ENABLE_PERMISSION_DENIED=unchecked((int)0x80040A02);
+ public const int E_SQL_DEBUGGING_NOT_ENABLED_ON_SERVER=unchecked((int)0x80040A03);
+ public const int E_SQL_CANT_FIND_SSDEBUGPS_ON_CLIENT=unchecked((int)0x80040A04);
+ public const int E_SQL_EXECUTED_BUT_NOT_DEBUGGED=unchecked((int)0x80040A05);
+ public const int E_SQL_VDT_INIT_RETURNED_SQL_ERROR=unchecked((int)0x80040A06);
+ public const int E_ATTACH_FAILED_ABORT_SILENTLY=unchecked((int)0x80040A07);
+ public const int E_SQL_REGISTER_FAILED=unchecked((int)0x80040A08);
+ public const int E_DE_NOT_SUPPORTED_PRE_8_0=unchecked((int)0x80040B00);
+ public const int E_PROGRAM_DESTROY_PENDING=unchecked((int)0x80040B01);
+ public const int E_MANAGED_FEATURE_NOTSUPPORTED=unchecked((int)0x80040BAD);
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7BoundBreakpoint.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7BoundBreakpoint.cs
new file mode 100644
index 00000000..9353f373
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7BoundBreakpoint.cs
@@ -0,0 +1,500 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using BlackBerry.NativeCore.Debugger.Model;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+using System.Runtime.InteropServices;
+using System.Threading;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class represents a breakpoint that has been bound to a location in the debuggee. It is a child of the pending
+ /// breakpoint that creates it. Unless the pending breakpoint only has one bound breakpoint, each bound breakpoint is displayed as
+ /// a child of the pending breakpoint in the breakpoints window. Otherwise, only one is displayed.
+ /// (http://msdn.microsoft.com/en-us/library/bb161979.aspx)
+ ///
+ public sealed class AD7BoundBreakpoint : IDebugBoundBreakpoint2
+ {
+ private readonly AD7PendingBreakpoint _pendingBreakpoint;
+ private readonly AD7BreakpointResolution _breakpointResolution;
+ private readonly AD7Engine _engine;
+
+ private bool _enabled;
+ private bool _deleted;
+ public uint _hitCount;
+
+ public uint m_bpLocationType;
+ public string m_filename = "";
+ public uint m_line;
+ public string m_func = "";
+
+ public BP_PASSCOUNT m_bpPassCount;
+ public BP_CONDITION m_bpCondition;
+
+ ///
+ /// TRUE if the program has to stop when the hit count is equal to a given value.
+ ///
+ public bool _isHitCountEqual;
+
+ ///
+ /// Different than 0 if the program has to stop whenever the hit count is multiple of a given value
+ ///
+ public uint _hitCountMultiple;
+ public bool _breakWhenCondChanged;
+ public string _previousCondEvaluation = "";
+
+ ///
+ /// Indicates if a given breakpoint is being manipulated in one of these 2 methods: SetPassCount and BreakpointHit.
+ ///
+ public bool _blockedPassCount;
+
+ ///
+ /// Indicates if a given breakpoint is being manipulated in one of these 2 methods: SetCondition and BreakpointHit.
+ ///
+ public bool _blockedConditional;
+
+ ///
+ /// GDB member variables.
+ ///
+ private BreakpointInfo _gdbInfo;
+
+ public BreakpointInfo GdbInfo
+ {
+ get { return _gdbInfo; }
+ set { _gdbInfo = value; }
+ }
+
+ ///
+ /// AD7BoundBreakpoint constructor for file/line breaks.
+ ///
+ /// AD7 Engine.
+ /// Contains the information required to implement a breakpoint.
+ /// Associated pending breakpoint.
+ public AD7BoundBreakpoint(AD7Engine engine, BP_REQUEST_INFO requestInfo, AD7PendingBreakpoint pendingBreakpoint)
+ {
+ if (engine == null)
+ throw new ArgumentNullException("engine");
+
+ if (requestInfo.bpLocation.bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FILE_LINE)
+ {
+ string documentName;
+
+ // Get Document Position and File Name
+ IDebugDocumentPosition2 docPosition = (IDebugDocumentPosition2)(Marshal.GetObjectForIUnknown(requestInfo.bpLocation.unionmember2));
+ docPosition.GetFileName(out documentName);
+
+ // Get the location in the document that the breakpoint is in.
+ TEXT_POSITION[] startPosition = new TEXT_POSITION[1];
+ TEXT_POSITION[] endPosition = new TEXT_POSITION[1];
+ docPosition.GetRange(startPosition, endPosition);
+
+ _engine = engine;
+ m_bpLocationType = (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FILE_LINE;
+ m_filename = documentName.Replace('\\', '/');
+ m_line = startPosition[0].dwLine + 1;
+
+ _pendingBreakpoint = pendingBreakpoint;
+ _enabled = true;
+ _deleted = false;
+ _hitCount = 0;
+ _engine.BreakpointManager.RemoteAdd(this, out _gdbInfo);
+ }
+ else if (requestInfo.bpLocation.bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FUNC_OFFSET)
+ {
+ string func;
+
+ IDebugFunctionPosition2 funcPosition = (IDebugFunctionPosition2)(Marshal.GetObjectForIUnknown(requestInfo.bpLocation.unionmember2));
+ funcPosition.GetFunctionName(out func);
+
+ _engine = engine;
+ m_func = func;
+ _enabled = true;
+ _deleted = false;
+ _hitCount = 0;
+ m_bpLocationType = (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FUNC_OFFSET;
+ _pendingBreakpoint = pendingBreakpoint;
+ _engine.BreakpointManager.RemoteAdd(this, out _gdbInfo);
+ }
+
+ if (_gdbInfo != null)
+ {
+ if (!string.IsNullOrEmpty(_gdbInfo.FileName) && _gdbInfo.Address != 0)
+ {
+ // Set the hit count and condition
+ if (requestInfo.bpPassCount.stylePassCount != enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE)
+ SetPassCount(requestInfo.bpPassCount);
+ if (requestInfo.bpCondition.styleCondition != enum_BP_COND_STYLE.BP_COND_NONE)
+ SetCondition(requestInfo.bpCondition);
+
+ // Get the Line Position sent back from GDB
+ AD7MemoryAddress codeContext = new AD7MemoryAddress(_engine, _gdbInfo.Address);
+ AD7DocumentContext documentContext = new AD7DocumentContext(_gdbInfo.FileName, _gdbInfo.Line > 0 ? _gdbInfo.Line - 1 : 0, codeContext);
+
+ _breakpointResolution = new AD7BreakpointResolution(_engine, _gdbInfo.Address, documentContext);
+ _engine.Callback.OnBreakpointBound(this, 0);
+ }
+ }
+ else
+ {
+ _gdbInfo = new BreakpointInfo(0, null, 0, 0);
+ }
+ }
+
+ ///
+ /// Sets the count and conditions upon which a breakpoint is fired.
+ /// (http://msdn.microsoft.com/en-us/library/bb161364.aspx)
+ ///
+ /// Describes the count and conditions upon which a conditional breakpoint is fired.
+ /// VSConstants.S_OK if successful, VSConstants.S_FALSE if not.
+ public int SetPassCount(BP_PASSCOUNT bpPassCount)
+ {
+ bool isRunning = false;
+ int result = VSConstants.S_FALSE;
+ while (!_engine.EventDispatcher.LockedBreakpoint(this, true, false))
+ {
+ Thread.Sleep(0);
+ }
+ while (!_engine.EventDispatcher.EnterCriticalRegion())
+ {
+ Thread.Sleep(0);
+ }
+ if ((_engine.State == AD7Engine.DebugEngineState.Run) && (EventDispatcher._GDBRunMode == true))
+ {
+ isRunning = true;
+ _engine.EventDispatcher.PrepareToModifyBreakpoint();
+ }
+ m_bpPassCount = bpPassCount;
+ if (bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER)
+ {
+ _isHitCountEqual = false;
+ _hitCountMultiple = 0;
+ if (!_breakWhenCondChanged)
+ {
+ if ((int)((bpPassCount.dwPassCount - _hitCount)) >= 0)
+ {
+ if (_engine.EventDispatcher.IgnoreHitCount(_gdbInfo.ID, (int)(bpPassCount.dwPassCount - _hitCount)))
+ result = VSConstants.S_OK;
+ }
+ else
+ {
+ if (_engine.EventDispatcher.IgnoreHitCount(_gdbInfo.ID, 1))
+ result = VSConstants.S_OK;
+ }
+
+ }
+ else
+ result = VSConstants.S_OK;
+ }
+ else if (bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL)
+ {
+ _hitCountMultiple = 0;
+ _isHitCountEqual = true;
+ if (!_breakWhenCondChanged)
+ {
+ if (_engine.EventDispatcher.IgnoreHitCount(_gdbInfo.ID, (int)(bpPassCount.dwPassCount - _hitCount)))
+ result = VSConstants.S_OK;
+ }
+ else
+ result = VSConstants.S_OK;
+ }
+ else if (bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_MOD)
+ {
+ _isHitCountEqual = false;
+ _hitCountMultiple = bpPassCount.dwPassCount;
+ if (!_breakWhenCondChanged)
+ {
+ if (_engine.EventDispatcher.IgnoreHitCount(_gdbInfo.ID, (int)(_hitCountMultiple - (_hitCount % _hitCountMultiple))))
+ result = VSConstants.S_OK;
+ }
+ else
+ result = VSConstants.S_OK;
+ }
+ else if (bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE)
+ {
+ _isHitCountEqual = false;
+ _hitCountMultiple = 0;
+ if (!_breakWhenCondChanged)
+ {
+ if (_engine.EventDispatcher.IgnoreHitCount(_gdbInfo.ID, 1)) // ignoreHitCount decrement by 1 automatically, so sending 1 means to stop ignoring (or ignore 0)
+ result = VSConstants.S_OK;
+ }
+ else
+ result = VSConstants.S_OK;
+ }
+
+ if (isRunning)
+ {
+ isRunning = false;
+ _engine.EventDispatcher.ResumeFromInterrupt();
+ }
+
+ _engine.EventDispatcher.LeaveCriticalRegion();
+ _engine.EventDispatcher.UnlockBreakpoint(this, true, false);
+ return result;
+ }
+
+ ///
+ /// Sets the conditions under which a conditional breakpoint fires. (http://msdn.microsoft.com/en-us/library/bb146215.aspx)
+ ///
+ /// Describes the conditions under which a breakpoint fires.
+ /// VSConstants.S_OK if successful, VSConstants.S_FALSE if not.
+ public int SetCondition(BP_CONDITION bpCondition)
+ {
+ bool updatingCondBreak = _engine._updatingConditionalBreakpoint.WaitOne(0);
+ bool isRunning = false;
+ bool verifyCondition = false;
+ int result = VSConstants.S_FALSE;
+ while (!_engine.EventDispatcher.LockedBreakpoint(this, false, true))
+ {
+ Thread.Sleep(0);
+ }
+
+ if (_hitCount != 0)
+ {
+ _engine.EventDispatcher.ResetHitCount(this, false);
+ }
+
+ while (!_engine.EventDispatcher.EnterCriticalRegion())
+ {
+ Thread.Sleep(0);
+ }
+
+ if ((_engine.State == AD7Engine.DebugEngineState.Run) && (EventDispatcher._GDBRunMode == true))
+ {
+ isRunning = true;
+ _engine.EventDispatcher.PrepareToModifyBreakpoint();
+ _engine.State = AD7Engine.DebugEngineState.Break;
+ }
+
+ m_bpCondition = bpCondition;
+
+ if (bpCondition.styleCondition == enum_BP_COND_STYLE.BP_COND_WHEN_TRUE)
+ {
+ if (_breakWhenCondChanged)
+ {
+ _breakWhenCondChanged = false;
+ verifyCondition = true;
+ }
+ else
+ _breakWhenCondChanged = false;
+
+ _previousCondEvaluation = "";
+ if (_engine.EventDispatcher.SetBreakpointCondition(_gdbInfo.ID, bpCondition.bstrCondition))
+ result = VSConstants.S_OK;
+ }
+ else if (bpCondition.styleCondition == enum_BP_COND_STYLE.BP_COND_WHEN_CHANGED)
+ {
+ _breakWhenCondChanged = true;
+ _previousCondEvaluation = bpCondition.bstrCondition; // just to initialize this variable
+ _engine.EventDispatcher.IgnoreHitCount(_gdbInfo.ID, 1); // have to break always to evaluate this option because GDB doesn't support it.
+ _engine.EventDispatcher.SetBreakpointCondition(_gdbInfo.ID, "");
+
+ result = VSConstants.S_OK;
+ }
+ else if (bpCondition.styleCondition == enum_BP_COND_STYLE.BP_COND_NONE)
+ {
+ if (_breakWhenCondChanged)
+ {
+ _breakWhenCondChanged = false;
+ verifyCondition = true;
+ }
+ else
+ _breakWhenCondChanged = false;
+
+ _previousCondEvaluation = "";
+ if (_engine.EventDispatcher.SetBreakpointCondition(_gdbInfo.ID, ""))
+ result = VSConstants.S_OK;
+ }
+
+ _engine.EventDispatcher.LeaveCriticalRegion();
+ _engine.EventDispatcher.UnlockBreakpoint(this, false, true);
+
+ if (verifyCondition)
+ {
+ SetPassCount(m_bpPassCount);
+ verifyCondition = false;
+ }
+
+ if (isRunning)
+ {
+ isRunning = false;
+ _engine.State = AD7Engine.DebugEngineState.Run;
+ _engine.EventDispatcher.ResumeFromInterrupt();
+ }
+
+ _engine._updatingConditionalBreakpoint.Set();
+
+ return result;
+ }
+
+ #region IDebugBoundBreakpoint2 Members
+
+ ///
+ /// Called when the breakpoint is being deleted by the user. (http://msdn.microsoft.com/en-us/library/bb146595.aspx)
+ ///
+ /// VSConstants.S_OK
+ int IDebugBoundBreakpoint2.Delete()
+ {
+ if (!_deleted)
+ {
+ _enabled = false;
+ _deleted = true;
+ _pendingBreakpoint.OnBoundBreakpointDeleted(this);
+ _engine.BreakpointManager.RemoteDelete(this);
+ _gdbInfo = null;
+ }
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Called by the debugger UI when the user is enabling or disabling a breakpoint.
+ /// (http://msdn.microsoft.com/en-us/library/bb145150.aspx)
+ ///
+ /// Equal to 0 if disabling; different than 0 if enabling.
+ /// VSConstants.S_OK
+ int IDebugBoundBreakpoint2.Enable(int fEnable)
+ {
+ bool xEnabled = fEnable != 0;
+ if (_enabled != xEnabled)
+ {
+ if (xEnabled)
+ {
+ _engine.BreakpointManager.RemoteEnable(this);
+ }
+ else
+ {
+ _engine.BreakpointManager.RemoteDisable(this);
+ }
+ _enabled = xEnabled;
+ }
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Return the breakpoint resolution which describes how the breakpoint bound in the debuggee.
+ /// (http://msdn.microsoft.com/en-us/library/bb145891.aspx)
+ ///
+ /// Contains the information that describes a bound breakpoint.
+ /// VSConstants.S_OK
+ int IDebugBoundBreakpoint2.GetBreakpointResolution(out IDebugBreakpointResolution2 ppBPResolution)
+ {
+ ppBPResolution = _breakpointResolution;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Return the pending breakpoint for this bound breakpoint. (http://msdn.microsoft.com/en-us/library/bb145337.aspx)
+ ///
+ /// Contains a breakpoint that is ready to bind to a code location.
+ /// VSConstants.S_OK
+ int IDebugBoundBreakpoint2.GetPendingBreakpoint(out IDebugPendingBreakpoint2 ppPendingBreakpoint)
+ {
+ ppPendingBreakpoint = _pendingBreakpoint;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the state of this bound breakpoint. (http://msdn.microsoft.com/en-us/library/bb161276.aspx)
+ ///
+ /// Describes the state of the breakpoint.
+ /// VSConstants.S_OK
+ int IDebugBoundBreakpoint2.GetState(enum_BP_STATE[] pState)
+ {
+ pState[0] = 0;
+
+ if (_deleted)
+ {
+ pState[0] = enum_BP_STATE.BPS_DELETED;
+ }
+ else if (_enabled)
+ {
+ pState[0] = enum_BP_STATE.BPS_ENABLED;
+ }
+ else if (!_enabled)
+ {
+ pState[0] = enum_BP_STATE.BPS_DISABLED;
+ }
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the current hit count for this bound breakpoint. (http://msdn.microsoft.com/en-us/library/bb145340.aspx)
+ ///
+ /// Returns the hit count.
+ /// AD7_HRESULT.E_BP_DELETED if the breakpoint was deleted; or VSConstants.S_OK if not.
+ int IDebugBoundBreakpoint2.GetHitCount(out uint pdwHitCount)
+ {
+ if (_deleted)
+ {
+ pdwHitCount = 0;
+ return AD7_HRESULT.E_BP_DELETED;
+ }
+ else
+ {
+ pdwHitCount = _hitCount;
+ return VSConstants.S_OK;
+ }
+ }
+
+ ///
+ /// Sets or changes the condition associated with this bound breakpoint. (http://msdn.microsoft.com/en-us/library/bb146215.aspx)
+ ///
+ /// Describes the condition.
+ /// VSConstants.S_OK if successful, VSConstants.S_FALSE if not.
+ int IDebugBoundBreakpoint2.SetCondition(BP_CONDITION bpCondition)
+ {
+ return SetCondition(bpCondition);
+ }
+
+ ///
+ /// Sets the hit count for the bound breakpoint. (http://msdn.microsoft.com/en-us/library/bb146736.aspx)
+ ///
+ /// The hit count to set.
+ /// AD7_HRESULT.E_BP_DELETED if the breakpoint was deleted; or VSConstants.S_OK if not.
+ int IDebugBoundBreakpoint2.SetHitCount(uint dwHitCount)
+ {
+ if (_deleted)
+ {
+ return AD7_HRESULT.E_BP_DELETED;
+ }
+ else
+ {
+ if ((dwHitCount == 0) && (_hitCount != 0))
+ {
+ _hitCount = dwHitCount;
+ _engine.EventDispatcher.ResetHitCount(this, true);
+ }
+ else
+ _hitCount = dwHitCount;
+ return VSConstants.S_OK;
+ }
+ }
+
+ ///
+ /// Sets or changes the pass count associated with this bound breakpoint. (http://msdn.microsoft.com/en-us/library/bb161364.aspx)
+ ///
+ /// Specifies the pass count.
+ /// VSConstants.S_OK if successful, VSConstants.S_FALSE if not.
+ int IDebugBoundBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
+ {
+ return SetPassCount(bpPassCount);
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7BreakpointResolution.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7BreakpointResolution.cs
new file mode 100644
index 00000000..1c17e776
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7BreakpointResolution.cs
@@ -0,0 +1,111 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+using System.Runtime.InteropServices;
+
+// TODO: Change to take filename and line number instead of an address?
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class represents the information that describes a bound breakpoint. (http://msdn.microsoft.com/en-us/library/bb145894.aspx)
+ ///
+ public class AD7BreakpointResolution : IDebugBreakpointResolution2
+ {
+ ///
+ /// AD7 Engine.
+ ///
+ private readonly AD7Engine _engine;
+
+ ///
+ /// GDB Address
+ ///
+ private readonly uint _address;
+
+ ///
+ /// The document context to the debugger. A document context represents a location within a source file.
+ ///
+ private readonly AD7DocumentContext _documentContext;
+
+ ///
+ /// Constructor.
+ ///
+ /// AD7 Engine.
+ /// GDB Address.
+ /// The document context to the debugger. A document context represents a location within a
+ /// source file.
+ public AD7BreakpointResolution(AD7Engine engine, uint address, AD7DocumentContext documentContext)
+ {
+ if (engine == null)
+ throw new ArgumentNullException("engine");
+
+ _engine = engine;
+ _address = address;
+ _documentContext = documentContext;
+ }
+
+ #region IDebugBreakpointResolution2 Members
+
+ ///
+ /// Gets the type of the breakpoint represented by this resolution. (http://msdn.microsoft.com/en-us/library/bb145576.aspx)
+ ///
+ /// The type of this breakpoint.
+ /// VSConstants.S_OK.
+ int IDebugBreakpointResolution2.GetBreakpointType(enum_BP_TYPE[] pBPType)
+ {
+ // The VSNDK debug engine only supports code breakpoints.
+ pBPType[0] = enum_BP_TYPE.BPT_CODE;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the breakpoint resolution information that describes this breakpoint.
+ /// (http://msdn.microsoft.com/en-us/library/bb146743.aspx)
+ ///
+ /// A combination of flags that determine which fields of the pBPResolutionInfo parameter are to be filled out.
+ /// The BP_RESOLUTION_INFO structure to be filled in with information about this breakpoint.
+ /// VSConstants.S_OK.
+ int IDebugBreakpointResolution2.GetResolutionInfo(enum_BPRESI_FIELDS dwFields, BP_RESOLUTION_INFO[] pBPResolutionInfo)
+ {
+ if ((dwFields & enum_BPRESI_FIELDS.BPRESI_BPRESLOCATION) != 0)
+ {
+ // The sample engine only supports code breakpoints.
+ BP_RESOLUTION_LOCATION location = new BP_RESOLUTION_LOCATION();
+ location.bpType = (uint)enum_BP_TYPE.BPT_CODE;
+
+ // The debugger will not QI the IDebugCodeContex2 interface returned here. We must pass the pointer
+ // to IDebugCodeContex2 and not IUnknown.
+ AD7MemoryAddress codeContext = new AD7MemoryAddress(_engine, _address);
+ codeContext.SetDocumentContext(_documentContext);
+ location.unionmember1 = Marshal.GetComInterfaceForObject(codeContext, typeof(IDebugCodeContext2));
+ pBPResolutionInfo[0].bpResLocation = location;
+ pBPResolutionInfo[0].dwFields |= enum_BPRESI_FIELDS.BPRESI_BPRESLOCATION;
+
+ }
+
+ if ((dwFields & enum_BPRESI_FIELDS.BPRESI_PROGRAM) != 0)
+ {
+ pBPResolutionInfo[0].pProgram = _engine;
+ pBPResolutionInfo[0].dwFields |= enum_BPRESI_FIELDS.BPRESI_PROGRAM;
+ }
+
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7DocumentContext.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7DocumentContext.cs
new file mode 100644
index 00000000..4a24e3cf
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7DocumentContext.cs
@@ -0,0 +1,202 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using BlackBerry.NativeCore;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class represents a document context to the debugger. A document context represents a location within a source file.
+ /// (http://msdn.microsoft.com/en-us/library/bb145572.aspx)
+ ///
+ public sealed class AD7DocumentContext : IDebugDocumentContext2
+ {
+ ///
+ /// Long path file name
+ ///
+ private readonly string _fileName;
+
+ ///
+ /// Start position. In VSNDK debug engine, both begPos and endPos have the same value.
+ ///
+ private TEXT_POSITION _beginPosition;
+
+ ///
+ /// End position. In VSNDK debug engine, both begPos and endPos have the same value.
+ ///
+ private TEXT_POSITION _endPosition;
+
+ ///
+ /// An address in a program's execution stream.
+ ///
+ private readonly AD7MemoryAddress _codeContext;
+
+ ///
+ /// Constructor.
+ ///
+ /// Short path file name.
+ /// Start position.
+ /// An address in a program's execution stream.
+ public AD7DocumentContext(string fileName, uint line, AD7MemoryAddress codeContext)
+ {
+ // Need to lengthen the path to be used by Visual Studio.
+ _fileName = NativeMethods.GetLongPathName(fileName.Replace(@"\\\\", @"\\").Replace(@"\\", @"\")).Replace('\\', '/');
+
+ // Assume source code matching breakpoint begins and ends at the beginning of the line:
+ _beginPosition = new TEXT_POSITION();
+ _beginPosition.dwLine = line;
+ _beginPosition.dwColumn = 0;
+ _endPosition = new TEXT_POSITION();
+ _endPosition.dwLine = line;
+ _endPosition.dwColumn = 0;
+ _codeContext = codeContext;
+ }
+
+ #region IDebugDocumentContext2 Members
+
+ ///
+ /// Compares this document context to a given array of document contexts. (http://msdn.microsoft.com/en-us/library/bb145338.aspx)
+ ///
+ /// A value from the DOCCONTEXT_COMPARE enumeration that specifies the type of comparison.
+ /// An array of IDebugDocumentContext2 objects that represent the document contexts being compared to.
+ /// The length of the array of document contexts to compare.
+ /// Returns the index into the rgpDocContextSet array of the first document context that satisfies the comparison.
+ /// VSConstants.E_NOTIMPL.
+ int IDebugDocumentContext2.Compare(enum_DOCCONTEXT_COMPARE compare, IDebugDocumentContext2[] rgpDocContextSet, uint dwDocContextSetLen, out uint pdwDocContext)
+ {
+ pdwDocContext = 0;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Retrieves a list of all code contexts associated with this document context. The VSNDK Debug Engine only supports one code context per document
+ /// context and the code contexts are always memory addresses. (http://msdn.microsoft.com/en-us/library/bb146273.aspx)
+ ///
+ /// Returns an IEnumDebugCodeContexts2 object that contains a list of code contexts.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ int IDebugDocumentContext2.EnumCodeContexts(out IEnumDebugCodeContexts2 ppEnumCodeCxts)
+ {
+ ppEnumCodeCxts = null;
+ try
+ {
+ IDebugCodeContext2[] codeContexts = new IDebugCodeContext2[1];
+ codeContexts[0] = _codeContext;
+ ppEnumCodeCxts = new AD7CodeContextEnum(codeContexts);
+ return VSConstants.S_OK;
+ }
+ catch (Exception ex)
+ {
+ return EngineUtils.UnexpectedException(ex);
+ }
+ }
+
+ ///
+ /// Gets the document that contains this document context. This method is for those debug engines that supply documents directly
+ /// to the IDE. Since the VSNDK Debug Engine does not do this, this method returns E_FAIL.
+ /// (http://msdn.microsoft.com/en-us/library/bb161759.aspx)
+ ///
+ /// Returns an IDebugDocument2 object that represents the document that contains this document context.
+ /// E_FAIL.
+ int IDebugDocumentContext2.GetDocument(out IDebugDocument2 ppDocument)
+ {
+ ppDocument = null;
+ return VSConstants.E_FAIL;
+ }
+
+ ///
+ /// Gets the language associated with this document context. The language for this sample is always C++.
+ /// (http://msdn.microsoft.com/en-us/library/bb146340.aspx)
+ ///
+ /// Returns the name of the language that implements the code at this document context.
+ /// Returns the GUID of the language that implements the code at this document context.
+ /// VSConstants.S_OK.
+ int IDebugDocumentContext2.GetLanguageInfo(ref string pbstrLanguage, ref Guid pguidLanguage)
+ {
+ pbstrLanguage = "C++";
+ pguidLanguage = AD7Guids.guidLanguageCpp;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the displayable name of the document that contains this document context.
+ /// (http://msdn.microsoft.com/en-us/library/bb146162.aspx)
+ ///
+ /// A value from the GETNAME_TYPE enumeration that specifies the type of name to return.
+ /// Returns the name of the file.
+ /// VSConstants.S_OK.
+ int IDebugDocumentContext2.GetName(enum_GETNAME_TYPE gnType, out string pbstrFileName)
+ {
+ pbstrFileName = _fileName;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the source code range of this document context. A source range is the entire range of source code, from the current
+ /// statement back to just after the previous statement that contributed code. The source range is typically used for mixing
+ /// source statements, including comments, with code in the disassembly window. Since this engine does not support the
+ /// disassembly window, this is not implemented. (http://msdn.microsoft.com/en-us/library/bb146190.aspx)
+ ///
+ /// A TEXT_POSITION structure that is filled in with the starting position. Set to a null value if it is not needed.
+ /// A TEXT_POSITION structure that is filled in with the ending position. Set to a null value if it is not needed.
+ /// Not implemented.
+ int IDebugDocumentContext2.GetSourceRange(TEXT_POSITION[] pBegPosition, TEXT_POSITION[] pEndPosition)
+ {
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Gets the file statement range of the document context. A statement range is the range of the lines that contributed the code
+ /// to which this document context refers. (http://msdn.microsoft.com/en-us/library/bb161669.aspx)
+ ///
+ /// A TEXT_POSITION structure that is filled in with the starting position. Set to a null value if it is not needed.
+ /// A TEXT_POSITION structure that is filled in with the ending position. Set to a null value if it is not needed.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ int IDebugDocumentContext2.GetStatementRange(TEXT_POSITION[] pBegPosition, TEXT_POSITION[] pEndPosition)
+ {
+ try
+ {
+ pBegPosition[0].dwColumn = _beginPosition.dwColumn;
+ pBegPosition[0].dwLine = _beginPosition.dwLine;
+
+ pEndPosition[0].dwColumn = _endPosition.dwColumn;
+ pEndPosition[0].dwLine = _endPosition.dwLine;
+ }
+ catch (Exception ex)
+ {
+ return EngineUtils.UnexpectedException(ex);
+ }
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Moves the document context by a given number of statements or lines. This is used primarily to support the Autos window in
+ /// discovering the proximity statements around this document context. Not implemented.
+ /// (http://msdn.microsoft.com/en-us/library/bb146603.aspx)
+ ///
+ /// The number of statements or lines to move ahead, depending on the document context.
+ /// Returns a new IDebugDocumentContext2 object with the new position.
+ /// Not implemented.
+ int IDebugDocumentContext2.Seek(int nCount, out IDebugDocumentContext2 ppDocContext)
+ {
+ ppDocContext = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7Engine.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7Engine.cs
new file mode 100644
index 00000000..6fd25cb4
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7Engine.cs
@@ -0,0 +1,1392 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using System.Runtime.InteropServices;
+using BlackBerry.NativeCore.Debugger;
+using BlackBerry.NativeCore.Debugger.Model;
+using BlackBerry.NativeCore.Diagnostics;
+using BlackBerry.NativeCore.Helpers;
+using BlackBerry.NativeCore.Model;
+using BlackBerry.NativeCore.Services;
+using BlackBerry.Package.Helpers;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+using System.Diagnostics;
+using System.Threading;
+using System.Windows.Forms;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// AD7Engine is the primary entrypoint object for the sample engine.
+ ///
+ /// It implements:
+ ///
+ /// IDebugEngine2: This interface represents a debug engine (DE). It is used to manage various aspects of a debugging session,
+ /// from creating breakpoints to setting and clearing exceptions. (http://msdn.microsoft.com/en-us/library/bb145310.aspx).
+ ///
+ /// IDebugEngineLaunch2: Used by a debug engine (DE) to launch and terminate programs.
+ /// (http://msdn.microsoft.com/en-us/library/bb146230.aspx).
+ ///
+ /// IDebugProgram3: This interface represents a program that is running in a process. Since this engine only debugs one process at a time and each
+ /// process only contains one program, it is implemented on the engine. (http://msdn.microsoft.com/en-us/library/bb145884.aspx).
+ ///
+ /// IDebugEngineProgram2: This interface provides simultanious debugging of multiple threads in a debuggee.
+ /// (http://msdn.microsoft.com/en-us/library/bb145128.aspx).
+ ///
+ /// IDebugSymbolSettings100: (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugsymbolsettings100.aspx).
+ ///
+ /// Comments:
+ /// Process "Is a container for a set of programs".
+ /// "A debug engine (DE) attaches to a program, and not to a process or a thread".
+ /// Program "Is a container for both a set of threads and a set of modules.".
+ ///
+ [ComVisible(true)]
+ [Guid(ClassGuid)]
+ public sealed class AD7Engine : IDebugEngine2, IDebugEngineLaunch2, IDebugProgram3, IDebugEngineProgram2, IDebugSymbolSettings100
+ {
+ public const string ClassGuid = "904AA6E0-942C-4D11-9094-7BAAEB3EE4B9";
+ public const string ClassName = "BlackBerry.DebugEngine.AD7Engine";
+
+ ///
+ /// This is the engine GUID of the VSNDK debug engine. It needs to be changed here and in the registration when creating a new engine.
+ ///
+ public const string DebugEngineGuid = "{E5A37609-2F43-4830-AA85-D94CFA035DD2}";
+
+ ///
+ /// Used to send events to the debugger. Some examples of these events are thread create, exception thrown, module load.
+ ///
+ public EngineCallback Callback
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// This object manages breakpoints in the sample engine.
+ ///
+ public BreakpointManager BreakpointManager
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// This object manages debug events in the engine.
+ ///
+ public EventDispatcher EventDispatcher
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// A unique identifier for the program being debugged.
+ ///
+ private Guid _programGuid;
+
+ ///
+ /// A module loaded in the debuggee process to the debugger. It is always null because the AD7Module class is
+ /// not implemented yet.
+ ///
+ private AD7Module _module;
+
+ ///
+ /// A process running on a port. A process "Is a container for a set of programs".
+ ///
+ private AD7Process _process;
+
+ ///
+ /// A program that can be debugged.
+ ///
+ private AD7ProgramNode _progNode;
+
+ ///
+ /// A program that is running in a process.
+ ///
+ private IDebugProgram2 _program;
+
+ ///
+ /// TRUE whenever a thread is created/ended, so the debug engine can update the m_threads data structure.
+ ///
+ public bool _updateThreads;
+
+ ///
+ /// Array of threads of the program that is being debugged.
+ ///
+ public AD7Thread[] Threads
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// The position in the m_threads array that corresponds to the current thread.
+ ///
+ public int _currentThreadIndex = -1;
+
+ ///
+ /// Used to avoid race condition when there are conditional breakpoints and the user hit break all. Both events will pause
+ /// the Debug Engine, but the one related to conditional breakpoint can resume execution. If both events happens at the same
+ /// time, the Debug Engine could resume the execution instead of pausing it.
+ ///
+ public ManualResetEvent _running = new ManualResetEvent(true);
+
+ ///
+ /// Used to avoid race condition when there are conditional breakpoints and a breakpoint is hit. This situation is similar to the above one.
+ ///
+ public ManualResetEvent _updatingConditionalBreakpoint = new ManualResetEvent(true);
+
+ ///
+ /// Keeps track of debug engine states
+ ///
+ public enum DebugEngineState
+ {
+ Design = 0,
+ Run,
+ Break,
+ Step,
+ Done
+ }
+
+ public DebugEngineState State
+ {
+ get;
+ set;
+ }
+
+ public AD7Module Module
+ {
+ get { return _module; }
+ }
+
+ public IDebugProgram2 Program
+ {
+ get { return _program; }
+ }
+
+ ///
+ /// Constructor.
+ ///
+ public AD7Engine()
+ {
+ BreakpointManager = new BreakpointManager(this);
+ State = DebugEngineState.Design;
+ }
+
+ ///
+ /// Destructor.
+ ///
+ ~AD7Engine()
+ {
+ // Transition DE state
+ State = DebugEngineState.Done;
+ }
+
+ #region Properties
+
+ public bool HasProcess
+ {
+ get { return _process != null; }
+ }
+
+ #endregion
+
+ #region IDebugEngine2 Members
+
+ ///
+ /// Attach the debug engine to a program. (http://msdn.microsoft.com/en-us/library/bb145136.aspx)
+ ///
+ /// Represent programs to be attached to. These are port programs.
+ /// Represent program nodes, one for each program. The program nodes in this array represent
+ /// the same programs as in pProgram. The program nodes are given so that the DE can identify the programs to attach to.
+ /// Number of programs and/or program nodes in the pProgram and rgpProgramNodes arrays.
+ /// The IDebugEventCallback2 object to be used to send debug events to the SDM.
+ /// A value from the ATTACH_REASON enumeration that specifies the reason for attaching these programs.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ int IDebugEngine2.Attach(IDebugProgram2[] rgpPrograms, IDebugProgramNode2[] rgpProgramNodes, uint aCeltPrograms, IDebugEventCallback2 ad7Callback, enum_ATTACH_REASON dwReason)
+ {
+ if (aCeltPrograms != 1)
+ {
+ Debug.Fail("VSNDK Debugger only supports one debug target at a time.");
+ throw new ArgumentException();
+ }
+
+ try
+ {
+ EngineUtils.RequireOK(rgpPrograms[0].GetProgramId(out _programGuid));
+
+ _program = rgpPrograms[0];
+
+ // It is NULL when the user attached the debugger to a running process (by using Attach to Process UI). When that
+ // happens, some objects must be instantiated, as well as GDB must be launched. Those ones are instantiated/launched
+ // by LaunchSuspended and ResumeProcess methods when debugging an open project.
+ if (Callback == null)
+ {
+ DebugEngineStatus.IsRunning = true;
+ Callback = new EngineCallback(this, ad7Callback);
+
+ var programNode = (AD7ProgramNodeAttach)_program;
+ _process = programNode.Process;
+ var port = (AD7Port)programNode.Process.Port;
+
+ var attachDiscoveryService = (IAttachDiscoveryService) Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(IAttachDiscoveryService));
+ Debug.Assert(attachDiscoveryService != null, "Invalid project references (make sure VisualStudio.Shell.dll is not references, as it duplicates the Package definition from VisualStudio.Shell..dll)");
+
+ // ask the package about opened BlackBerry projects and find matching one:
+ var exePath = attachDiscoveryService.FindExecutable(_process.Details);
+
+ // load from registry
+ var runtime = RuntimeDefinition.Load();
+
+ uint aux;
+ if (GdbWrapper.AttachToProcess(programNode.Process.ID.ToString(), exePath, _process.Details, port.NDK, port.Device, runtime, out aux))
+ {
+ if (exePath == "CannotAttachToRunningProcess")
+ {
+ MessageBoxHelper.Show(_process.Details.Name + " is attached to the debugger. However, to be able to debug your application, you must build and deploy it from this computer first.", "No executable file with symbols found.", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ }
+ EventDispatcher = new EventDispatcher(this);
+ _module = new AD7Module();
+ _progNode = new AD7ProgramNode(_process);
+ AddThreadsToProgram();
+ }
+ else
+ {
+ DebugEngineStatus.IsRunning = false;
+ return VSConstants.E_FAIL;
+ }
+ }
+ AD7EngineCreateEvent.Send(this);
+ AD7ProgramCreateEvent.Send(this);
+ AD7ModuleLoadEvent.Send(this, _module, true);
+ AD7LoadCompleteEvent.Send(this, CurrentThread());
+
+ // If the reason for attaching is ATTACH_REASON_LAUNCH, the DE needs to send the IDebugEntryPointEvent2 event.
+ // See http://msdn.microsoft.com/en-us/library/bb145136%28v=vs.100%29.aspx
+ if (dwReason == enum_ATTACH_REASON.ATTACH_REASON_LAUNCH)
+ {
+ AD7EntryPointEvent ad7Event = new AD7EntryPointEvent();
+ Guid riidEvent = new Guid(AD7EntryPointEvent.IID);
+ uint attributes = (uint)enum_EVENTATTRIBUTES.EVENT_STOPPING | (uint)enum_EVENTATTRIBUTES.EVENT_SYNCHRONOUS;
+ int rc = ad7Callback.Event(this, null, _program, CurrentThread(), ad7Event, ref riidEvent, attributes);
+ Debug.Assert(rc == VSConstants.S_OK);
+ }
+ }
+ catch (Exception e)
+ {
+ return EngineUtils.UnexpectedException(e);
+ }
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Requests that all programs being debugged by this DE stop execution the next time one of their threads attempts to run.
+ /// This is normally called in response to the user clicking on the pause button in the debugger. When the break is complete,
+ /// an AsyncBreakComplete event will be sent back to the debugger. (http://msdn.microsoft.com/en-us/library/bb145141.aspx)
+ ///
+ /// VSConstants.S_OK.
+ int IDebugEngine2.CauseBreak()
+ {
+ // If not already broken, send the interrupt
+ if (State != DebugEngineState.Design && State != DebugEngineState.Break && State != DebugEngineState.Step)
+ {
+ if (EventDispatcher._GDBRunMode)
+ {
+ HandleProcessExecution.m_mre.Reset();
+ _running.WaitOne();
+
+ // Sends the GDB command that interrupts the background execution of the target.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
+ GdbWrapper.PostCommand(@"-exec-interrupt");
+
+ // Ensure the process is interrupted before returning
+ HandleProcessExecution.m_mre.WaitOne(1000);
+
+ _running.Set();
+
+ if (DebugEngineStatus.IsRunning)
+ HandleProcessExecution.m_mre.Reset();
+ }
+ }
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Called by the SDM to indicate that a synchronous debug event, previously sent by the DE to the SDM,
+ /// was received and processed. The only event the VSNDK Debug Engine sends in this fashion is Program Destroy.
+ /// It responds to that event by shutting down the engine. (http://msdn.microsoft.com/en-us/library/bb160915.aspx)
+ ///
+ /// Represents the previously sent synchronous event from which the debugger should now continue.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ int IDebugEngine2.ContinueFromSynchronousEvent(IDebugEvent2 eventObject)
+ {
+ try
+ {
+ if (eventObject is AD7ProgramDestroyEvent)
+ {
+ ResetStackFrames();
+ _process.Detach();
+ _process = null;
+
+ _program.Detach();
+ _program = null;
+
+ Callback = null;
+ BreakpointManager = null;
+ EventDispatcher.Dispose();
+ EventDispatcher = null;
+ _module = null;
+ _progNode = null;
+ _programGuid = Guid.Empty;
+
+ Threads = null;
+ }
+ else
+ {
+ Debug.Fail("Unknown synchronous event");
+ }
+ }
+ catch (Exception ex)
+ {
+ return EngineUtils.UnexpectedException(ex);
+ }
+
+ if (EventDispatcher != null)
+ EventDispatcher.ContinueExecution();
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Creates a pending breakpoint in the Debug Engine. A pending breakpoint is essentially a collection of all the information
+ /// needed to bind a breakpoint to code. (http://msdn.microsoft.com/en-us/library/bb147033.aspx)
+ ///
+ /// An IDebugBreakpointRequest2 object that describes the pending breakpoint to create.
+ /// Returns an IDebugPendingBreakpoint2 object that represents the pending breakpoint.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ int IDebugEngine2.CreatePendingBreakpoint(IDebugBreakpointRequest2 pBPRequest, out IDebugPendingBreakpoint2 ppPendingBP)
+ {
+ Debug.Assert(BreakpointManager != null);
+ ppPendingBP = null;
+
+ try
+ {
+ BreakpointManager.CreatePendingBreakpoint(pBPRequest, out ppPendingBP);
+ }
+ catch (Exception e)
+ {
+ return EngineUtils.UnexpectedException(e);
+ }
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Informs a DE that the program specified has been atypically terminated and that the DE should clean up all references
+ /// to the program and send a program destroy event. (http://msdn.microsoft.com/en-us/library/bb145073.aspx)
+ ///
+ /// An IDebugProgram2 object that represents the program that has been atypically terminated.
+ /// AD7_HRESULT.E_PROGRAM_DESTROY_PENDING.
+ int IDebugEngine2.DestroyProgram(IDebugProgram2 pProgram)
+ {
+ // Tell the SDM that the engine knows that the program is exiting, and that the
+ // engine will send a program destroy. We do this because the Win32 debug api will always
+ // tell us that the process exited, and otherwise we have a race condition.
+
+ return (AD7_HRESULT.E_PROGRAM_DESTROY_PENDING);
+ }
+
+ ///
+ /// Gets the GUID of the DE. (http://msdn.microsoft.com/en-us/library/bb145079.aspx)
+ ///
+ /// Returns the GUID of the DE.
+ /// VSConstants.S_OK.
+ int IDebugEngine2.GetEngineId(out Guid guidEngine)
+ {
+ guidEngine = new Guid(DebugEngineGuid);
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Removes the list of exceptions the IDE has set for a particular run-time architecture or language. The VSNDK debug engine
+ /// does not support exceptions in the debuggee so this method is not actually implemented.
+ /// (http://msdn.microsoft.com/en-us/library/bb145134.aspx)
+ ///
+ /// Either the GUID for the language or the GUID for the debug engine that is specific to a run-time
+ /// architecture.
+ /// VSConstants.S_OK.
+ int IDebugEngine2.RemoveAllSetExceptions(ref Guid guidType)
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Removes the specified exception so it is no longer handled by the debug engine. The VSNDK debug engine does not support
+ /// exceptions in the debuggee so this method is not actually implemented. (http://msdn.microsoft.com/en-us/library/bb161697.aspx)
+ ///
+ /// An EXCEPTION_INFO structure that describes the exception to be removed.
+ /// VSConstants.S_OK.
+ int IDebugEngine2.RemoveSetException(EXCEPTION_INFO[] pException)
+ {
+ // The VSNDK debug engine will always stop on all exceptions.
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Specifies how the DE should handle a given exception. The VSNDK debug engine does not support exceptions in the debuggee
+ /// so this method is not actually implemented. (http://msdn.microsoft.com/en-us/library/bb162170.aspx)
+ ///
+ /// An EXCEPTION_INFO structure that describes the exception and how to debug it.
+ /// VSConstants.S_OK.
+ int IDebugEngine2.SetException(EXCEPTION_INFO[] pException)
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Sets the locale of the DE. This method is called by the session debug manager (SDM) to propagate the locale settings
+ /// of the IDE so that strings returned by the DE are properly localized. The sample engine is not localized so this is
+ /// not implemented. (http://msdn.microsoft.com/en-us/library/bb161784.aspx)
+ ///
+ /// Specifies the language locale.
+ /// VSConstants.S_OK.
+ int IDebugEngine2.SetLocale(ushort wLangID)
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// A metric is a registry value used to change a debug engine's behavior or to advertise supported functionality.
+ /// This method can forward the call to the appropriate form of the Debugging SDK Helpers function, SetMetric.
+ /// (http://msdn.microsoft.com/en-us/library/bb161968.aspx)
+ ///
+ /// The metric name.
+ /// Specifies the metric value.
+ /// VSConstants.S_OK.
+ int IDebugEngine2.SetMetric(string pszMetric, object varValue)
+ {
+ // The VSNDK debug engine does not need to understand any metric settings.
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Sets the registry root currently in use by the DE. Different installations of Visual Studio can change where their
+ /// registry information is stored. This allows the debugger to tell the engine where that location is.
+ /// (http://msdn.microsoft.com/en-us/library/bb161800.aspx)
+ ///
+ /// The registry root to use.
+ /// VSConstants.S_OK.
+ int IDebugEngine2.SetRegistryRoot(string pszRegistryRoot)
+ {
+ // The VSNDK debug engine does not read settings from the registry.
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+
+ #region IDebugEngineLaunch2 Members
+
+ ///
+ /// Determines if a process can be terminated. (http://msdn.microsoft.com/en-us/library/bb146673.aspx)
+ ///
+ /// An IDebugProcess2 object that represents the process to be terminated.
+ /// VSConstants.S_OK.
+ int IDebugEngineLaunch2.CanTerminateProcess(IDebugProcess2 process)
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Launches a process by means of the debug engine. (http://msdn.microsoft.com/en-us/library/bb146223.aspx)
+ ///
+ /// The name of the machine in which to launch the process. Use a null value to specify the local
+ /// machine. Or it should be the name of the server?
+ /// The IDebugPort2 interface representing the port that the program will run in.
+ /// The name of the executable to be launched.
+ /// The arguments to pass to the executable. May be a null value if there are no arguments.
+ /// The name of the working directory used by the executable. May be a null value if no working directory is
+ /// required.
+ /// Environment block of NULL-terminated strings, followed by an additional NULL terminator.
+ /// The options for the executable.
+ /// Specifies the LAUNCH_FLAGS for a session.
+ /// Handle to an alternate input stream. May be 0 if redirection is not required.
+ /// Handle to an alternate output stream. May be 0 if redirection is not required.
+ /// Handle to an alternate error output stream. May be 0 if redirection is not required.
+ /// The IDebugEventCallback2 object that receives debugger events.
+ /// Returns the resulting IDebugProcess2 object that represents the launched process.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ int IDebugEngineLaunch2.LaunchSuspended(string pszServer, IDebugPort2 port, string exe, string args, string dir, string env, string options, enum_LAUNCH_FLAGS launchFlags, uint hStdInput, uint hStdOutput, uint hStdError, IDebugEventCallback2 ad7Callback, out IDebugProcess2 process)
+ {
+ Debug.Assert(_programGuid == Guid.Empty);
+
+ process = null;
+
+ try
+ {
+ DebugEngineStatus.IsRunning = true;
+ Callback = new EngineCallback(this, ad7Callback);
+
+ // Read arguments back from the args string
+ var nvc = CollectionHelper.Deserialize(args);
+
+ uint pidNumber;
+ string pidOrName = nvc["pidOrName"];
+
+ var target = CollectionHelper.GetDevice(nvc);
+ var ndk = CollectionHelper.GetNDK(nvc);
+ var runtime = CollectionHelper.GetRuntime(nvc);
+ if (target == null)
+ {
+ TraceLog.WriteLine("LaunchSuspended: Missing info about target device");
+ return VSConstants.E_FAIL;
+ }
+ if (ndk == null)
+ {
+ TraceLog.WriteLine("LaunchSuspended: Missing info about NDK");
+ return VSConstants.E_FAIL;
+ }
+
+ var result = GdbWrapper.AttachToProcess(pidOrName, exe, null, ndk, target, runtime, out pidNumber);
+ if (result)
+ {
+ process = _process = new AD7Process(port, new ProcessInfo(pidNumber, exe), target);
+ EventDispatcher = new EventDispatcher(this);
+ _programGuid = _process.UID;
+ _module = new AD7Module();
+ _progNode = new AD7ProgramNode(_process);
+ AddThreadsToProgram();
+
+ AD7EngineCreateEvent.Send(this);
+
+ return VSConstants.S_OK;
+ }
+
+ DebugEngineStatus.IsRunning = false;
+ return VSConstants.E_FAIL;
+ }
+ catch (Exception e)
+ {
+ EngineUtils.UnexpectedException(e);
+ return VSConstants.E_FAIL;
+ }
+ }
+
+ ///
+ /// Resume a process launched by IDebugEngineLaunch2.LaunchSuspended. (http://msdn.microsoft.com/en-us/library/bb146261.aspx)
+ ///
+ /// An IDebugProcess2 object that represents the process to be resumed.
+ /// An IDebugProcess2 object that represents the process to be resumed.
+ int IDebugEngineLaunch2.ResumeProcess(IDebugProcess2 process)
+ {
+ Debug.Assert(Callback != null);
+
+ try
+ {
+ var xProcess = process as AD7Process;
+ if (xProcess == null)
+ {
+ return VSConstants.E_INVALIDARG;
+ }
+
+ // Send a program node to the SDM. This will cause the SDM to turn around and call IDebugEngine2.Attach
+ // which will complete the hookup with AD7
+ IDebugPort2 port;
+ EngineUtils.RequireOK(process.GetPort(out port));
+
+ IDebugDefaultPort2 defaultPort = (IDebugDefaultPort2)port;
+
+ IDebugPortNotify2 portNotify;
+ EngineUtils.RequireOK(defaultPort.GetPortNotify(out portNotify));
+
+ EngineUtils.RequireOK(portNotify.AddProgramNode(_progNode));
+
+ Callback.OnModuleLoad(_module);
+
+ Callback.OnThreadStart(CurrentThread());
+ }
+ catch (Exception e)
+ {
+ return EngineUtils.UnexpectedException(e);
+ }
+ return VSConstants.S_OK;
+ }
+
+
+ ///
+ /// This function is used to terminate a process. (http://msdn.microsoft.com/en-us/library/bb162314.aspx)
+ /// The debugger will call IDebugEngineLaunch2::CanTerminateProcess before calling this method.
+ ///
+ /// An IDebugProcess2 object that represents the process to be terminated.
+ /// VSConstants.S_OK.
+ int IDebugEngineLaunch2.TerminateProcess(IDebugProcess2 process)
+ {
+ CauseBreak();
+ if (EventDispatcher != null)
+ {
+ EventDispatcher.KillProcess();
+ EventDispatcher.EndDebugSession(0);
+ }
+
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+
+ #region IDebugProgram2 Members
+
+ ///
+ /// Determines if a debug engine (DE) can detach from the program. (http://msdn.microsoft.com/en-us/library/bb161967.aspx)
+ ///
+ /// VSConstants.S_OK.
+ public int CanDetach()
+ {
+ // The VSNDK debug engine always supports detach
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Requests that the program stop execution the next time one of its threads attempts to run. The debugger calls CauseBreak
+ /// when the user clicks on the pause button in VS. The debugger should respond by entering breakmode.
+ /// (http://msdn.microsoft.com/en-us/library/bb145018.aspx)
+ ///
+ /// VSConstants.S_OK.
+ public int CauseBreak()
+ {
+ return ((IDebugEngine2)this).CauseBreak();
+ }
+
+ ///
+ /// Continues running this program from a stopped state. Any previous execution state (such as a step) is preserved, and
+ /// the program starts executing again. (http://msdn.microsoft.com/en-us/library/bb162148.aspx)
+ ///
+ /// An IDebugThread2 object that represents the thread.
+ /// VSConstants.S_OK.
+ public int Continue(IDebugThread2 pThread)
+ {
+ EventDispatcher.ContinueExecution();
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Detaches a debug engine from the program. (http://msdn.microsoft.com/en-us/library/bb146228.aspx)
+ ///
+ /// VSConstants.S_OK.
+ public int Detach()
+ {
+ CauseBreak();
+ if (BreakpointManager != null)
+ BreakpointManager.ClearBoundBreakpoints(); // TODO: Check if active bound BP list needs to be updated too?
+
+ if (EventDispatcher != null)
+ EventDispatcher.EndDebugSession(0);
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Retrieves a list of the code contexts for a given position in a source file. Not implemented.
+ /// (http://msdn.microsoft.com/en-us/library/bb145902.aspx)
+ ///
+ /// An object representing an abstract position in a source file known to the IDE.
+ /// Returns an IEnumDebugCodeContexts2 object that contains a list of the code contexts.
+ /// Not implemented.
+ public int EnumCodeContexts(IDebugDocumentPosition2 pDocPos, out IEnumDebugCodeContexts2 ppEnum)
+ {
+ ppEnum = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Retrieves a list of the code paths for a given position in a source file. EnumCodePaths is used for the step-into specific
+ /// feature -- right click on the current statement and decide which function to step into. This is not something that the
+ /// VSNDK debug engine supports. (http://msdn.microsoft.com/en-us/library/bb162326.aspx)
+ ///
+ /// The word under the cursor in the Source or Disassembly view in the IDE.
+ /// An IDebugCodeContext2 object representing the current code context.
+ /// An IDebugStackFrame2 object representing the stack frame associated with the current breakpoint.
+ /// Nonzero (TRUE) if in the Source view, or zero (FALSE) if in the Disassembly view.
+ /// Returns an IEnumCodePaths2 object containing a list of the code paths.
+ /// Returns an IDebugCodeContext2 object representing an additional code context to be set as a
+ /// breakpoint in case the chosen code path is skipped. This can happen in the case of a short-circuited Boolean expression,
+ /// for example.
+ /// VSConstants.E_NOTIMPL.
+ public int EnumCodePaths(string hint, IDebugCodeContext2 start, IDebugStackFrame2 frame, int fSource, out IEnumCodePaths2 pathEnum, out IDebugCodeContext2 safetyContext)
+ {
+ pathEnum = null;
+ safetyContext = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Retrieves a list of the modules that this program has loaded and is executing.
+ /// (http://msdn.microsoft.com/en-us/library/bb146980.aspx)
+ ///
+ /// Returns an IEnumDebugModules2 object that contains a list of the modules.
+ /// VSConstants.S_OK.
+ public int EnumModules(out IEnumDebugModules2 ppEnum)
+ {
+ ppEnum = new AD7ModuleEnum(new[] { _module });
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Retrieves a list of the threads that are running in the program. (http://msdn.microsoft.com/en-us/library/bb145110.aspx)
+ ///
+ /// Returns an IEnumDebugThreads2 object that contains a list of the threads.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ public int EnumThreads(out IEnumDebugThreads2 ppEnum)
+ {
+ AD7Thread[] listThreads = null;
+ int currentThread = 0;
+
+ if (State != DebugEngineState.Run)
+ currentThread = GetListOfThreads(out listThreads);
+
+ // the following code seems to be weird but I had to update each field of this.m_process._threads because, when using
+ // "this.m_process._threads = listThreads;" without having a new thread, VS starts to duplicate the existing threads
+ // and, as a consequence, the call stack entries too.
+
+ if ((currentThread == -1) || (listThreads == null))
+ {
+ ppEnum = null;
+ return currentThread == 0 ? VSConstants.S_OK : VSConstants.S_FALSE;
+ }
+
+ if (listThreads.Length != Threads.Length)
+ {
+ foreach (AD7Thread t in Threads)
+ {
+ AD7ThreadDestroyEvent.Send(this, 0, t);
+ }
+ Threads = null;
+ Threads = listThreads;
+ _currentThreadIndex = currentThread;
+ foreach (AD7Thread t in Threads)
+ {
+ Callback.OnThreadStart(t);
+ }
+ ppEnum = new AD7ThreadEnum(Threads);
+ }
+ else
+ {
+ if (_currentThreadIndex != currentThread)
+ {
+ _currentThreadIndex = currentThread;
+ }
+
+ for (int i = 0; i < listThreads.Length; i++)
+ {
+ if (Threads[i]._engine != listThreads[i]._engine)
+ {
+ Threads[i]._engine = listThreads[i]._engine;
+ }
+ if (Threads[i]._threadDisplayName != listThreads[i]._threadDisplayName)
+ {
+ Threads[i]._threadDisplayName = listThreads[i]._threadDisplayName;
+ }
+ if (Threads[i]._id != listThreads[i]._id)
+ {
+ Threads[i]._id = listThreads[i]._id;
+ }
+ if (Threads[i]._state != listThreads[i]._state)
+ {
+ Threads[i]._state = listThreads[i]._state;
+ }
+ if (Threads[i]._targetID != listThreads[i]._targetID)
+ {
+ Threads[i]._targetID = listThreads[i]._targetID;
+ }
+ if (Threads[i]._priority != listThreads[i]._priority)
+ {
+ Threads[i]._priority = listThreads[i]._priority;
+ }
+ if (Threads[i]._line != listThreads[i]._line)
+ {
+ Threads[i]._line = listThreads[i]._line;
+ }
+ if (Threads[i]._filename != listThreads[i]._filename)
+ {
+ if (listThreads[i]._filename == "")
+ Threads[i]._filename = "";
+ else
+ Threads[i]._filename = listThreads[i]._filename;
+ }
+ Threads[i]._suspendCount = listThreads[i]._suspendCount;
+ }
+
+ ppEnum = new AD7ThreadEnum(Threads);
+ }
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the program's properties. The VSNDK debug engine does not support this.
+ /// (http://msdn.microsoft.com/en-us/library/bb161801.aspx)
+ ///
+ /// Returns an IDebugProperty2 object that represents the program's properties.
+ /// Not implemented.
+ public int GetDebugProperty(out IDebugProperty2 ppProperty)
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ ///
+ /// Gets the disassembly stream for this program or a part of this program.
+ /// The sample engine does not support dissassembly so it returns E_NOTIMPL
+ ///
+ /// Specifies a value from the DISASSEMBLY_STREAM_SCOPE enumeration that defines the scope of the
+ /// disassembly stream.
+ /// An object that represents the position of where to start the disassembly stream.
+ /// Returns an IDebugDisassemblyStream2 object that represents the disassembly stream.
+ /// VSConstants.E_NOTIMPL.
+ public int GetDisassemblyStream(enum_DISASSEMBLY_STREAM_SCOPE dwScope, IDebugCodeContext2 codeContext, out IDebugDisassemblyStream2 disassemblyStream)
+ {
+ disassemblyStream = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// This method gets the Edit and Continue (ENC) update for this program. A custom debug engine always returns E_NOTIMPL
+ ///
+ /// Returns an internal interface that can be used to update this program.
+ /// VSConstants.S_OK.
+ public int GetENCUpdate(out object update)
+ {
+ // The VSNDK debug engine does not participate in managed edit & continue.
+ update = null;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the name and GUID of the debug engine running this program. (http://msdn.microsoft.com/en-us/library/bb145854.aspx)
+ ///
+ /// Returns the name of the DE running this program.
+ /// Returns the GUID of the DE running this program.
+ /// VSConstants.S_OK.
+ public int GetEngineInfo(out string engineName, out Guid engineGuid)
+ {
+ engineName = AD7PortSupplier.PublicName;
+ engineGuid = new Guid(DebugEngineGuid);
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Retrieves the memory bytes occupied by the program. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145291.aspx)
+ ///
+ /// Returns an IDebugMemoryBytes2 object that represents the memory bytes of the program.
+ /// Not implemented.
+ public int GetMemoryBytes(out IDebugMemoryBytes2 ppMemoryBytes)
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ ///
+ /// Gets the name of the program. The name returned by this method is always a friendly, user-displayable name that describes
+ /// the program. (http://msdn.microsoft.com/en-us/library/bb161279.aspx)
+ ///
+ /// Returns the name of the program.
+ /// VSConstants.S_OK.
+ public int GetName(out string programName)
+ {
+ if (_progNode != null)
+ programName = _progNode.Name;
+ else
+ programName = null;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets a GUID for this program. A debug engine (DE) must return the program identifier originally passed to the
+ /// IDebugProgramNodeAttach2::OnAttach or IDebugEngine2::Attach methods. This allows identification of the program
+ /// across debugger components. (http://msdn.microsoft.com/en-us/library/bb145581.aspx)
+ ///
+ /// Returns the GUID for this program.
+ /// VSConstants.S_OK.
+ public int GetProgramId(out Guid guidProgramId)
+ {
+ guidProgramId = _programGuid;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Performs a step. This method is deprecated. Use the IDebugProcess3::Step method instead.
+ /// (http://msdn.microsoft.com/en-us/library/bb162134.aspx)
+ ///
+ /// An IDebugThread2 object that represents the thread being stepped.
+ /// A value from the STEPKIND enumeration that specifies the kind of step.
+ /// A value from the STEPUNIT enumeration that specifies the unit of step.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ public int Step(IDebugThread2 thread, enum_STEPKIND kind, enum_STEPUNIT step)
+ {
+ // Don't allow stepping through unknown code because it can lead to future problems with stepping and break-all.
+ if (EventDispatcher._unknownCode)
+ {
+ State = AD7Engine.DebugEngineState.Step;
+ EventDispatcher.ContinueExecution();
+
+ return VSConstants.S_OK;
+ }
+
+ if (kind == enum_STEPKIND.STEP_INTO)
+ {
+ // Equivalent to F11 hotkey.
+ // Sends the GDB command that resumes the execution of the inferior program, stopping at the next instruction, diving
+ // into function if it is a function call. (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
+ GdbWrapper.PostCommand("-exec-step --thread " + Threads[_currentThreadIndex]._id);
+ }
+ else if (kind == enum_STEPKIND.STEP_OVER)
+ {
+ // Equivalent to F10 hotkey.
+ // Sends the GDB command that resumes the execution of the inferior program, stopping at the next instruction, but
+ // without diving into functions. (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
+ GdbWrapper.PostCommand("-exec-next --thread " + Threads[_currentThreadIndex]._id);
+ }
+ else if (kind == enum_STEPKIND.STEP_OUT)
+ {
+ // Equivalent to Shift-F11 hotkey.
+ if (EventDispatcher.GetStackDepth(Threads[_currentThreadIndex]._id) > 1)
+ {
+ // Sends the GDB command that resumes the execution of the inferior program until the current function is exited.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
+ GdbWrapper.PostCommand("-exec-finish --thread " + Threads[_currentThreadIndex]._id + " --frame 0");
+ }
+ else
+ {
+ // If this the only frame left, do a step-over.
+ // Sends the GDB command that resumes the execution of the inferior program, stopping at the next instruction, but
+ // without diving into functions. (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
+ GdbWrapper.PostCommand("-exec-next --thread " + Threads[_currentThreadIndex]._id);
+ }
+ }
+ else if (kind == enum_STEPKIND.STEP_BACKWARDS)
+ {
+ return EngineUtils.NotImplemented();
+ }
+ else
+ {
+ Callback.OnStepComplete(); // Have to call this otherwise VS gets "stuck"
+ }
+
+ // Transition DE state
+ State = DebugEngineState.Step;
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Terminates the program. (http://msdn.microsoft.com/en-us/library/bb145919.aspx)
+ ///
+ /// VSConstants.S_OK.
+ public int Terminate()
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Writes a dump to a file. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145827.aspx)
+ ///
+ /// A value from the DUMPTYPE enumeration that specifies the type of dump, for example, short or
+ /// long.
+ /// The URL to write the dump to. Typically, this is in the form of file://c:\path\filename.ext,
+ /// but may be any valid URL.
+ /// VSConstants.E_NOTIMPL.
+ public int WriteDump(enum_DUMPTYPE type, string dumpUrl)
+ {
+ // The VSNDK debugger does not support creating or reading mini-dumps.
+ return EngineUtils.NotImplemented();
+ }
+
+ #endregion
+
+ #region IDebugProgram3 Members
+
+ ///
+ /// Executes the debugger program. The thread is returned to give the debugger information on which thread the user is
+ /// viewing when executing the program. ExecuteOnThread is called when the SDM wants execution to continue and have
+ /// stepping state cleared. (http://msdn.microsoft.com/en-us/library/bb145596.aspx)
+ ///
+ /// An IDebugThread2 object.
+ /// VSConstants.S_OK.
+ public int ExecuteOnThread(IDebugThread2 thread)
+ {
+ EventDispatcher.ContinueExecution();
+
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+
+ #region IDebugEngineProgram2 Members
+
+ ///
+ /// Stops all threads running in this program. This method is called when this program is being debugged in a multi-program
+ /// environment. When a stopping event from some other program is received, this method is called on this program. The
+ /// implementation of this method should be asynchronous; that is, not all threads should be required to be stopped before
+ /// this method returns. The implementation of this method may be as simple as calling the IDebugProgram2::CauseBreak method
+ /// on this program. Not implemented. (http://msdn.microsoft.com/en-us/library/bb146567.aspx)
+ ///
+ /// The VSNDK debug engine only supports debugging native applications and therefore only has one program per-process
+ ///
+ /// VSConstants.E_NOTIMPL.
+ public int Stop()
+ {
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Allows (or disallows) expression evaluation to occur on the given thread, even if the program has stopped.
+ /// WatchForExpressionEvaluationOnThread is used to cooperate between two different engines debugging the same process.
+ /// The VSNDK debug engine doesn't cooperate with other engines, so it has nothing to do here.
+ /// (http://msdn.microsoft.com/en-us/library/bb144913.aspx)
+ ///
+ /// An IDebugProgram2 object representing the program that is evaluating an expression.
+ /// Specifies the identifier of the thread.
+ /// A combination of flags from the EVALFLAGS enumeration that specify how the evaluation is to be performed.
+ /// An IDebugEventCallback2 object to be used to send debug events that occur during expression evaluation.
+ /// If non-zero (TRUE), allows expression evaluation on the thread identified by dwTid; otherwise, zero
+ /// (FALSE) disallows expression evaluation on that thread.
+ /// VSConstants.S_OK.
+ public int WatchForExpressionEvaluationOnThread(IDebugProgram2 program, uint threadID, uint flags, IDebugEventCallback2 callback, int canWatch)
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Watches for execution (or stops watching for execution) to occur on the given thread. WatchForThreadStep is used to
+ /// cooperate between two different engines debugging the same process. The VSNDK debug engine doesn't cooperate with other
+ /// engines, so it has nothing to do here. (http://msdn.microsoft.com/en-us/library/bb161406.aspx)
+ ///
+ /// An IDebugProgram2 object representing the program being stepped.
+ /// Specifies the identifier of the thread to watch.
+ /// Non-zero (TRUE) means start watching for execution on the thread identified by dwTid; otherwise,
+ /// zero (FALSE) means stop watching for execution on dwTid.
+ /// Specifies a frame index that controls the step type.
+ /// VSConstants.S_OK.
+ public int WatchForThreadStep(IDebugProgram2 program, uint dwTid, int canWatch, uint frame)
+ {
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+
+ #region IDebugSymbolSettings100 members
+
+ ///
+ /// The SDM will call this method on the debug engine when it is created, to notify it of the user's
+ /// symbol settings in Tools->Options->Debugging->Symbols. (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugsymbolsettings100.setsymbolloadstate.aspx)
+ ///
+ /// true if 'Automatically load symbols: Only for specified modules' is checked.
+ /// true if 'Specify modules'->'Always load symbols next to the modules' is checked.
+ /// semicolon-delimited list of modules when automatically loading 'Only specified modules'
+ /// semicolon-delimited list of modules when automatically loading 'All modules, unless excluded'
+ /// VSConstants.S_OK.
+ int IDebugSymbolSettings100.SetSymbolLoadState(int isManual, int loadAdjacent, string includeList, string excludeList)
+ {
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+
+ #region Thread methods
+
+ ///
+ /// Verify if the stack frame information specified by "flags" were already evaluated.
+ ///
+ /// Thread ID.
+ /// Specifies the information to verify about a stack frame object.
+ /// If successful, returns TRUE; otherwise, returns FALSE.
+ public bool EvaluatedTheseFlags(string threadId, enum_FRAMEINFO_FLAGS flags)
+ {
+ if (Threads != null)
+ {
+ int currentFlags = Convert.ToInt32(flags);
+ int i = 0;
+ // looking for the "threadId" thread.
+ for (; i < Threads.Length; i++)
+ {
+ if (Threads[i]._id == threadId)
+ break;
+ }
+ if (i < Threads.Length)
+ {
+ if (Threads[i]._alreadyEvaluated == currentFlags)
+ {
+ // This stack frame information were already evaluated.
+ return true;
+ }
+ else
+ {
+ // This stack frame information were not evaluated before. Modifying the _alreadyEvaluated flag.
+ Threads[i]._alreadyEvaluated = currentFlags;
+ }
+ }
+ }
+ return false;
+ }
+
+ ///
+ /// Clean the "flags" data (_alreadyEvaluated) that are stored in each thread without resetting the stack frames. This operation
+ /// must be done whenever the stack frames for a given thread have to be evaluated, like when the user changes the current frame
+ /// or when he wants to investigate different threads in break mode, for example.
+ ///
+ public void CleanEvaluatedThreads()
+ {
+ if (Threads != null)
+ {
+ for (int i = 0; i < Threads.Length; i++)
+ {
+ Threads[i]._alreadyEvaluated = 0;
+ }
+ }
+ }
+
+ ///
+ /// Reset stack frames for each thread. This operation must be performed before changing the state to break mode, like when a
+ /// breakpoint is hit, for example.
+ ///
+ public void ResetStackFrames()
+ {
+ if (Threads != null)
+ {
+ foreach (AD7Thread t in Threads)
+ {
+ if (t.__stackFrames != null)
+ {
+ t.__stackFrames.Clear();
+ t.__stackFrames = null;
+ }
+ }
+ }
+ }
+
+ ///
+ /// Update the list of threads. This operation must be performed whenever the list of threads changes (a thread exits or is
+ /// created) and before entering in break mode.
+ ///
+ public void UpdateListOfThreads()
+ {
+ if (Threads != null)
+ {
+ foreach (AD7Thread t in Threads)
+ {
+ // Send events to VS to destroy its current debugged threads.
+ AD7ThreadDestroyEvent.Send(this, 0, t);
+ }
+
+ Threads = null;
+ }
+
+ // Get the current list of threads and store them into a temporary variable listThreads.
+ AD7Thread[] threads;
+ _currentThreadIndex = GetListOfThreads(out threads);
+ Threads = threads;
+
+ if (_currentThreadIndex == -1 || Threads == null)
+ return;
+
+ // Send events to VS to add this list of debugged threads.
+ foreach (AD7Thread t in Threads)
+ {
+ Callback.OnThreadStart(t);
+ }
+
+ _updateThreads = false;
+ }
+
+ ///
+ /// Get the list of threads being debugged, also returning the index of the current thread (or -1 in case of error)
+ ///
+ /// Returns the current list of threads that are being debugged.
+ /// Returns the index of the current thread in the list of threads (or -1 in case of error)
+ private int GetListOfThreads(out AD7Thread[] threadObjects)
+ {
+ // Gets the parsed response for the GDB/MI command that ask for information about all threads.
+ // (http://www.sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Thread-Commands.html)
+ string threadResponse = GdbWrapper.SendCommand(@"-thread-info", 22);
+ string[] threadStrings = threadResponse.Split('#');
+ CleanEvaluatedThreads();
+
+ // Query the threads depth without inquiring GDB.
+ int numThreads = threadStrings.Length - 1; // the last item in threadStrings is not a thread but the current thread ID.
+ string currentThread = threadStrings[threadStrings.Length - 1];
+ if (numThreads < 1)
+ {
+ threadObjects = null;
+ return -1;
+ }
+
+ try
+ {
+ threadObjects = new AD7Thread[numThreads];
+ int currentThreadIndex = -1;
+
+ for (int i = 0; i < numThreads; i++)
+ {
+ string[] threadInfo = threadStrings[i].Split(';');
+
+ // Setting the current thread index.
+ if (currentThread == threadInfo[0])
+ {
+ currentThreadIndex = i;
+ }
+
+ // Each threadInfo has one of these two formats:
+ // with 5 elements: ID; State; targetID; details (not used); name -> this format is normally used for external code.
+ // with 7 elements: ID; State; targetID; details (not used); full short-path filename; line; name
+ if (threadInfo.Length > 5)
+ threadObjects[i] = new AD7Thread(this, threadInfo[0], threadInfo[2], threadInfo[1], "Normal", threadInfo[6], threadInfo[4], threadInfo[5]);
+ else
+ threadObjects[i] = new AD7Thread(this, threadInfo[0], threadInfo[2], threadInfo[1], "Normal", threadInfo[4], "", "");
+ }
+ return currentThreadIndex;
+ }
+ catch (Exception)
+ {
+ threadObjects = null;
+ return -1;
+ }
+ }
+
+ ///
+ /// Returns the current thread.
+ ///
+ /// If successful, returns the current thread; otherwise, returns NULL.
+ public AD7Thread CurrentThread()
+ {
+ if (_currentThreadIndex != -1)
+ return Threads[_currentThreadIndex];
+ return null;
+ }
+
+ ///
+ /// Returns the thread data structure with a given ID.
+ ///
+ /// The ID of the thread to search for.
+ /// If successful, returns the selected thread; otherwise, returns NULL.
+ public AD7Thread SelectThread(string id)
+ {
+ if (Threads == null)
+ return null;
+
+ for (int i = 0; i < Threads.Length; i++)
+ {
+ if (Threads[i]._id == id)
+ return Threads[i];
+ }
+ return null;
+ }
+
+ ///
+ /// Set a given thread as the current one.
+ ///
+ /// The ID of the thread.
+ public void SetAsCurrentThread(string id)
+ {
+ if (Threads != null)
+ {
+ for (int i = 0; i < Threads.Length; i++)
+ {
+ if (Threads[i]._id == id)
+ {
+ _currentThreadIndex = i;
+ break;
+ }
+ }
+ }
+ }
+
+ ///
+ /// Add threads for a program when launching it and the debugger (IDebugEngineLaunch2.LaunchSuspended).
+ ///
+ /// VSConstants.S_OK.
+ public int AddThreadsToProgram()
+ {
+ AD7Thread[] threads;
+ Threads = null;
+
+ _currentThreadIndex = GetListOfThreads(out threads);
+ Threads = threads;
+
+ if (_currentThreadIndex != -1)
+ {
+ foreach (AD7Thread t in threads)
+ {
+ Callback.OnThreadStart(t);
+ }
+ }
+ else
+ {
+ Callback.OnThreadStart(null);
+ }
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+
+ #region Deprecated interface methods
+ // These methods are not called by the Visual Studio debugger, so they don't need to be implemented
+
+ ///
+ /// Retrieves a list of all programs being debugged by a debug engine (DE). Not implemented.
+ /// (http://msdn.microsoft.com/en-us/library/bb146175.aspx)
+ ///
+ /// Returns an object that contains a list of all programs being debugged by a DE.
+ /// VSConstants.E_NOTIMPL.
+ int IDebugEngine2.EnumPrograms(out IEnumDebugPrograms2 pPrograms)
+ {
+ pPrograms = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Attaches to the program. Not implemented. (http://msdn.microsoft.com/en-us/library/bb161973.aspx)
+ ///
+ /// An IDebugEventCallback2 object to be used for debug event notification.
+ /// VSConstants.E_NOTIMPL.
+ public int Attach(IDebugEventCallback2 callback)
+ {
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Get the process that this program is running in. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145293.aspx)
+ ///
+ /// Returns the IDebugProcess2 interface that represents the process.
+ /// VSConstants.E_NOTIMPL.
+ public int GetProcess(out IDebugProcess2 pProcess)
+ {
+ pProcess = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ /// TODO: Verify if this method is called or not by VS.
+ /// Continues running this program from a stopped state. Any previous execution state (such as a step) is cleared, and the
+ /// program starts executing again. (http://msdn.microsoft.com/en-us/library/bb162315.aspx)
+ ///
+ /// VSConstants.S_OK.
+ public int Execute()
+ {
+ EventDispatcher.ContinueExecution();
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7Enums.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7Enums.cs
new file mode 100644
index 00000000..ad7efb0e
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7Enums.cs
@@ -0,0 +1,396 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+
+namespace BlackBerry.DebugEngine
+{
+ #region Base Class
+
+ ///
+ /// These classes use a generic enumerator implementation to create the various enumerators required by the engine.
+ /// They allow the enumeration of everything from programs to breakpoints.
+ ///
+ /// Array of T elements.
+ /// Enumerator interface.
+ class AD7Enum where I: class
+ {
+ private readonly T[] _data;
+ private uint _position;
+
+ ///
+ /// Constructor.
+ ///
+ /// Array of T elements.
+ public AD7Enum(T[] data)
+ {
+#if DEBUG
+ if (data == null)
+ throw new ArgumentNullException("data");
+#endif
+
+ _data = data;
+ _position = 0;
+ }
+
+ ///
+ /// Returns a copy of the current enumeration as a separate object. Not implemented.
+ ///
+ /// Returns a copy of this enumeration as a separate object.
+ /// Not implemented.
+ public int Clone(out I ppEnum)
+ {
+ ppEnum = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Returns the number of elements in the enumeration.
+ ///
+ /// Returns the number of elements in the enumeration.
+ /// VSConstants.S_OK.
+ public int GetCount(out uint pcelt)
+ {
+ pcelt = (uint)_data.Length;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Returns the next set of elements from the enumeration.
+ ///
+ /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
+ /// Array of T elements to be filled in.
+ /// Returns the number of elements actually returned in rgelt.
+ /// If successful, returns S_OK. If not, returns S_FALSE.
+ public int Next(uint celt, T[] rgelt, out uint celtFetched)
+ {
+ return Move(celt, rgelt, out celtFetched);
+ }
+
+ ///
+ /// Resets the enumeration to the first element.
+ ///
+ /// VSConstants.S_OK.
+ public int Reset()
+ {
+ lock (this)
+ {
+ _position = 0;
+
+ return VSConstants.S_OK;
+ }
+ }
+
+ ///
+ /// Skips over the specified number of elements.
+ ///
+ /// Number of elements to skip.
+ /// If successful, returns S_OK. If not, returns S_FALSE.
+ public int Skip(uint celt)
+ {
+ uint celtFetched;
+
+ return Move(celt, null, out celtFetched);
+ }
+
+ ///
+ /// Returns/Skips over the specified number of elements.
+ ///
+ /// Number of elements to retrieve/skip.
+ /// Array of T elements to be filled in.
+ /// Returns the number of elements actually returned/skipped in rgelt.
+ /// If successful, returns S_OK. If not, returns S_FALSE.
+ private int Move(uint celt, T[] rgelt, out uint celtFetched)
+ {
+ lock (this)
+ {
+ int hr = VSConstants.S_OK;
+ celtFetched = (uint)_data.Length - _position;
+
+ if (celt > celtFetched)
+ {
+ hr = VSConstants.S_FALSE;
+ }
+ else if (celt < celtFetched)
+ {
+ celtFetched = celt;
+ }
+
+ if (rgelt != null)
+ {
+ for (int c = 0; c < celtFetched; c++)
+ {
+ rgelt[c] = _data[_position + c];
+ }
+ }
+
+ _position += celtFetched;
+
+ return hr;
+ }
+ }
+ }
+
+ #endregion
+
+ ///
+ /// This class enumerates the processes running on a debug port. (http://msdn.microsoft.com/en-ca/library/bb145005.aspx)
+ ///
+ sealed class AD7ProcessEnum : AD7Enum, IEnumDebugProcesses2
+ {
+ ///
+ /// Constructor.
+ ///
+ /// Array of IDebugProcess2 elements.
+ public AD7ProcessEnum(IDebugProcess2[] data)
+ : base(data)
+ {
+ }
+
+ ///
+ /// Returns the next set of elements from the enumeration. (http://msdn.microsoft.com/en-ca/library/bb147027.aspx)
+ ///
+ /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
+ /// Array of IDebugProcess2 elements to be filled in.
+ /// Returns the number of elements actually returned in rgelt.
+ /// If successful, returns S_OK. If not, returns S_FALSE.
+ public int Next(uint celt, IDebugProcess2[] rgelt, ref uint celtFetched)
+ {
+ return Next(celt, rgelt, out celtFetched);
+ }
+ }
+
+ ///
+ /// This class enumerates the ports of a machine or port supplier. (http://msdn.microsoft.com/en-ca/library/bb145137.aspx)
+ ///
+ sealed class AD7PortEnum : AD7Enum, IEnumDebugPorts2
+ {
+ ///
+ /// Constructor.
+ ///
+ /// Array of IDebugPort2 elements.
+ public AD7PortEnum(IDebugPort2[] data)
+ : base(data)
+ {
+ }
+
+ ///
+ /// Returns the next set of elements from the enumeration. (http://msdn.microsoft.com/en-ca/library/bb147027.aspx)
+ ///
+ /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
+ /// Array of IDebugPort2 elements to be filled in.
+ /// Returns the number of elements actually returned in rgelt.
+ /// If successful, returns S_OK. If not, returns S_FALSE.
+ public int Next(uint celt, IDebugPort2[] rgelt, ref uint celtFetched)
+ {
+ return Next(celt, rgelt, out celtFetched);
+ }
+ }
+
+ ///
+ /// This class enumerates the programs running in the current debug session. (http://msdn.microsoft.com/en-ca/library/bb146727.aspx)
+ ///
+ sealed class AD7ProgramEnum : AD7Enum, IEnumDebugPrograms2
+ {
+ ///
+ /// Constructor.
+ ///
+ /// Array of IDebugProgram2 elements.
+ public AD7ProgramEnum(IDebugProgram2[] data)
+ : base(data)
+ {
+ }
+
+ ///
+ /// Returns the next set of elements from the enumeration. (http://msdn.microsoft.com/en-ca/library/bb147027.aspx)
+ ///
+ /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
+ /// Array of IDebugProgram2 elements to be filled in.
+ /// Returns the number of elements actually returned in rgelt.
+ /// If successful, returns S_OK. If not, returns S_FALSE.
+ public int Next(uint celt, IDebugProgram2[] rgelt, ref uint celtFetched)
+ {
+ return Next(celt, rgelt, out celtFetched);
+ }
+ }
+
+ ///
+ /// This class enumerates FRAMEINFO structures. (http://msdn.microsoft.com/en-us/library/bb147119.aspx)
+ ///
+ sealed class AD7FrameInfoEnum : AD7Enum, IEnumDebugFrameInfo2
+ {
+ ///
+ /// Constructor.
+ ///
+ /// Array of FRAMEINFO elements.
+ public AD7FrameInfoEnum(FRAMEINFO[] data)
+ : base(data)
+ {
+ }
+
+ ///
+ /// Returns the next set of elements from the enumeration. (http://msdn.microsoft.com/en-us/library/bb146293.aspx)
+ ///
+ /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
+ /// Array of FRAMEINFO elements to be filled in.
+ /// Returns the number of elements actually returned in rgelt.
+ /// If successful, returns S_OK. If not, returns S_FALSE.
+ public int Next(uint celt, FRAMEINFO[] rgelt, ref uint celtFetched)
+ {
+ return Next(celt, rgelt, out celtFetched);
+ }
+ }
+
+ ///
+ /// This class enumerates DEBUG_PROPERTY_INFO structures. (http://msdn.microsoft.com/en-ca/library/bb162336.aspx)
+ ///
+ sealed class AD7PropertyInfoEnum : AD7Enum, IEnumDebugPropertyInfo2
+ {
+ ///
+ /// Constructor.
+ ///
+ /// Array of DEBUG_PROPERTY_INFO elements.
+ public AD7PropertyInfoEnum(DEBUG_PROPERTY_INFO[] data)
+ : base(data)
+ {
+ }
+ }
+
+ ///
+ /// This class enumerates the threads running in the current debug session. (http://msdn.microsoft.com/en-ca/library/bb145142.aspx)
+ ///
+ sealed class AD7ThreadEnum : AD7Enum, IEnumDebugThreads2
+ {
+ ///
+ /// Constructor.
+ ///
+ /// Array of IDebugThread2 elements.
+ public AD7ThreadEnum(IDebugThread2[] threads)
+ : base(threads)
+ {
+ }
+
+ ///
+ /// Returns the next set of elements from the enumeration. (http://msdn.microsoft.com/en-ca/library/bb161679.aspx)
+ ///
+ /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
+ /// Array of IDebugThread2 elements to be filled in.
+ /// Returns the number of elements actually returned in rgelt.
+ /// If successful, returns S_OK. If not, returns S_FALSE.
+ public int Next(uint celt, IDebugThread2[] rgelt, ref uint celtFetched)
+ {
+ return Next(celt, rgelt, out celtFetched);
+ }
+ }
+
+ ///
+ /// This class enumerates a list of modules. (http://msdn.microsoft.com/en-ca/library/bb145925.aspx)
+ ///
+ sealed class AD7ModuleEnum : AD7Enum, IEnumDebugModules2
+ {
+ ///
+ /// Constructor.
+ ///
+ /// Array of IDebugModule2 elements.
+ public AD7ModuleEnum(IDebugModule2[] modules)
+ : base(modules)
+ {
+ }
+
+ ///
+ /// Returns the next set of elements from the enumeration. (http://msdn.microsoft.com/en-ca/library/bb145898.aspx)
+ ///
+ /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
+ /// Array of IDebugModule2 elements to be filled in.
+ /// Returns the number of elements actually returned in rgelt.
+ /// If successful, returns S_OK. If not, returns S_FALSE.
+ public int Next(uint celt, IDebugModule2[] rgelt, ref uint celtFetched)
+ {
+ return Next(celt, rgelt, out celtFetched);
+ }
+ }
+
+ ///
+ /// This class enumerates DEBUG_PROPERTY_INFO structures. (http://msdn.microsoft.com/en-ca/library/bb162336.aspx)
+ ///
+ sealed class AD7PropertyEnum : AD7Enum, IEnumDebugPropertyInfo2
+ {
+ ///
+ /// Constructor.
+ ///
+ /// Array of DEBUG_PROPERTY_INFO elements.
+ public AD7PropertyEnum(DEBUG_PROPERTY_INFO[] properties)
+ : base(properties)
+ {
+ }
+ }
+
+ ///
+ /// This class enumerates the code contexts associated with the debug session, or with a particular program or document.
+ /// (http://msdn.microsoft.com/en-us/library/bb146612.aspx)
+ ///
+ sealed class AD7CodeContextEnum : AD7Enum, IEnumDebugCodeContexts2
+ {
+ ///
+ /// Constructor.
+ ///
+ /// Array of IDebugCodeContext2 elements.
+ public AD7CodeContextEnum(IDebugCodeContext2[] codeContexts)
+ : base(codeContexts)
+ {
+ }
+
+ ///
+ /// Returns the next set of elements from the enumeration. (http://msdn.microsoft.com/en-us/library/bb145085.aspx)
+ ///
+ /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
+ /// Array of IDebugCodeContext2 elements to be filled in.
+ /// Returns the number of elements actually returned in rgelt.
+ /// If successful, returns S_OK. If not, returns S_FALSE.
+ public int Next(uint celt, IDebugCodeContext2[] rgelt, ref uint celtFetched)
+ {
+ return Next(celt, rgelt, out celtFetched);
+ }
+ }
+
+ ///
+ /// This class enumerates the bound breakpoints associated with a pending breakpoint or breakpoint bound event.
+ /// (http://msdn.microsoft.com/en-ca/library/bb162182.aspx)
+ ///
+ sealed class AD7BoundBreakpointsEnum : AD7Enum, IEnumDebugBoundBreakpoints2
+ {
+ ///
+ /// Constructor.
+ ///
+ /// Array of IDebugBoundBreakpoint2 elements.
+ public AD7BoundBreakpointsEnum(IDebugBoundBreakpoint2[] breakpoints)
+ : base(breakpoints)
+ {
+ }
+
+ ///
+ /// Returns the next set of elements from the enumeration. (http://msdn.microsoft.com/en-ca/library/bb161772.aspx)
+ ///
+ /// The number of elements to retrieve. Also specifies the maximum size of the rgelt array.
+ /// Array of IDebugBoundBreakpoint2 elements to be filled in.
+ /// Returns the number of elements actually returned in rgelt.
+ /// If successful, returns S_OK. If not, returns S_FALSE.
+ public int Next(uint celt, IDebugBoundBreakpoint2[] rgelt, ref uint celtFetched)
+ {
+ return Next(celt, rgelt, out celtFetched);
+ }
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7ErrorBreakpointResolution.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7ErrorBreakpointResolution.cs
new file mode 100644
index 00000000..12249acd
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7ErrorBreakpointResolution.cs
@@ -0,0 +1,42 @@
+using Microsoft.VisualStudio.Debugger.Interop;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// Represents the resolution of a breakpoint error. (http://msdn.microsoft.com/en-us/library/bb161341.aspx)
+ ///
+ class AD7ErrorBreakpointResolution : IDebugErrorBreakpointResolution2
+ {
+ #region IDebugErrorBreakpointResolution2 Members
+
+ ///
+ /// Gets the breakpoint type. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145065.aspx)
+ ///
+ /// The type of this breakpoint.
+ /// Not implemented.
+ int IDebugErrorBreakpointResolution2.GetBreakpointType(enum_BP_TYPE[] pBPType)
+ {
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Gets the breakpoint error resolution information. Not implemented. (http://msdn.microsoft.com/en-us/library/bb161960.aspx)
+ ///
+ /// A combination of flags that determine which fields of pErrorResolutionInfo are to be filled out.
+ /// The BP_ERROR_RESOLUTION_INFO structure that is filled in with the description of the
+ /// breakpoint resolution.
+ /// Not implemented.
+ int IDebugErrorBreakpointResolution2.GetResolutionInfo(enum_BPERESI_FIELDS dwFields, BP_ERROR_RESOLUTION_INFO[] pErrorResolutionInfo)
+ {
+ if (((uint)dwFields & (uint)enum_BPERESI_FIELDS.BPERESI_BPRESLOCATION) != 0) { }
+ if (((uint)dwFields & (uint)enum_BPERESI_FIELDS.BPERESI_PROGRAM) != 0) { }
+ if (((uint)dwFields & (uint)enum_BPERESI_FIELDS.BPERESI_THREAD) != 0) { }
+ if (((uint)dwFields & (uint)enum_BPERESI_FIELDS.BPERESI_MESSAGE) != 0) { }
+ if (((uint)dwFields & (uint)enum_BPERESI_FIELDS.BPERESI_TYPE) != 0) { }
+
+ return EngineUtils.NotImplemented();
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7Events.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7Events.cs
new file mode 100644
index 00000000..b91313b7
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7Events.cs
@@ -0,0 +1,685 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+
+// This file contains the various event objects that are sent to the debugger from the VSNDK debug engine via IDebugEventCallback2::Event.
+// These are used in EngineCallback.cs.
+// The events are how the engine tells the debugger about what is happening in the debuggee process.
+// There are four base classes the other events derive from: AD7AsynchronousEvent, AD7StoppingEvent, AD7SynchronousEvent and
+// AD7SynchronousStoppingEvent. Each of them implements the IDebugEvent2.GetAttributes method for the type of event they represent.
+// Most events sent by the debugger are asynchronous ones.
+
+namespace BlackBerry.DebugEngine
+{
+ #region Event Base Classes
+
+ ///
+ /// Used to communicate both critical debug information and non-critical information.
+ /// (http://msdn.microsoft.com/en-us/library/bb161977.aspx)
+ ///
+ class AD7AsynchronousEvent : IDebugEvent2
+ {
+ private const uint Attributes = (uint)enum_EVENTATTRIBUTES.EVENT_ASYNCHRONOUS;
+
+ ///
+ /// Gets the attributes for this debug event. (http://msdn.microsoft.com/en-us/library/bb145575.aspx)
+ ///
+ /// A combination of flags from the enum_EVENTATTRIBUTES enumeration.
+ /// VSConstants.S_OK.
+ int IDebugEvent2.GetAttributes(out uint eventAttributes)
+ {
+ eventAttributes = Attributes;
+ return VSConstants.S_OK;
+ }
+ }
+
+ ///
+ /// Used to communicate both critical debug information and non-critical information.
+ /// (http://msdn.microsoft.com/en-us/library/bb161977.aspx)
+ ///
+ class AD7StoppingEvent : IDebugEvent2
+ {
+ public const uint Attributes = (uint)enum_EVENTATTRIBUTES.EVENT_ASYNC_STOP;
+
+ ///
+ /// Gets the attributes for this debug event. (http://msdn.microsoft.com/en-us/library/bb145575.aspx)
+ ///
+ /// A combination of flags from the enum_EVENTATTRIBUTES enumeration.
+ /// VSConstants.S_OK.
+ int IDebugEvent2.GetAttributes(out uint eventAttributes)
+ {
+ eventAttributes = Attributes;
+ return VSConstants.S_OK;
+ }
+ }
+
+ ///
+ /// Used to communicate both critical debug information and non-critical information.
+ /// (http://msdn.microsoft.com/en-us/library/bb161977.aspx)
+ ///
+ class AD7SynchronousEvent : IDebugEvent2
+ {
+ public const uint Attributes = (uint)enum_EVENTATTRIBUTES.EVENT_SYNCHRONOUS;
+
+ ///
+ /// Gets the attributes for this debug event. (http://msdn.microsoft.com/en-us/library/bb145575.aspx)
+ ///
+ /// A combination of flags from the enum_EVENTATTRIBUTES enumeration.
+ /// VSConstants.S_OK.
+ int IDebugEvent2.GetAttributes(out uint eventAttributes)
+ {
+ eventAttributes = Attributes;
+ return VSConstants.S_OK;
+ }
+ }
+
+ ///
+ /// Used to communicate both critical debug information and non-critical information.
+ /// (http://msdn.microsoft.com/en-us/library/bb161977.aspx)
+ ///
+ class AD7SynchronousStoppingEvent : IDebugEvent2
+ {
+ public const uint Attributes = (uint)enum_EVENTATTRIBUTES.EVENT_STOPPING | (uint)enum_EVENTATTRIBUTES.EVENT_SYNCHRONOUS;
+
+ ///
+ /// Gets the attributes for this debug event. (http://msdn.microsoft.com/en-us/library/bb145575.aspx)
+ ///
+ /// A combination of flags from the enum_EVENTATTRIBUTES enumeration.
+ /// VSConstants.S_OK.
+ int IDebugEvent2.GetAttributes(out uint eventAttributes)
+ {
+ eventAttributes = Attributes;
+ return VSConstants.S_OK;
+ }
+ }
+
+ #endregion
+
+ ///
+ /// The debug engine (DE) sends this interface to the session debug manager (SDM) when an instance of the DE is created.
+ /// (http://msdn.microsoft.com/en-us/library/bb145830.aspx)
+ ///
+ sealed class AD7EngineCreateEvent : AD7AsynchronousEvent, IDebugEngineCreateEvent2
+ {
+ public const string IID = "FE5B734C-759D-4E59-AB04-F103343BDD06";
+
+ private readonly IDebugEngine2 _engine;
+
+ ///
+ /// Constructor.
+ ///
+ /// The AD7Engine object that represents the DE.
+ AD7EngineCreateEvent(AD7Engine engine)
+ {
+ _engine = engine;
+ }
+
+ ///
+ /// Sends the event.
+ ///
+ /// The AD7Engine object that represents the DE.
+ public static void Send(AD7Engine engine)
+ {
+ AD7EngineCreateEvent eventObject = new AD7EngineCreateEvent(engine);
+ engine.Callback.Send(eventObject, IID, null, null);
+ }
+
+ ///
+ /// Retrieves the object that represents the newly created debug engine (DE).
+ /// (http://msdn.microsoft.com/en-us/library/bb145143.aspx)
+ ///
+ /// Returns an AD7Engine object that represents the newly created DE.
+ /// VSConstants.S_OK.
+ int IDebugEngineCreateEvent2.GetEngine(out IDebugEngine2 engine)
+ {
+ engine = _engine;
+ return VSConstants.S_OK;
+ }
+ }
+
+ ///
+ /// This interface is sent when a process is launched. (http://msdn.microsoft.com/en-ca/library/bb161755.aspx)
+ ///
+ sealed class AD7ProcessCreateEvent : IDebugEvent2, IDebugProcessCreateEvent2
+ {
+ public const string IID = "9020DEE3-362D-4FF2-8CA9-8F6791F0EC85";
+ public const uint Attributes = (uint)enum_EVENTATTRIBUTES.EVENT_IMMEDIATE;
+
+ ///
+ /// Gets the attributes for this debug event. (http://msdn.microsoft.com/en-us/library/bb145575.aspx)
+ ///
+ /// A combination of flags from the enum_EVENTATTRIBUTES enumeration.
+ /// VSConstants.S_OK.
+ int IDebugEvent2.GetAttributes(out uint eventAttributes)
+ {
+ eventAttributes = Attributes;
+ return VSConstants.S_OK;
+ }
+ }
+
+ ///
+ /// This interface is sent when a process is terminated, exits atypically, or is detached from.
+ /// (http://msdn.microsoft.com/en-us/library/bb145152.aspx)
+ ///
+ sealed class AD7ProcessDestroyEvent : IDebugEvent2, IDebugProcessDestroyEvent2
+ {
+ public const string IID = "29DAA0AC-C718-4F93-A11E-6D15681476C7";
+ public const uint Attributes = (uint)enum_EVENTATTRIBUTES.EVENT_IMMEDIATE;
+
+ ///
+ /// Gets the attributes for this debug event. (http://msdn.microsoft.com/en-us/library/bb145575.aspx)
+ ///
+ /// A combination of flags from the enum_EVENTATTRIBUTES enumeration.
+ /// VSConstants.S_OK.
+ int IDebugEvent2.GetAttributes(out uint eventAttributes)
+ {
+ eventAttributes = Attributes;
+ return VSConstants.S_OK;
+ }
+ }
+
+ ///
+ /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a program is attached to.
+ /// (http://msdn.microsoft.com/en-ca/library/bb161345.aspx)
+ ///
+ sealed class AD7ProgramCreateEvent : AD7AsynchronousEvent, IDebugProgramCreateEvent2
+ {
+ public const string IID = "96CD11EE-ECD4-4E89-957E-B5D496FC4139";
+
+ ///
+ /// Sends the event.
+ ///
+ /// The AD7Engine object that represents the DE.
+ internal static void Send(AD7Engine engine)
+ {
+ AD7ProgramCreateEvent eventObject = new AD7ProgramCreateEvent();
+ engine.Callback.Send(eventObject, IID, null);
+ }
+ }
+
+ ///
+ /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when asynchronous expression evaluation
+ /// is complete. (http://msdn.microsoft.com/en-ca/library/bb161810.aspx)
+ ///
+ sealed class AD7ExpressionEvaluationCompleteEvent : AD7AsynchronousEvent, IDebugExpressionEvaluationCompleteEvent2
+ {
+ public const string IID = "C0E13A85-238A-4800-8315-D947C960A843";
+
+ private readonly IDebugExpression2 _expression;
+ private readonly IDebugProperty2 _property;
+
+ ///
+ /// Constructor.
+ ///
+ /// The IDebugExpression2 object that represents the expression.
+ /// The IDebugProperty2 object that represents the result of the expression evaluation.
+ public AD7ExpressionEvaluationCompleteEvent(IDebugExpression2 expression, IDebugProperty2 property)
+ {
+ _expression = expression;
+ _property = property;
+ }
+
+ ///
+ /// Gets the original expression. (http://msdn.microsoft.com/en-ca/library/bb162323.aspx)
+ ///
+ /// Returns an IDebugExpression2 object that represents the expression that was parsed.
+ /// VSConstants.S_OK.
+ public int GetExpression(out IDebugExpression2 ppExpr)
+ {
+ ppExpr = _expression;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the result of expression evaluation. (http://msdn.microsoft.com/en-ca/library/bb161962.aspx)
+ ///
+ /// Returns an IDebugProperty2 object that represents the result of the expression evaluation.
+ /// VSConstants.S_OK.
+ public int GetResult(out IDebugProperty2 ppResult)
+ {
+ ppResult = _property;
+ return _property != null ? VSConstants.S_OK : VSConstants.E_FAIL;
+ }
+ }
+
+ ///
+ /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a module is loaded or unloaded.
+ /// (http://msdn.microsoft.com/en-ca/library/bb146706.aspx)
+ ///
+ sealed class AD7ModuleLoadEvent : AD7AsynchronousEvent, IDebugModuleLoadEvent2
+ {
+ public const string IID = "989DB083-0D7C-40D1-A9D9-921BF611A4B2";
+
+ private readonly AD7Module _module;
+ private readonly bool _isLoad;
+
+ ///
+ /// Constructor.
+ ///
+ /// The IDebugModule2 object that represents the module which is loading or unloading.
+ /// onzero (TRUE) if the module is loading and zero (FALSE) if the module is unloading.
+ public AD7ModuleLoadEvent(AD7Module module, bool isLoad)
+ {
+ _module = module;
+ _isLoad = isLoad;
+ }
+
+ ///
+ /// Gets the module that is being loaded or unloaded. (http://msdn.microsoft.com/en-ca/library/bb161763.aspx)
+ ///
+ /// Returns an IDebugModule2 object that represents the module which is loading or unloading.
+ /// Returns an optional message describing this event. If this parameter is a null value, no message
+ /// is requested.
+ /// Nonzero (TRUE) if the module is loading and zero (FALSE) if the module is unloading. If this
+ /// parameter is a null value, no status is requested.
+ /// VSConstants.S_OK.
+ int IDebugModuleLoadEvent2.GetModule(out IDebugModule2 module, ref string debugMessage, ref int isLoad)
+ {
+ module = _module;
+ isLoad = _isLoad ? 1 : 0;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Sends the event.
+ ///
+ /// The AD7Engine object that represents the DE.
+ /// The IDebugModule2 object that represents the module which is loading or unloading.
+ /// onzero (TRUE) if the module is loading and zero (FALSE) if the module is unloading.
+ internal static void Send(AD7Engine engine, AD7Module module, bool isLoad)
+ {
+ var eventObject = new AD7ModuleLoadEvent(module, isLoad);
+ engine.Callback.Send(eventObject, IID, null);
+ }
+ }
+
+ ///
+ /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a program has run to completion
+ /// or is otherwise destroyed. (http://msdn.microsoft.com/en-ca/library/bb161972.aspx)
+ ///
+ sealed class AD7ProgramDestroyEvent : AD7SynchronousEvent, IDebugProgramDestroyEvent2
+ {
+ public const string IID = "E147E9E3-6440-4073-A7B7-A65592C714B5";
+
+ private readonly uint _exitCode;
+
+ ///
+ /// Constructor.
+ ///
+ /// The program's exit code.
+ public AD7ProgramDestroyEvent(uint exitCode)
+ {
+ _exitCode = exitCode;
+ }
+
+ #region IDebugProgramDestroyEvent2 Members
+
+ ///
+ /// Gets the program's exit code. (http://msdn.microsoft.com/en-ca/library/bb146724.aspx)
+ ///
+ /// Returns the program's exit code.
+ /// VSConstants.S_OK.
+ int IDebugProgramDestroyEvent2.GetExitCode(out uint exitCode)
+ {
+ exitCode = _exitCode;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Sends the event.
+ ///
+ /// The AD7Engine object that represents the DE.
+ /// The program's exit code.
+ internal static void Send(AD7Engine engine, uint exitCode)
+ {
+ var eventObject = new AD7ProgramDestroyEvent(exitCode);
+ engine.Callback.Send(eventObject, IID, null);
+ }
+
+ #endregion
+ }
+
+ ///
+ /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a thread is created in a program
+ /// being debugged. (http://msdn.microsoft.com/en-ca/library/bb161327.aspx)
+ ///
+ sealed class AD7ThreadCreateEvent : AD7AsynchronousEvent, IDebugThreadCreateEvent2
+ {
+ public const string IID = "2090CCFC-70C5-491D-A5E8-BAD2DD9EE3EA";
+ }
+
+ ///
+ /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a thread has run to completion.
+ /// (http://msdn.microsoft.com/en-ca/library/bb162330.aspx)
+ ///
+ sealed class AD7ThreadDestroyEvent : AD7AsynchronousEvent, IDebugThreadDestroyEvent2
+ {
+ public const string IID = "2C3B7532-A36F-4A6E-9072-49BE649B8541";
+
+ private readonly uint _exitCode;
+
+ ///
+ /// Constructor.
+ ///
+ /// The thread's exit code.
+ public AD7ThreadDestroyEvent(uint exitCode)
+ {
+ _exitCode = exitCode;
+ }
+
+ #region IDebugThreadDestroyEvent2 Members
+
+ ///
+ /// Gets the exit code for a thread. (http://msdn.microsoft.com/en-ca/library/bb146996.aspx)
+ ///
+ /// Returns the thread's exit code.
+ /// VSConstants.S_OK.
+ int IDebugThreadDestroyEvent2.GetExitCode(out uint exitCode)
+ {
+ exitCode = _exitCode;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Sends the event.
+ ///
+ /// The AD7Engine object that represents the DE.
+ /// The thread's exit code.
+ /// The AD7Thread object that represents the thread.
+ internal static void Send(AD7Engine engine, uint exitCode, AD7Thread thread)
+ {
+ var eventObject = new AD7ThreadDestroyEvent(exitCode);
+ if (thread == null)
+ {
+ foreach (AD7Thread t in engine.Threads)
+ {
+ engine.Callback.Send(eventObject, IID, t);
+ }
+ engine._currentThreadIndex = -1;
+ }
+ else
+ {
+ engine.Callback.Send(eventObject, IID, thread);
+ }
+ }
+
+ #endregion
+ }
+
+ ///
+ /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a program is loaded, but before
+ /// any code is executed. (http://msdn.microsoft.com/en-ca/library/bb145834.aspx)
+ ///
+ sealed class AD7LoadCompleteEvent : AD7StoppingEvent, IDebugLoadCompleteEvent2
+ {
+ public const string IID = "B1844850-1349-45D4-9F12-495212F5EB0B";
+
+ ///
+ /// Sends the event.
+ ///
+ /// The AD7Engine object that represents the DE.
+ /// The AD7Thread object that represents the thread.
+ internal static void Send(AD7Engine engine, AD7Thread thread)
+ {
+ if (thread == null)
+ throw new ArgumentNullException("thread");
+
+ var message = new AD7LoadCompleteEvent();
+ engine.Callback.Send(message, IID, thread);
+ }
+ }
+
+ ///
+ /// This interface tells the session debug manager (SDM) that an asynchronous break has been successfully completed.
+ /// (http://msdn.microsoft.com/en-ca/library/bb146180.aspx)
+ ///
+ sealed class AD7AsyncBreakCompleteEvent : AD7StoppingEvent, IDebugBreakEvent2
+ {
+ public const string IID = "c7405d1d-e24b-44e0-b707-d8a5a4e1641b";
+ }
+
+ ///
+ /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) to output a string.
+ /// (http://msdn.microsoft.com/en-ca/library/bb146756.aspx)
+ ///
+ sealed class AD7OutputDebugStringEvent : AD7AsynchronousEvent, IDebugOutputStringEvent2
+ {
+ public const string IID = "569c4bb1-7b82-46fc-ae28-4536ddad753e";
+
+ private readonly string _message;
+
+ ///
+ /// Constructor.
+ ///
+ /// The displayable message.
+ public AD7OutputDebugStringEvent(string message)
+ {
+ _message = message;
+ }
+
+ #region IDebugOutputStringEvent2 Members
+
+ ///
+ /// Gets the displayable message. (http://msdn.microsoft.com/en-ca/library/bb162293.aspx)
+ ///
+ /// Returns the displayable message.
+ /// VSConstants.S_OK.
+ int IDebugOutputStringEvent2.GetString(out string pbstrString)
+ {
+ pbstrString = _message;
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+ }
+
+ ///
+ /// This interface is sent by the debug engine (DE) to indicate that the debugging symbols for a module being debugged have
+ /// been loaded. (http://msdn.microsoft.com/en-ca/library/bb160924.aspx)
+ ///
+ sealed class AD7SymbolSearchEvent : AD7AsynchronousEvent, IDebugSymbolSearchEvent2
+ {
+ public const string IID = "638F7C54-C160-4c7b-B2D0-E0337BC61F8C";
+
+ private readonly AD7Module _module;
+ private readonly string _searchInfo;
+ private readonly uint _symbolFlags;
+
+ ///
+ /// Constructor.
+ ///
+ /// The AD7Module object representing the module for which the symbols were loaded.
+ /// The string containing any error messages from the module.
+ /// A combination of flags from the MODULE_INFO_FLAGS enumeration indicating whether any
+ /// symbols were loaded.
+ public AD7SymbolSearchEvent(AD7Module module, string searchInfo, uint symbolFlags)
+ {
+ _module = module;
+ _searchInfo = searchInfo;
+ _symbolFlags = symbolFlags;
+ }
+
+ #region IDebugSymbolSearchEvent2 Members
+
+ ///
+ /// Called by an event handler to retrieve results about a symbol load process.
+ /// (http://msdn.microsoft.com/en-ca/library/bb161324.aspx)
+ ///
+ /// An IDebugModule3 object representing the module for which the symbols were loaded.
+ /// Returns a string containing any error messages from the module. If there is no error,
+ /// then this string will just contain the module's name but it is never empty.
+ /// A combination of flags from the MODULE_INFO_FLAGS enumeration indicating whether any
+ /// symbols were loaded.
+ /// VSConstants.S_OK.
+ int IDebugSymbolSearchEvent2.GetSymbolSearchInfo(out IDebugModule3 pModule, ref string pbstrDebugMessage, enum_MODULE_INFO_FLAGS[] pdwModuleInfoFlags)
+ {
+ pModule = _module;
+ pbstrDebugMessage = _searchInfo;
+ pdwModuleInfoFlags[0] = (enum_MODULE_INFO_FLAGS)_symbolFlags;
+
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+ }
+
+ ///
+ /// This interface tells the session debug manager (SDM) that a pending breakpoint has been successfully bound to a loaded program.
+ /// (http://msdn.microsoft.com/en-us/library/bb145356.aspx)
+ ///
+ sealed class AD7BreakpointBoundEvent : AD7AsynchronousEvent, IDebugBreakpointBoundEvent2
+ {
+ public const string IID = "1dddb704-cf99-4b8a-b746-dabb01dd13a0";
+
+ private readonly AD7PendingBreakpoint _pendingBreakpoint;
+ private readonly AD7BoundBreakpoint _boundBreakpoint;
+
+ ///
+ /// Constructor.
+ ///
+ /// The AD7PendingBreakpoint object that represents the pending breakpoint being bound.
+ /// The AD7BoundBreakpoint object that represents the breakpoint being bound.
+ public AD7BreakpointBoundEvent(AD7PendingBreakpoint pendingBreakpoint, AD7BoundBreakpoint boundBreakpoint)
+ {
+ _pendingBreakpoint = pendingBreakpoint;
+ _boundBreakpoint = boundBreakpoint;
+ }
+
+ #region IDebugBreakpointBoundEvent2 Members
+
+ ///
+ /// Creates an enumerator of breakpoints that were bound on this event. (http://msdn.microsoft.com/en-us/library/bb145322.aspx)
+ ///
+ /// Returns an IEnumDebugBoundBreakpoints2 object that enumerates all the breakpoints bound from
+ /// this event.
+ /// VSConstants.S_OK.
+ int IDebugBreakpointBoundEvent2.EnumBoundBreakpoints(out IEnumDebugBoundBreakpoints2 ppEnum)
+ {
+ IDebugBoundBreakpoint2[] boundBreakpoints = new IDebugBoundBreakpoint2[1];
+ boundBreakpoints[0] = _boundBreakpoint;
+ ppEnum = new AD7BoundBreakpointsEnum(boundBreakpoints);
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the pending breakpoint that is being bound. (http://msdn.microsoft.com/en-us/library/bb146558.aspx)
+ ///
+ /// Returns the IDebugPendingBreakpoint2 object that represents the pending breakpoint being
+ /// bound.
+ /// VSConstants.S_OK.
+ int IDebugBreakpointBoundEvent2.GetPendingBreakpoint(out IDebugPendingBreakpoint2 ppPendingBP)
+ {
+ ppPendingBP = _pendingBreakpoint;
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+ }
+
+ ///
+ /// The debug engine (DE) sends this interface to the session debug manager (SDM) when a program stops at a breakpoint.
+ /// (http://msdn.microsoft.com/en-us/library/bb145927.aspx)
+ ///
+ sealed class AD7BreakpointEvent : AD7StoppingEvent, IDebugBreakpointEvent2
+ {
+ public const string IID = "501C1E21-C557-48B8-BA30-A1EAB0BC4A74";
+
+ private readonly IEnumDebugBoundBreakpoints2 _boundBreakpoints;
+
+ ///
+ /// Constructor.
+ ///
+ /// The IEnumDebugBoundBreakpoints2 object that enumerates all the breakpoints associated with
+ /// the current code location.
+ public AD7BreakpointEvent(IEnumDebugBoundBreakpoints2 boundBreakpoints)
+ {
+ _boundBreakpoints = boundBreakpoints;
+ }
+
+ #region IDebugBreakpointEvent2 Members
+
+ ///
+ /// Creates an enumerator for all the breakpoints that fired at the current code location.
+ /// (http://msdn.microsoft.com/en-us/library/bb146247.aspx)
+ ///
+ /// Returns an IEnumDebugBoundBreakpoints2 object that enumerates all the breakpoints associated with
+ /// the current code location.
+ /// VSConstants.S_OK.
+ int IDebugBreakpointEvent2.EnumBreakpoints(out IEnumDebugBoundBreakpoints2 ppEnum)
+ {
+ ppEnum = _boundBreakpoints;
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+ }
+
+
+ ///
+ /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when the program being debugged completes
+ /// a step into, a step over, or a step out of a line of source code or statement or instruction.
+ /// (http://msdn.microsoft.com/en-us/library/bb162189.aspx)
+ ///
+ sealed class AD7StepCompletedEvent : IDebugEvent2, IDebugStepCompleteEvent2
+ {
+ public const string IID = "0F7F24C1-74D9-4EA6-A3EA-7EDB2D81441D";
+
+ ///
+ /// Sends the event.
+ ///
+ /// The AD7Engine object that represents the DE.
+ public static void Send(AD7Engine engine)
+ {
+ var eventObject = new AD7StepCompletedEvent();
+ engine.Callback.Send(eventObject, IID, engine.CurrentThread());
+ }
+
+ #region IDebugEvent2 Members
+
+ ///
+ /// Gets the attributes for this debug event. (http://msdn.microsoft.com/en-us/library/bb145575.aspx)
+ ///
+ /// A combination of flags from the enum_EVENTATTRIBUTES enumeration.
+ /// VSConstants.S_OK.
+ public int GetAttributes(out uint pdwAttributes)
+ {
+ pdwAttributes = (uint)(enum_EVENTATTRIBUTES.EVENT_ASYNC_STOP);
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+ }
+
+ ///
+ /// The debug engine (DE) sends this interface to the session debug manager (SDM) when the program is about to execute its
+ /// first instruction of user code. (http://msdn.microsoft.com/en-us/library/bb161265.aspx)
+ ///
+ sealed class AD7EntryPointEvent : AD7SynchronousStoppingEvent, IDebugEntryPointEvent2
+ {
+ public const string IID = "86D5A99E-C721-4625-A401-4D052DF38475";
+
+ ///
+ /// Sends the event.
+ ///
+ /// The AD7Engine object that represents the DE.
+ public static void Send(AD7Engine engine)
+ {
+ var eventObject = new AD7EntryPointEvent();
+ engine.Callback.Send(eventObject, IID, engine.CurrentThread());
+ }
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7Expression.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7Expression.cs
new file mode 100644
index 00000000..be94a18e
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7Expression.cs
@@ -0,0 +1,139 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using BlackBerry.NativeCore.Diagnostics;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class represents a parsed expression ready for binding and evaluating.
+ /// It is returned as a result of a successful call to IDebugExpressionContext2.ParseText
+ /// It allows the debugger to obtain the values of an expression in the debuggee.
+ /// (http://msdn.microsoft.com/en-ca/library/bb162308.aspx)
+ ///
+ public sealed class AD7Expression : IDebugExpression2
+ {
+ ///
+ /// The expression to be evaluated.
+ ///
+ private readonly string _expression;
+
+ ///
+ /// The class that manages debug events for the debug engine.
+ ///
+ private readonly EventDispatcher _eventDispatcher;
+
+ ///
+ /// Current stack frame.
+ ///
+ private readonly AD7StackFrame _frame;
+
+ ///
+ /// Constructor.
+ ///
+ /// The expression to be evaluated.
+ /// Current stack frame.
+ /// Represents the class that manages debug events for the debug engine.
+ public AD7Expression(string expression, AD7StackFrame frame, EventDispatcher dispatcher)
+ {
+ _expression = expression;
+ _eventDispatcher = dispatcher;
+ _frame = frame;
+ }
+
+ #region IDebugExpression2 Members
+
+ ///
+ /// This method cancels asynchronous expression evaluation as started by a call to the IDebugExpression2::EvaluateAsync method.
+ /// Not implemented yet because it was not needed yet. (http://msdn.microsoft.com/en-ca/library/bb145924.aspx)
+ ///
+ /// Not implemented.
+ int IDebugExpression2.Abort()
+ {
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Thread responsible for evaluating expressions asynchronously.
+ ///
+ public void EvaluatingAsync()
+ {
+ try
+ {
+ VariableInfo vi = VariableInfo.Get(_expression, _eventDispatcher, _frame);
+ AD7Property ppResult = new AD7Property(vi);
+
+ _frame._engine.Callback.Send(new AD7ExpressionEvaluationCompleteEvent(this, ppResult), AD7ExpressionEvaluationCompleteEvent.IID, _frame._engine, _frame._thread);
+ }
+ catch (Exception ex)
+ {
+ TraceLog.WriteException(ex, "Unable to evaluate expression value");
+ _frame._engine.Callback.Send(new AD7ExpressionEvaluationCompleteEvent(this, null), AD7ExpressionEvaluationCompleteEvent.IID, _frame._engine, _frame._thread);
+ }
+ }
+
+ private void EvaluateAsyncCompleted(IAsyncResult ar)
+ {
+ // release async-call system resources:
+ var action = (Action) ar.AsyncState;
+ action.EndInvoke(ar);
+ }
+
+ ///
+ /// This method evaluates the expression asynchronously.
+ /// This is primarily used for the immediate window. (http://msdn.microsoft.com/en-ca/library/bb146752.aspx)
+ ///
+ /// A combination of flags from the EVALFLAGS enumeration that control expression evaluation.
+ /// This parameter is always a null value.
+ /// VSConstants.S_OK.
+ int IDebugExpression2.EvaluateAsync(enum_EVALFLAGS dwFlags, IDebugEventCallback2 pExprCallback)
+ {
+ // Evaluate the expression asynchronously
+ var action = new Action(EvaluatingAsync);
+ action.BeginInvoke(EvaluateAsyncCompleted, action);
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// This method evaluates the expression synchronously. (http://msdn.microsoft.com/en-ca/library/bb146982.aspx)
+ ///
+ /// A combination of flags from the EVALFLAGS enumeration that control expression evaluation.
+ /// Maximum time, in milliseconds, to wait before returning from this method. Use INFINITE to wait
+ /// indefinitely.
+ /// This parameter is always a null value.
+ /// Returns the IDebugProperty2 object that contains the result of the expression evaluation.
+ /// VSConstants.S_OK.
+ int IDebugExpression2.EvaluateSync(enum_EVALFLAGS dwFlags, uint dwTimeout, IDebugEventCallback2 pExprCallback, out IDebugProperty2 ppResult)
+ {
+ try
+ {
+ VariableInfo vi = VariableInfo.Get(_expression, _eventDispatcher, _frame);
+ ppResult = new AD7Property(vi);
+ return VSConstants.S_OK;
+ }
+ catch (Exception ex)
+ {
+ TraceLog.WriteException(ex, "Unable to evaluate expression value");
+ ppResult = null;
+ return VSConstants.E_FAIL;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7MemoryAddress.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7MemoryAddress.cs
new file mode 100644
index 00000000..cb2f2332
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7MemoryAddress.cs
@@ -0,0 +1,254 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// And implementation of IDebugCodeContext2 and IDebugMemoryContext2.
+ /// IDebugMemoryContext2 represents a position in the address space of the machine running the program being debugged.
+ /// IDebugCodeContext2 represents the starting position of a code instruction. For most run-time architectures today, a code
+ /// context can be thought of as an address in a program's execution stream.
+ ///
+ public sealed class AD7MemoryAddress : IDebugCodeContext2, IDebugCodeContext100
+ {
+ ///
+ /// The AD7Engine object that represents the DE.
+ ///
+ private readonly AD7Engine _engine;
+
+ ///
+ /// The current context's address.
+ ///
+ private readonly uint _address;
+
+ ///
+ /// The IDebugDocumentContext2 object that corresponds to the code context.
+ ///
+ private IDebugDocumentContext2 _documentContext;
+
+ ///
+ /// Constructor.
+ ///
+ /// The AD7Engine object that represents the DE.
+ /// The current context's address.
+ public AD7MemoryAddress(AD7Engine engine, uint address)
+ {
+ if (engine == null)
+ throw new ArgumentNullException("engine");
+
+ _engine = engine;
+ _address = address;
+ }
+
+ ///
+ /// Sets the document context.
+ ///
+ /// The IDebugDocumentContext2 object that corresponds to the code context.
+ public void SetDocumentContext(IDebugDocumentContext2 docContext)
+ {
+ _documentContext = docContext;
+ }
+
+ #region IDebugMemoryContext2 Members
+
+ ///
+ /// Adds a specified value to the current context's address to create a new context.
+ /// (http://msdn.microsoft.com/en-ca/library/bb145861.aspx)
+ ///
+ /// The value to add to the current context.
+ /// Returns a new IDebugMemoryContext2 object.
+ /// VSConstants.S_OK.
+ public int Add(ulong dwCount, out IDebugMemoryContext2 newAddress)
+ {
+ newAddress = new AD7MemoryAddress(_engine, (uint)dwCount + _address);
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Compares the memory context to each context in the given array in the manner indicated by compare flags,
+ /// returning an index of the first context that matches. (http://msdn.microsoft.com/en-ca/library/bb161750.aspx)
+ ///
+ /// A value from the CONTEXT_COMPARE enumeration that determines the type of comparison.
+ /// An array of references to the IDebugMemoryContext2 objects to compare against.
+ /// The number of contexts in the compareToItems array.
+ /// Returns the index of the first memory context that satisfies the comparison.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ public int Compare(enum_CONTEXT_COMPARE uContextCompare, IDebugMemoryContext2[] compareToItems, uint compareToLength, out uint foundIndex)
+ {
+ foundIndex = uint.MaxValue;
+
+ try
+ {
+ enum_CONTEXT_COMPARE contextCompare = uContextCompare;
+
+ for (uint c = 0; c < compareToLength; c++)
+ {
+ // check if expected type and managed by the same debug-engine:
+ AD7MemoryAddress compareTo = compareToItems[c] as AD7MemoryAddress;
+ if (compareTo == null || !ReferenceEquals(_engine, compareTo._engine))
+ {
+ continue;
+ }
+
+ bool result;
+
+ switch (contextCompare)
+ {
+ case enum_CONTEXT_COMPARE.CONTEXT_EQUAL:
+ result = _address == compareTo._address;
+ break;
+
+ case enum_CONTEXT_COMPARE.CONTEXT_LESS_THAN:
+ result = _address < compareTo._address;
+ break;
+
+ case enum_CONTEXT_COMPARE.CONTEXT_GREATER_THAN:
+ result = _address > compareTo._address;
+ break;
+
+ case enum_CONTEXT_COMPARE.CONTEXT_LESS_THAN_OR_EQUAL:
+ result = _address <= compareTo._address;
+ break;
+
+ case enum_CONTEXT_COMPARE.CONTEXT_GREATER_THAN_OR_EQUAL:
+ result = _address >= compareTo._address;
+ break;
+
+ // The VSNDK debug engine doesn't understand scopes or functions
+ case enum_CONTEXT_COMPARE.CONTEXT_SAME_SCOPE:
+ case enum_CONTEXT_COMPARE.CONTEXT_SAME_FUNCTION:
+ result = _address == compareTo._address;
+ break;
+
+ case enum_CONTEXT_COMPARE.CONTEXT_SAME_MODULE:
+ result = _address == compareTo._address;
+ break;
+
+ case enum_CONTEXT_COMPARE.CONTEXT_SAME_PROCESS:
+ result = true;
+ break;
+
+ default:
+ // A new comparison was invented that we don't support
+ return EngineUtils.NotImplemented();
+ }
+
+ if (result)
+ {
+ foundIndex = c;
+ return VSConstants.S_OK;
+ }
+ }
+
+ return VSConstants.S_FALSE;
+ }
+ catch (Exception e)
+ {
+ return EngineUtils.UnexpectedException(e);
+ }
+ }
+
+ ///
+ /// Gets information that describes this context. Not implemented. (http://msdn.microsoft.com/en-ca/library/bb145034.aspx)
+ ///
+ /// A combination of flags from the CONTEXT_INFO_FIELDS enumeration that indicate which fields of the
+ /// CONTEXT_INFO structure are to be fill in.
+ /// The CONTEXT_INFO structure that is filled in.
+ /// Not implemented.
+ public int GetInfo(enum_CONTEXT_INFO_FIELDS dwFields, CONTEXT_INFO[] pinfo)
+ {
+ return EngineUtils.NotImplemented(false);
+ }
+
+ ///
+ /// Gets the user-displayable name for this context. This is not supported by the VSNDK debug engine.
+ /// (http://msdn.microsoft.com/en-ca/library/bb146997.aspx)
+ ///
+ /// Returns the name of the memory context.
+ /// Not implemented.
+ public int GetName(out string pbstrName)
+ {
+ pbstrName = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Subtracts a specified value from the current context's address to create a new context.
+ /// (http://msdn.microsoft.com/en-ca/library/bb146285.aspx)
+ ///
+ /// The number of memory bytes to decrement.
+ /// Returns a new IDebugMemoryContext2 object.
+ /// VSConstants.S_OK.
+ public int Subtract(ulong dwCount, out IDebugMemoryContext2 ppMemCxt)
+ {
+ ppMemCxt = new AD7MemoryAddress(_engine, (uint)dwCount - _address);
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+
+ #region IDebugCodeContext2 Members
+
+ ///
+ /// Gets the document context that corresponds to this code context. The document context represents a position in the source file
+ /// that corresponds to the source code that generated this instruction. (http://msdn.microsoft.com/en-ca/library/bb161811.aspx)
+ ///
+ /// Returns the IDebugDocumentContext2 object that corresponds to the code context.
+ /// VSConstants.S_OK.
+ public int GetDocumentContext(out IDebugDocumentContext2 ppSrcCxt)
+ {
+ ppSrcCxt = _documentContext;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the language information for this code context. (http://msdn.microsoft.com/en-ca/library/bb144925.aspx)
+ ///
+ /// Returns a string that contains the name of the language, such as "C++.".
+ /// Returns the GUID for the language of the code context, for example, guidCPPLang.
+ /// If successful, returns S_OK; otherwise, returns S_FALSE.
+ public int GetLanguageInfo(ref string pbstrLanguage, ref Guid pguidLanguage)
+ {
+ if (_documentContext != null)
+ {
+ _documentContext.GetLanguageInfo(ref pbstrLanguage, ref pguidLanguage);
+ return VSConstants.S_OK;
+ }
+ return VSConstants.S_FALSE;
+ }
+
+ #endregion
+
+ #region IDebugCodeContext100 Members
+
+ ///
+ /// Returns the program being debugged. In the case of this VSNDK debug debug engine, AD7Engine implements IDebugProgram2 which
+ /// represents the program being debugged.
+ /// (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugcodecontext100.getprogram.aspx)
+ ///
+ /// Returns the program being debugged.
+ /// VSConstants.S_OK.
+ int IDebugCodeContext100.GetProgram(out IDebugProgram2 pProgram)
+ {
+ pProgram = _engine;
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7Module.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7Module.cs
new file mode 100644
index 00000000..dad80fb1
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7Module.cs
@@ -0,0 +1,207 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class represents a module loaded in the debuggee process to the debugger. Not implemented, yet.
+ ///
+ /// It implements:
+ ///
+ /// IDebugModule2: This interface represents a modulethat is, an executable unit of a programsuch as a DLL.
+ /// (http://msdn.microsoft.com/en-ca/library/bb145360.aspx)
+ ///
+ /// IDebugModule3: This interface represents a module that supports alternate locations of symbols and JustMyCode states.
+ /// (http://msdn.microsoft.com/en-ca/library/bb145893.aspx)
+ ///
+ public sealed class AD7Module : IDebugModule2, IDebugModule3
+ {
+ ///
+ /// Gets information about this module. (http://msdn.microsoft.com/en-ca/library/bb161975.aspx)
+ ///
+ /// A combination of flags from the MODULE_INFO_FIELDS enumeration that specify which fields of pInfo
+ /// are to be filled out.
+ /// A MODULE_INFO structure that is filled in with a description of the module.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ int IDebugModule2.GetInfo(enum_MODULE_INFO_FIELDS flags, MODULE_INFO[] infoArray)
+ {
+ try
+ {
+ MODULE_INFO info = new MODULE_INFO();
+
+ if (flags.HasFlag(enum_MODULE_INFO_FIELDS.MIF_NAME))
+ {
+ info.m_bstrName = "";
+ info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
+ }
+ if (flags.HasFlag(enum_MODULE_INFO_FIELDS.MIF_URL))
+ {
+ info.m_bstrUrl = "";
+ info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
+ }
+ if (flags.HasFlag(enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS))
+ {
+ info.m_addrLoadAddress = 0;
+ info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS;
+ }
+ if (flags.HasFlag(enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS))
+ {
+ // A debugger that actually supports showing the preferred base should crack the PE header and get
+ // that field. This debugger does not do that, so assume the module loaded where it was suppose to.
+ info.m_addrPreferredLoadAddress = 0;
+ info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS;
+ }
+ if (flags.HasFlag(enum_MODULE_INFO_FIELDS.MIF_SIZE))
+ {
+ info.m_dwSize = 0;
+ info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_SIZE;
+ }
+ if (flags.HasFlag(enum_MODULE_INFO_FIELDS.MIF_LOADORDER))
+ {
+ info.m_dwLoadOrder = 0;
+ info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADORDER;
+ }
+ if (flags.HasFlag(enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION))
+ {
+ info.m_bstrUrlSymbolLocation = "";
+ info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION;
+ }
+ if (flags.HasFlag(enum_MODULE_INFO_FIELDS.MIF_FLAGS))
+ {
+ info.m_dwModuleFlags = 0;
+ info.m_dwModuleFlags |= (enum_MODULE_FLAGS.MODULE_FLAG_SYMBOLS);
+ info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_FLAGS;
+ }
+ if (flags.HasFlag(enum_MODULE_INFO_FIELDS.MIF_VERSION))
+ {
+ info.m_bstrVersion = "";
+ info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_VERSION;
+ }
+ if (flags.HasFlag(enum_MODULE_INFO_FIELDS.MIF_DEBUGMESSAGE))
+ {
+ info.m_bstrDebugMessage = "";
+ info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_DEBUGMESSAGE;
+ }
+
+ infoArray[0] = info;
+ return VSConstants.S_OK;
+ }
+ catch (Exception e)
+ {
+ return EngineUtils.UnexpectedException(e);
+ }
+ }
+
+ #region Deprecated interface methods
+ // These methods are not called by the Visual Studio debugger, so they don't need to be implemented
+
+ ///
+ /// OBSOLETE. DO NOT USE. Reloads the symbols for this module. (http://msdn.microsoft.com/en-ca/library/bb145113.aspx)
+ ///
+ /// The path to the symbol store.
+ /// Returns an informational message, such as a status or error message, that is displayed to the
+ /// right of the module name in the Modules window.
+ /// VSConstants.E_NOTIMPL.
+ int IDebugModule2.ReloadSymbols_Deprecated(string urlToSymbols, out string debugMessage)
+ {
+ debugMessage = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// This method is not presented in IDebugModule3 webpage but the debug engine fails to build without it. It should have the same
+ /// behavior as the above IDebugModule2.ReloadSymbols_Deprecated. (http://msdn.microsoft.com/en-ca/library/bb145893.aspx)
+ ///
+ ///
+ ///
+ /// Not implemented.
+ int IDebugModule3.ReloadSymbols_Deprecated(string urlToSymbols, out string pbstrDebugMessage)
+ {
+ pbstrDebugMessage = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ #endregion
+
+ ///
+ /// This method is not presented in IDebugModule3 webpage but the debug engine fails to build without it.
+ /// (http://msdn.microsoft.com/en-ca/library/bb145893.aspx). It should have the same behavior as the above
+ /// IDebugModule2.GetInfo, i.e., gets information about this module. (http://msdn.microsoft.com/en-ca/library/bb161975.aspx)
+ ///
+ /// A combination of flags from the MODULE_INFO_FIELDS enumeration that specify which fields of pInfo
+ /// are to be filled out.
+ /// A MODULE_INFO structure that is filled in with a description of the module.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ int IDebugModule3.GetInfo(enum_MODULE_INFO_FIELDS flags, MODULE_INFO[] pinfo)
+ {
+ return ((IDebugModule2)this).GetInfo(flags, pinfo);
+ }
+
+ ///
+ /// Returns a list of paths searched for symbols and the results of searching each path.
+ /// [http://msdn.microsoft.com/en-ca/library/bb161971(v=vs.100).aspx]
+ ///
+ /// A combination of flags from the SYMBOL_SEARCH_INFO_FIELDS enumeration specifying which fields
+ /// of pInfo are to be filled in.
+ /// A MODULE_SYMBOL_SEARCH_INFO structure whose members are to be filled in with the specified information.
+ /// If this is a null value, this method returns E_INVALIDARG.
+ /// VSConstants.S_OK.
+ int IDebugModule3.GetSymbolInfo(enum_SYMBOL_SEARCH_INFO_FIELDS flags, MODULE_SYMBOL_SEARCH_INFO[] pinfo)
+ {
+ pinfo[0] = new MODULE_SYMBOL_SEARCH_INFO();
+ pinfo[0].dwValidFields = 1; // SSIF_VERBOSE_SEARCH_INFO;
+ pinfo[0].bstrVerboseSearchInfo = "Symbols not loaded";
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Retrieves information on whether the module represents user code or not. Used to support the JustMyCode features of the
+ /// debugger. [http://msdn.microsoft.com/en-ca/library/bb146644(v=vs.100).aspx]
+ /// The VSNDK debug engine does not support JustMyCode and therefore all modules are considered "My Code"
+ ///
+ /// Nonzero (TRUE) if module represents user code, zero (FALSE) if it does not.
+ /// VSConstants.S_OK.
+ int IDebugModule3.IsUserCode(out int pIsUserCode)
+ {
+ pIsUserCode = 1;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Loads and initializes symbols for the current module when the user explicitly asks for them to load. Not implemented.
+ /// [http://msdn.microsoft.com/en-ca/library/bb146634(v=vs.100).aspx]
+ ///
+ /// Not implemented.
+ int IDebugModule3.LoadSymbols()
+ {
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Specifies whether the module should be considered user code or not. Used to support the JustMyCode features of the debugger.
+ /// [http://msdn.microsoft.com/en-ca/library/bb146327(v=vs.100).aspx]
+ /// The VSNDK debug engine does not support JustMyCode so this is not implemented
+ ///
+ /// Nonzero (TRUE) if the module should be considered user code, zero (FALSE) if it should not.
+ /// Not implemented.
+ int IDebugModule3.SetJustMyCodeState(int fIsUserCode)
+ {
+ return EngineUtils.NotImplemented();
+ }
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7PendingBreakpoint.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7PendingBreakpoint.cs
new file mode 100644
index 00000000..c7f8bc03
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7PendingBreakpoint.cs
@@ -0,0 +1,345 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+using System;
+using System.Collections.Generic;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class represents a pending breakpoint that is ready to bind to a code location. A pending breakpoint is an abstract
+ /// representation of a breakpoint before it is bound. When a user creates a new breakpoint, the pending breakpoint is created
+ /// and is later bound. The bound breakpoints become children of the pending breakpoint.
+ ///
+ /// It implements IDebugPendingBreakpoint2: (http://msdn.microsoft.com/en-ca/library/bb161807.aspx)
+ ///
+ public sealed class AD7PendingBreakpoint : IDebugPendingBreakpoint2
+ {
+ private readonly AD7Engine _engine;
+
+ ///
+ /// The breakpoint request that resulted in this pending breakpoint being created.
+ ///
+ private readonly IDebugBreakpointRequest2 _breakpointRequest;
+ private BP_REQUEST_INFO _breakpointRequestInfo;
+
+ private readonly List _boundBreakpoints;
+ private bool _enabled;
+ private bool _deleted;
+
+ ///
+ /// Constructor.
+ ///
+ /// The breakpoint request used to create this pending breakpoint.
+ /// The AD7Engine object that represents the DE.
+ public AD7PendingBreakpoint(AD7Engine engine, IDebugBreakpointRequest2 breakpointRequest)
+ {
+ if (engine == null)
+ throw new ArgumentNullException("engine");
+ if (breakpointRequest == null)
+ throw new ArgumentNullException("breakpointRequest");
+
+ BP_REQUEST_INFO[] requestInfo = new BP_REQUEST_INFO[1];
+ _breakpointRequest = breakpointRequest;
+ _breakpointRequest.GetRequestInfo(enum_BPREQI_FIELDS.BPREQI_BPLOCATION, requestInfo); // PH: FIXME: check return code here and in following calls...
+ _breakpointRequestInfo = requestInfo[0];
+ _breakpointRequest.GetRequestInfo(enum_BPREQI_FIELDS.BPREQI_CONDITION, requestInfo);
+ if (requestInfo[0].dwFields != 0)
+ {
+ _breakpointRequestInfo.bpCondition = requestInfo[0].bpCondition;
+ _breakpointRequestInfo.dwFields |= requestInfo[0].dwFields;
+ }
+ _breakpointRequest.GetRequestInfo(enum_BPREQI_FIELDS.BPREQI_PASSCOUNT, requestInfo);
+ if (requestInfo[0].dwFields != 0)
+ {
+ _breakpointRequestInfo.bpPassCount = requestInfo[0].bpPassCount;
+ _breakpointRequestInfo.dwFields |= requestInfo[0].dwFields;
+ }
+
+ _engine = engine;
+ _boundBreakpoints = new List();
+
+ _enabled = true;
+ _deleted = false;
+ }
+
+ ///
+ /// Determines whether this pending breakpoint can bind to a code location.
+ ///
+ /// If successful, returns TRUE; otherwise, returns FALSE.
+ private bool CanBind
+ {
+ get
+ {
+ if (_deleted || !_engine.HasProcess)
+ return false;
+
+ // The engine only supports these types of breakpoints:
+ // - file and line number
+ // - function name and offset
+ if (_breakpointRequestInfo.bpLocation.bpLocationType == (uint) enum_BP_LOCATION_TYPE.BPLT_CODE_FILE_LINE
+ || _breakpointRequestInfo.bpLocation.bpLocationType == (uint) enum_BP_LOCATION_TYPE.BPLT_CODE_FUNC_OFFSET)
+ return true;
+
+ return false;
+ }
+ }
+
+ ///
+ /// Remove all of the bound breakpoints for this pending breakpoint
+ ///
+ public void ClearBoundBreakpoints()
+ {
+ lock (_boundBreakpoints)
+ {
+ for (int i = _boundBreakpoints.Count - 1; i >= 0; i--)
+ {
+ _boundBreakpoints[i].Delete();
+ }
+ }
+ }
+
+ ///
+ /// Called by bound breakpoints when they are being deleted.
+ ///
+ /// A bound breakpoint.
+ public void OnBoundBreakpointDeleted(AD7BoundBreakpoint boundBreakpoint)
+ {
+ lock (_boundBreakpoints)
+ {
+ _boundBreakpoints.Remove(boundBreakpoint);
+ }
+ }
+
+ #region IDebugPendingBreakpoint2 Members
+
+ ///
+ /// Bind this breakpoint. (http://msdn.microsoft.com/en-ca/library/bb145901.aspx)
+ ///
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ int IDebugPendingBreakpoint2.Bind()
+ {
+ if (!DebugEngineStatus.IsRunning)
+ {
+ return VSConstants.S_FALSE;
+ }
+
+ try
+ {
+ if (CanBind)
+ {
+ // Visual Studio returns a start position that is one less than it actually is
+ var boundBreakpoint = new AD7BoundBreakpoint(_engine, _breakpointRequestInfo, this);
+
+ if (boundBreakpoint.GdbInfo.ID == 0)
+ {
+ return VSConstants.S_FALSE;
+ }
+
+ // Set the enabled state of the bound breakpoint based on the pending breakpoint's enabled state
+ ((IDebugBoundBreakpoint2)boundBreakpoint).Enable(_enabled ? 1 : 0);
+ _boundBreakpoints.Add(boundBreakpoint);
+
+ return VSConstants.S_OK;
+ }
+
+ // PH: FIXME:
+ // The breakpoint could not be bound. This may occur for many reasons such as an invalid location, an invalid
+ // expression, etc... The VSNDK debug engine does not support this, but a real world engine will want to send an
+ // instance of IDebugBreakpointErrorEvent2 to the UI and return a valid instance of IDebugErrorBreakpoint2 from
+ // IDebugPendingBreakpoint2::EnumErrorBreakpoints. The debugger will then display information about why the
+ // breakpoint did not bind to the user.
+ return VSConstants.S_FALSE;
+ }
+ catch (Exception ex)
+ {
+ return EngineUtils.UnexpectedException(ex);
+ }
+ }
+
+ ///
+ /// Determines whether this pending breakpoint can bind to a code location. (http://msdn.microsoft.com/en-ca/library/bb146753.aspx)
+ ///
+ /// Returns an IEnumDebugErrorBreakpoints2 object that contains a list of IDebugErrorBreakpoint2
+ /// objects if there could be errors.
+ /// If successful, returns S_OK; otherwise, returns S_FALSE
+ int IDebugPendingBreakpoint2.CanBind(out IEnumDebugErrorBreakpoints2 ppErrorEnum)
+ {
+ ppErrorEnum = null;
+
+ if (!CanBind)
+ {
+ // PH: FIXME:
+ // The breakpoint could not be bound. This may occur for many reasons such as an invalid location, an invalid
+ // expression, etc... The VSNDK debug engine does not support this, but a real world engine will want to send an
+ // instance of IDebugBreakpointErrorEvent2 to the UI and return a valid instance of IDebugErrorBreakpoint2 from
+ // IDebugPendingBreakpoint2::EnumErrorBreakpoints. The debugger will then display information about why the
+ // breakpoint did not bind to the user.
+ return VSConstants.S_FALSE;
+ }
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Deletes this pending breakpoint and all breakpoints bound from it. (http://msdn.microsoft.com/en-ca/library/bb145918.aspx)
+ ///
+ /// VSConstants.S_OK.
+ int IDebugPendingBreakpoint2.Delete()
+ {
+ lock (_boundBreakpoints)
+ {
+ for (int i = _boundBreakpoints.Count - 1; i >= 0; i--)
+ {
+ _boundBreakpoints[i].Delete();
+ }
+ }
+
+ _enabled = false;
+ _deleted = true;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Toggles the enabled state of this pending breakpoint. (http://msdn.microsoft.com/en-ca/library/bb145046.aspx)
+ ///
+ /// Set to nonzero (TRUE) to enable a pending breakpoint, or to zero (FALSE) to disable.
+ /// VSConstants.S_OK.
+ int IDebugPendingBreakpoint2.Enable(int fEnable)
+ {
+ lock (_boundBreakpoints)
+ {
+ _enabled = fEnable != 0;
+
+ foreach (var breakpoint in _boundBreakpoints)
+ {
+ breakpoint.Enable(fEnable);
+ }
+ }
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Enumerates all breakpoints bound from this pending breakpoint. (http://msdn.microsoft.com/en-ca/library/bb145139.aspx)
+ ///
+ /// Returns an IEnumDebugBoundBreakpoints2 object that enumerates the bound breakpoints.
+ /// VSConstants.S_OK.
+ int IDebugPendingBreakpoint2.EnumBoundBreakpoints(out IEnumDebugBoundBreakpoints2 ppEnum)
+ {
+ lock (_boundBreakpoints)
+ {
+ IDebugBoundBreakpoint2[] boundBreakpoints = _boundBreakpoints.ToArray();
+ ppEnum = new AD7BoundBreakpointsEnum(boundBreakpoints);
+ }
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Enumerates all error breakpoints that resulted from this pending breakpoint.
+ /// (http://msdn.microsoft.com/en-ca/library/bb145598.aspx)
+ ///
+ /// A combination of values from the enum_BP_ERROR_TYPE enumeration that selects the type of errors
+ /// to enumerate.
+ /// Returns an IEnumDebugErrorBreakpoints2 object that contains a list of IDebugErrorBreakpoint2 objects.
+ /// VSConstants.E_NOTIMPL.
+ int IDebugPendingBreakpoint2.EnumErrorBreakpoints(enum_BP_ERROR_TYPE bpErrorType, out IEnumDebugErrorBreakpoints2 ppEnum)
+ {
+ // PH: FIXME:
+ // Called when a pending breakpoint could not be bound. This may occur for many reasons such as an invalid location, an
+ // invalid expression, etc... The VSNDK debug engine does not support this, but a real world engine will want to send an
+ // instance of IDebugBreakpointErrorEvent2 to the UI and return a valid enumeration of IDebugErrorBreakpoint2 from
+ // IDebugPendingBreakpoint2::EnumErrorBreakpoints. The debugger will then display information about why the breakpoint
+ // did not bind to the user.
+ ppEnum = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Gets the breakpoint request that was used to create this pending breakpoint.
+ /// (http://msdn.microsoft.com/en-ca/library/bb161770.aspx)
+ ///
+ /// Returns an IDebugBreakpointRequest2 object representing the breakpoint request that was used to
+ /// create this pending breakpoint.
+ /// VSConstants.S_OK.
+ int IDebugPendingBreakpoint2.GetBreakpointRequest(out IDebugBreakpointRequest2 ppBPRequest)
+ {
+ ppBPRequest = _breakpointRequest;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the state of this pending breakpoint. (http://msdn.microsoft.com/en-ca/library/bb162178.aspx)
+ ///
+ /// A PENDING_BP_STATE_INFO structure that is filled in with a description of this pending breakpoint.
+ /// VSConstants.S_OK.
+ int IDebugPendingBreakpoint2.GetState(PENDING_BP_STATE_INFO[] pState)
+ {
+ if (_deleted)
+ {
+ pState[0].state = (enum_PENDING_BP_STATE)enum_BP_STATE.BPS_DELETED;
+ return VSConstants.S_OK;
+ }
+
+ if (!_enabled)
+ {
+ pState[0].state = (enum_PENDING_BP_STATE)enum_BP_STATE.BPS_DISABLED;
+ return VSConstants.S_OK;
+ }
+
+ pState[0].state = (enum_PENDING_BP_STATE)enum_BP_STATE.BPS_ENABLED;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Sets or changes the condition associated with the pending breakpoint. (http://msdn.microsoft.com/en-ca/library/bb144977.aspx).
+ /// Not implemented here, but a conditional breakpoint can be set using IDebugBoundBreakpoint2::SetCondition().
+ ///
+ /// A BP_CONDITION structure that specifies the condition to set.
+ /// Not implemented.
+ int IDebugPendingBreakpoint2.SetCondition(BP_CONDITION bpCondition)
+ {
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Sets or changes the pass count associated with the pending breakpoint. (http://msdn.microsoft.com/en-ca/library/bb145038.aspx).
+ /// Not implemented here, but a pass count associated to a breakpoint can be set/changed using
+ /// IDebugBoundBreakpoint2::SetPassCount().
+ ///
+ /// A BP_PASSCOUNT structure that contains the pass count.
+ /// Not implemented.
+ int IDebugPendingBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
+ {
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Toggles the virtualized state of this pending breakpoint. When a pending breakpoint is virtualized, the debug engine will
+ /// attempt to bind it every time new code loads into the program. (http://msdn.microsoft.com/en-ca/library/bb146187.aspx)
+ /// The VSNDK debug engine does not support this. Not implemented.
+ ///
+ /// Set to nonzero (TRUE) to virtualize the pending breakpoint, or to zero (FALSE) to turn off
+ /// virtualization.
+ /// VSConstants.S_OK.
+ int IDebugPendingBreakpoint2.Virtualize(int fVirtualize)
+ {
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7Port.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7Port.cs
new file mode 100644
index 00000000..fccbb0d3
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7Port.cs
@@ -0,0 +1,292 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using BlackBerry.NativeCore;
+using BlackBerry.NativeCore.Components;
+using BlackBerry.NativeCore.Debugger;
+using BlackBerry.NativeCore.Debugger.Model;
+using BlackBerry.NativeCore.Diagnostics;
+using BlackBerry.NativeCore.Model;
+using BlackBerry.NativeCore.QConn;
+using BlackBerry.NativeCore.QConn.Model;
+using BlackBerry.Package.Helpers;
+using Microsoft.VisualStudio.Debugger.Interop;
+using Microsoft.VisualStudio;
+using System.Windows.Forms;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class implements a port.
+ ///
+ /// It implements:
+ ///
+ /// - IDebugPort2 - This interface represents a debug port on a machine. (http://msdn.microsoft.com/en-us/library/bb147021.aspx)
+ /// - IConnectionPointContainer - Supports connection points for connectable objects. Indicates to a client that the object is
+ /// connectable and provides the IConnectionPoint interface. (http://msdn.microsoft.com/en-CA/library/ms683857.aspx)
+ /// - IConnectionPoint - Supports connection points for connectable objects. (http://msdn.microsoft.com/en-us/library/ms694318.aspx)
+ ///
+ public sealed class AD7Port : IDebugPort2
+ {
+ ///
+ /// Represents the request that was used to create the port.
+ ///
+ private readonly AD7PortRequest _request;
+
+ ///
+ /// Represents the port supplier for this port.
+ ///
+ private readonly AD7PortSupplier _supplier;
+
+ ///
+ /// Stores the last time that the list of running processes was refreshed.
+ /// Used to avoid issues in case the user spams the refresh button.
+ ///
+ private DateTime _lastTimeRefresh = DateTime.MinValue;
+
+ ///
+ /// Stores the list of running processes in the simulator/device.
+ ///
+ private IDebugProcess2[] _processes;
+
+ ///
+ /// Constructor.
+ ///
+ /// The port supplier for this port.
+ /// The request used to create the port.
+ /// The GUID that identifies the port.
+ /// The name of the port.
+ /// Description of the device it should communicate with.
+ /// The description of NDK installed on host machine.
+ public AD7Port(AD7PortSupplier supplier, AD7PortRequest request, Guid guid, string name, DeviceDefinition device, NdkDefinition ndk)
+ {
+ if (supplier == null)
+ throw new ArgumentNullException("supplier");
+ if (string.IsNullOrEmpty(name))
+ throw new ArgumentNullException("name");
+ if (device == null)
+ throw new ArgumentNullException("device");
+ if (ndk == null)
+ throw new ArgumentNullException("ndk");
+
+ Name = name;
+ _request = request;
+ _supplier = supplier;
+ Guid = guid;
+ Device = device;
+ NDK = ndk;
+ }
+
+ #region Properties
+
+ ///
+ /// Gets or set the GUID that identifies the port.
+ ///
+ public Guid Guid
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// Gets or sets the name of the port.
+ ///
+ public string Name
+ {
+ get;
+ private set;
+ }
+
+ public DeviceDefinition Device
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// Gets or sets the NDK reference.
+ ///
+ public NdkDefinition NDK
+ {
+ get;
+ private set;
+ }
+
+ #endregion
+
+ ///
+ /// Gets the list of processes running on this port.
+ ///
+ /// Returns the list of processes running on this port.
+ private AD7Process[] GetProcesses()
+ {
+ ////////////////////////////////////////////////////////
+ // "the old way", which seemed not to work on PlayBook
+ //var processesRequest = GdbWrapper.ListProcesses(NDK, Device);
+ //processesRequest.Processes...
+
+ ////////////////////////////////////////////////////////
+ // "the new way" is using a dedicated separate connection to the device,
+ // that servers extra data for IDEs:
+
+ // get QConnClient and connect to the device, if not yet connected:
+ SystemInfoProcess[] processes = null;
+
+ try
+ {
+ var qClient = Targets.Get(Device, ConfigDefaults.SshPublicKeyPath, ConfigDefaults.SshPrivateKeyPath);
+ if (qClient != null)
+ {
+ processes = qClient.SysInfoService.LoadProcesses();
+ }
+ }
+ catch (Exception ex)
+ {
+ TraceLog.WriteException(ex, "Unable to load list of processes");
+
+ // try to disconnect, so retry will have a clean-state:
+ Targets.Disconnect(Device);
+ }
+
+ // timeout or other problem?
+ if (processes == null)
+ {
+ string deviceType = Device.Type == DeviceDefinitionType.Device ? "device" : "simulator";
+ MessageBoxHelper.Show(string.Concat("Please, verify if the ", deviceType, " (", Device.IP, ") is defined correctly. It can be modified at \"BlackBerry -> Options -> Targets\" tab."),
+ "Connection failure or timeout", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+
+ return new AD7Process[0];
+ }
+
+ // ok, got the valid response
+ var result = new List();
+ foreach (var p in processes)
+ {
+ result.Add(new AD7Process(this, p));
+ }
+
+ return result.ToArray();
+ }
+
+ #region Implementation of IDebugPort2
+
+ ///
+ /// Returns the port name. (http://msdn.microsoft.com/en-us/library/bb145890.aspx)
+ ///
+ /// Returns the name of the port.
+ /// VSConstants.S_OK.
+ public int GetPortName(out string pbstrName)
+ {
+ pbstrName = Name;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Returns the port identifier. (http://msdn.microsoft.com/en-us/library/bb146747.aspx)
+ ///
+ /// Returns the GUID that identifies the port.
+ /// VSConstants.S_OK.
+ public int GetPortId(out Guid pguidPort)
+ {
+ pguidPort = Guid;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Returns the request used to create a port. (http://msdn.microsoft.com/en-us/library/bb145127.aspx)
+ ///
+ /// Returns an IDebugPortRequest2 object representing the request that was used to create the port.
+ /// VSConstants.S_OK.
+ public int GetPortRequest(out IDebugPortRequest2 ppRequest)
+ {
+ ppRequest = _request;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Returns the port supplier for this port. (http://msdn.microsoft.com/en-us/library/bb146688.aspx)
+ ///
+ /// Returns an IDebugPortSupplier2 object represents the port supplier for a port.
+ /// VSConstants.S_OK.
+ public int GetPortSupplier(out IDebugPortSupplier2 ppSupplier)
+ {
+ ppSupplier = _supplier;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Returns the specified process running on a port. (http://msdn.microsoft.com/en-us/library/bb145867.aspx)
+ ///
+ /// An AD_PROCESS_ID structure that specifies the process identifier.
+ /// Returns an IDebugProcess2 object representing the process.
+ /// If successful, returns VSConstants.S_OK; otherwise, returns VSConstants.S_FALSE.
+ public int GetProcess(AD_PROCESS_ID processId, out IDebugProcess2 ppProcess)
+ {
+ IEnumerable list = GetProcesses();
+ uint id = processId.dwProcessId;
+
+ ppProcess = null;
+ foreach (var process in list)
+ {
+ if (process.ID == id)
+ {
+ ppProcess = process;
+ break;
+ }
+ }
+ return ppProcess != null ? VSConstants.S_OK : VSConstants.S_FALSE;
+ }
+
+ ///
+ /// Enumerates all the processes running on a port. (http://msdn.microsoft.com/en-us/library/bb161302.aspx)
+ ///
+ /// Returns an IEnumDebugProcesses2 object that contains a list of all the processes running on a port.
+ /// VSConstants.S_OK.
+ public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
+ {
+ if (string.IsNullOrEmpty(Device.IP))
+ {
+ _processes = new IDebugProcess2[0];
+ }
+ else
+ {
+ DateTime now = DateTime.Now;
+
+ TimeSpan diff = now - _lastTimeRefresh;
+ double seconds = diff.TotalSeconds;
+
+ if (seconds > 1)
+ {
+ var processlist = GetProcesses();
+ _processes = new IDebugProcess2[processlist.Length];
+ int i = 0;
+ foreach (var debugProcess in processlist)
+ {
+ _processes[i] = debugProcess;
+ i++;
+ }
+ _lastTimeRefresh = DateTime.Now;
+ }
+ }
+
+ ppEnum = new AD7ProcessEnum(_processes);
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7PortRequest.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7PortRequest.cs
new file mode 100644
index 00000000..83074cf0
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7PortRequest.cs
@@ -0,0 +1,76 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using BlackBerry.NativeCore.Model;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class describes a port. This description is used to add the port to a port supplier.
+ ///
+ /// It implements IDebugPortRequest2 (http://msdn.microsoft.com/en-us/library/bb146168.aspx)
+ ///
+ public sealed class AD7PortRequest : IDebugPortRequest2
+ {
+ ///
+ /// Constructor.
+ ///
+ /// The name of the port.
+ /// Detailed info about the device.
+ public AD7PortRequest(string name, DeviceDefinition device)
+ {
+ if (string.IsNullOrEmpty(name))
+ throw new ArgumentNullException("name");
+ if (device == null)
+ throw new ArgumentNullException("device");
+
+ Name = name;
+ Device = device;
+ }
+
+ #region Properties
+
+ public string Name
+ {
+ get;
+ private set;
+ }
+
+ public DeviceDefinition Device
+ {
+ get;
+ private set;
+ }
+
+ #endregion
+
+ #region Implementation of IDebugPortRequest2
+
+ ///
+ /// Gets the name of the port to create.
+ ///
+ /// Returns the name of the port.
+ /// VSConstants.S_OK.
+ public int GetPortName(out string portName)
+ {
+ portName = Name;
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7PortSupplier.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7PortSupplier.cs
new file mode 100644
index 00000000..8795a863
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7PortSupplier.cs
@@ -0,0 +1,392 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using BlackBerry.NativeCore.Helpers;
+using BlackBerry.NativeCore.Model;
+using BlackBerry.NativeCore.Services;
+using BlackBerry.Package.Helpers;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Windows.Forms;
+using Microsoft.VisualStudio.Shell;
+using IServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class supplies ports to the Session Debug Manager (SDM).
+ ///
+ /// It implements:
+ ///
+ /// - IDebugPortSupplier2 - This interface supplies ports to the session debug manager (SDM). (http://msdn.microsoft.com/en-ca/library/bb145819.aspx)
+ /// - IDebugPortSupplierDescription2 - Enables the Visual Studio UI to display text inside the Transport Information section of
+ /// the Attach to Process dialog box. (http://msdn.microsoft.com/en-us/library/bb458056.aspx)
+ ///
+ /// It is needed to enable updating the list of processes in the "attach to process" user interface.
+ ///
+ [ComVisible(true)]
+ [Guid(ClassGuid)]
+ public sealed class AD7PortSupplier : IDebugPortSupplier2, IDebugPortSupplierDescription2, IDebugPortPicker
+ {
+ public const string PublicName = "BlackBerry Native Debugger";
+ public const string ClassGuid = "BDC2218C-D50C-4A5A-A2F6-66BDC94FF8D6";
+ public const string ClassName = "BlackBerry.DebugEngine.AD7PortSupplier";
+
+ ///
+ /// The NDK reference.
+ ///
+ private NdkDefinition _ndk;
+ private ServiceProvider _serviceProvider;
+
+ ///
+ /// List of ports for this port supplier.
+ ///
+ private readonly Dictionary _ports = new Dictionary();
+
+ private IDebugPort2[] CreateDefaultPorts()
+ {
+ var ndk = NdkDefinition.Load();
+ var devices = DeviceDefinition.LoadAll();
+
+ if (ndk == null || string.IsNullOrEmpty(ndk.ToolsPath))
+ return null;
+ _ndk = ndk;
+
+ var result = new List();
+
+ if (devices != null)
+ {
+ foreach (var device in devices)
+ {
+ result.Add(CreatePort(this, new AD7PortRequest(GetPortRequestName(device), device), _ndk));
+ }
+ }
+
+ return result.ToArray();
+ }
+
+ private static string GetPortRequestName(DeviceDefinition device)
+ {
+ if (device == null)
+ throw new ArgumentNullException("device");
+
+ if (string.IsNullOrEmpty(device.Name))
+ return string.Concat(DeviceHelper.GetTypeToString(device.Type), ": ", device.IP);
+
+ return string.Concat(DeviceHelper.GetTypeToString(device.Type), ": ", device.Name, " (", device.IP, ")");
+ }
+
+ private static string GetAdHocPortRequestName(DeviceDefinition device)
+ {
+ if (device == null)
+ throw new ArgumentNullException("device");
+
+ if (string.IsNullOrEmpty(device.Name))
+ return string.Concat(DeviceHelper.GetTypeToString(device.Type), " ", device.IP, " ", device.Password);
+ return string.Concat(DeviceHelper.GetTypeToString(device.Type), " ", device.Name.Replace(' ', '_'), " ", device.IP, " ", device.Password);
+ }
+
+ ///
+ /// Creates an AD7Port.
+ ///
+ private static AD7Port CreatePort(AD7PortSupplier supplier, AD7PortRequest request, NdkDefinition ndk)
+ {
+ if (request == null)
+ throw new ArgumentNullException("request");
+ if (request.Device == null)
+ throw new ArgumentOutOfRangeException("request");
+
+ return new AD7Port(supplier, request, Guid.NewGuid(), request.Name, request.Device, ndk);
+ }
+
+ #region Implementation of IDebugPortSupplier2
+
+ ///
+ /// Adds a port. (http://msdn.microsoft.com/en-ca/library/bb161980.aspx)
+ ///
+ /// An IDebugPortRequest2 object that describes the port to be added.
+ /// Returns an IDebugPort2 object that represents the port.
+ /// VSConstants.S_OK.
+ int IDebugPortSupplier2.AddPort(IDebugPortRequest2 request, out IDebugPort2 ppPort)
+ {
+ if (request == null || _ndk == null)
+ {
+ ppPort = null;
+ return VSConstants.S_OK;
+ }
+
+ // is it one of the default requests created by the AD7PortSupplier?
+ var portRequest = request as AD7PortRequest;
+ if (portRequest != null)
+ {
+ var port = CreatePort(this, portRequest, _ndk);
+ _ports[port.Guid] = port;
+ ppPort = port;
+ return VSConstants.S_OK;
+ }
+
+ string requestName;
+ if (request.GetPortName(out requestName) == VSConstants.S_OK)
+ {
+ requestName = requestName.Trim();
+ var port = FindPort(requestName);
+
+ // create something at hoc?
+ if (port == null)
+ {
+ var device = CreateAdHocDevice(requestName);
+ if (device != null)
+ {
+ ppPort = new AD7Port(this, null, Guid.NewGuid(), GetPortRequestName(device), device, _ndk);
+ return VSConstants.S_OK;
+ }
+
+ MessageBoxHelper.Show("Too few information about device you are trying to connect.\n\nPlease, follow the pattern: \"(device|simulator) IP password\".", "Unable to create device connection", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ }
+ else
+ {
+ ppPort = port;
+ return VSConstants.S_OK;
+ }
+ }
+
+ ppPort = null;
+ return VSConstants.E_FAIL;
+ }
+
+ private AD7Port FindPort(string text)
+ {
+ if (string.IsNullOrEmpty(text))
+ return null;
+
+ foreach (var port in _ports.Values)
+ {
+ if (port.Device.HasIdenticalIP(text) || port.Device.HasIdenticalName(text))
+ return port;
+ }
+
+ return null;
+ }
+
+ private static DeviceDefinition CreateAdHocDevice(string text)
+ {
+ if (string.IsNullOrEmpty(text))
+ return null;
+
+ var items = text.Split(new[] { ' ', '|', ':', ',' }, StringSplitOptions.RemoveEmptyEntries);
+ if (items.Length < 2)
+ return null;
+
+ int i = 0;
+ var type = DeviceDefinitionType.Device;
+ string name = "Ad-hoc Connection";
+ string ip = null;
+ string password = null;
+
+ try
+ {
+ type = DeviceHelper.GetTypeFromString(items[i++], true);
+ }
+ catch
+ {
+ // unable to decipher type: device/simulator...
+ return null;
+ }
+
+ // name:
+ if (items.Length > i && items[i].IndexOf('.') < 0)
+ {
+ name = items[i++];
+ }
+
+ // ip:
+ if (items.Length > i && items[i].IndexOf('.') > 0)
+ {
+ ip = items[i++];
+ }
+
+ // password:
+ if (items.Length > i)
+ {
+ password = items[i];
+ }
+
+ // verify input:
+ if (string.IsNullOrEmpty(ip) || string.IsNullOrEmpty(password))
+ return null;
+
+ return new DeviceDefinition(name, ip, password, type);
+ }
+
+ ///
+ /// Verifies that a port supplier can add new ports. (http://msdn.microsoft.com/en-ca/library/bb145880.aspx)
+ ///
+ /// VSConstants.S_OK.
+ int IDebugPortSupplier2.CanAddPort()
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Retrieves a list of all the ports supplied by a port supplier. (http://msdn.microsoft.com/en-ca/library/bb146984.aspx)
+ ///
+ /// Returns an IEnumDebugPorts2 object containing a list of ports supplied.
+ /// VSConstants.S_OK.
+ int IDebugPortSupplier2.EnumPorts(out IEnumDebugPorts2 ppEnum)
+ {
+ // Returning because VS can debug only one app at a time.
+ if (DebugEngineStatus.IsRunning)
+ {
+ MessageBoxHelper.Show("Visual Studio can debug only one BlackBerry application at a time.\n\nPlease, select a different transport or close the current debug session.", "Visual Studio is already debugging an application", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ ppEnum = null;
+ return VSConstants.S_FALSE;
+ }
+
+ var defaultPorts = CreateDefaultPorts();
+ if (defaultPorts == null)
+ {
+ MessageBoxHelper.Show("You must select an API Level to be able to attach to a running process.\n\nPlease, use \"BlackBerry -> Options -> API Level\" to download or select one.", "Missing NDK", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ ppEnum = null;
+ return VSConstants.S_FALSE;
+ }
+ if (defaultPorts.Length == 0)
+ {
+ MessageBoxHelper.Show("Missing Device/Simulator information. Please, use menu \"BlackBerry -> Options\" to add any of those information.", "Missing Device/Simulator Data", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ ppEnum = null;
+ return VSConstants.S_FALSE;
+ }
+
+ _ports.Clear();
+ foreach (var port in defaultPorts)
+ {
+ Guid portGuid;
+ if (port.GetPortId(out portGuid) == VSConstants.S_OK)
+ {
+ _ports[portGuid] = (AD7Port) port;
+ }
+ }
+
+ ppEnum = new AD7PortEnum(defaultPorts);
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets a port from a port supplier. (http://msdn.microsoft.com/en-ca/library/bb161812.aspx)
+ ///
+ /// Globally unique identifier (GUID) of the port.
+ /// Returns an IDebugPort2 object that represents the port.
+ /// VSConstants.S_OK.
+ int IDebugPortSupplier2.GetPort(ref Guid guidPort, out IDebugPort2 ppPort)
+ {
+ ppPort = _ports[guidPort];
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the port supplier identifier. (http://msdn.microsoft.com/en-ca/library/bb146617.aspx)
+ ///
+ /// Returns the GUID of the port supplier.
+ /// VSConstants.S_OK.
+ int IDebugPortSupplier2.GetPortSupplierId(out Guid pguidPortSupplier)
+ {
+ pguidPortSupplier = new Guid(ClassGuid);
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the port supplier name. (http://msdn.microsoft.com/en-ca/library/bb162136.aspx)
+ ///
+ /// Returns the name of the port supplier.
+ /// VSConstants.S_OK.
+ int IDebugPortSupplier2.GetPortSupplierName(out string pbstrName)
+ {
+ pbstrName = PublicName;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Removes a port. Not implemented. (http://msdn.microsoft.com/en-ca/library/bb162306.aspx)
+ ///
+ /// An IDebugPort2 object that represents the port to be removed.
+ /// Not implemented. It should returns S_OK if successful; or an error code.
+ int IDebugPortSupplier2.RemovePort(IDebugPort2 port)
+ {
+ return EngineUtils.NotImplemented();
+ }
+
+ #endregion
+
+ #region Implementation of IDebugPortSupplierDescription2
+
+ ///
+ /// Retrieves the description for the port supplier. (http://msdn.microsoft.com/en-us/library/bb457978.aspx)
+ ///
+ /// Metadata flags for the description.
+ /// Description of the port supplier.
+ /// VSConstants.S_OK.
+ int IDebugPortSupplierDescription2.GetDescription(enum_PORT_SUPPLIER_DESCRIPTION_FLAGS[] pdwFlags, out string pbstrText)
+ {
+ pbstrText = "The BlackBerry Native Transport lets you select and attach to a process that is running on a device or simulator";
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+
+ ///
+ /// Sets the service provider. (http://msdn.microsoft.com/en-us/library/bb491408.aspx)
+ ///
+ /// Reference to the interface of the service provider.
+ int IDebugPortPicker.SetSite(IServiceProvider serviceProvider)
+ {
+ _serviceProvider = new ServiceProvider(serviceProvider);
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Displays the specified dialog box that allows the user to select a port. (http://msdn.microsoft.com/en-us/library/bb491260.aspx)
+ ///
+ /// Handle for the parent dialog box.
+ /// Port identifier string.
+ /// If successful, returns S_OK; otherwise, returns an error code. A return value of S_FALSE (or a return value of S_OK with the BSTR set to NULL) indicates that the user clicked Cancel.
+ int IDebugPortPicker.DisplayPortPicker(IntPtr hwndParentDialog, out string pbstrPortId)
+ {
+ var service = _serviceProvider != null ? _serviceProvider.GetService(typeof(IDeviceDiscoveryService)) as IDeviceDiscoveryService : null;
+
+ if (service == null)
+ {
+ MessageBoxHelper.Show(
+ "Searching is not supported.\r\nPlease add more devices at \"BlackBerry -> Options -> Targets\", if you want to quickly switch between them. They will automatically appear, when \"Qualifier\" list is expanded.",
+ "Microsoft Visual Studio", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ pbstrPortId = null;
+ return VSConstants.S_FALSE;
+ }
+
+ var device = service.FindDevice();
+
+ // did we found the device?
+ if (device != null)
+ {
+ pbstrPortId = GetAdHocPortRequestName(device);
+ return VSConstants.S_OK;
+ }
+
+ // or cancelled:
+ pbstrPortId = null;
+ return VSConstants.S_FALSE;
+ }
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7Process.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7Process.cs
new file mode 100644
index 00000000..0b3b8700
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7Process.cs
@@ -0,0 +1,397 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using System.Collections.Generic;
+using BlackBerry.NativeCore.Debugger.Model;
+using BlackBerry.NativeCore.Model;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class represents a process running on a port. If the port is the local port, then IDebugProcess2 usually represents a
+ /// physical process on the local machine. Not implemented completely. (http://msdn.microsoft.com/en-ca/library/bb147137.aspx).
+ ///
+ /// It also implements IDebugProcessEx2: This interface lets the session debug manager (SDM) notify a process that it is
+ /// attaching to or detaching from the process. (http://msdn.microsoft.com/en-us/library/bb145892.aspx)
+ ///
+ /// Process "Is a container for a set of programs".
+ ///
+ /// This interface is implemented by a custom port supplier to manage programs as a group. An IDebugProcess2 contains one or more
+ /// IDebugProgram2 interfaces.
+ ///
+ public sealed class AD7Process : IDebugProcess2, IDebugProcessEx2
+ {
+ ///
+ /// The name and ID of the process running on target device.
+ ///
+ private readonly ProcessInfo _details;
+
+ ///
+ /// The object that represents the port used in Attach to Process UI or on which the process was launched.
+ ///
+ private IDebugPort2 _port;
+
+ private readonly bool _attaching;
+
+ ///
+ /// The list of programs that are running in this process.
+ ///
+ private readonly List _listOfPrograms;
+
+ ///
+ /// Constructor.
+ ///
+ /// The IDebugPort2 object that represents the port on which the process was launched.
+ /// The ID of the process running on the device and local path to the executable.
+ /// Description of the device the process is running programs on.
+ public AD7Process(IDebugPort2 port, ProcessInfo details, DeviceDefinition device)
+ {
+ if (port == null)
+ throw new ArgumentNullException("port");
+ if (details == null)
+ throw new ArgumentNullException("details");
+ if (device == null)
+ throw new ArgumentNullException("device");
+
+ _port = port;
+ _attaching = false;
+ _details = details;
+ Device = device;
+ _listOfPrograms = new List();
+ UID = Guid.NewGuid();
+ }
+
+ ///
+ /// Constructor.
+ ///
+ /// The AD7Port object that represents the port used in Attach to Process UI.
+ /// The name and ID of the process running on device.
+ public AD7Process(AD7Port port, ProcessInfo details)
+ {
+ if (port == null)
+ throw new ArgumentNullException("port");
+ if (port.Device == null)
+ throw new ArgumentOutOfRangeException("port");
+ if (details == null)
+ throw new ArgumentNullException("details");
+
+ _port = port;
+ _attaching = true;
+ _details = details;
+ Device = port.Device;
+ _listOfPrograms = new List();
+ UID = Guid.NewGuid();
+ }
+
+ #region Properties
+
+ public uint ID
+ {
+ get { return _details.ID; }
+ }
+
+ public Guid UID
+ {
+ get;
+ private set;
+ }
+
+ public ProcessInfo Details
+ {
+ get { return _details; }
+ }
+
+ public IDebugPort2 Port
+ {
+ get { return _port; }
+ }
+
+ public DeviceDefinition Device
+ {
+ get;
+ private set;
+ }
+
+ #endregion
+
+ ///
+ /// Attaches the session debug manager (SDM) to the process. Not implemented. Currently using IDebugEngine2.Attach.
+ /// (http://msdn.microsoft.com/en-ca/library/bb145875.aspx)
+ ///
+ /// An IDebugEventCallback2 object that is used for debug event notification.
+ /// An array of GUIDs of debug engines to be used to debug programs running in the process.
+ /// This parameter can be a null value.
+ /// The number of debug engines in the rgguidSpecificEngines array and the size of the
+ /// rghrEngineAttach array.
+ /// An array of HRESULT codes returned by the debug engines.
+ /// VSConstants.S_OK.
+ public int Attach(IDebugEventCallback2 pCallback, Guid[] rgguidSpecificEngines, uint celtSpecificEngines, int[] rghrEngineAttach)
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Determines if the session debug manager (SDM) can detach the process. Not implemented.
+ /// (http://msdn.microsoft.com/en-us/library/bb145567.aspx)
+ ///
+ /// VSConstants.S_OK.
+ public int CanDetach()
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Requests that the next program that is running code in this process halt and send an IDebugBreakEvent2 event object.
+ /// Not implemented. (http://msdn.microsoft.com/en-us/library/bb162292.aspx)
+ ///
+ /// VSConstants.S_OK.
+ public int CauseBreak()
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Detaches the debugger from this process by detaching all of the programs in the process.
+ /// (http://msdn.microsoft.com/en-us/library/bb162197.aspx)
+ ///
+ /// VSConstants.S_OK.
+ public int Detach()
+ {
+ _port = null;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Retrieves a list of all the programs contained by this process.
+ /// (http://msdn.microsoft.com/en-us/library/bb162305.aspx)
+ ///
+ /// Returns an IEnumDebugPrograms2 object that contains a list of all the programs in the process.
+ /// VSConstants.S_OK.
+ public int EnumPrograms(out IEnumDebugPrograms2 ppEnum)
+ {
+ if (_listOfPrograms.Count == 0)
+ {
+ AD7ProgramNodeAttach pn = new AD7ProgramNodeAttach(this);
+ _listOfPrograms.Add(pn);
+ }
+
+ ppEnum = new AD7ProgramEnum(_listOfPrograms.ToArray());
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Retrieves a list of all the threads running in all programs in the process. Not implemented.
+ /// (http://msdn.microsoft.com/en-us/library/bb144981.aspx)
+ ///
+ /// Returns an IEnumDebugThreads2 object that contains a list of all threads in all programs in the
+ /// process.
+ /// VSConstants.S_OK.
+ public int EnumThreads(out IEnumDebugThreads2 ppEnum)
+ {
+ ppEnum = null;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the name of the session that is debugging the process. [DEPRECATED. SHOULD ALWAYS RETURN E_NOTIMPL.]
+ /// (http://msdn.microsoft.com/en-us/library/bb146718.aspx)
+ ///
+ /// DEPRECATED. Return null.
+ /// This method should always return E_NOTIMPL.
+ public int GetAttachedSessionName(out string pbstrSessionName)
+ {
+ pbstrSessionName = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Gets a description of the process. (http://msdn.microsoft.com/en-us/library/bb145895.aspx)
+ ///
+ /// A combination of values from the PROCESS_INFO_FIELDS enumeration that specifies which fields of
+ /// the pProcessInfo parameter are to be filled in.
+ /// A PROCESS_INFO structure that is filled in with a description of the process.
+ /// VSConstants.S_OK.
+ public int GetInfo(enum_PROCESS_INFO_FIELDS fields, PROCESS_INFO[] pProcessInfo)
+ {
+ try
+ {
+ if ((fields & enum_PROCESS_INFO_FIELDS.PIF_FILE_NAME) != 0)
+ {
+ pProcessInfo[0].bstrFileName = _details.ExecutablePath;
+ pProcessInfo[0].Fields |= enum_PROCESS_INFO_FIELDS.PIF_FILE_NAME;
+ }
+ if ((fields & enum_PROCESS_INFO_FIELDS.PIF_BASE_NAME) != 0)
+ {
+ pProcessInfo[0].bstrBaseName = _details.Name;
+ pProcessInfo[0].Fields |= enum_PROCESS_INFO_FIELDS.PIF_BASE_NAME;
+ }
+ if ((fields & enum_PROCESS_INFO_FIELDS.PIF_TITLE) != 0)
+ {
+ pProcessInfo[0].bstrTitle = _details.ShortExecutablePath;
+ pProcessInfo[0].Fields |= enum_PROCESS_INFO_FIELDS.PIF_TITLE;
+ }
+ if ((fields & enum_PROCESS_INFO_FIELDS.PIF_PROCESS_ID) != 0)
+ {
+ pProcessInfo[0].ProcessId.dwProcessId = _details.ID;
+ pProcessInfo[0].ProcessId.ProcessIdType = (uint)enum_AD_PROCESS_ID.AD_PROCESS_ID_SYSTEM;
+ pProcessInfo[0].Fields |= enum_PROCESS_INFO_FIELDS.PIF_PROCESS_ID;
+ }
+
+ if ((fields & enum_PROCESS_INFO_FIELDS.PIF_SESSION_ID) != 0)
+ {
+ //pProcessInfo[0].dwSessionId = 0;
+ pProcessInfo[0].Fields |= enum_PROCESS_INFO_FIELDS.PIF_SESSION_ID;
+ }
+ if ((fields & enum_PROCESS_INFO_FIELDS.PIF_ATTACHED_SESSION_NAME) != 0)
+ {
+ //pProcessInfo[0].bstrAttachedSessionName = null;
+ pProcessInfo[0].Fields |= enum_PROCESS_INFO_FIELDS.PIF_ATTACHED_SESSION_NAME;
+ }
+ if ((fields & enum_PROCESS_INFO_FIELDS.PIF_CREATION_TIME) != 0)
+ {
+ //pProcessInfo[0].CreationTime.dwHighDateTime = 0;
+ //pProcessInfo[0].CreationTime.dwLowDateTime = 0;
+ pProcessInfo[0].Fields |= enum_PROCESS_INFO_FIELDS.PIF_CREATION_TIME;
+ }
+
+ return VSConstants.S_OK;
+ }
+ catch (Exception e)
+ {
+ return EngineUtils.UnexpectedException(e);
+ }
+ }
+
+ ///
+ /// Gets the name of the process. (http://msdn.microsoft.com/en-us/library/bb161270.aspx)
+ ///
+ /// A value from the GETNAME_TYPE enumeration that specifies what type of name to return.
+ /// Returns the name of the process.
+ /// VSConstants.S_OK.
+ public int GetName(enum_GETNAME_TYPE type, out string pbstrName)
+ {
+ pbstrName = _details.Name;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the system process identifier. (http://msdn.microsoft.com/en-us/library/bb146648.aspx)
+ ///
+ /// An AD_PROCESS_ID structure that is filled in with the system process identifier information.
+ /// VSConstants.S_OK.
+ public int GetPhysicalProcessId(AD_PROCESS_ID[] pProcessId)
+ {
+ if (_attaching)
+ {
+ // attaching to existing process on the target
+ pProcessId[0].dwProcessId = _details.ID;
+ pProcessId[0].ProcessIdType = (uint)enum_AD_PROCESS_ID.AD_PROCESS_ID_SYSTEM;
+ }
+ else
+ {
+ // running in app in debug
+ pProcessId[0].guidProcessId = UID;
+ pProcessId[0].ProcessIdType = (uint)enum_AD_PROCESS_ID.AD_PROCESS_ID_GUID;
+ }
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the port that the process is running on. (http://msdn.microsoft.com/en-us/library/bb162121.aspx)
+ ///
+ /// Returns an IDebugPort2 object that represents the port on which the process was launched.
+ /// VSConstants.S_OK.
+ public int GetPort(out IDebugPort2 ppPort)
+ {
+ ppPort = _port;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the GUID for this process. (http://msdn.microsoft.com/en-us/library/bb161938.aspx)
+ ///
+ /// Returns the GUID for this process.
+ /// VSConstants.S_OK.
+ public int GetProcessId(out Guid pguidProcessId)
+ {
+ pguidProcessId = UID;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the server that this process is running on. Not implemented completely because _server has no value assigned to it.
+ /// (http://msdn.microsoft.com/en-us/library/bb147017.aspx)
+ ///
+ /// Returns an IDebugCoreServer2 object that represents the server on which this process is running.
+ /// VSConstants.S_OK.
+ public int GetServer(out IDebugCoreServer2 ppServer)
+ {
+ ppServer = null;
+ return VSConstants.S_OK;
+ }
+
+
+ ///
+ /// Terminates the process. Not implemented. (http://msdn.microsoft.com/en-us/library/bb146226.aspx)
+ ///
+ /// VSConstants.S_OK.
+ public int Terminate()
+ {
+ return VSConstants.S_OK;
+ }
+
+ #region IDebugProcessEx2 Members
+
+ ///
+ /// Informs the process that a session is now debugging the process. (http://msdn.microsoft.com/en-us/library/bb162300.aspx)
+ ///
+ /// A value that uniquely identifies the session attaching to this process.
+ /// VSConstants.S_OK.
+ public int Attach(IDebugSession2 session)
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Informs the process that a session is no longer debugging the process. (http://msdn.microsoft.com/en-us/library/bb146313.aspx)
+ ///
+ /// A value that uniquely identifies the session to detach this process from.
+ /// VSConstants.S_OK.
+ public int Detach(IDebugSession2 session)
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Adds program nodes for a list of debug engines. (http://msdn.microsoft.com/en-us/library/bb146990.aspx)
+ /// In this project, it is used only one debug engine, that's why its GUID is assigned to the guidLaunchingEngine explicitly.
+ ///
+ /// The GUID of a DE that is to be used to launch programs (and is assumed to add its own
+ /// program nodes).
+ /// Array of GUIDs of DEs for which program nodes will be added.
+ /// The number of GUIDs in the rgguidSpecificEngines array.
+ /// VSConstants.S_OK.
+ public int AddImplicitProgramNodes(ref Guid guidLaunchingEngine, Guid[] rgguidSpecificEngines, uint celtSpecificEngines)
+ {
+ guidLaunchingEngine = new Guid(AD7Engine.DebugEngineGuid);
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7ProgramNode.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7ProgramNode.cs
new file mode 100644
index 00000000..776ba14b
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7ProgramNode.cs
@@ -0,0 +1,185 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using BlackBerry.NativeCore.Debugger.Model;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+using System;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class implements IDebugProgramNode2. (http://msdn.microsoft.com/en-ca/library/bb146735.aspx)
+ /// This interface represents a program that can be debugged.
+ /// A running process is viewed as a ProgramNode by VS.
+ /// A debug engine (DE) or a custom port supplier implements this interface to represent a program that can be debugged.
+ ///
+ public sealed class AD7ProgramNode : IDebugProgramNode2
+ {
+ ///
+ /// The GUID of the hosting process.
+ ///
+ private readonly Guid _processGuid;
+
+ private readonly ProcessInfo _details;
+
+ ///
+ /// Constructor.
+ /// At this moment, used only for testing purposes, because GetProviderProcessData (AD7ProgramProvider.cs) needs a program node.
+ ///
+ /// The GUID for this process.
+ public AD7ProgramNode(Guid processGuid)
+ {
+ _processGuid = processGuid;
+ }
+
+ ///
+ /// Constructor.
+ ///
+ /// The description of the the debugged program.
+ /// The GUID for this process.
+ /// The GUID of the VSNDK debug engine.
+ public AD7ProgramNode(ProcessInfo details, Guid processGuid)
+ {
+ if (details == null)
+ throw new ArgumentNullException("details");
+
+ _details = details;
+ _processGuid = processGuid;
+ }
+
+ ///
+ /// Constructor.
+ ///
+ /// The process associated with the node.
+ public AD7ProgramNode(AD7Process process)
+ {
+ if (process == null)
+ throw new ArgumentNullException("process");
+ if (process.Details == null)
+ throw new ArgumentOutOfRangeException("process");
+
+ _details = process.Details;
+ _processGuid = process.UID;
+ }
+
+ #region Properties
+
+ public string Name
+ {
+ get { return _details.Name; }
+ }
+
+ #endregion
+
+ #region IDebugProgramNode2 Members
+
+
+ ///
+ /// Gets the name and identifier of the DE running this program. (http://msdn.microsoft.com/en-ca/library/bb146303.aspx)
+ ///
+ /// Returns the name of the DE running the program (C++-specific: this can be a null pointer
+ /// indicating that the caller is not interested in the name of the engine).
+ /// Returns the globally unique identifier of the DE running the program (C++-specific: this can
+ /// be a null pointer indicating that the caller is not interested in the GUID of the engine).
+ /// VSConstants.S_OK.
+ int IDebugProgramNode2.GetEngineInfo(out string engineName, out Guid engineGuid)
+ {
+ engineName = string.Empty;
+ engineGuid = new Guid(AD7Engine.DebugEngineGuid);
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the system process identifier for the process hosting a program. (http://msdn.microsoft.com/en-us/library/bb162159.aspx)
+ ///
+ /// Returns the system process identifier for the hosting process.
+ /// VSConstants.S_OK.
+ int IDebugProgramNode2.GetHostPid(AD_PROCESS_ID[] pHostProcessId)
+ {
+ // According to the MSDN documentation (http://msdn.microsoft.com/en-us/library/bb162159.aspx),
+ // it should return the process id of the hosting process, but what is expected is the program ID...
+ pHostProcessId[0].ProcessIdType = (uint) enum_AD_PROCESS_ID.AD_PROCESS_ID_GUID;
+ pHostProcessId[0].guidProcessId = _processGuid;
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the name of the process hosting a program. (http://msdn.microsoft.com/en-us/library/bb145135.aspx)
+ ///
+ /// A value from the GETHOSTNAME_TYPE enumeration that specifies the type of name to return.
+ /// Returns the name of the hosting process.
+ /// VSConstants.S_OK.
+ int IDebugProgramNode2.GetHostName(enum_GETHOSTNAME_TYPE type, out string processName)
+ {
+ if (type == enum_GETHOSTNAME_TYPE.GHN_FILE_NAME)
+ processName = "(BB-pid = " + _details.ID + ") " + _details.ExecutablePath;
+ else
+ processName = _details.Name;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the name of a program. (http://msdn.microsoft.com/en-us/library/bb145928.aspx)
+ ///
+ /// Returns the name of the program.
+ /// VSConstants.S_OK.
+ int IDebugProgramNode2.GetProgramName(out string programName)
+ {
+ programName = _details.Name;
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+
+ #region Deprecated interface methods
+ // These methods are not called by the Visual Studio debugger, so they don't need to be implemented
+
+ ///
+ /// DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161399.aspx)
+ ///
+ /// The IDebugProgram2 interface that represents the program to attach to.
+ /// The IDebugEventCallback2 interface to be used to send debug events to the SDM.
+ /// A value from the ATTACH_REASON enumeration that specifies the reason for attaching.
+ /// VSConstants.E_NOTIMPL.
+ int IDebugProgramNode2.Attach_V7(IDebugProgram2 program, IDebugEventCallback2 pCallback, uint reason)
+ {
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161803.aspx)
+ ///
+ /// VSConstants.E_NOTIMPL.
+ int IDebugProgramNode2.DetachDebugger_V7()
+ {
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161297.aspx)
+ ///
+ /// Returns the name of the machine in which the program is running.
+ /// VSConstants.E_NOTIMPL.
+ int IDebugProgramNode2.GetHostMachineName_V7(out string hostMachineName)
+ {
+ hostMachineName = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7ProgramNodeAttach.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7ProgramNodeAttach.cs
new file mode 100644
index 00000000..1eb4d9f0
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7ProgramNodeAttach.cs
@@ -0,0 +1,404 @@
+using System;
+using System.Diagnostics;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class is used only when the user wants to Attach to a running process and it implements:
+ /// - IDebugProgramNode2. (http://msdn.microsoft.com/en-ca/library/bb146735.aspx)
+ /// - and IDebugProgram2. (http://msdn.microsoft.com/en-us/library/bb147004.aspx)
+ ///
+ /// The Debug Engine does not use this class. It uses AD7ProgramNode.cs. This class is used only to represent each of the running
+ /// processes that can be attached to the debug engine. When the debug engine attaches to a running process, an AD7ProgramNode
+ /// class is used to represent the chosen running program. That's why some methods were not implemented.
+ ///
+ /// This interface represents a program that can be debugged.
+ /// A running process is viewed as a ProgramNode by VS.
+ /// A debug engine (DE) or a custom port supplier implements this interface to represent a program that can be debugged.
+ ///
+ sealed class AD7ProgramNodeAttach : IDebugProgramNode2, IDebugProgram2
+ {
+ ///
+ /// The hosting process.
+ ///
+ private readonly AD7Process _process;
+
+ ///
+ /// Constructor.
+ ///
+ /// The process on the target device engine is supposed to attach.
+ /// The GUID of a debug engine.
+ public AD7ProgramNodeAttach(AD7Process process)
+ {
+ if (process == null)
+ throw new ArgumentNullException("process");
+ if (process.Details == null)
+ throw new ArgumentOutOfRangeException("process");
+
+ _process = process;
+ }
+
+ #region Properties
+
+ public AD7Process Process
+ {
+ get { return _process; }
+ }
+
+ #endregion
+
+ #region IDebugProgram2 Members
+
+ ///
+ /// Determines if a debug engine (DE) can detach from the program. (http://msdn.microsoft.com/en-us/library/bb161967.aspx)
+ /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
+ ///
+ /// VSConstants.S_OK.
+ public int CanDetach()
+ {
+ // The VSNDK debug engine always supports detach
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Requests that the program stop execution the next time one of its threads attempts to run. The debugger calls CauseBreak
+ /// when the user clicks on the pause button in VS. The debugger should respond by entering breakmode.
+ /// (http://msdn.microsoft.com/en-us/library/bb145018.aspx)
+ /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
+ ///
+ /// VSConstants.S_OK.
+ public int CauseBreak()
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Continues running this program from a stopped state. Any previous execution state (such as a step) is preserved, and
+ /// the program starts executing again. (http://msdn.microsoft.com/en-us/library/bb162148.aspx).
+ /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
+ ///
+ /// An IDebugThread2 object that represents the thread.
+ /// VSConstants.S_OK.
+ public int Continue(IDebugThread2 thread)
+ {
+ // This method is not called by the debug engine.
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Detaches a debug engine from the program. (http://msdn.microsoft.com/en-us/library/bb146228.aspx)
+ /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
+ ///
+ /// VSConstants.S_OK.
+ public int Detach()
+ {
+ // This method is not called by the debug engine.
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Retrieves a list of the code contexts for a given position in a source file. Not implemented.
+ /// (http://msdn.microsoft.com/en-us/library/bb145902.aspx)
+ ///
+ /// An object representing an abstract position in a source file known to the IDE.
+ /// Returns an IEnumDebugCodeContexts2 object that contains a list of the code contexts.
+ /// Not implemented.
+ public int EnumCodeContexts(IDebugDocumentPosition2 docPos, out IEnumDebugCodeContexts2 ppEnum)
+ {
+ ppEnum = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Retrieves a list of the code paths for a given position in a source file. EnumCodePaths is used for the step-into specific
+ /// feature -- right click on the current statement and decide which function to step into. This is not something that the
+ /// VSNDK debug engine supports. (http://msdn.microsoft.com/en-us/library/bb162326.aspx)
+ ///
+ /// The word under the cursor in the Source or Disassembly view in the IDE.
+ /// An IDebugCodeContext2 object representing the current code context.
+ /// An IDebugStackFrame2 object representing the stack frame associated with the current breakpoint.
+ /// Nonzero (TRUE) if in the Source view, or zero (FALSE) if in the Disassembly view.
+ /// Returns an IEnumCodePaths2 object containing a list of the code paths.
+ /// Returns an IDebugCodeContext2 object representing an additional code context to be set as a
+ /// breakpoint in case the chosen code path is skipped. This can happen in the case of a short-circuited Boolean expression,
+ /// for example.
+ /// VSConstants.E_NOTIMPL.
+ public int EnumCodePaths(string hint, IDebugCodeContext2 start, IDebugStackFrame2 frame, int fSource, out IEnumCodePaths2 pathEnum, out IDebugCodeContext2 safetyContext)
+ {
+ pathEnum = null;
+ safetyContext = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Retrieves a list of the modules that this program has loaded and is executing.
+ /// (http://msdn.microsoft.com/en-us/library/bb146980.aspx)
+ ///
+ /// Returns an IEnumDebugModules2 object that contains a list of the modules.
+ /// VSConstants.S_OK.
+ public int EnumModules(out IEnumDebugModules2 ppEnum)
+ {
+ // Setting ppEnum to null because we are not adding/working with this feature now. It was causing an error
+ // when opening Threads Window and ppEnum = new AD7ModuleEnum(new[] { m_module }).
+ ppEnum = null;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Retrieves a list of the threads that are running in the program. (http://msdn.microsoft.com/en-us/library/bb145110.aspx)
+ /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
+ ///
+ /// Returns an IEnumDebugThreads2 object that contains a list of the threads.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ public int EnumThreads(out IEnumDebugThreads2 ppEnum)
+ {
+ ppEnum = null;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the program's properties. The VSNDK debug engine does not support this.
+ /// (http://msdn.microsoft.com/en-us/library/bb161801.aspx)
+ ///
+ /// Returns an IDebugProperty2 object that represents the program's properties.
+ /// Not implemented.
+ public int GetDebugProperty(out IDebugProperty2 ppProperty)
+ {
+ ppProperty = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Gets the disassembly stream for this program or a part of this program.
+ /// The sample engine does not support dissassembly so it returns E_NOTIMPL
+ ///
+ /// Specifies a value from the DISASSEMBLY_STREAM_SCOPE enumeration that defines the scope of the
+ /// disassembly stream.
+ /// An object that represents the position of where to start the disassembly stream.
+ /// Returns an IDebugDisassemblyStream2 object that represents the disassembly stream.
+ /// VSConstants.E_NOTIMPL.
+ public int GetDisassemblyStream(enum_DISASSEMBLY_STREAM_SCOPE scope, IDebugCodeContext2 codeContext, out IDebugDisassemblyStream2 disassemblyStream)
+ {
+ disassemblyStream = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// This method gets the Edit and Continue (ENC) update for this program. A custom debug engine always returns E_NOTIMPL
+ ///
+ /// Returns an internal interface that can be used to update this program.
+ /// VSConstants.S_OK.
+ public int GetENCUpdate(out object update)
+ {
+ // The VSNDK debug engine does not participate in managed edit & continue.
+ update = null;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Retrieves the memory bytes occupied by the program. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145291.aspx)
+ ///
+ /// Returns an IDebugMemoryBytes2 object that represents the memory bytes of the program.
+ /// Not implemented.
+ public int GetMemoryBytes(out IDebugMemoryBytes2 ppMemoryBytes)
+ {
+ ppMemoryBytes = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Gets the name of the program. The name returned by this method is always a friendly, user-displayable name that describes
+ /// the program. (http://msdn.microsoft.com/en-us/library/bb161279.aspx)
+ ///
+ /// Returns the name of the program.
+ /// VSConstants.S_OK.
+ public int GetName(out string programName)
+ {
+ programName = _process.Details != null ? _process.Details.Name : string.Empty;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets a GUID for this program. A debug engine (DE) must return the program identifier originally passed to the
+ /// IDebugProgramNodeAttach2::OnAttach or IDebugEngine2::Attach methods. This allows identification of the program
+ /// across debugger components. (http://msdn.microsoft.com/en-us/library/bb145581.aspx)
+ ///
+ /// Returns the GUID for this program.
+ /// VSConstants.S_OK.
+ public int GetProgramId(out Guid guidProgramId)
+ {
+ guidProgramId = _process.UID;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Performs a step. This method is deprecated. Use the IDebugProcess3::Step method instead.
+ /// (http://msdn.microsoft.com/en-us/library/bb162134.aspx)
+ /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
+ ///
+ /// An IDebugThread2 object that represents the thread being stepped.
+ /// A value from the STEPKIND enumeration that specifies the kind of step.
+ /// A value from the STEPUNIT enumeration that specifies the unit of step.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ public int Step(IDebugThread2 thread, enum_STEPKIND stepKind, enum_STEPUNIT step)
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Terminates the program. (http://msdn.microsoft.com/en-us/library/bb145919.aspx)
+ /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
+ ///
+ /// VSConstants.S_OK.
+ public int Terminate()
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Writes a dump to a file. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145827.aspx)
+ ///
+ /// A value from the DUMPTYPE enumeration that specifies the type of dump, for example, short or
+ /// long.
+ /// The URL to write the dump to. Typically, this is in the form of file://c:\path\filename.ext,
+ /// but may be any valid URL.
+ /// VSConstants.E_NOTIMPL.
+ public int WriteDump(enum_DUMPTYPE type, string dumpUrl)
+ {
+ // The VSNDK debugger does not support creating or reading mini-dumps.
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Get the process that this program is running in. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145293.aspx)
+ ///
+ /// Returns the IDebugProcess2 interface that represents the process.
+ /// VSConstants.E_NOTIMPL.
+ public int GetProcess(out IDebugProcess2 ppProcess)
+ {
+ ppProcess = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Attaches to the program. Not implemented. (http://msdn.microsoft.com/en-us/library/bb161973.aspx)
+ ///
+ /// An IDebugEventCallback2 object to be used for debug event notification.
+ /// VSConstants.E_NOTIMPL.
+ public int Attach(IDebugEventCallback2 callback)
+ {
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Continues running this program from a stopped state. Any previous execution state (such as a step) is cleared, and the
+ /// program starts executing again. Not implemented. (http://msdn.microsoft.com/en-us/library/bb162315.aspx)
+ /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
+ ///
+ /// VSConstants.S_OK.
+ public int Execute()
+ {
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+
+ #region IDebugProgramNode2 Members
+
+ ///
+ /// Gets the name and GUID of the debug engine running this program. (http://msdn.microsoft.com/en-ca/library/bb146303.aspx)
+ ///
+ /// Returns the name of the DE running this program.
+ /// Returns the GUID of the DE running this program.
+ /// VSConstants.S_OK.
+ public int GetEngineInfo(out string engineName, out Guid engineGuid)
+ {
+ engineName = _process.Device.Architecture;
+ engineGuid = new Guid(AD7Engine.DebugEngineGuid);
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the system process identifier for the process hosting a program. (http://msdn.microsoft.com/en-us/library/bb162159.aspx)
+ ///
+ /// Returns the system process identifier for the hosting process.
+ /// VSConstants.S_OK.
+ public int GetHostPid(AD_PROCESS_ID[] pHostProcessId)
+ {
+ // According to the MSDN documentation (http://msdn.microsoft.com/en-us/library/bb162159.aspx),
+ // it should return the process id of the hosting process, but what is expected is the program ID...
+ pHostProcessId[0].ProcessIdType = (uint) enum_AD_PROCESS_ID.AD_PROCESS_ID_GUID;
+ pHostProcessId[0].guidProcessId = _process.UID;
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the name of the process hosting a program. (http://msdn.microsoft.com/en-us/library/bb145135.aspx)
+ ///
+ /// A value from the GETHOSTNAME_TYPE enumeration that specifies the type of name to return.
+ /// Returns the name of the hosting process.
+ /// VSConstants.S_OK.
+ public int GetHostName(enum_GETHOSTNAME_TYPE type, out string processName)
+ {
+ if (type == enum_GETHOSTNAME_TYPE.GHN_FILE_NAME)
+ processName = "(BB-pid = " + _process.Details.ID + ") " + _process.Details.ExecutablePath;
+ else
+ processName = _process.Details.Name;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the name of a program. (http://msdn.microsoft.com/en-us/library/bb145928.aspx)
+ ///
+ /// Returns the name of the program.
+ /// VSConstants.S_OK.
+ int IDebugProgramNode2.GetProgramName(out string programName)
+ {
+ programName = _process.Details.Name;
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+
+ #region Deprecated interface methods
+ // These methods are not called by the Visual Studio debugger, so they don't need to be implemented
+
+ ///
+ /// DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161399.aspx)
+ ///
+ /// The IDebugProgram2 interface that represents the program to attach to.
+ /// The IDebugEventCallback2 interface to be used to send debug events to the SDM.
+ /// A value from the ATTACH_REASON enumeration that specifies the reason for attaching.
+ /// VSConstants.E_NOTIMPL.
+ public int Attach_V7(IDebugProgram2 program, IDebugEventCallback2 callback, uint reason)
+ {
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161803.aspx)
+ ///
+ /// VSConstants.E_NOTIMPL.
+ public int DetachDebugger_V7()
+ {
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161297.aspx)
+ ///
+ /// Returns the name of the machine in which the program is running.
+ /// VSConstants.E_NOTIMPL.
+ public int GetHostMachineName_V7(out string hostMachineName)
+ {
+ hostMachineName = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7ProgramProvider.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7ProgramProvider.cs
new file mode 100644
index 00000000..789d7480
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7ProgramProvider.cs
@@ -0,0 +1,136 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using System.Runtime.InteropServices;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class implements IDebugProgramProvider2. (http://msdn.microsoft.com/en-us/library/bb161298.aspx)
+ /// This registered interface allows the session debug manager (SDM) to obtain information about programs
+ /// that have been "published" through the IDebugProgramPublisher2 interface.
+ ///
+ /// Partially implemented and not used at this moment.
+ ///
+ [ComVisible(true)]
+ [Guid(ClassGuid)]
+ public sealed class AD7ProgramProvider : IDebugProgramProvider2
+ {
+ public const string ClassGuid = "AD06FD46-C790-4D5C-A274-8815DF9511B8";
+ public const string ClassName = "BlackBerry.DebugEngine.AD7ProgramProvider";
+
+ #region IDebugProgramProvider2 Members
+
+ ///
+ /// Obtains information about programs running, filtered in a variety of ways.
+ /// (http://msdn.microsoft.com/en-us/library/bb147025.aspx)
+ ///
+ /// A combination of flags from the PROVIDER_FLAGS enumeration.
+ /// The port the calling process is running on.
+ /// An AD_PROCESS_ID structure holding the ID of the process that contains the program in question.
+ /// An array of GUIDs for debug engines assigned to debug this process (these will be used to filter
+ /// the programs that are actually returned based on what the supplied engines support; if no engines are specified, then all
+ /// programs will be returned).
+ /// A PROVIDER_PROCESS_DATA structure that is filled in with the requested information.
+ /// If successful, returns S_OK; otherwise, returns VSConstants.S_FALSE.
+ int IDebugProgramProvider2.GetProviderProcessData(enum_PROVIDER_FLAGS flags, IDebugDefaultPort2 port, AD_PROCESS_ID processId, CONST_GUID_ARRAY engineFilter, PROVIDER_PROCESS_DATA[] processArray)
+ {
+ processArray[0] = new PROVIDER_PROCESS_DATA();
+
+ if (((uint)flags & (uint)enum_PROVIDER_FLAGS.PFLAG_GET_PROGRAM_NODES) != 0)
+ {
+ // The debugger is asking the engine to return the program nodes it can debug. The VSNDK debug engine claims that it can
+ // debug all processes, and returns exactly one program node for each process. A full-featured debugger may wish to
+ // examine the target process and determine if it understands how to debug it.
+
+ IDebugProgramNode2 node = new AD7ProgramNode(processId.guidProcessId);
+
+ IntPtr[] programNodes = { Marshal.GetComInterfaceForObject(node, typeof(IDebugProgramNode2)) };
+
+ IntPtr destinationArray = Marshal.AllocCoTaskMem(IntPtr.Size * programNodes.Length);
+ Marshal.Copy(programNodes, 0, destinationArray, programNodes.Length);
+
+ processArray[0].Fields = enum_PROVIDER_FIELDS.PFIELD_PROGRAM_NODES;
+ processArray[0].ProgramNodes.Members = destinationArray;
+ processArray[0].ProgramNodes.dwCount = (uint)programNodes.Length;
+
+ return VSConstants.S_OK;
+ }
+
+ return VSConstants.S_FALSE;
+ }
+
+
+ ///
+ /// Gets a program node, given a specific process ID. Not implemented.
+ /// (http://msdn.microsoft.com/en-us/library/bb162155.aspx)
+ ///
+ /// A combination of flags from the PROVIDER_FLAGS enumeration.
+ /// The port the calling process is running on.
+ /// An AD_PROCESS_ID structure holding the ID of the process that contains the program in question.
+ /// GUID of the debug engine that the program is attached to (if any).
+ /// ID of the program for which to get the program node.
+ /// An IDebugProgramNode2 object representing the requested program node.
+ /// VSConstants.E_NOTIMPL.
+ int IDebugProgramProvider2.GetProviderProgramNode(enum_PROVIDER_FLAGS flags, IDebugDefaultPort2 port, AD_PROCESS_ID processId, ref Guid guidEngine, ulong programId, out IDebugProgramNode2 programNode)
+ {
+ // This method is used for Just-In-Time debugging support, which this program provider does not support
+ programNode = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Establishes a locale for any language-specific resources needed by the DE. Not implemented.
+ /// (http://msdn.microsoft.com/en-us/library/bb161383.aspx)
+ ///
+ /// Language ID to establish. For example, 1033 for English.
+ /// VSConstants.S_OK.
+ int IDebugProgramProvider2.SetLocale(ushort langID)
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Establishes a callback to watch for provider events associated with specific kinds of processes, allowing the process to
+ /// be notified of port events. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145594.aspx)
+ ///
+ /// A combination of flags from the PROVIDER_FLAGS enumeration.
+ /// The port the calling process is running on.
+ /// An AD_PROCESS_ID structure holding the ID of the process that contains the program in question.
+ /// An array of GUIDs of debug engines associated with the process.
+ /// GUID of the debug engine that launched this process (if any).
+ /// An IDebugPortNotify2 object that receives the event notifications.
+ /// VSConstants.S_OK.
+ int IDebugProgramProvider2.WatchForProviderEvents(enum_PROVIDER_FLAGS flags, IDebugDefaultPort2 port, AD_PROCESS_ID processId, CONST_GUID_ARRAY engineFilter, ref Guid guidLaunchingEngine, IDebugPortNotify2 eventCallback)
+ {
+ // The VSNDK debug engine is a native debugger, and can therefore always provide a program node
+ // in GetProviderProcessData. Non-native debuggers may wish to implement this method as a way
+ // of monitoring the process before code for their runtime starts. For example, if implementing a
+ // 'foo script' debug engine, one could attach to a process which might eventually run 'foo script'
+ // before this 'foo script' started.
+ //
+ // To implement this method, an engine would monitor the target process and call AddProgramNode
+ // when the target process started running code which was debuggable by the engine. The
+ // enum_PROVIDER_FLAGS.PFLAG_ATTACHED_TO_DEBUGGEE flag indicates if the request is to start
+ // or stop watching the process.
+
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7Property.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7Property.cs
new file mode 100644
index 00000000..bd7c9eba
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7Property.cs
@@ -0,0 +1,363 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+using System.Collections;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// An implementation of IDebugProperty2. (http://msdn.microsoft.com/en-ca/library/bb161287.aspx)
+ /// This interface represents a stack frame property, a program document property, or some other property.
+ /// The property is usually the result of an expression evaluation.
+ ///
+ sealed class AD7Property : IDebugProperty2
+ {
+ ///
+ /// Object that contains all information about a variable / expression.
+ ///
+ private readonly VariableInfo _variableInfo;
+
+ ///
+ /// Object that contains all information about a stack frame.
+ ///
+ private readonly AD7StackFrame _stackFrame;
+
+ ///
+ /// Constructor.
+ ///
+ /// Contains all information about a variable / expression.
+ public AD7Property(AD7StackFrame vi)
+ {
+ _stackFrame = vi;
+ }
+
+ ///
+ /// Constructor.
+ ///
+ /// Contains all information about a variable / expression.
+ public AD7Property(VariableInfo vi)
+ {
+ _variableInfo = vi;
+ }
+
+ ///
+ /// Construct a DEBUG_PROPERTY_INFO representing this local or parameter.
+ ///
+ /// A combination of flags from the DEBUGPROP_INFO_FLAGS enumeration that specifies which variables are
+ /// to be filled in.
+ /// The Property info.
+ public DEBUG_PROPERTY_INFO ConstructDebugPropertyInfo(enum_DEBUGPROP_INFO_FLAGS flags)
+ {
+ DEBUG_PROPERTY_INFO propertyInfo = new DEBUG_PROPERTY_INFO();
+
+ if (_variableInfo != null)
+ {
+ string name = _variableInfo._name;
+ if ((flags & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME) != 0)
+ {
+ propertyInfo.bstrFullName = name;
+ propertyInfo.dwFields = (enum_DEBUGPROP_INFO_FLAGS)((uint)propertyInfo.dwFields | (uint)(DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME));
+ }
+
+ if ((flags & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME) != 0)
+ {
+ propertyInfo.bstrName = name;
+ propertyInfo.dwFields = (enum_DEBUGPROP_INFO_FLAGS)((uint)propertyInfo.dwFields | (uint)(DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME));
+ }
+
+ if ((flags & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE) != 0)
+ {
+ propertyInfo.bstrType = _variableInfo._type;
+ propertyInfo.dwFields = (enum_DEBUGPROP_INFO_FLAGS)((uint)propertyInfo.dwFields | (uint)(DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE));
+ }
+
+ if ((flags & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE) != 0)
+ {
+ propertyInfo.bstrValue = _variableInfo._value;
+ propertyInfo.dwFields = (enum_DEBUGPROP_INFO_FLAGS)((uint)propertyInfo.dwFields | (uint)(DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE));
+ }
+
+ if ((flags & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB) != 0)
+ {
+ if (_variableInfo._children != null)
+ {
+ propertyInfo.dwAttrib |= (enum_DBG_ATTRIB_FLAGS)DBG_ATTRIB_FLAGS.DBG_ATTRIB_OBJ_IS_EXPANDABLE;
+ }
+ }
+
+ // If the debugger has asked for the property, or the property has children (meaning it is a pointer in the sample)
+ // then set the pProperty field so the debugger can call back when the chilren are enumerated.
+ if ((flags & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP) != 0 || _variableInfo._children != null)
+ {
+ propertyInfo.pProperty = this;
+ propertyInfo.dwFields = (enum_DEBUGPROP_INFO_FLAGS)((uint)propertyInfo.dwFields | (uint)(DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP));
+ }
+
+ }
+ return propertyInfo;
+ }
+
+ #region IDebugProperty2 Members
+
+ ///
+ /// Enumerates the children of a property. This provides support for dereferencing pointers, displaying members of an array, or
+ /// fields of a class or struct. (http://msdn.microsoft.com/en-us/library/bb161791.aspx)
+ ///
+ /// A combination of flags from the DEBUGPROP_INFO_FLAGS enumeration that specifies which fields in
+ /// the enumerated DEBUG_PROPERTY_INFO structures are to be filled in.
+ /// Specifies the radix to be used in formatting any numerical information.
+ /// GUID of the filter used with the dwAttribFilter and pszNameFilter parameters to select which
+ /// DEBUG_PROPERTY_INFO children are to be enumerated. For example, guidFilterLocals filters for local variables.
+ /// A combination of flags from the DBG_ATTRIB_FLAGS enumeration that specifies what type of
+ /// objects to enumerate, for example DBG_ATTRIB_METHOD for all methods that might be children of this property. Used in
+ /// combination with the guidFilter and pszNameFilter parameters.
+ /// The name of the filter used with the guidFilter and dwAttribFilter parameters to select which
+ /// DEBUG_PROPERTY_INFO children are to be enumerated. For example, setting this parameter to "MyX" filters for all children
+ /// with the name "MyX."
+ /// Specifies the maximum time, in milliseconds, to wait before returning from this method. Use
+ /// INFINITE to wait indefinitely.
+ /// Returns an IEnumDebugPropertyInfo2 object containing a list of the child properties.
+ /// If successful, returns S_OK; otherwise returns S_FALSE.
+ public int EnumChildren(enum_DEBUGPROP_INFO_FLAGS flags, uint radix, ref Guid guidFilter, enum_DBG_ATTRIB_FLAGS attributesFilter, string nameFilter, uint timeout, out IEnumDebugPropertyInfo2 ppEnum)
+ {
+ ppEnum = null;
+
+ if (_variableInfo != null)
+ {
+ if (_variableInfo._children != null)
+ {
+ if (_variableInfo._children.Count == 0)
+ {
+ // This is an array, struct, union, or pointer.
+ // Create a variable object so we can list this variable's children.
+
+ // Some VS variable names cannot be used by GDB. When that happens, it is added the prefix VsNdK_ to the GDB variable
+ // name and it is stored in the GDBNames array. At the same time, the VS name is stored in the VSNames array using the
+ // same index position. This bool variable just indicate if this prefix is used or not.
+ bool hasVsNDK;
+ string numChildren = AD7StackFrame._dispatcher.CreateVariable(_variableInfo._name, out hasVsNDK);
+
+ ArrayList GDBNames = new ArrayList();
+ ArrayList VSNames = new ArrayList();
+
+ if (hasVsNDK)
+ {
+ _variableInfo._GDBName = "VsNdK_" + _variableInfo._name;
+ GDBNames.Add("VsNdK_" + _variableInfo._name);
+ VSNames.Add(_variableInfo._name);
+ }
+
+ try // Catch non-numerical data
+ {
+ if (Convert.ToInt32(numChildren) > 0) // If the variable has children evaluate
+ {
+ if (_variableInfo._type.Contains("struct"))
+ if (_variableInfo._type[_variableInfo._type.Length - 1] == '*')
+ _variableInfo.ListChildren(AD7StackFrame._dispatcher, "*", GDBNames, VSNames, hasVsNDK, null);
+ else if (_variableInfo._type.Contains("["))
+ _variableInfo.ListChildren(AD7StackFrame._dispatcher, "struct[]", GDBNames, VSNames, hasVsNDK, null);
+ else
+ _variableInfo.ListChildren(AD7StackFrame._dispatcher, "struct", GDBNames, VSNames, hasVsNDK, null);
+ else if (_variableInfo._type.Contains("["))
+ _variableInfo.ListChildren(AD7StackFrame._dispatcher, "[]", GDBNames, VSNames, hasVsNDK, null);
+ else if (_variableInfo._type.Contains("*"))
+ _variableInfo.ListChildren(AD7StackFrame._dispatcher, "*", GDBNames, VSNames, hasVsNDK, null);
+ else
+ _variableInfo.ListChildren(AD7StackFrame._dispatcher, "", GDBNames, VSNames, hasVsNDK, null);
+
+ }
+ }
+ catch (FormatException)
+ {
+ }
+ AD7StackFrame._dispatcher.DeleteVariable(_variableInfo._name, hasVsNDK);
+ }
+ DEBUG_PROPERTY_INFO[] properties = new DEBUG_PROPERTY_INFO[_variableInfo._children.Count];
+ int i = 0;
+ foreach (VariableInfo child in _variableInfo._children)
+ {
+ VariableInfo.EvaluateExpression(child._name, out child._value, child._GDBName);
+ properties[i] = new AD7Property(child).ConstructDebugPropertyInfo(flags);
+ i++;
+ }
+ ppEnum = new AD7PropertyEnum(properties);
+ return VSConstants.S_OK;
+ }
+ }
+ else if (_stackFrame != null)
+ {
+ uint elementsReturned;
+ _stackFrame.CreateLocalsPlusArgsProperties(flags, out elementsReturned, out ppEnum);
+ return VSConstants.S_OK;
+ }
+
+ return VSConstants.S_FALSE;
+ }
+
+ ///
+ /// Returns the property that describes the most-derived property of a property.
+ /// (http://msdn.microsoft.com/en-ca/library/bb161781.aspx)
+ /// This is called to support object oriented languages. It allows the debug engine to return an IDebugProperty2 for the
+ /// most-derived object in a hierarchy.
+ /// The VSNDK debug engine does not support this. Not implemented.
+ ///
+ /// Returns an IDebugProperty2 object that represents the derived-most property.
+ /// Not implemented.
+ public int GetDerivedMostProperty(out IDebugProperty2 ppDerivedMost)
+ {
+ ppDerivedMost = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Returns the extended information of a property. (http://msdn.microsoft.com/en-ca/library/bb145070.aspx)
+ /// This method exists for the purpose of retrieving information that does not lend itself to being retrieved by calling the
+ /// IDebugProperty2::GetPropertyInfo method. This includes information about custom viewers, managed type slots and other
+ /// information.
+ /// The VSNDK debug engine does not support this. Not implemented.
+ ///
+ /// GUID that determines the type of extended information to be retrieved.
+ /// Returns a VARIANT (C++) or object (C#) that can be used to retrieve the extended property
+ /// information. For example, this parameter might return an IUnknown interface that can be queried for an IDebugDocumentText2
+ /// interface.
+ /// Not implemented.
+ public int GetExtendedInfo(ref Guid guidExtendedInfo, out object pExtendedInfo)
+ {
+ pExtendedInfo = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Returns the memory bytes that compose the value of a property. (http://msdn.microsoft.com/en-ca/library/bb161360.aspx)
+ /// Not implemented.
+ ///
+ /// Returns an IDebugMemoryBytes2 object that can be used to retrieve the memory that contains
+ /// the value of the property.
+ /// Not implemented.
+ public int GetMemoryBytes(out IDebugMemoryBytes2 ppMemoryBytes)
+ {
+ ppMemoryBytes = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Returns the memory context for a property value. (http://msdn.microsoft.com/en-ca/library/bb147028.aspx)
+ /// Not implemented.
+ ///
+ /// Returns the IDebugMemoryContext2 object that represents the memory associated with this property.
+ /// Not implemented.
+ public int GetMemoryContext(out IDebugMemoryContext2 ppMemory)
+ {
+ ppMemory = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Returns the parent of a property. (http://msdn.microsoft.com/en-ca/library/bb146184.aspx)
+ /// Not implemented.
+ ///
+ /// Returns an IDebugProperty2 object that represents the parent of the property.
+ /// Not implemented.
+ public int GetParent(out IDebugProperty2 ppParent)
+ {
+ ppParent = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Fills in a DEBUG_PROPERTY_INFO structure that describes a property. (http://msdn.microsoft.com/en-ca/library/bb145852.aspx)
+ ///
+ /// A combination of flags from the DEBUGPROP_INFO_FLAGS enumeration that specifies which fields are to
+ /// be filled out in the pPropertyInfo structure.
+ /// Radix to be used in formatting any numerical information.
+ /// Specifies the maximum time, in milliseconds, to wait before returning from this method. Use
+ /// INFINITE to wait indefinitely.
+ /// Reserved for future use; set to a null value.
+ /// Reserved for future use; set to zero.
+ /// A DEBUG_PROPERTY_INFO structure that is filled in with the description of the property.
+ /// VSConstants.S_OK.
+ public int GetPropertyInfo(enum_DEBUGPROP_INFO_FLAGS flags, uint radix, uint timeout, IDebugReference2[] rgpArgs, uint argCount, DEBUG_PROPERTY_INFO[] pPropertyInfo)
+ {
+ pPropertyInfo[0] = new DEBUG_PROPERTY_INFO();
+ pPropertyInfo[0] = ConstructDebugPropertyInfo(flags);
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Returns a reference to the property's value. IDebugProperty2 represents a property, while IDebugReference2 represents a
+ /// reference to a property, typically a reference to an object in the program being debugged. Not implemented.
+ /// (http://msdn.microsoft.com/en-ca/library/bb145600.aspx)
+ ///
+ /// Returns an IDebugReference2 object representing a reference to the property's value.
+ /// Not implemented.
+ public int GetReference(out IDebugReference2 ppReference)
+ {
+ ppReference = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Returns the size, in bytes, of the property value. Not implemented. (http://msdn.microsoft.com/en-ca/library/bb145093.aspx)
+ ///
+ /// Returns the size, in bytes, of the property value.
+ /// Not implemented.
+ public int GetSize(out uint pSize)
+ {
+ pSize = 0;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Sets the value of the property from the value of a given reference. (http://msdn.microsoft.com/en-ca/library/bb145613.aspx)
+ /// The debugger will call this when the user tries to edit the property's values. As the sample has set the read-only flag on
+ /// its properties, this should not be called.
+ /// Not implemented.
+ ///
+ /// An array of arguments to pass to the managed code property setter. If the property setter does not
+ /// take arguments or if this IDebugProperty2 object does not refer to such a property setter, rgpArgs should be a null value.
+ /// This parameter is typically a null value.
+ /// The number of arguments in the rgpArgs array.
+ /// A reference, in the form of an IDebugReference2 object, to the value to use to set this property.
+ /// How long to take to set the value, in milliseconds. A typical value is INFINITE. This affects
+ /// the length of time that any possible evaluation can take.
+ /// Not implemented.
+ public int SetValueAsReference(IDebugReference2[] rgpArgs, uint argCount, IDebugReference2 value, uint timeout)
+ {
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Sets the value of a property from a given string. (http://msdn.microsoft.com/en-ca/library/bb160956.aspx)
+ /// The debugger will call this when the user tries to edit the property's values in one of the debugger windows.
+ ///
+ /// A string containing the value to be set.
+ /// A radix to be used in interpreting any numerical information. This can be 0 to attempt to determine
+ /// the radix automatically.
+ /// Specifies the maximum time, in milliseconds, to wait before returning from this method. Use
+ /// INFINITE to wait indefinitely.
+ /// VSConstants.S_OK.
+ public int SetValueAsString(string value, uint radix, uint timeout)
+ {
+ string result;
+ VariableInfo.EvaluateExpression(_variableInfo._name + "=" + value, out result, null);
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7StackFrame.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7StackFrame.cs
new file mode 100644
index 00000000..756c7f55
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7StackFrame.cs
@@ -0,0 +1,810 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using System.Collections;
+using BlackBerry.NativeCore.Debugger;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// Represents a logical stack frame on the thread stack.
+ ///
+ /// It implements:
+ ///
+ /// IDebugStackFrame2: Represents a single stack frame in a call stack in a particular thread.
+ /// (http://msdn.microsoft.com/en-us/library/bb161683.aspx)
+ ///
+ /// IDebugExpressionContext: Represents a context for expression evaluation, which allows expression evaluation and watch windows.
+ /// (http://msdn.microsoft.com/en-ca/library/bb146178.aspx)
+ ///
+ public sealed class AD7StackFrame : IDebugStackFrame2, IDebugExpressionContext2
+ {
+ ///
+ /// The class that manages debug events for the debug engine.
+ ///
+ public static EventDispatcher _dispatcher;
+
+ ///
+ /// The AD7Engine object that represents the DE.
+ ///
+ public readonly AD7Engine _engine;
+
+ ///
+ /// Represents the thread for this stack frame.
+ ///
+ public readonly AD7Thread _thread;
+
+ ///
+ /// The short path file name that contains the source code of this stack frame.
+ ///
+ private readonly string _documentName;
+
+ ///
+ /// The function name associated to this stack frame.
+ ///
+ public string _functionName = "";
+
+ ///
+ /// Represents the current position (line number) in m_documentName.
+ ///
+ private readonly uint _lineNum;
+
+ ///
+ /// Boolean value that indicates if this stack frame has an associated source code to present.
+ ///
+ private readonly bool _hasSource;
+
+ ///
+ /// The current context's address.
+ ///
+ private readonly uint _address;
+
+ ///
+ /// List of variables that we want to filter from the locals window.
+ ///
+ private string[] _variableFilter = { "__func__" };
+
+ ///
+ /// Contains the locals variables to this stack frame.
+ ///
+ public ArrayList _locals;
+
+ ///
+ /// Contains the parameters used to call the method/function that originated this stack frame.
+ ///
+ public ArrayList _arguments;
+
+ ///
+ /// Search the __stackframes cache for the internal representation of the stack frame associated to the GDB frameInfo
+ /// information. If successful, returns the stack frame; otherwise, creates a new one and return it.
+ ///
+ /// The AD7Engine object that represents the DE.
+ /// Represents the thread for this stack frame.
+ /// Array of strings with the information provided by GDB about this stack frame.
+ /// Boolean value that indicates if a new object for this stack frame was created or not.
+ /// Returns the created/found stack frame.
+ public static AD7StackFrame Create(AD7Engine engine, AD7Thread thread, string[] frameInfo, ref bool created)
+ {
+ created = false;
+ if (thread.__stackFrames != null)
+ {
+ foreach (AD7StackFrame frame in thread.__stackFrames)
+ {
+ if (frame._documentName != null && frame._functionName != null)
+ {
+ if (frame._documentName == frameInfo[3] && frame._functionName == frameInfo[2]) // frameInfo[2] = func, frameInfo[3] = file
+ return frame;
+ }
+ }
+ }
+ else
+ thread.__stackFrames = new ArrayList();
+
+ AD7StackFrame newFrame = new AD7StackFrame(engine, thread, frameInfo);
+ thread.__stackFrames.Add(newFrame);
+ created = true;
+ return newFrame;
+ }
+
+ ///
+ /// Constructor.
+ ///
+ /// The AD7Engine object that represents the DE.
+ /// Represents the thread for this stack frame.
+ /// Array of strings with the information provided by GDB about this stack frame.
+ public AD7StackFrame(AD7Engine engine, AD7Thread thread, string[] frameInfo)
+ {
+ _lineNum = 0;
+ _engine = engine;
+ _thread = thread;
+ _dispatcher = _engine.EventDispatcher;
+
+ uint level = Convert.ToUInt32(frameInfo[0]);
+ string address = frameInfo[1];
+ _functionName = frameInfo[2];
+ _documentName = frameInfo[3];
+
+ if (!uint.TryParse(frameInfo[4], out _lineNum))
+ {
+ _lineNum = 0;
+ }
+
+ _locals = new ArrayList();
+ _arguments = new ArrayList();
+ _hasSource = _lineNum != 0;
+ ArrayList evaluatedVars = new ArrayList();
+
+ // Add the variable filter list to the evaluatedVars list.
+ // Causes named variables to be ignored.
+ evaluatedVars.AddRange(_variableFilter);
+
+ if (address.StartsWith("0x"))
+ address = address.Remove(0, 2);
+ _address = uint.Parse(address, System.Globalization.NumberStyles.AllowHexSpecifier);
+
+ // Query GDB for parameters and locals.
+ string variablesResponse = _engine.EventDispatcher.GetVariablesForFrame(level, _thread._id).Replace("#;;;", "");
+ if (variablesResponse == null || variablesResponse == "ERROR" || variablesResponse == "")
+ return;
+ variablesResponse = variablesResponse.Substring(3);
+
+ string[] variableStrings = variablesResponse.Split('#');
+
+ foreach (string variableString in variableStrings)
+ {
+ bool arg = false;
+ string type = null;
+ string value = null;
+
+ string[] variableProperties = variableString.Split(';');
+
+ if (variableProperties[0] != "")
+ {
+ if (!evaluatedVars.Contains(variableProperties[0]))
+ {
+ string name = variableProperties[0];
+ evaluatedVars.Add(variableProperties[0]);
+ if (variableProperties[1] != "")
+ arg = true;
+ if (variableProperties[2] != "")
+ type = variableProperties[2];
+ if (variableProperties[3] != "")
+ value = variableProperties[3];
+ if (arg)
+ _arguments.Add(VariableInfo.Create(name, type, value, _engine.EventDispatcher));
+ else
+ _locals.Add(VariableInfo.Create(name, type, value, _engine.EventDispatcher));
+ }
+ }
+ }
+ }
+
+ #region Non-interface methods
+
+ ///
+ /// Construct a FRAMEINFO for this stack frame with the requested information.
+ ///
+ /// A combination of flags from the FRAMEINFO_FLAGS enumeration that specifies which fields of the
+ /// frameInfo parameter are to be filled in.
+ /// A FRAMEINFO structure that is filled in with the description of the stack frame.
+ public void SetFrameInfo(enum_FRAMEINFO_FLAGS flags, out FRAMEINFO frameInfo)
+ {
+ frameInfo = new FRAMEINFO();
+
+ // The debugger is asking for the formatted name of the function which is displayed in the callstack window.
+ // There are several optional parts to this name including the module, argument types and values, and line numbers.
+ // The optional information is requested by setting flags in the dwFieldSpec parameter.
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME) != 0)
+ {
+ // If there is source information, construct a string that contains the module name, function name, and optionally argument names and values.
+ if (_hasSource)
+ {
+ frameInfo.m_bstrFuncName = "";
+
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_MODULE) != 0)
+ {
+// frameInfo.m_bstrFuncName = System.IO.Path.GetFileName(module.Name) + "!";
+ }
+
+
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_RETURNTYPE) != 0)
+ {
+ // Adds the return type to the m_bstrFuncName field.
+ //frameInfo.m_bstrFuncName += _returnType;
+ }
+
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_LANGUAGE) != 0)
+ {
+ // Adds the language to the m_bstrFuncName field.
+ if (_documentName.EndsWith(".c"))
+ frameInfo.m_bstrFuncName += "(C) ";
+ else if (_documentName.EndsWith(".cpp") || _documentName.EndsWith(".c++"))
+ frameInfo.m_bstrFuncName += "(C++) ";
+ }
+
+ frameInfo.m_bstrFuncName += _functionName;
+
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_ARGS) != 0)
+ {
+ // Add the arguments to the m_bstrFuncName field.
+ frameInfo.m_bstrFuncName += "(";
+ bool all = (flags & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_ARGS_ALL) != 0;
+ int i = 0;
+ foreach (VariableInfo arg in _arguments)
+ {
+ if (all || (flags & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_ARGS_TYPES) != 0)
+ {
+ frameInfo.m_bstrFuncName += arg._type + " ";
+ }
+
+ if (all || (flags & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_ARGS_NAMES) != 0)
+ {
+ frameInfo.m_bstrFuncName += arg._name;
+ }
+
+ if (all || (flags & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_ARGS_VALUES) != 0)
+ {
+ frameInfo.m_bstrFuncName += "=" + arg._value;
+ }
+
+ if (i < _arguments.Count - 1)
+ {
+ frameInfo.m_bstrFuncName += ", ";
+ }
+ i++;
+ }
+ frameInfo.m_bstrFuncName += ")";
+ }
+
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_LINES) != 0)
+ {
+ frameInfo.m_bstrFuncName += " Line: " + _lineNum.ToString();
+ }
+
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_OFFSET) != 0)
+ {
+ // TODO:
+ // Adds to the m_bstrFuncName field the offset in bytes from the start of the line if FIF_FUNCNAME_LINES is specified.
+ // If FIF_FUNCNAME_LINES is not specified, or if line numbers are not available, adds the offset in bytes from the start of the function.
+ }
+
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_FORMAT) != 0)
+ {
+ // TODO:
+ // Formats the function name. The result is returned in the m_bstrFuncName field and no other fields are filled out.
+ // According to http://msdn.microsoft.com/en-us/library/bb145138.aspx, this flag "Specify the FIF_FUNCNAME_FORMAT
+ // flag to format the function name into a single string". This method already works on this way.
+ }
+ }
+ else
+ {
+ // No source information, so only return the module name and the instruction pointer.
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_MODULE) != 0)
+ {
+ if ((_functionName != "") && (_functionName != "??"))
+ frameInfo.m_bstrFuncName = _functionName;
+ else
+ frameInfo.m_bstrFuncName = "[External Code]";
+ }
+ else
+ {
+ frameInfo.m_bstrFuncName = "[External Code]";
+ }
+
+ }
+ frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_FUNCNAME;
+ }
+
+ // The debugger is requesting the name of the module for this stack frame.
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_MODULE) != 0)
+ {
+ frameInfo.m_bstrModule = "";
+ frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_MODULE;
+ }
+
+
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_RETURNTYPE) != 0)
+ {
+ // TODO:
+ // Initialize/use the m_bstrReturnType field.
+ frameInfo.m_bstrReturnType = "";
+ frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_RETURNTYPE;
+ }
+
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_ARGS) != 0)
+ {
+ // Initialize/use the m_bstrArgs field.
+ frameInfo.m_bstrArgs = "";
+ bool all = (flags & enum_FRAMEINFO_FLAGS.FIF_ARGS_ALL) != 0;
+ int i = 0;
+ foreach (VariableInfo arg in _arguments)
+ {
+ if (all || (flags & enum_FRAMEINFO_FLAGS.FIF_ARGS_TYPES) != 0)
+ {
+ frameInfo.m_bstrArgs += arg._type + " ";
+ }
+
+ if (all || (flags & enum_FRAMEINFO_FLAGS.FIF_ARGS_NAMES) != 0)
+ {
+ frameInfo.m_bstrArgs += arg._name;
+ }
+
+ if (all || (flags & enum_FRAMEINFO_FLAGS.FIF_ARGS_VALUES) != 0)
+ {
+ frameInfo.m_bstrArgs += "=" + arg._value;
+ }
+
+ if (i < _arguments.Count - 1)
+ {
+ frameInfo.m_bstrArgs += ", ";
+ }
+ i++;
+ }
+
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_ARGS_NO_TOSTRING) != 0)
+ {
+ // TODO:
+ // Do not allow ToString() function evaluation or formatting when returning function arguments.
+ }
+
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_ARGS_NO_FUNC_EVAL) != 0)
+ {
+ // TODO:
+ // Specifies that function (property) evaluation should not be used when retrieving argument values.
+ }
+
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_ARGS_NOFORMAT) != 0)
+ {
+ // TODO:
+ // Specifies that the arguments are not be formatted (for example, do not add opening and closing parentheses around
+ // the argument list nor add a separator between arguments).
+ }
+
+ frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_ARGS;
+ }
+
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_LANGUAGE) != 0)
+ {
+ // Initialize/use the m_bstrLanguage field.
+ if (_documentName != null)
+ {
+ if (_documentName.EndsWith(".c"))
+ frameInfo.m_bstrLanguage = "C";
+ else if (_documentName.EndsWith(".cpp") || _documentName.EndsWith(".c++"))
+ frameInfo.m_bstrLanguage = "C++";
+ else
+ frameInfo.m_bstrLanguage = "";
+ }
+ else
+ frameInfo.m_bstrLanguage = "";
+ frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_LANGUAGE;
+ }
+
+ // The debugger would like a pointer to the IDebugModule2 that contains this stack frame.
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_DEBUG_MODULEP) != 0)
+ {
+ frameInfo.m_pModule = _engine.Module;
+ frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_DEBUG_MODULEP;
+ }
+
+ // The debugger is requesting the range of memory addresses for this frame.
+ // For the sample engine, this is the contents of the frame pointer.
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_STACKRANGE) != 0)
+ {
+ // TODO:
+ // Initialize/use the m_addrMin and m_addrMax (stack range) fields.
+
+ frameInfo.m_addrMin = 0;
+ frameInfo.m_addrMax = 0;
+ frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_STACKRANGE;
+ }
+
+ // The debugger is requesting the IDebugStackFrame2 value for this frame info.
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_FRAME) != 0)
+ {
+ frameInfo.m_pFrame = this;
+ frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_FRAME;
+ }
+
+ // Does this stack frame of symbols loaded?
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_DEBUGINFO) != 0)
+ {
+ frameInfo.m_fHasDebugInfo = _hasSource ? 1 : 0;
+ frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_DEBUGINFO;
+ }
+
+ // Is this frame stale?
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_STALECODE) != 0)
+ {
+ frameInfo.m_fStaleCode = 0;
+ frameInfo.m_dwValidFields |= enum_FRAMEINFO_FLAGS.FIF_STALECODE;
+ }
+
+ // The debug engine is to filter non-user code frames so they are not included.
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_FILTER_NON_USER_CODE ) != 0)
+ {
+ }
+
+ // Frame information should be gotten from the hosted app-domain rather than the hosting process.
+ if ((flags & enum_FRAMEINFO_FLAGS.FIF_DESIGN_TIME_EXPR_EVAL) != 0)
+ {
+ }
+ }
+
+ ///
+ /// Construct an instance of IEnumDebugPropertyInfo2 for the combined locals and parameters.
+ ///
+ /// A combination of flags from the DEBUGPROP_INFO_FLAGS enumeration that specifies which fields in
+ /// the enumObject are to be filled in.
+ /// Returns the number of elements in the enumeration.
+ /// Returns an IEnumDebugPropertyInfo2 object containing a list of the desired properties.
+ public void CreateLocalsPlusArgsProperties(enum_DEBUGPROP_INFO_FLAGS flags, out uint elementsReturned, out IEnumDebugPropertyInfo2 enumObject)
+ {
+ elementsReturned = 0;
+ int localsLength = 0;
+
+ if (_locals != null)
+ {
+ localsLength = _locals.Count;
+ elementsReturned += (uint)localsLength;
+ }
+
+ if (_arguments != null)
+ {
+ elementsReturned += (uint)_arguments.Count;
+ }
+ DEBUG_PROPERTY_INFO[] propInfo = new DEBUG_PROPERTY_INFO[elementsReturned];
+
+ if (_locals != null)
+ {
+ int i = 0;
+ foreach(VariableInfo var in _locals)
+ {
+ AD7Property property = new AD7Property(var);
+ propInfo[i] = property.ConstructDebugPropertyInfo(flags);
+ i++;
+ }
+ }
+
+ if (_arguments != null)
+ {
+ int i = 0;
+ foreach (VariableInfo arg in _arguments)
+ {
+ AD7Property property = new AD7Property(arg);
+ propInfo[localsLength + i] = property.ConstructDebugPropertyInfo(flags);
+ i++;
+ }
+ }
+
+ enumObject = new AD7PropertyInfoEnum(propInfo);
+ }
+
+ ///
+ /// Construct an instance of IEnumDebugPropertyInfo2 for the locals collection only.
+ ///
+ /// A combination of flags from the DEBUGPROP_INFO_FLAGS enumeration that specifies which fields in
+ /// the enumObject are to be filled in.
+ /// Returns the number of elements in the enumeration.
+ /// Returns an IEnumDebugPropertyInfo2 object containing a list of the desired properties.
+ private void CreateLocalProperties(enum_DEBUGPROP_INFO_FLAGS flags, out uint elementsReturned, out IEnumDebugPropertyInfo2 enumObject)
+ {
+ elementsReturned = (uint)_locals.Count;
+ DEBUG_PROPERTY_INFO[] propInfo = new DEBUG_PROPERTY_INFO[_locals.Count];
+
+ int i = 0;
+ foreach (VariableInfo var in _locals)
+ {
+ AD7Property property = new AD7Property(var);
+ propInfo[i] = property.ConstructDebugPropertyInfo(flags);
+ i++;
+ }
+
+ enumObject = new AD7PropertyInfoEnum(propInfo);
+ }
+
+ ///
+ /// Construct an instance of IEnumDebugPropertyInfo2 for the parameters collection only.
+ ///
+ /// A combination of flags from the DEBUGPROP_INFO_FLAGS enumeration that specifies which fields in
+ /// the enumObject are to be filled in.
+ /// Returns the number of elements in the enumeration.
+ /// Returns an IEnumDebugPropertyInfo2 object containing a list of the desired properties.
+ private void CreateParameterProperties(enum_DEBUGPROP_INFO_FLAGS flags, out uint elementsReturned, out IEnumDebugPropertyInfo2 enumObject)
+ {
+ elementsReturned = (uint)_arguments.Count;
+ DEBUG_PROPERTY_INFO[] propInfo = new DEBUG_PROPERTY_INFO[_arguments.Count];
+
+ int i = 0;
+ foreach (VariableInfo arg in _arguments)
+ {
+ AD7Property property = new AD7Property(arg);
+ propInfo[i] = property.ConstructDebugPropertyInfo(flags);
+ i++;
+ }
+
+ enumObject = new AD7PropertyInfoEnum(propInfo);
+ }
+
+ #endregion
+
+ #region IDebugStackFrame2 Members
+
+ ///
+ /// Creates an enumerator for properties associated with the stack frame, such as local variables.
+ /// (http://msdn.microsoft.com/en-us/library/bb145607.aspx).
+ ///
+ /// A combination of flags from the DEBUGPROP_INFO_FLAGS enumeration that specifies which fields in
+ /// the enumerated DEBUG_PROPERTY_INFO structures are to be filled in.
+ /// The radix to be used in formatting any numerical information.
+ /// A GUID of a filter used to select which DEBUG_PROPERTY_INFO structures are to be enumerated, such as guidFilterLocals.
+ /// Maximum time, in milliseconds, to wait before returning from this method. Use INFINITE to wait indefinitely.
+ /// Returns the number of properties enumerated. This is the same as calling the IEnumDebugPropertyInfo2::GetCount method.
+ /// Returns an IEnumDebugPropertyInfo2 object containing a list of the desired properties.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ int IDebugStackFrame2.EnumProperties(enum_DEBUGPROP_INFO_FLAGS flags, uint radix, ref Guid guidFilter, uint timeout, out uint elementsReturned, out IEnumDebugPropertyInfo2 enumObject)
+ {
+ elementsReturned = 0;
+ enumObject = null;
+
+ try
+ {
+ if (guidFilter == AD7Guids.guidFilterLocalsPlusArgs ||
+ guidFilter == AD7Guids.guidFilterAllLocalsPlusArgs ||
+ guidFilter == AD7Guids.guidFilterAllLocals)
+ {
+ CreateLocalsPlusArgsProperties(flags, out elementsReturned, out enumObject);
+ return VSConstants.S_OK;
+ }
+ if (guidFilter == AD7Guids.guidFilterLocals)
+ {
+ CreateLocalProperties(flags, out elementsReturned, out enumObject);
+ return VSConstants.S_OK;
+ }
+ if (guidFilter == AD7Guids.guidFilterArgs)
+ {
+ CreateParameterProperties(flags, out elementsReturned, out enumObject);
+ return VSConstants.S_OK;
+ }
+ return EngineUtils.NotImplemented();
+ }
+ catch (Exception ex)
+ {
+ return EngineUtils.UnexpectedException(ex);
+ }
+ }
+
+ ///
+ /// Gets the code context for this stack frame. The code context represents the current instruction pointer in this stack frame.
+ /// (http://msdn.microsoft.com/en-us/library/bb147046.aspx)
+ ///
+ /// Returns an IDebugCodeContext2 object that represents the current instruction pointer in this stack frame.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ int IDebugStackFrame2.GetCodeContext(out IDebugCodeContext2 pMemoryAddress)
+ {
+ pMemoryAddress = null;
+ try
+ {
+ pMemoryAddress = new AD7MemoryAddress(_engine, _address);
+ return VSConstants.S_OK;
+ }
+ catch (Exception e)
+ {
+ return EngineUtils.UnexpectedException(e);
+ }
+ }
+
+ ///
+ /// Gets a description of the properties associated with a stack frame.
+ /// (http://msdn.microsoft.com/en-us/library/bb144920.aspx)
+ ///
+ /// Returns an IDebugProperty2 object that describes the properties of this stack frame.
+ /// VSConstants.S_OK.
+ int IDebugStackFrame2.GetDebugProperty(out IDebugProperty2 pProperty)
+ {
+ pProperty = new AD7Property(this);
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the document context for this stack frame. The debugger will call this when the current stack frame is changed and
+ /// will use it to open the correct source document for this stack frame. (http://msdn.microsoft.com/en-us/library/bb146338.aspx)
+ ///
+ /// Returns an IDebugDocumentContext2 object that represents the current position in a source
+ /// document.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ int IDebugStackFrame2.GetDocumentContext(out IDebugDocumentContext2 pDocContext)
+ {
+ _engine.CleanEvaluatedThreads();
+ pDocContext = null;
+
+ try
+ {
+ pDocContext = new AD7DocumentContext(_documentName, _lineNum > 0 ? _lineNum - 1 : 0, null);
+ return VSConstants.S_OK;
+ }
+ catch (Exception ex)
+ {
+ return EngineUtils.UnexpectedException(ex);
+ }
+ }
+
+ ///
+ /// Gets an evaluation context for expression evaluation within the current context of a stack frame and thread.
+ /// Generally, an expression evaluation context can be thought of as a scope for performing expression evaluation.
+ /// Call the IDebugExpressionContext2::ParseText method to parse an expression and then call the resulting
+ /// IDebugExpression2::EvaluateSync or IDebugExpression2::EvaluateAsync methods to evaluate the parsed expression.
+ /// (http://msdn.microsoft.com/en-us/library/bb161269.aspx)
+ ///
+ /// Returns an IDebugExpressionContext2 object that represents a context for expression evaluation.
+ /// VSConstants.S_OK.
+ int IDebugStackFrame2.GetExpressionContext(out IDebugExpressionContext2 ppExprCxt)
+ {
+ ppExprCxt = this;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets a description of the stack frame. (http://msdn.microsoft.com/en-us/library/bb145146.aspx)
+ ///
+ /// A combination of flags from the FRAMEINFO_FLAGS enumeration that specifies which fields of the
+ /// pFrameInfo parameter are to be filled in.
+ /// The radix to be used in formatting any numerical information.
+ /// A FRAMEINFO structure that is filled in with the description of the stack frame.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ int IDebugStackFrame2.GetInfo(enum_FRAMEINFO_FLAGS flags, uint radix, FRAMEINFO[] pFrameInfo)
+ {
+ try
+ {
+ SetFrameInfo(flags, out pFrameInfo[0]);
+
+ int frame = 0;
+ if (_thread.__stackFrames != null)
+ {
+ foreach (AD7StackFrame sf in _thread.__stackFrames)
+ {
+ if (sf._functionName == _functionName)
+ break;
+ frame++;
+ }
+ }
+
+ if (_thread._id != _engine.CurrentThread()._id)
+ _engine.EventDispatcher.SelectThread(_thread._id);
+
+ // Waits for the parsed response for the GDB/MI command that changes the selected frame.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Stack-Manipulation.html)
+ GdbWrapper.SendCommand("-stack-select-frame " + frame, 5);
+
+ if (_thread._id != _engine.CurrentThread()._id)
+ _engine.EventDispatcher.SelectThread(_engine.CurrentThread()._id);
+
+ _engine.CleanEvaluatedThreads();
+
+ return VSConstants.S_OK;
+ }
+ catch (Exception ex)
+ {
+ return EngineUtils.UnexpectedException(ex);
+ }
+ }
+
+ ///
+ /// Gets the language associated with this stack frame. (http://msdn.microsoft.com/en-us/library/bb145096.aspx)
+ ///
+ /// Returns the name of the language that implements the method associated with this stack frame.
+ /// Returns the GUID of the language.
+ /// VSConstants.S_OK.
+ int IDebugStackFrame2.GetLanguageInfo(ref string pbstrLanguage, ref Guid pguidLanguage)
+ {
+ if (_documentName.EndsWith(".c"))
+ {
+ pbstrLanguage = "C";
+ pguidLanguage = AD7Guids.guidLanguageCpp;
+ }
+ else if (_documentName.EndsWith(".cpp") || _documentName.EndsWith(".c++"))
+ {
+ pbstrLanguage = "C++";
+ pguidLanguage = AD7Guids.guidLanguageCpp;
+ }
+
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the name of the stack frame. The name of a stack frame is typically the name of the method being executed.
+ /// Not implemented. (http://msdn.microsoft.com/en-us/library/bb145002.aspx)
+ ///
+ /// Returns the name of the stack frame.
+ /// Not implemented.
+ int IDebugStackFrame2.GetName(out string name)
+ {
+ name = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Gets a machine-dependent representation of the range of physical addresses associated with a stack frame.
+ /// Not implemented. (http://msdn.microsoft.com/en-us/library/bb145597.aspx)
+ ///
+ /// Returns the lowest physical address associated with this stack frame.
+ /// Returns the highest physical address associated with this stack frame.
+ /// Not implemented.
+ int IDebugStackFrame2.GetPhysicalStackRange(out ulong addressMin, out ulong addressMax)
+ {
+ addressMin = 0;
+ addressMax = 0;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Gets the thread associated with a stack frame. (http://msdn.microsoft.com/en-us/library/bb161776.aspx)
+ ///
+ /// Returns an IDebugThread2 object that represents the thread.
+ /// VSConstants.S_OK.
+ int IDebugStackFrame2.GetThread(out IDebugThread2 pThread)
+ {
+ pThread = _thread;
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+
+ #region IDebugExpressionContext2 Members
+
+ ///
+ /// Retrieves the name of the evaluation context. The name is the description of this evaluation context. It is typically
+ /// something that can be parsed by an expression evaluator that refers to this exact evaluation context. For example, in
+ /// C++ the name is as follows: "{ function-name, source-file-name, module-file-name }"
+ /// Not implemented. (http://msdn.microsoft.com/en-ca/library/bb161724.aspx)
+ ///
+ /// Returns the name of the evaluation context.
+ /// Not implemented.
+ int IDebugExpressionContext2.GetName(out string pbstrName)
+ {
+ pbstrName = null;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Parses a text-based expression for evaluation. (http://msdn.microsoft.com/en-ca/library/bb162304.aspx).
+ /// GDB will parse and evaluate the expression, returning the result or an error in the expression. So, the only task for this
+ /// method is to create the IDebugExpression2 object that will be sent indirectly to the methods responsible for the evaluation.
+ ///
+ /// The expression to be parsed.
+ /// A combination of flags from the PARSEFLAGS enumeration that controls parsing.
+ /// The radix to be used in parsing any numerical information in pszCode.
+ /// Returns the IDebugExpression2 object that represents the parsed expression, which is ready for binding and evaluation.
+ /// Returns the error message if the expression contains an error.
+ /// Returns the character index of the error in pszCode if the expression contains an error.
+ /// VSConstants.S_OK.
+ int IDebugExpressionContext2.ParseText(string pszCode,
+ enum_PARSEFLAGS dwFlags,
+ uint nRadix,
+ out IDebugExpression2 ppExpr,
+ out string pbstrError,
+ out uint pichError)
+ {
+ pbstrError = "";
+ pichError = 0;
+ ppExpr = new AD7Expression(pszCode, this, _engine.EventDispatcher);
+ return VSConstants.S_OK;
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/AD7.Impl/AD7Thread.cs b/src_vs2010/DebugEngine/AD7.Impl/AD7Thread.cs
new file mode 100644
index 00000000..f1bcda49
--- /dev/null
+++ b/src_vs2010/DebugEngine/AD7.Impl/AD7Thread.cs
@@ -0,0 +1,666 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using BlackBerry.NativeCore;
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Debugger.Interop;
+using System.Collections;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class represents a thread running in a program and it implements:
+ ///
+ /// IDebugThread2: (http://msdn.microsoft.com/en-ca/library/bb145332.aspx)
+ ///
+ /// IDebugThread100: (http://msdn.microsoft.com/en-us/library/ff471152.aspx)
+ ///
+ public sealed class AD7Thread : IDebugThread2, IDebugThread100
+ {
+ #region Internal Types
+
+ ///
+ /// Thread's category, from http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/807e26cc-4f3f-4e90-a9a8-b550d484b8c1
+ ///
+ enum enum_THREADCATEGORY
+ {
+ THREADCATEGORY_Worker = 0,
+ THREADCATEGORY_UI = (THREADCATEGORY_Worker + 1),
+ THREADCATEGORY_Main = (THREADCATEGORY_UI + 1),
+ THREADCATEGORY_RPC = (THREADCATEGORY_Main + 1),
+ THREADCATEGORY_Unknown = (THREADCATEGORY_RPC + 1)
+ }
+
+ #endregion
+
+ ///
+ /// The AD7Engine object that represents the DE.
+ ///
+ public AD7Engine _engine;
+
+ ///
+ /// Thread's name.
+ ///
+ public string _threadDisplayName;
+
+ ///
+ /// The suspend count determines how many times the IDebugThread2::Suspend method has been called so far.
+ ///
+ public uint _suspendCount;
+
+ ///
+ /// Full long path file name.
+ ///
+ public string _filename;
+
+ ///
+ /// Line number.
+ ///
+ public uint _line;
+
+ ///
+ /// Contains flags that specifies the information that were already verified about this thread's stack frame object.
+ /// Used to avoid reevaluating stack frames that were already evaluated.
+ ///
+ public int _alreadyEvaluated;
+
+ ///
+ /// Contains the stack frames for this thread
+ ///
+ public ArrayList __stackFrames;
+
+ ///
+ /// A FRAMEINFO structure that is filled in with the description of the previous stack frame that works as a cache, to avoid
+ /// reevaluate the stack frame again.
+ ///
+ public FRAMEINFO[] previousFrameInfoArray = new FRAMEINFO[0];
+
+ ///
+ /// Thread's ID.
+ ///
+ public string _id;
+
+ ///
+ /// Thread's state.
+ ///
+ public string _state;
+
+ ///
+ /// Process' ID + Thread's ID.
+ ///
+ public string _targetID;
+
+ ///
+ /// Thread's priority.
+ ///
+ public string _priority;
+
+
+ ///
+ /// Constructor.
+ ///
+ /// The AD7Engine object that represents the DE.
+ /// Thread's ID.
+ /// Process' ID + Thread's ID.
+ /// Thread's state.
+ /// Thread's priority.
+ /// Thread's name.
+ /// Full short path file name.
+ /// Line number.
+ public AD7Thread(AD7Engine engine, string id, string targetID, string state, string priority, string name, string filename, string line)
+ {
+ if (engine == null)
+ throw new ArgumentNullException("engine");
+
+ _engine = engine;
+ _suspendCount = 0;
+ if (id == "1")
+ _threadDisplayName = "Main Thread";
+ else
+ _threadDisplayName = (name != "") ? name : "";
+
+ _filename = NativeMethods.GetLongPathName(filename);
+ uint.TryParse(line, out _line); // stopping on that exception was just horrible...
+ _id = id;
+ _state = state;
+ _targetID = targetID;
+ _priority = priority;
+ }
+
+ ///
+ /// Called by EventDipatcher to set the current location during break mode.
+ ///
+ /// Full short path file name.
+ /// Line number.
+ public void SetCurrentLocation(string filename, uint line)
+ {
+ _filename = NativeMethods.GetLongPathName(filename);
+ _line = line;
+ }
+
+ ///
+ /// Gets the function name.
+ ///
+ /// If successful, returns the function name; otherwise, returns "".
+ public string GetFunctionName()
+ {
+ string func = "";
+
+ if ((_id != "") && (_id != _engine.CurrentThread()._id))
+ _engine.EventDispatcher.SelectThread(_id);
+
+ string stackResponse = _engine.EventDispatcher.GetStackFrames().Replace("#;;;;", "");
+
+ if (stackResponse != "")
+ {
+ string[] frameStrings = stackResponse.Split('#');
+
+ // Query the stack depth without inquiring GDB.
+ int numStackFrames = frameStrings.Length;
+
+ if (numStackFrames > 30) // limiting the amount of stackFrames to avoid VS crashing.
+ numStackFrames = 30;
+
+ for (int i = 0; i < numStackFrames; i++)
+ {
+ string[] frameInfo = frameStrings[i].Split(';');
+ if (frameInfo.Length >= 2)
+ {
+ if ((frameInfo[2] != "") && (frameInfo[2] != "??") && (!frameInfo[2].Contains("object.")))
+ {
+ func = frameInfo[2];
+ break;
+ }
+ }
+ }
+
+ if ((_id != "") && (_id != _engine.CurrentThread()._id))
+ _engine.EventDispatcher.SelectThread(_engine.CurrentThread()._id);
+ }
+
+ return func;
+ }
+
+ ///
+ /// Determines whether the next statement can be set to the given stack frame and code context. Not implemented.
+ /// (http://msdn.microsoft.com/en-ca/library/bb146582.aspx)
+ ///
+ /// Reserved for future use; set to a null value. If this is a null value, use the current
+ /// stack frame.
+ /// An IDebugCodeContext2 object that describes the code location about to be executed and
+ /// its context.
+ /// VSConstants.S_OK.
+ int IDebugThread2.CanSetNextStatement(IDebugStackFrame2 stackFrame, IDebugCodeContext2 codeContext)
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Retrieves a list of the stack frames for this thread. (http://msdn.microsoft.com/en-ca/library/bb145138.aspx)
+ ///
+ /// A combination of flags from the FRAMEINFO_FLAGS enumeration that specifies which fields of the FRAMEINFO structures are to be filled out.
+ /// Radix used in formatting numerical information in the enumerator.
+ /// Returns an IEnumDebugFrameInfo2 object that contains a list of FRAMEINFO structures describing the stack frame.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ int IDebugThread2.EnumFrameInfo(enum_FRAMEINFO_FLAGS flags, uint radix, out IEnumDebugFrameInfo2 ppEnum)
+ {
+ if (_id == "")
+ {
+ ppEnum = null;
+ return VSConstants.S_FALSE;
+ }
+
+ if (_engine.EvaluatedTheseFlags(_id, flags))
+ {
+ ppEnum = new AD7FrameInfoEnum(previousFrameInfoArray);
+ return VSConstants.S_OK;
+ }
+
+ // Ask for general stack information.
+ if ((_id != "") && (_id != _engine.CurrentThread()._id))
+ _engine.EventDispatcher.SelectThread(_id);
+
+ string stackResponse = _engine.EventDispatcher.GetStackFrames().Replace("#;;;;", "");
+ if (stackResponse == "")
+ {
+ ppEnum = null;
+ return VSConstants.S_FALSE;
+ }
+ string[] frameStrings = stackResponse.Split('#');
+
+ // Query the stack depth without inquiring GDB.
+ int numStackFrames = frameStrings.Length;
+
+ if (numStackFrames > 30) // limiting the amount of stackFrames to avoid VS crashing.
+ numStackFrames = 30;
+
+ ppEnum = null;
+ try
+ {
+ bool created = false;
+ FRAMEINFO[] frameInfoArray = new FRAMEINFO[numStackFrames];
+ for (int i = 0; i < numStackFrames; i++)
+ {
+ string[] frameInfo = frameStrings[i].Split(';');
+ if (frameInfo.Length >= 3)
+ {
+ frameInfo[3] = NativeMethods.GetLongPathName(frameInfo[3]);
+ AD7StackFrame frame = AD7StackFrame.Create(_engine, this, frameInfo, ref created);
+ frame.SetFrameInfo(flags, out frameInfoArray[i]);
+ }
+ }
+ if ((previousFrameInfoArray.Length != frameInfoArray.Length) || created)
+ {
+ previousFrameInfoArray = frameInfoArray;
+ ppEnum = new AD7FrameInfoEnum(frameInfoArray);
+ }
+ else
+ {
+ bool isEqual = true;
+ for (int i = 0; i < frameInfoArray.Length; i++)
+ {
+ if (frameInfoArray[i].m_bstrFuncName != previousFrameInfoArray[i].m_bstrFuncName)
+ {
+ isEqual = false;
+ break;
+ }
+ if (frameInfoArray[i].m_dwValidFields != previousFrameInfoArray[i].m_dwValidFields)
+ {
+ isEqual = false;
+ break;
+ }
+ if (frameInfoArray[i].m_bstrLanguage != previousFrameInfoArray[i].m_bstrLanguage)
+ {
+ isEqual = false;
+ break;
+ }
+ }
+ if (!isEqual)
+ {
+ previousFrameInfoArray = frameInfoArray;
+ ppEnum = new AD7FrameInfoEnum(frameInfoArray);
+ }
+ else
+ {
+ ppEnum = new AD7FrameInfoEnum(previousFrameInfoArray);
+ }
+ }
+
+ if ((_id != "") && (_id != _engine.CurrentThread()._id))
+ _engine.EventDispatcher.SelectThread(_engine.CurrentThread()._id);
+
+ return VSConstants.S_OK;
+ }
+ catch (Exception ex)
+ {
+ if ((_id != "") && (_id != _engine.CurrentThread()._id))
+ _engine.EventDispatcher.SelectThread(_engine.CurrentThread()._id);
+ return EngineUtils.UnexpectedException(ex);
+ }
+ }
+
+ ///
+ /// Gets the logical thread associated with this physical thread. Not implemented.
+ /// (http://msdn.microsoft.com/en-ca/library/bb161676.aspx)
+ ///
+ /// An IDebugStackFrame2 object that represents the stack frame.
+ /// Returns an IDebugLogicalThread2 interface that represents the associated logical
+ /// thread. A debug engine implementation should set this to a null value.
+ /// VSConstants.S_OK.
+ int IDebugThread2.GetLogicalThread(IDebugStackFrame2 stackFrame, out IDebugLogicalThread2 ppLogicalThread)
+ {
+ ppLogicalThread = null;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the name of a thread. (http://msdn.microsoft.com/en-ca/library/bb162273.aspx)
+ ///
+ /// Returns the name of the thread.
+ /// VSConstants.S_OK.
+ int IDebugThread2.GetName(out string pbstrName)
+ {
+ pbstrName = _threadDisplayName;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the program in which a thread is running. (http://msdn.microsoft.com/en-ca/library/bb147002.aspx)
+ ///
+ /// Returns an IDebugProgram2 object that represents the program this thread is running in.
+ /// VSConstants.S_OK.
+ int IDebugThread2.GetProgram(out IDebugProgram2 ppProgram)
+ {
+ ppProgram = _engine.Program;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the system thread identifier. (http://msdn.microsoft.com/en-ca/library/bb161964.aspx)
+ ///
+ /// Returns the system thread identifier.
+ /// VSConstants.S_OK.
+ int IDebugThread2.GetThreadId(out uint pThreadId)
+ {
+ try
+ {
+ pThreadId = Convert.ToUInt32(_id);
+ }
+ catch
+ {
+ pThreadId = 0;
+ }
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the properties that describe this thread. (http://msdn.microsoft.com/en-ca/library/bb145602.aspx)
+ ///
+ /// A combination of flags from the THREADPROPERTY_FIELDS enumeration that determines which fields of
+ /// ptp are to be filled in.
+ /// A THREADPROPERTIES structure that that is filled in with the properties of the thread.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ int IDebugThread2.GetThreadProperties(enum_THREADPROPERTY_FIELDS fields, THREADPROPERTIES[] pThreadProperties)
+ {
+ try
+ {
+ if ((fields & enum_THREADPROPERTY_FIELDS.TPF_ID) != 0)
+ {
+ try
+ {
+ pThreadProperties[0].dwThreadId = Convert.ToUInt32(_id);
+ }
+ catch
+ {
+ pThreadProperties[0].dwThreadId = 0;
+ }
+ pThreadProperties[0].dwFields |= enum_THREADPROPERTY_FIELDS.TPF_ID;
+ }
+ if ((fields & enum_THREADPROPERTY_FIELDS.TPF_SUSPENDCOUNT) != 0)
+ {
+ // VSNDK debug engine doesn't support suspending threads
+ pThreadProperties[0].dwFields |= enum_THREADPROPERTY_FIELDS.TPF_SUSPENDCOUNT;
+ }
+ if ((fields & enum_THREADPROPERTY_FIELDS.TPF_STATE) != 0)
+ {
+ if (_state == "running")
+ pThreadProperties[0].dwThreadState = (uint)enum_THREADSTATE.THREADSTATE_RUNNING;
+ else
+ pThreadProperties[0].dwThreadState = (uint)enum_THREADSTATE.THREADSTATE_STOPPED;
+ pThreadProperties[0].dwFields |= enum_THREADPROPERTY_FIELDS.TPF_STATE;
+ }
+ if ((fields & enum_THREADPROPERTY_FIELDS.TPF_PRIORITY) != 0)
+ {
+ pThreadProperties[0].bstrPriority = "Normal";
+ pThreadProperties[0].dwFields |= enum_THREADPROPERTY_FIELDS.TPF_PRIORITY;
+ }
+ if ((fields & enum_THREADPROPERTY_FIELDS.TPF_NAME) != 0)
+ {
+ pThreadProperties[0].bstrName = _threadDisplayName;
+ pThreadProperties[0].dwFields |= enum_THREADPROPERTY_FIELDS.TPF_NAME;
+ }
+ if ((fields & enum_THREADPROPERTY_FIELDS.TPF_LOCATION) != 0)
+ {
+ pThreadProperties[0].bstrLocation = "";
+ if (__stackFrames != null)
+ {
+ foreach (AD7StackFrame frame in __stackFrames)
+ {
+ if (frame._functionName != "")
+ {
+ pThreadProperties[0].bstrLocation = frame._functionName;
+ break;
+ }
+ }
+ }
+ if (pThreadProperties[0].bstrLocation == "")
+ pThreadProperties[0].bstrLocation = "[External Code]";
+
+ pThreadProperties[0].dwFields |= enum_THREADPROPERTY_FIELDS.TPF_LOCATION;
+ }
+
+ return VSConstants.S_OK;
+ }
+ catch (Exception ex)
+ {
+ return EngineUtils.UnexpectedException(ex);
+ }
+ }
+
+ ///
+ /// Resumes execution of a thread. (http://msdn.microsoft.com/en-ca/library/bb145813.aspx)
+ ///
+ /// Returns the suspend count after the resume operation.
+ /// VSConstants.S_OK.
+ int IDebugThread2.Resume(out uint pSuspendCount)
+ {
+ _suspendCount--;
+ pSuspendCount = _suspendCount;
+ if (_suspendCount == 0)
+ {
+ // Send GDB command to resume execution of thread
+ }
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Sets the next statement to the given stack frame and code context. Not implemented.
+ /// (http://msdn.microsoft.com/en-ca/library/bb160944.aspx)
+ ///
+ /// Reserved for future use; set to a null value.
+ /// An IDebugCodeContext2 object that describes the code location about to be executed and
+ /// its context.
+ /// VSConstants.S_OK.
+ int IDebugThread2.SetNextStatement(IDebugStackFrame2 stackFrame, IDebugCodeContext2 codeContext)
+ {
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Sets the name of the thread. (http://msdn.microsoft.com/en-ca/library/bb162322.aspx)
+ ///
+ /// The name of the thread.
+ /// VSConstants.S_OK.
+ int IDebugThread2.SetThreadName(string name)
+ {
+ _threadDisplayName = name;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Suspends a thread. (http://msdn.microsoft.com/en-us/library/bb145297.aspx)
+ ///
+ /// Returns the suspend count after the suspend operation.
+ /// VSConstants.S_OK
+ int IDebugThread2.Suspend(out uint pSuspendCount)
+ {
+ _suspendCount++;
+ pSuspendCount = _suspendCount;
+ return VSConstants.S_OK;
+ }
+
+ #region IDebugThread100 Members
+
+ ///
+ /// Sets the name of the thread.
+ /// (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugthread100.setthreaddisplayname.aspx)
+ ///
+ /// The name of the thread.
+ /// VSConstants.S_OK.
+ int IDebugThread100.SetThreadDisplayName(string name)
+ {
+ _threadDisplayName = name;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Gets the name of a thread.
+ /// (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugthread100.getthreaddisplayname.aspx)
+ ///
+ /// Returns the name of the thread.
+ /// VSConstants.S_OK.
+ int IDebugThread100.GetThreadDisplayName(out string name)
+ {
+ name = _threadDisplayName;
+ return VSConstants.S_OK;
+ }
+
+ ///
+ /// Returns whether this thread can be used to do function/property evaluation. Not implemented.
+ /// (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugthread100.candofunceval.aspx)
+ ///
+ /// VSConstants.S_FALSE.
+ int IDebugThread100.CanDoFuncEval()
+ {
+ return VSConstants.S_FALSE;
+ }
+
+ ///
+ /// Set flags. Not implemented.
+ /// (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugthread100.setflags.aspx)
+ ///
+ /// Flags.
+ /// VSConstants.E_NOTIMPL.
+ int IDebugThread100.SetFlags(uint flags)
+ {
+ // Not necessary to implement in the debug engine. Instead it is implemented in the SDM.
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Get flags. Not implemented.
+ /// (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugthread100.getflags.aspx)
+ ///
+ /// Flags.
+ /// VSConstants.E_NOTIMPL.
+ int IDebugThread100.GetFlags(out uint flags)
+ {
+ // Not necessary to implement in the debug engine. Instead it is implemented in the SDM.
+ flags = 0;
+ return EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Gets the properties that describe this thread.
+ /// (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugthread100.getthreadproperties100.aspx)
+ ///
+ /// A combination of flags from the THREADPROPERTIES100 enumeration that determines which fields of
+ /// ptp are to be filled in.
+ /// A THREADPROPERTIES100 structure that that is filled in with the properties of the thread.
+ /// If successful, returns S_OK; otherwise, returns an error code.
+ int IDebugThread100.GetThreadProperties100(uint fields, THREADPROPERTIES100[] pThreadproperties)
+ {
+ try
+ {
+ if ((fields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_ID) != 0)
+ {
+ try
+ {
+ pThreadproperties[0].dwThreadId = Convert.ToUInt32(_id);
+ }
+ catch
+ {
+ pThreadproperties[0].dwThreadId = 0;
+ }
+ pThreadproperties[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_ID;
+ }
+ if ((fields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_SUSPENDCOUNT) != 0)
+ {
+ // VSNDK debug engine doesn't support suspending threads
+ pThreadproperties[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_SUSPENDCOUNT;
+ }
+ if ((fields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_STATE) != 0)
+ {
+ if (_state == "running")
+ pThreadproperties[0].dwThreadState = (uint)enum_THREADSTATE.THREADSTATE_RUNNING;
+ else
+ pThreadproperties[0].dwThreadState = (uint)enum_THREADSTATE.THREADSTATE_STOPPED;
+ pThreadproperties[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_STATE;
+ }
+ if ((fields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_PRIORITY) != 0)
+ {
+ pThreadproperties[0].bstrPriority = "Normal";
+ pThreadproperties[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_PRIORITY;
+ }
+ if ((fields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_NAME) != 0)
+ {
+ pThreadproperties[0].bstrName = _threadDisplayName;
+ pThreadproperties[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_NAME;
+ }
+ if ((fields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_DISPLAY_NAME) != 0)
+ {
+ // Thread display name is being requested
+ pThreadproperties[0].bstrDisplayName = _threadDisplayName;
+ pThreadproperties[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_DISPLAY_NAME;
+
+ // Give this display name a higher priority than the default (0)
+ // so that it will actually be displayed
+ pThreadproperties[0].DisplayNamePriority = 10;
+ pThreadproperties[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_DISPLAY_NAME_PRIORITY;
+ }
+ if ((fields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_LOCATION) != 0)
+ {
+ pThreadproperties[0].bstrLocation = "";
+ if (__stackFrames != null)
+ {
+ foreach (AD7StackFrame frame in __stackFrames)
+ {
+ if ((frame._functionName != "") && (frame._functionName != "??"))
+ {
+ pThreadproperties[0].bstrLocation = frame._functionName;
+ break;
+ }
+ }
+ }
+ else
+ pThreadproperties[0].bstrLocation = GetFunctionName();
+
+ if (pThreadproperties[0].bstrLocation == "")
+ pThreadproperties[0].bstrLocation = "[External Code]";
+
+ pThreadproperties[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_LOCATION;
+ }
+ if ((fields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_CATEGORY) != 0)
+ {
+ if (_id == "1")
+ pThreadproperties[0].dwThreadCategory = (uint)enum_THREADCATEGORY.THREADCATEGORY_Main;
+ else
+ pThreadproperties[0].dwThreadCategory = (uint)enum_THREADCATEGORY.THREADCATEGORY_Worker;
+ pThreadproperties[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_CATEGORY;
+ }
+ if ((fields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_AFFINITY) != 0)
+ {
+ // Thread cpu affinity is being requested
+ pThreadproperties[0].AffinityMask = 0;
+ pThreadproperties[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_AFFINITY;
+ }
+
+ if ((fields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_PRIORITY_ID) != 0)
+ {
+ // Thread display name is being requested
+ pThreadproperties[0].priorityId = 0;
+ pThreadproperties[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_PRIORITY_ID;
+ }
+ return VSConstants.S_OK;
+ }
+ catch (Exception ex)
+ {
+ return EngineUtils.UnexpectedException(ex);
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/src_vs2010/DebugEngine/BlackBerry.DebugEngine.csproj b/src_vs2010/DebugEngine/BlackBerry.DebugEngine.csproj
new file mode 100644
index 00000000..b4343f42
--- /dev/null
+++ b/src_vs2010/DebugEngine/BlackBerry.DebugEngine.csproj
@@ -0,0 +1,126 @@
+
+
+
+ Debug
+ AnyCPU
+ 8.0.30703
+ 2.0
+ {59A7B188-E307-4495-A3AF-4ED76B086A87}
+ Library
+ Properties
+ BlackBerry.DebugEngine
+ BlackBerry.DebugEngine
+ v4.0
+ 512
+
+
+ true
+ full
+ false
+ bin\Debug\
+ TRACE;DEBUG;PLATFORM_VS2010
+ prompt
+ 4
+ true
+ AnyCPU
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE;PLATFORM_VS2010
+ prompt
+ 4
+ AnyCPU
+
+
+
+
+ False
+ C:\Program Files (x86)\Microsoft Visual Studio 2010 SDK SP1\VisualStudioIntegration\Common\Assemblies\v4.0\Microsoft.VisualStudio.Shell.10.0.dll
+
+
+
+ False
+ True
+ C:\Program Files (x86)\Microsoft Visual Studio 2010 SDK SP1\VisualStudioIntegration\Common\Assemblies\v2.0\Microsoft.VisualStudio.Shell.Interop.10.0.dll
+
+
+ False
+ C:\Program Files (x86)\Microsoft Visual Studio 2008 SDK\VisualStudioIntegration\Common\Assemblies\Microsoft.VisualStudio.Shell.Interop.8.0.dll
+
+
+ False
+ C:\Program Files (x86)\Microsoft Visual Studio 2008 SDK\VisualStudioIntegration\Common\Assemblies\Microsoft.VisualStudio.Shell.Interop.9.0.dll
+
+
+
+
+ False
+ ..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio 2010 SDK\VisualStudioIntegration\Common\Assemblies\v2.0\Microsoft.VisualStudio.Debugger.Interop.10.0.dll
+
+
+ False
+ ..\..\..\..\..\Microsoft.VisualStudio.Debugger.InteropA.dll
+
+
+
+
+ NativeMethods.cs
+
+
+ Helpers\MessageBoxHelper.cs
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {36D4495B-9A92-478F-BF95-AEA13804A7BA}
+ BlackBerry.NativeCore
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src_vs2010/DebugEngine/DebugEngineStatus.cs b/src_vs2010/DebugEngine/DebugEngineStatus.cs
new file mode 100644
index 00000000..76159c3f
--- /dev/null
+++ b/src_vs2010/DebugEngine/DebugEngineStatus.cs
@@ -0,0 +1,14 @@
+namespace BlackBerry.DebugEngine
+{
+ public static class DebugEngineStatus
+ {
+ ///
+ /// Gets or sets an indication, if the DebugEngine is running.
+ ///
+ public static bool IsRunning
+ {
+ get;
+ set;
+ }
+ }
+}
diff --git a/src_vs2010/DebugEngine/Engine.Impl/BreakpointManager.cs b/src_vs2010/DebugEngine/Engine.Impl/BreakpointManager.cs
new file mode 100644
index 00000000..147edee1
--- /dev/null
+++ b/src_vs2010/DebugEngine/Engine.Impl/BreakpointManager.cs
@@ -0,0 +1,150 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using System.Collections.Generic;
+using BlackBerry.NativeCore.Debugger.Model;
+using Microsoft.VisualStudio.Debugger.Interop;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class manages breakpoints for the engine.
+ ///
+ public sealed class BreakpointManager
+ {
+ ///
+ /// The AD7Engine object that represents the DE.
+ ///
+ private readonly AD7Engine _engine;
+
+ ///
+ /// List of pending breakpoints.
+ ///
+ private readonly List _pendingBreakpoints;
+
+ ///
+ /// List of active breakpoints.
+ ///
+ private readonly List _activeBPs;
+
+ ///
+ /// Breakpoint manager constructor.
+ ///
+ /// Associated Debug Engine.
+ public BreakpointManager(AD7Engine engine)
+ {
+ if (engine == null)
+ throw new ArgumentNullException("engine");
+
+ _engine = engine;
+ _pendingBreakpoints = new List();
+ _activeBPs = new List();
+ }
+
+ ///
+ /// A helper method used to construct a new pending breakpoint.
+ ///
+ /// An IDebugBreakpointRequest2 object that describes the pending breakpoint to create.
+ /// Returns an IDebugPendingBreakpoint2 object that represents the pending breakpoint.
+ public void CreatePendingBreakpoint(IDebugBreakpointRequest2 request, out IDebugPendingBreakpoint2 ppPendingBreakpoint)
+ {
+ AD7PendingBreakpoint pendingBreakpoint = new AD7PendingBreakpoint(_engine, request);
+ ppPendingBreakpoint = pendingBreakpoint;
+ _pendingBreakpoints.Add(pendingBreakpoint);
+ }
+
+ ///
+ /// Return the active bound breakpoint matching the given GDB ID.
+ ///
+ /// Breakpoint ID in GDB.
+ /// If successful, returns the active bound breakpoint; otherwise, returns null.
+ public AD7BoundBreakpoint GetBoundBreakpointForGDBID(uint gdbID)
+ {
+ foreach (AD7BoundBreakpoint breakpoint in _activeBPs)
+ {
+ if (breakpoint != null && breakpoint.GdbInfo.ID == gdbID)
+ {
+ return breakpoint;
+ }
+ }
+ return null;
+ }
+
+ ///
+ /// Called from the engine's detach method to remove the debugger's breakpoint instructions.
+ ///
+ public void ClearBoundBreakpoints()
+ {
+ foreach (AD7PendingBreakpoint breakpoint in _pendingBreakpoints)
+ {
+ breakpoint.ClearBoundBreakpoints();
+ }
+ }
+
+ ///
+ /// Creates an entry and remotely enables the breakpoint in the debug stub.
+ ///
+ /// The bound breakpoint to add.
+ /// Info about GDB breakpoint.
+ public void RemoteAdd(AD7BoundBreakpoint breakpoint, out BreakpointInfo info)
+ {
+ // Call GDB to set a breakpoint based on filename and line no. in aBBP
+ bool ret = false;
+
+ info = null;
+ if (breakpoint.m_bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FILE_LINE)
+ {
+ ret = _engine.EventDispatcher.SetBreakpoint(breakpoint.m_filename, breakpoint.m_line, out info);
+ }
+ else if (breakpoint.m_bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FUNC_OFFSET)
+ {
+ ret = _engine.EventDispatcher.SetBreakpoint(breakpoint.m_func, out info);
+ }
+
+ if (ret && info != null)
+ {
+ _activeBPs.Add(breakpoint);
+ }
+ }
+
+ ///
+ /// Enable bound breakpoint.
+ ///
+ /// The Bound breakpoint to enable.
+ public void RemoteEnable(AD7BoundBreakpoint breakpoint)
+ {
+ _engine.EventDispatcher.EnableBreakpoint(breakpoint.GdbInfo.ID, true);
+ }
+
+ ///
+ /// Disable bound breakpoint.
+ ///
+ /// The Bound breakpoint to disable.
+ public void RemoteDisable(AD7BoundBreakpoint breakpoint)
+ {
+ _engine.EventDispatcher.EnableBreakpoint(breakpoint.GdbInfo.ID, false);
+ }
+
+ ///
+ /// Remove the associated bound breakpoint.
+ ///
+ /// The breakpoint to remove.
+ public void RemoteDelete(AD7BoundBreakpoint breakpoint)
+ {
+ _activeBPs.Remove(breakpoint);
+ _engine.EventDispatcher.DeleteBreakpoint(breakpoint.GdbInfo.ID);
+ }
+ }
+}
diff --git a/src_vs2010/DebugEngine/Engine.Impl/EngineCallback.cs b/src_vs2010/DebugEngine/Engine.Impl/EngineCallback.cs
new file mode 100644
index 00000000..230a84ad
--- /dev/null
+++ b/src_vs2010/DebugEngine/Engine.Impl/EngineCallback.cs
@@ -0,0 +1,216 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using System.Collections.Generic;
+using Microsoft.VisualStudio.Debugger.Interop;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// Used to send events to the debugger. Some examples of these events are thread create, exception thrown, module load.
+ ///
+ public sealed class EngineCallback
+ {
+ ///
+ /// The IDebugEventCallback2 object that receives debugger events.
+ ///
+ private readonly IDebugEventCallback2 _ad7Callback;
+
+ ///
+ /// The AD7Engine object that represents the DE.
+ ///
+ private readonly AD7Engine _engine;
+
+ ///
+ /// Constructor.
+ ///
+ /// The AD7Engine object that represents the DE.
+ /// The IDebugEventCallback2 object that receives debugger events.
+ public EngineCallback(AD7Engine engine, IDebugEventCallback2 ad7Callback)
+ {
+ if (engine == null)
+ throw new ArgumentNullException("engine");
+ if (ad7Callback == null)
+ throw new ArgumentNullException("ad7Callback");
+
+ _engine = engine;
+ _ad7Callback = ad7Callback;
+ }
+
+ ///
+ /// Send events to the debugger.
+ ///
+ /// Event object to be sent to the debugger.
+ /// ID of the event.
+ /// A program that is running in a process.
+ /// A thread running in a program.
+ public void Send(IDebugEvent2 eventObject, string iidEvent, IDebugProgram2 program, IDebugThread2 thread)
+ {
+ uint attributes;
+ Guid riidEvent = new Guid(iidEvent);
+
+ EngineUtils.RequireOK(eventObject.GetAttributes(out attributes));
+
+ if ((thread == null) && (_engine != null) && (_engine.Threads != null) && (program != null) && (eventObject != null) && (riidEvent != null) && (attributes != 0))
+ {
+ if (_engine._currentThreadIndex != -1)
+ {
+ EngineUtils.RequireOK(_ad7Callback.Event(_engine, null, program, _engine.Threads[_engine._currentThreadIndex], eventObject, ref riidEvent, attributes));
+ }
+ else
+ {
+ if (_engine.Threads != null)
+ EngineUtils.RequireOK(_ad7Callback.Event(_engine, null, program, _engine.Threads[0], eventObject, ref riidEvent, attributes));
+ else
+ EngineUtils.RequireOK(_ad7Callback.Event(_engine, null, program, null, eventObject, ref riidEvent, attributes));
+ }
+ }
+ else
+ EngineUtils.RequireOK(_ad7Callback.Event(_engine, null, program, thread, eventObject, ref riidEvent, attributes));
+ }
+
+ ///
+ /// Call the method that will send the event to the debugger with all the arguments.
+ ///
+ /// Event object to be sent to the debugger.
+ /// ID of the event.
+ /// A thread running in a program.
+ public void Send(IDebugEvent2 eventObject, string iidEvent, IDebugThread2 thread)
+ {
+ Send(eventObject, iidEvent, _engine, thread);
+ }
+
+ ///
+ /// IDebugErrorEvent2 is used to report error messages to the user when something goes wrong in the debug engine.
+ /// The VSNDK debug engine doesn't take advantage of this. Not implemented.
+ ///
+ ///
+ public void OnError(int hrErr)
+ {
+ }
+
+ ///
+ /// The VSNDK debug engine does not support binding breakpoints as modules load since the primary exe is the only module
+ /// symbols are loaded for. A production debugger will need to bind breakpoints when a new module is loaded.
+ ///
+ /// A module loaded in the debugged process.
+ public void OnModuleLoad(AD7Module debuggedModule)
+ {
+ AD7ModuleLoadEvent eventObject = new AD7ModuleLoadEvent(debuggedModule, true /* this is a module load */);
+ Send(eventObject, AD7ModuleLoadEvent.IID, null);
+ }
+
+ ///
+ /// Send to the session debug manager (SDM) an event to output a string.
+ /// Not used.
+ ///
+ /// The output string.
+ public void OnOutputString(string outputString)
+ {
+ AD7OutputDebugStringEvent eventObject = new AD7OutputDebugStringEvent(outputString);
+ Send(eventObject, AD7OutputDebugStringEvent.IID, null);
+ }
+
+ ///
+ /// Send an event to SDM with the breakpoint that was hit.
+ ///
+ /// The thread running in a program.
+ /// List of bound breakpoints. At this moment, this list has only one element.
+ public void OnBreakpoint(AD7Thread thread, IList clients)
+ {
+ IDebugBoundBreakpoint2[] boundBreakpoints = new IDebugBoundBreakpoint2[clients.Count];
+
+ int i = 0;
+ foreach (var breakpoint in clients)
+ {
+ boundBreakpoints[i++] = breakpoint;
+ }
+
+ AD7BoundBreakpointsEnum boundBreakpointsEnum = new AD7BoundBreakpointsEnum(boundBreakpoints);
+ AD7BreakpointEvent eventObject = new AD7BreakpointEvent(boundBreakpointsEnum);
+ Send(eventObject, AD7BreakpointEvent.IID, thread);
+ }
+
+ ///
+ // Exception events are sent when an exception occurs in the debugged that the debugger was not expecting.
+ // The VSNDK debug engine does not support these. Not implemented.
+ ///
+ public void OnException()
+ {
+ EngineUtils.NotImplemented();
+ }
+
+ ///
+ /// Step complete is sent when a step has finished. Not implemented.
+ ///
+ public void OnStepComplete()
+ {
+ EngineUtils.NotImplemented();
+ // AD7StepCompletedEvent.Send(m_engine);
+ // TODO: implement this method...
+ }
+
+ ///
+ /// This will get called when the engine receives the breakpoint event that is created when the user
+ /// hits the pause button in VS.
+ ///
+ /// The thread running in a program.
+ public void OnAsyncBreakComplete(AD7Thread thread)
+ {
+ AD7AsyncBreakCompleteEvent eventObject = new AD7AsyncBreakCompleteEvent();
+ Send(eventObject, AD7AsyncBreakCompleteEvent.IID, thread);
+ }
+
+ ///
+ /// Engines notify the debugger about the results of a symbol search by sending an instance of IDebugSymbolSearchEvent2.
+ /// Not used.
+ ///
+ ///
+ ///
+ ///
+ public void OnSymbolSearch(AD7Module module, string status, uint dwStatusFlags)
+ {
+ string statusString = (dwStatusFlags == 1 ? "Symbols loaded - " : "No symbols loaded - ") + status;
+
+ AD7SymbolSearchEvent eventObject = new AD7SymbolSearchEvent(module, statusString, dwStatusFlags);
+ Send(eventObject, AD7SymbolSearchEvent.IID, null);
+ }
+
+ ///
+ /// Engines notify the debugger that a breakpoint has bound through the breakpoint bound event.
+ ///
+ /// The bounded breakpoint.
+ /// 0.
+ public void OnBreakpointBound(object objBoundBreakpoint, uint address)
+ {
+ AD7BoundBreakpoint boundBreakpoint = (AD7BoundBreakpoint)objBoundBreakpoint;
+ IDebugPendingBreakpoint2 pendingBreakpoint;
+ ((IDebugBoundBreakpoint2)boundBreakpoint).GetPendingBreakpoint(out pendingBreakpoint);
+
+ AD7BreakpointBoundEvent eventObject = new AD7BreakpointBoundEvent((AD7PendingBreakpoint)pendingBreakpoint, boundBreakpoint);
+ Send(eventObject, AD7BreakpointBoundEvent.IID, null);
+ }
+
+ ///
+ /// Send an event to notify the SDM that this thread was created.
+ ///
+ /// The new thread running in a program.
+ public void OnThreadStart(AD7Thread debuggedThread)
+ {
+ AD7ThreadCreateEvent eventObject = new AD7ThreadCreateEvent();
+ Send(eventObject, AD7ThreadCreateEvent.IID, debuggedThread);
+ }
+ }
+}
diff --git a/src_vs2010/DebugEngine/Engine.Impl/EngineUtils.cs b/src_vs2010/DebugEngine/Engine.Impl/EngineUtils.cs
new file mode 100644
index 00000000..a481f149
--- /dev/null
+++ b/src_vs2010/DebugEngine/Engine.Impl/EngineUtils.cs
@@ -0,0 +1,95 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using BlackBerry.NativeCore.Diagnostics;
+using Microsoft.VisualStudio;
+using System.Diagnostics;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// Some utilities used in VSNDK debug engine projects.
+ ///
+ public static class EngineUtils
+ {
+ ///
+ ///
+ ///
+ /// An integer result of COM operation.
+ public static void RequireOK(int hr)
+ {
+ if (hr != VSConstants.S_OK)
+ {
+ throw new InvalidOperationException();
+ }
+ }
+
+ ///
+ ///
+ ///
+ /// Exception.
+ /// VSConstants.E_NOTIMPL.
+ public static int UnexpectedException(Exception ex)
+ {
+ TraceLog.WriteException(ex);
+
+ Debug.Fail("Unexpected exception: " + ex);
+ return VSConstants.E_FAIL;
+ }
+
+ ///
+ /// Default handler for 'non-implemented' method.
+ /// It will conditionally stop the debugger, when called.
+ ///
+ [DebuggerStepThrough]
+ public static int NotImplemented(bool canBreak)
+ {
+ TraceLog.WriteLine("Hit not implemented method \"{0}\"!", GetMethodName(2));
+ if (canBreak && Debugger.IsAttached)
+ Debugger.Break();
+
+ return VSConstants.E_NOTIMPL;
+ }
+
+ ///
+ /// Default handler for 'non-implemented' method.
+ /// It will stop the debugger, when called, as the original place was not supposed to be called by Visual Studio.
+ ///
+ [DebuggerStepThrough]
+ public static int NotImplemented()
+ {
+ TraceLog.WriteLine("Hit not implemented method \"{0}\"!", GetMethodName(2));
+ if (Debugger.IsAttached)
+ Debugger.Break();
+
+ return VSConstants.E_NOTIMPL;
+ }
+
+ ///
+ /// Gets the name of the method from stack.
+ ///
+ [DebuggerStepThrough]
+ private static string GetMethodName(int backCalls)
+ {
+ StackTrace stack = new StackTrace();
+ StackFrame frame = stack.GetFrame(backCalls);
+
+ var method = frame.GetMethod();
+ if (method != null && method.DeclaringType != null)
+ return string.Concat(method.DeclaringType.Name, "::", method.Name, "()");
+ return "";
+ }
+ }
+}
diff --git a/src_vs2010/DebugEngine/Engine.Impl/EventDispatcher.cs b/src_vs2010/DebugEngine/Engine.Impl/EventDispatcher.cs
new file mode 100644
index 00000000..b83c246c
--- /dev/null
+++ b/src_vs2010/DebugEngine/Engine.Impl/EventDispatcher.cs
@@ -0,0 +1,922 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using BlackBerry.NativeCore;
+using BlackBerry.NativeCore.Debugger;
+using BlackBerry.NativeCore.Debugger.Model;
+using Microsoft.VisualStudio.Debugger.Interop;
+using System.Threading;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class manages debug events for the debug engine.
+ ///
+ /// Process GDB's output by classifying it by type (e.g. breakpoint event) and providing relevant data.
+ /// Send GDB commands as appropriate for the received event (e.g. call -exec-continue to resume execution after a breakpoint is
+ /// inserted).
+ /// Call debug engine methods to notify the SDM of an event (e.g. if a breakpoint is hit, call EngineCallback.OnBreakpoint()).
+ ///
+ public sealed class EventDispatcher : IDisposable
+ {
+ #region Internal Classes
+
+ ///
+ /// Process asynchronous GDB's output by classifying it by type (e.g. breakpoint event).
+ ///
+ sealed class GdbOutput
+ {
+ ///
+ /// This object manages debug events in the engine.
+ ///
+ private readonly EventDispatcher _eventDispatcher;
+
+ ///
+ /// This object manages breakpoints events.
+ ///
+ private HandleBreakpoints _hBreakpoints;
+
+ ///
+ /// This object manages events related to execution control (processes, threads, programs).
+ ///
+ private HandleProcessExecution _hProcExe;
+
+ ///
+ /// This object manages events related to output messages.
+ ///
+ private HandleOutputs _hOutputs;
+
+ ///
+ /// Constructor.
+ ///
+ /// This object manages debug events in the engine.
+ public GdbOutput(EventDispatcher ed)
+ {
+ _eventDispatcher = ed;
+ IsRunning = true;
+ GdbWrapper.Received += GdbOnReceivedResponse;
+ GdbWrapper.UnexpectedlyClosed += GdbOnUnexpectedlyClosed;
+ }
+
+ private void GdbOnUnexpectedlyClosed(object sender, EventArgs e)
+ {
+ Dispose();
+ _eventDispatcher.EndDebugSession(0);
+ }
+
+ private void GdbOnReceivedResponse(object sender, ResponseParsedEventArgs e)
+ {
+ Debug.Assert(e != null && e.Response != null && e.Response.RawData != null, "Invalid response object received");
+ ProcessingGdbOutput(e.ParsedResult);
+ }
+
+ public void Dispose()
+ {
+ GdbWrapper.UnexpectedlyClosed -= GdbOnUnexpectedlyClosed;
+ GdbWrapper.Received -= GdbOnReceivedResponse;
+ }
+
+ #region Properties
+
+ ///
+ /// Corresponds to the event-dispatcher status. When false, exit the event dispatch loop.
+ ///
+ public bool IsRunning
+ {
+ get;
+ set;
+ }
+
+ #endregion
+
+ ///
+ /// Thread responsible for handling asynchronous GDB output.
+ ///
+ private void ProcessingGdbOutput(string parsedResponse)
+ {
+ string[] events = parsedResponse.Replace("\r\n", "@").Split('@');
+ foreach (string ev in events)
+ {
+ if (ev.Length > 1) // only to avoid empty events, when there are two delimiters characters together.
+ {
+ if (_eventDispatcher.countSIGINT > 0)
+ if ((ev.Substring(0, 2) != "50") && (ev.Substring(0, 2) != "80"))
+ _eventDispatcher.countSIGINT = 0; // Reset the counter, if GDB has recovered from a GDB bug.
+ switch (ev[0])
+ {
+ case '0': // Events related to starting GDB.
+ break;
+ case '1': // Not used.
+ break;
+ case '2': // Events related to breakpoints (including breakpoint hits).
+ _hBreakpoints = new HandleBreakpoints(_eventDispatcher);
+ _hBreakpoints.Handle(ev);
+ break;
+ case '3': // Not used.
+ break;
+ case '4': // Events related to execution control (processes, threads, programs) 1.
+ _hProcExe = new HandleProcessExecution(_eventDispatcher);
+ _hProcExe.Handle(ev);
+ break;
+ case '5': // Events related to execution control (processes, threads, programs and GDB Bugs) 2.
+ _hProcExe = new HandleProcessExecution(_eventDispatcher);
+ _hProcExe.Handle(ev);
+ break;
+ case '6': // Events related to evaluating expressions. Not used.
+ break;
+ case '7': // Events related to stack frames. Not used.
+ break;
+ case '8': // Events related to output.
+ _hOutputs = new HandleOutputs(_eventDispatcher);
+ _hOutputs.Handle(ev);
+ break;
+ case '9': // Not used.
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ ///
+ /// Represents the object that process asynchronous GDB's output by classifying it by type (e.g. breakpoint event).
+ ///
+ private readonly GdbOutput _gdbOutput;
+
+ ///
+ /// Boolean variable that indicates if the current code is known or unknown, i.e., if there is a source code file associated.
+ ///
+ public static bool _unknownCode;
+
+ ///
+ /// Object used to control the access to the critical section that exists in the "lockedBreakpoint" method.
+ ///
+ private readonly object _lockBreakpoint = new object();
+
+ ///
+ /// Object used to control the access to the critical section that exists in the "unlockBreakpoint" method.
+ ///
+ private readonly object _unlockBreakpoint = new object();
+
+ ///
+ /// Object used to control the access to the critical section that exists in the "enterCriticalRegion" method.
+ ///
+ private readonly object _criticalRegion = new object();
+
+ ///
+ /// Object used to control the access to the critical section that exists in the "leaveCriticalRegion" method.
+ ///
+ private readonly object _leaveCriticalRegion = new object();
+
+ ///
+ /// Boolean variable that indicates the GDB state: TRUE -> run mode; FALSE -> break mode.
+ ///
+ public static bool _GDBRunMode = true;
+
+ ///
+ /// Variable that is manipulated only in methods enterCriticalRegion and leaveCriticalRegion
+ ///
+ public bool _inCriticalRegion;
+
+ ///
+ /// There is a GDB bug that causes a message "Quit (expect signal SIGINT when the program is resumed)". If this message occurs
+ /// 5 times, VSNDK will end the debug session. That's why this variable is needed, to count the amount of this kind of message
+ /// that is received in a sequence.
+ ///
+ public int countSIGINT;
+
+ #region Properties
+
+ ///
+ /// The public AD7Engine object that represents the DE.
+ ///
+ public AD7Engine Engine
+ {
+ get;
+ private set;
+ }
+
+ #endregion
+
+ ///
+ /// Constructor. Starts the thread responsible for handling asynchronous GDB output.
+ ///
+ /// The AD7Engine object that represents the DE.
+ public EventDispatcher(AD7Engine engine)
+ {
+ if (engine == null)
+ throw new ArgumentNullException("engine");
+
+ Engine = engine;
+
+ _gdbOutput = new GdbOutput(this);
+ }
+
+ #region IDisposable Implementation
+
+ ~EventDispatcher()
+ {
+ Dispose(false);
+ }
+
+ ///
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ ///
+ /// 2
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ private void Dispose(bool disposing)
+ {
+ _gdbOutput.Dispose();
+ }
+
+ #endregion
+
+ ///
+ /// Ends the debug session by closing GDB, sending the appropriate events to the SDM, and breaking out of all
+ /// buffer- and event-listening loops.
+ ///
+ /// The exit code.
+ public void EndDebugSession(uint exitCode)
+ {
+ // Exit the event dispatch loop.
+ _gdbOutput.IsRunning = false;
+
+ // Send events to the SDM.
+ AD7ThreadDestroyEvent.Send(Engine, exitCode, null);
+ AD7ProgramDestroyEvent.Send(Engine, exitCode);
+
+ // Exit GDB.
+ GdbWrapper.Exit();
+
+ // Notify the AddIn that this debug session has ended.
+ DebugEngineStatus.IsRunning = false;
+ }
+
+ ///
+ /// Interrupt the debugged process if necessary before changing a breakpoint.
+ ///
+ public void PrepareToModifyBreakpoint()
+ {
+ if (Engine.State != AD7Engine.DebugEngineState.Design
+ && Engine.State != AD7Engine.DebugEngineState.Break)
+ {
+ HandleProcessExecution.NeedsResumeAfterInterrupt = true;
+ Engine.CauseBreak();
+ }
+ }
+
+ ///
+ /// If the process was running when the breakpoint was changed, resume the process.
+ ///
+ public void ResumeFromInterrupt()
+ {
+ if (HandleProcessExecution.NeedsResumeAfterInterrupt)
+ {
+ HandleProcessExecution.NeedsResumeAfterInterrupt = false;
+ ContinueExecution();
+ }
+ }
+
+ ///
+ /// Code to set the breakpoint in GDB and then confirm and set in Visual Studio
+ ///
+ /// Initial command to set the breakpoint in GDB, with the entire path when setting
+ /// a breakpoint in a given line number.
+ /// Initial command to set the breakpoint in GDB, with only the file name when setting
+ /// a breakpoint in a given line number, or "" when setting a breakpoint in a function.
+ /// Returns the breakpoint info from GDB.
+ /// If successful, returns true; otherwise, returns false.
+ private bool SetBreakpointImpl(string command, string command2, out BreakpointInfo breakpointInfo)
+ {
+ string response;
+ string bpointAddress;
+ string bpointStopPoint;
+
+ if (DebugEngineStatus.IsRunning)
+ {
+ PrepareToModifyBreakpoint();
+
+ // Gets the parsed response for the GDB/MI command that inserts breakpoint in a given line or a given function.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Breakpoint-Commands.html)
+ response = GdbWrapper.SendCommand(command, 6);
+
+ if ((command2 != "") && ((response.Contains(""))))
+ {
+ response = GdbWrapper.SendCommand(command2, 6);
+ }
+
+ if (((response.Length < 2) && (DebugEngineStatus.IsRunning == false)) || (response == "Function not found!"))
+ {
+ breakpointInfo = null;
+ ResumeFromInterrupt();
+ return false;
+ }
+
+ HandleBreakpoints hBreakpoints = new HandleBreakpoints(this);
+ hBreakpoints.Handle(response);
+
+ if (hBreakpoints.Address != "" && hBreakpoints.Address != "")
+ {
+ //** Run Code to verify breakpoint stop point.
+
+ // Gets the parsed response for the GDB command that print information about the specified breakpoint, in this
+ // case, only its address. (http://sourceware.org/gdb/onlinedocs/gdb/Set-Breaks.html)
+ bpointAddress = GdbWrapper.SendCommand("info b " + hBreakpoints.Number, 18);
+
+ // Gets the parsed response for the GDB command that inquire what source line covers a particular address.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/Machine-Code.html)
+ bpointStopPoint = GdbWrapper.SendCommand("info line *" + bpointAddress, 18);
+
+ var line = (uint)Convert.ToInt64(bpointStopPoint.Trim());
+ uint address = 0;
+
+ if (hBreakpoints.Address != null && hBreakpoints.Address.Length > 2)
+ {
+ uint.TryParse(hBreakpoints.Address.Substring(2), System.Globalization.NumberStyles.HexNumber, null, out address);
+ }
+ breakpointInfo = new BreakpointInfo((uint)hBreakpoints.Number, hBreakpoints.FileName, line, address);
+ }
+ else
+ {
+ var line = (uint)hBreakpoints.LinePosition;
+ breakpointInfo = new BreakpointInfo((uint)hBreakpoints.Number, hBreakpoints.FileName, line, 0);
+ }
+
+ ResumeFromInterrupt();
+ return true;
+ }
+
+ breakpointInfo = null;
+ return false;
+ }
+
+ ///
+ /// Set a breakpoint given a filename and line number.
+ ///
+ /// Full path and filename for the code source.
+ /// The line number for the breakpoint.
+ /// Info of GDB breakpoint.
+ /// If successful, returns true; otherwise, returns false.
+ public bool SetBreakpoint(string filename, uint line, out BreakpointInfo breakpoint)
+ {
+ string cmd = @"-break-insert --thread-group i1 -f " + filename + ":" + line;
+ string cmd2 = @"-break-insert --thread-group i1 -f " + NativeMethods.GetShortPathName(filename) + ":" + line;
+ return SetBreakpointImpl(cmd, cmd2, out breakpoint);
+ }
+
+ ///
+ /// Set a breakpoint given a function name.
+ ///
+ /// Function name.
+ /// Info of GDB breakpoint.
+ /// If successful, returns true; otherwise, returns false.
+ public bool SetBreakpoint(string functionName, out BreakpointInfo breakpoint)
+ {
+ string cmd = @"-break-insert " + functionName;
+ return SetBreakpointImpl(cmd, "", out breakpoint);
+ }
+
+ ///
+ /// Ignore a given number of hit counts in GDB.
+ ///
+ /// Breakpoint ID in GDB.
+ /// Number of hit counts to ignore.
+ /// If successful, returns true; otherwise, returns false.
+ public bool IgnoreHitCount(uint GDB_ID, int ignore)
+ {
+ ignore -= 1; // The given number is decreased by one, because the VS command means to break when hit count is equal or greater
+ // than X hits. So, the equivalent GDB command is to break after (X - 1) hit counts.
+
+ if (ignore < 0)
+ {
+ // Had to ignore the biggest number of times to keep the breakpoint enabled and to avoid stopping on it.
+ ignore = int.MaxValue;
+ }
+
+ // Gets the parsed response for the GDB/MI command that makes the breakpoint "GDB_ID" ignore "ignore" hit counts.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Breakpoint-Commands.html)
+ string response = GdbWrapper.SendCommand(@"-break-after " + GDB_ID + " " + ignore, 18);
+
+ if (response == "")
+ return false;
+
+ HandleBreakpoints hBreakpoints = new HandleBreakpoints(this);
+ hBreakpoints.Handle(response);
+
+ return true;
+ }
+
+ ///
+ /// Reset current hit count in GDB. There is no way to reset hit counts in GDB. To implement this functionality, the specified GDB
+ /// breakpoint is deleted and a new one is created with the same conditions, substituting the GDB_ID of the VS breakpoint.
+ ///
+ /// The VS breakpoint.
+ /// Is false when this method is called by SetCondition, true if not. Used to avoid setting
+ /// breakpoint conditions again in case it is called by SetCondition method.
+ /// If successful, returns true; otherwise, returns false.
+ public bool ResetHitCount(AD7BoundBreakpoint bbp, bool resetCondition)
+ {
+ // Declare local Variables
+ BreakpointInfo info = null;
+
+ // Deleting GDB breakpoint.
+ DeleteBreakpoint(bbp.GdbInfo.ID);
+
+ // Creating a new GDB breakpoint.
+ bool ret = false;
+ if (bbp.m_bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FILE_LINE)
+ {
+ ret = SetBreakpoint(bbp.m_filename, bbp.m_line, out info);
+ }
+ else if (bbp.m_bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FUNC_OFFSET)
+ {
+ ret = SetBreakpoint(bbp.m_func, out info);
+ }
+
+ if (ret && info != null)
+ {
+ bbp.GdbInfo = info;
+ bbp._hitCount = 0;
+ bbp.SetPassCount(bbp.m_bpPassCount);
+ if (resetCondition)
+ bbp.SetCondition(bbp.m_bpCondition);
+
+ return true;
+ }
+ return false;
+ }
+
+ ///
+ /// Set breakpoint condition in GDB.
+ ///
+ /// Breakpoint ID in GDB.
+ /// Condition to be set. When empty (""), means to remove any previous condition.
+ /// If successful, returns true; otherwise, returns false.
+ public bool SetBreakpointCondition(uint GDB_ID, string condition)
+ {
+ // Gets the parsed response for the GDB/MI command that sets a condition to the breakpoint "GDB_ID". If there is no
+ // condition, any previous one associated to this breakpoint will be removed.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Breakpoint-Commands.html)
+ string response = GdbWrapper.SendCommand(string.Concat(@"-break-condition ", GDB_ID, string.IsNullOrEmpty(condition) ? string.Empty : " ", condition ?? string.Empty), 19);
+
+ if (response == "")
+ return false;
+
+ HandleBreakpoints hBreakpoints = new HandleBreakpoints(this);
+ hBreakpoints.Handle(response);
+ return true;
+ }
+
+ ///
+ /// Delete a breakpoint in GDB.
+ ///
+ /// Breakpoint ID in GDB.
+ /// If successful, returns true; otherwise, returns false.
+ public bool DeleteBreakpoint(uint GDB_ID)
+ {
+ if (_gdbOutput.IsRunning)
+ {
+ PrepareToModifyBreakpoint();
+
+ // Gets the parsed response for the GDB/MI command that deletes the breakpoint "GDB_ID".
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Breakpoint-Commands.html)
+ string response = GdbWrapper.SendCommand(@"-break-delete " + GDB_ID, 7);
+ if (string.IsNullOrEmpty(response))
+ {
+ ResumeFromInterrupt();
+ return false;
+ }
+
+ HandleBreakpoints hBreakpoints = new HandleBreakpoints(this);
+ hBreakpoints.Handle(response);
+ uint retID = (uint)hBreakpoints.Number;
+
+ ResumeFromInterrupt();
+
+ if (GDB_ID != retID)
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ ///
+ /// Enable or disable a breakpoint.
+ ///
+ /// Breakpoint ID in GDB.
+ /// If true, enable the breakpoint. If false, disable it.
+ /// If successful, returns true; otherwise, returns false.
+ public bool EnableBreakpoint(uint GDB_ID, bool enable)
+ {
+ PrepareToModifyBreakpoint();
+
+ // Gets the parsed response for the GDB/MI command that enables or disables the breakpoint "GDB_ID".
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Breakpoint-Commands.html)
+ string response = GdbWrapper.SendCommand(@"-break-" + (enable ? "enable" : "disable") + " " + GDB_ID, 8);
+
+ HandleBreakpoints hBreakpoints = new HandleBreakpoints(this);
+ hBreakpoints.Handle(response);
+ uint retID = (uint)hBreakpoints.Number;
+
+ ResumeFromInterrupt();
+ if (GDB_ID != retID)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Update hit count.
+ ///
+ /// Breakpoint ID in GDB.
+ /// Hit count.
+ public void UpdateHitCount(uint id, uint hitCount)
+ {
+ var bbp = Engine.BreakpointManager.GetBoundBreakpointForGDBID(id);
+ if (bbp != null)
+ {
+ if (!bbp._breakWhenCondChanged)
+ {
+ ((IDebugBoundBreakpoint2) bbp).SetHitCount(hitCount);
+ }
+ }
+ }
+
+ ///
+ /// Lock a breakpoint before updating its hit counts and/or condition. This is done to avoid a race condition that can happen when
+ /// user modifies a breakpoint condition at run time and the same breakpoint is hit. When that happens, only one event will be
+ /// handled at a time.
+ ///
+ /// Breakpoint to be locked.
+ /// True if user is adding/modifying count and conditions upon which a breakpoint is fired. It is also true
+ /// when event dispatcher is handling a breakpoint hit.
+ /// True if user is adding/modifying conditions under which a conditional breakpoint fires. It is also true
+ /// when event dispatcher is handling a breakpoint hit.
+ /// If successful, returns true; otherwise, returns false.
+ public bool LockedBreakpoint(AD7BoundBreakpoint bbp, bool hit, bool cond)
+ {
+ lock (_lockBreakpoint)
+ {
+ if (hit && cond)
+ {
+ if ((!bbp._blockedPassCount) && (!bbp._blockedConditional))
+ {
+ bbp._blockedPassCount = true;
+ bbp._blockedConditional = true;
+ return true;
+ }
+ }
+ else if (hit)
+ {
+ if (!bbp._blockedPassCount)
+ {
+ bbp._blockedPassCount = true;
+ return true;
+ }
+ }
+ else if (cond)
+ {
+ if (!bbp._blockedConditional)
+ {
+ bbp._blockedConditional = true;
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ ///
+ /// Unlock a breakpoint after updating its hit counts and/or condition. This is done to avoid a race condition that can happen when
+ /// user modifies a breakpoint condition at run time and the same breakpoint is hit. When that happens, only one event will be
+ /// handled at a time.
+ ///
+ /// Breakpoint to be locked.
+ /// True if user is adding/modifying count and conditions upon which a breakpoint is fired. It is also true
+ /// when event dispatcher is handling a breakpoint hit.
+ /// True if user is adding/modifying conditions under which a conditional breakpoint fires. It is also true
+ /// when event dispatcher is handling a breakpoint hit.
+ public void UnlockBreakpoint(AD7BoundBreakpoint bbp, bool hit, bool cond)
+ {
+ lock (_unlockBreakpoint)
+ {
+ if (hit && cond)
+ {
+ bbp._blockedPassCount = false;
+ bbp._blockedConditional = false;
+ }
+ else if (hit)
+ {
+ bbp._blockedPassCount = false;
+ }
+ else if (cond)
+ {
+ bbp._blockedConditional = false;
+ }
+ }
+ }
+
+ ///
+ /// Control access to a critical region, that manipulates some of the debug engine variables, like its state. This is done to
+ /// avoid a race condition that can happen when user modifies a breakpoint condition at run time and the same breakpoint is hit.
+ /// When that happens, only one event will be handled at a time.
+ ///
+ /// If successful, returns true; otherwise, returns false.
+ public bool EnterCriticalRegion()
+ {
+ lock (_criticalRegion)
+ {
+ if (!_inCriticalRegion)
+ {
+ _inCriticalRegion = true;
+ return true;
+ }
+ return false;
+ }
+ }
+
+ ///
+ /// Leave the critical region, that manipulates some of the debug engine variables, like its state. This is done to
+ /// avoid a race condition that can happen when user modifies a breakpoint condition at run time and the same breakpoint is hit.
+ /// When that happens, only one event will be handled at a time.
+ ///
+ public void LeaveCriticalRegion()
+ {
+ lock (_leaveCriticalRegion)
+ {
+ _inCriticalRegion = false;
+ }
+ }
+
+ ///
+ /// Update VS when a breakpoint is hit in GDB.
+ ///
+ /// Breakpoint ID from GDB.
+ /// Thread ID.
+ public void BreakpointHit(uint id, string threadID)
+ {
+ var xBoundBreakpoints = new List();
+
+ // Search the active bound BPs and find ones that match the ID.
+ var bbp = Engine.BreakpointManager.GetBoundBreakpointForGDBID(id);
+
+ if (bbp != null)
+ xBoundBreakpoints.Add(bbp);
+
+ if (bbp == null || xBoundBreakpoints.Count == 0)
+ {
+ // if no matching breakpoints are found then its one of the following:
+ // - Stepping operation
+ // - Code based break
+ // - Asm stepping
+ }
+ else
+ {
+ if (LockedBreakpoint(bbp, true, true))
+ {
+ while (!EnterCriticalRegion())
+ {
+ Thread.Sleep(0);
+ }
+
+ bool breakExecution = true;
+
+ if (bbp._breakWhenCondChanged)
+ {
+ string result;
+ bool valid = VariableInfo.EvaluateExpression(bbp.m_bpCondition.bstrCondition, out result, null);
+ if ((valid) && (bbp._previousCondEvaluation != result)) // check if condition evaluation has changed
+ {
+ if ((bbp.m_bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL) && (bbp._hitCount != bbp.m_bpPassCount.dwPassCount))
+ {
+ breakExecution = false;
+ }
+ else if ((bbp.m_bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER) && (bbp._hitCount < bbp.m_bpPassCount.dwPassCount))
+ {
+ breakExecution = false;
+ }
+ else if ((bbp.m_bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_MOD) && ((bbp._hitCount % bbp.m_bpPassCount.dwPassCount) != 0))
+ {
+ breakExecution = false;
+ }
+ bbp._previousCondEvaluation = result;
+ }
+ else
+ breakExecution = false;
+ }
+ if (!breakExecution) // must continue the execution
+ {
+ bool hitBreakAll = Engine._running.WaitOne(0);
+ if (hitBreakAll)
+ {
+ Engine.State = AD7Engine.DebugEngineState.Run;
+
+ // Sends the GDB command that resumes the execution of the inferior program.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
+ GdbWrapper.PostCommand(@"-exec-continue --thread-group i1");
+ _GDBRunMode = true;
+ Engine._running.Set();
+ }
+ }
+ else
+ {
+ if (bbp._breakWhenCondChanged)
+ bbp._hitCount += 1;
+
+ // Transition DE state
+ _GDBRunMode = false;
+ Engine.State = AD7Engine.DebugEngineState.Break;
+
+ // Found a bound breakpoint
+ Engine.Callback.OnBreakpoint(Engine.SelectThread(threadID), xBoundBreakpoints.AsReadOnly());
+
+ if (bbp._isHitCountEqual)
+ {
+ // Have to ignore the biggest number of times to keep the breakpoint enabled and to avoid stopping on it.
+ IgnoreHitCount(id, int.MaxValue);
+ }
+ else if (bbp._hitCountMultiple != 0)
+ {
+ IgnoreHitCount(id, (int)(bbp._hitCountMultiple - (bbp._hitCount % bbp._hitCountMultiple)));
+ }
+ }
+ LeaveCriticalRegion();
+ UnlockBreakpoint(bbp, true, true);
+ }
+ else
+ {
+ while (!EnterCriticalRegion())
+ {
+ Thread.Sleep(0);
+ }
+
+ bool hitBreakAll = Engine._running.WaitOne(0);
+ if (hitBreakAll)
+ {
+ Engine.State = AD7Engine.DebugEngineState.Run;
+
+ // Sends the GDB command that resumes the execution of the inferior program.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
+ GdbWrapper.PostCommand(@"-exec-continue --thread-group i1");
+ _GDBRunMode = true;
+ Engine._running.Set();
+ }
+
+ LeaveCriticalRegion();
+ }
+ }
+ }
+
+ ///
+ /// Return the depth of the stack.
+ ///
+ /// Thread ID.
+ /// Returns the stack depth.
+ public int GetStackDepth(string threadID)
+ {
+ // Returns the parsed response for the GDB/MI command that inquires about the depth of the stack.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Stack-Manipulation.html)
+ return Convert.ToInt32(GdbWrapper.SendCommand(@"-stack-info-depth --thread " + threadID + " --frame 0", 9));
+ }
+
+ ///
+ /// List the frames currently on the stack.
+ ///
+ /// Returns a string with the frames currently on the stack.
+ public string GetStackFrames()
+ {
+ // Returns the parsed response for the GDB/MI command that list the frames currently on the stack.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Stack-Manipulation.html)
+ return GdbWrapper.SendCommand(@"-stack-list-frames", 10);
+ }
+
+ ///
+ /// List the names of local variables and function arguments for the selected frame.
+ ///
+ /// Frame number.
+ /// Thread ID.
+ /// Returns a string with the names of local variables and function arguments for the selected frame.
+ public string GetVariablesForFrame(uint frameIndex, string threadID)
+ {
+ // Returns the parsed response for the GDB/MI command that list the names of local variables and function arguments for the
+ // selected frame. (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Stack-Manipulation.html)
+ return GdbWrapper.SendCommand(@"-stack-list-variables --thread " + threadID + " --frame " + frameIndex + " --simple-values", 11);
+ }
+
+ ///
+ /// Make "id" the current thread.
+ ///
+ /// Thread ID.
+ public void SelectThread(string id)
+ {
+ // Waits for the parsed response for the GDB/MI command that make "id" the current thread.
+ // (http://www.sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Thread-Commands.html)
+ GdbWrapper.SendCommand(@"-thread-select " + id, 12);
+ }
+
+ ///
+ /// Creates a variable object.
+ ///
+ /// Name of the variable.
+ /// Boolean value that indicates if the variable name has the prefix VsNdK_.
+ /// If successful, returns the variable's number of children; otherwise, returns string "ERROR".
+ public string CreateVariable(string name, out bool hasVsNdK)
+ {
+ hasVsNdK = false;
+
+ // Gets the variable's number of children after sending the following GDB/MI command to create a variable object.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Variable-Objects.html)
+ string response = GdbWrapper.SendCommand("-var-create " + name + " \"*\" " + name, 13);
+ if (response == "ERROR")
+ {
+ // The -var-create GDB/MI command can return an error when the variable name starts with some characters, like '_'.
+ // So, in case of an error, add the prefix VsNdK_ to the variable name and try to create it again.
+ response = GdbWrapper.SendCommand("-var-create VsNdK_" + name + " \"*\" " + name, 13);
+ if (response != "ERROR")
+ hasVsNdK = true;
+ }
+ return response;
+ }
+
+ ///
+ /// Deletes a previously created variable object and all of its children.
+ ///
+ /// Name of the variable.
+ /// Boolean value that indicates if the variable name has the prefix VsNdK_.
+ public void DeleteVariable(string name, bool hasVsNdK)
+ {
+ // Waits for the parsed response for the GDB/MI command that deletes a previously created variable object and all of
+ // its children. (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Variable-Objects.html)
+ if (!hasVsNdK)
+ GdbWrapper.SendCommand("-var-delete " + name, 14);
+ else
+ GdbWrapper.SendCommand("-var-delete VsNdK_" + name, 14);
+ }
+
+ ///
+ /// Return a list of the children of the specified variable object.
+ ///
+ /// Variable name.
+ /// Return a string that contains the list of the children of the specified variable object.
+ public string ListChildren(string name)
+ {
+ // Returns the parsed response for the GDB/MI command that list the children of the specified variable object.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Variable-Objects.html)
+ return GdbWrapper.SendCommand("-var-list-children --all-values " + name + " 0 50", 15);
+ }
+
+ ///
+ /// Kill the child process in which your program is running under gdb.
+ ///
+ public void KillProcess()
+ {
+ // Waits for the parsed response for the GDB command that kills the child process in which your program is running.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/Kill-Process.html#Kill-Process)
+ GdbWrapper.SendCommand("kill", 16);
+ }
+
+ ///
+ /// Called after the debug engine has set the initial breakpoints, or to resume a process that was interrupted.
+ ///
+ public void ContinueExecution()
+ {
+ //** Transition DE state
+ bool hitBreakAll = Engine._running.WaitOne(0);
+ if (hitBreakAll)
+ {
+ Engine.State = AD7Engine.DebugEngineState.Run;
+
+ // Sends the GDB command that resumes the execution of the inferior program.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
+ GdbWrapper.PostCommand(@"-exec-continue --thread-group i1");
+ _GDBRunMode = true;
+ Engine._running.Set();
+ }
+ }
+ }
+}
diff --git a/src_vs2010/DebugEngine/Engine.Impl/HandleBreakpoints.cs b/src_vs2010/DebugEngine/Engine.Impl/HandleBreakpoints.cs
new file mode 100644
index 00000000..690508fc
--- /dev/null
+++ b/src_vs2010/DebugEngine/Engine.Impl/HandleBreakpoints.cs
@@ -0,0 +1,315 @@
+using System;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class manages breakpoints events.
+ ///
+ public sealed class HandleBreakpoints
+ {
+ ///
+ /// GDB breakpoint ID.
+ ///
+ private int _number = -1;
+
+ /*
+ ///
+ /// Boolean variable that indicates if this breakpoint is enable (true) or disable (false).
+ ///
+ private bool _enabled;
+ */
+
+ ///
+ /// Breakpoint address.
+ ///
+ private string _address = "";
+
+ ///
+ /// Name of the function that contains this breakpoint.
+ ///
+ private string _functionName = "";
+
+ ///
+ /// File name that contains this breakpoint.
+ ///
+ private string _fileName = "";
+
+ ///
+ /// Line number for this breakpoint.
+ ///
+ private int _line = -1;
+
+ ///
+ /// Number of hits for this breakpoint.
+ ///
+ private int _hits = -1;
+
+ ///
+ /// Number of hits to be ignored by this breakpoint.
+ ///
+ private int _ignoreHits = -1;
+
+ ///
+ /// Condition associated to this breakpoint.
+ ///
+ private string _condition = "";
+
+ ///
+ /// Thread ID that was interrupted when this breakpoint was hit.
+ ///
+ private string _threadID = "";
+
+ ///
+ /// This object manages debug events in the engine.
+ ///
+ private readonly EventDispatcher _eventDispatcher;
+
+ ///
+ /// GDB_ID Property
+ ///
+ public int Number
+ {
+ get { return _number; }
+ }
+
+ ///
+ /// GDB Line Position Property
+ ///
+ public int LinePosition
+ {
+ get { return _line; }
+ }
+
+ ///
+ /// GDB File name
+ ///
+ public string FileName
+ {
+ get { return _fileName; }
+ }
+
+ ///
+ /// GDB Address
+ ///
+ public string Address
+ {
+ get { return _address; }
+ }
+
+ ///
+ /// Constructor.
+ ///
+ /// This object manages debug events in the engine.
+ public HandleBreakpoints(EventDispatcher ed)
+ {
+ _eventDispatcher = ed;
+ }
+
+ ///
+ /// This method manages breakpoints events by classifying each of them by sub-type (e.g. breakpoint inserted, modified, etc.).
+ ///
+ /// String that contains the event description.
+ public void Handle(string ev)
+ {
+ int ini;
+ int end;
+ switch (ev[1])
+ {
+ case '0':
+ // Breakpoint inserted (synchronous).
+ // Example: 20,1,y,0x0804d843,main,C:/Users/xxxxx/vsplugin-ndk/samples/Square/Square/main.c,319,0
+ ini = 3;
+ end = ev.IndexOf(';', 3);
+ _number = Convert.ToInt32(ev.Substring(ini, (end - ini)));
+
+ /*
+ if (ev[end + 1] == 'y')
+ _enabled = true;
+ else
+ _enabled = false;
+ */
+
+ ini = end + 3;
+ end = ev.IndexOf(';', ini);
+ _address = ev.Substring(ini, (end - ini));
+ if (_address == "")
+ {
+ _functionName = "??";
+ EventDispatcher._unknownCode = true;
+ _fileName = "";
+ _line = 0;
+ _hits = 0;
+ return;
+ }
+
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _functionName = ev.Substring(ini, end - ini);
+
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _fileName = ev.Substring(ini, end - ini);
+
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _line = Convert.ToInt32(ev.Substring(ini, (end - ini)));
+
+ ini = end + 1;
+ _hits = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
+
+ break;
+ case '1':
+ // Breakpoint modified (asynchronous).
+ // Example: 21,1,y,0x0804d843,main,C:/Users/xxxxxx/vsplugin-ndk/samples/Square/Square/main.c,318,1
+ ini = 3;
+ end = ev.IndexOf(';', 3);
+ _number = Convert.ToInt32(ev.Substring(ini, (end - ini))); ;
+
+ /*
+ if (ev[end + 1] == 'y')
+ _enabled = true;
+ else
+ _enabled = false;
+ */
+
+ ini = end + 3;
+ end = ev.IndexOf(';', ini);
+ _address = ev.Substring(ini, (end - ini));
+
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _functionName = ev.Substring(ini, end - ini);
+
+ // Need to set the flag for unknown code if necessary.
+ if (_functionName == "??")
+ {
+ EventDispatcher._unknownCode = true;
+ }
+ else
+ {
+ EventDispatcher._unknownCode = false;
+ }
+
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _fileName = ev.Substring(ini, end - ini);
+
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _line = Convert.ToInt32(ev.Substring(ini, (end - ini)));
+
+ ini = end + 1;
+ _hits = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
+
+ // Update hit count on affected bound breakpoint.
+ _eventDispatcher.UpdateHitCount((uint)_number, (uint)_hits);
+
+ break;
+ case '2':
+ // Breakpoint deleted asynchronously (a temporary breakpoint). Example: 22,2\r\n
+ _number = Convert.ToInt32(ev.Substring(3, (ev.Length - 3)));
+
+ break;
+ case '3':
+ // Breakpoint enabled. Example: 23 (enabled all) or 23,1 (enabled only breakpoint 1)
+ if (ev.Length > 2)
+ _number = Convert.ToInt32(ev.Substring(3, (ev.Length - 3)));
+ else
+ _number = 0; // 0 means ALL breakpoints.
+
+ break;
+ case '4':
+ // Breakpoint disabled. Example: 24 (disabled all) or 24,1 (disabled only breakpoint 1)
+ if (ev.Length > 2)
+ _number = Convert.ToInt32(ev.Substring(3, (ev.Length - 3)));
+ else
+ _number = 0; // 0 means ALL breakpoints.
+
+ break;
+ case '5':
+ // Breakpoint deleted. Example: 25 (deleted all) or 25,1 (deleted only breakpoint 1)
+ if (ev.Length > 2)
+ _number = Convert.ToInt32(ev.Substring(3, (ev.Length - 3)));
+ else
+ _number = 0; // 0 means ALL breakpoints.
+
+ break;
+ case '6':
+ // Break after "n" hits (or ignore n hits). Example: 26;1;100
+ ini = 3;
+ end = ev.IndexOf(';', 3);
+ _number = Convert.ToInt32(ev.Substring(3, (end - 3)));
+
+ ini = end + 1;
+ _ignoreHits = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
+
+ break;
+ case '7':
+ // Breakpoint hit.
+ // Example: 27,1,C:/Users/xxxxxx/vsplugin-ndk/samples/Square/Square/main.c,319;1\r\n
+ bool updatingCondBreak = _eventDispatcher.Engine._updatingConditionalBreakpoint.WaitOne(0);
+ if (updatingCondBreak)
+ {
+
+ _eventDispatcher.Engine.ResetStackFrames();
+
+ ini = 3;
+ end = ev.IndexOf(';', ini);
+ _number = Convert.ToInt32(ev.Substring(ini, (end - ini)));
+
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _fileName = ev.Substring(ini, end - ini);
+
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _line = Convert.ToInt32(ev.Substring(ini, (end - ini)));
+
+ ini = end + 1;
+ _threadID = ev.Substring(ini, (ev.Length - ini));
+
+ _eventDispatcher.Engine.CleanEvaluatedThreads();
+
+ // Call the method/event that will stop SDM because a breakpoint was hit here.
+ if (_eventDispatcher.Engine._updateThreads)
+ {
+ _eventDispatcher.Engine.UpdateListOfThreads();
+ }
+ _eventDispatcher.Engine.SelectThread(_threadID).SetCurrentLocation(_fileName, (uint)_line);
+ _eventDispatcher.Engine.SetAsCurrentThread(_threadID);
+
+ // A breakpoint can be hit during a step
+ if (_eventDispatcher.Engine.State == AD7Engine.DebugEngineState.Step)
+ {
+ HandleProcessExecution.OnStepCompleted(_eventDispatcher, _fileName, (uint)_line);
+ }
+ else
+ {
+ _eventDispatcher.BreakpointHit((uint)_number, _threadID);
+ }
+ _eventDispatcher.Engine._updatingConditionalBreakpoint.Set();
+ }
+ break;
+ case '8':
+ // Breakpoint condition set. Example: 28;1;expression
+ ini = 3;
+ end = ev.IndexOf(';', 3);
+ if (end != -1)
+ {
+ _number = Convert.ToInt32(ev.Substring(3, (end - 3)));
+
+ ini = end + 1;
+ _condition = ev.Substring(ini, (ev.Length - ini));
+ }
+ else
+ {
+ _number = Convert.ToInt32(ev.Substring(3));
+ _condition = "";
+ }
+ break;
+ case '9': // Error in testing breakpoint condition
+ break;
+ }
+ }
+ }
+}
diff --git a/src_vs2010/DebugEngine/Engine.Impl/HandleOutputs.cs b/src_vs2010/DebugEngine/Engine.Impl/HandleOutputs.cs
new file mode 100644
index 00000000..f5b8a8c7
--- /dev/null
+++ b/src_vs2010/DebugEngine/Engine.Impl/HandleOutputs.cs
@@ -0,0 +1,70 @@
+using System;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class manages events related to output messages.
+ ///
+ public sealed class HandleOutputs
+ {
+ ///
+ /// GDB textual output from the running target to be presented in the VS standard output window.
+ ///
+ private string _stdOut = "";
+
+ ///
+ /// Other GDB messages to be presented in the VS standard output window.
+ ///
+ private string _console = "";
+
+ ///
+ /// This object manages debug events in the engine.
+ ///
+ private EventDispatcher _eventDispatcher;
+
+ ///
+ /// Constructor.
+ ///
+ /// This object manages debug events in the engine.
+ public HandleOutputs(EventDispatcher eventDispatcher)
+ {
+ if (eventDispatcher == null)
+ throw new ArgumentNullException("eventDispatcher");
+
+ _eventDispatcher = eventDispatcher;
+ }
+
+ ///
+ /// This method manages events related to output messages by classifying each of them by sub-type.
+ ///
+ /// String that contains the event description.
+ public void Handle(string ev)
+ {
+ int ini;
+ int end;
+ switch (ev[1])
+ {
+ case '0': // Display the m_console message in the VS output window. Example: 80,\"\"[New pid 15380494 tid 2]\\n\"\"!80
+ ini = 4;
+ end = ev.IndexOf("\"!80", 4);
+ if (end == -1)
+ end = ev.Length;
+ _console = ev.Substring(ini, (end - ini));
+
+ // TODO: Call the method/event that will output this message in the VS output window.
+
+ break;
+ case '1': // Display the m_stdOut message in the VS standard output window. Instruction should look like this: 81,\"\" ... "\"!81
+ ini = 4;
+ end = ev.IndexOf("\"!81", 4);
+ if (end == -1)
+ end = ev.Length;
+ _stdOut = ev.Substring(ini, (end - ini));
+
+ // TODO: Call the method/event that will output this message in the VS standar output window.
+
+ break;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src_vs2010/DebugEngine/Engine.Impl/HandleProcessExecution.cs b/src_vs2010/DebugEngine/Engine.Impl/HandleProcessExecution.cs
new file mode 100644
index 00000000..a9e52670
--- /dev/null
+++ b/src_vs2010/DebugEngine/Engine.Impl/HandleProcessExecution.cs
@@ -0,0 +1,576 @@
+using System;
+using System.Threading;
+using System.Windows.Forms;
+using BlackBerry.NativeCore.Diagnostics;
+using BlackBerry.Package.Helpers;
+using Microsoft.VisualStudio.Debugger.Interop;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class manages events related to execution control (processes, threads, programs).
+ ///
+ public sealed class HandleProcessExecution
+ {
+ ///
+ /// Thread ID.
+ ///
+ private int _threadId = -1; // when threadId is 0, it means all threads.
+
+ ///
+ /// Process ID.
+ ///
+ private int _processId = -1;
+
+ ///
+ /// Name of the signal that caused an interruption.
+ ///
+ private string _signalName = "";
+
+ ///
+ /// Meaning of the signal that caused an interruption.
+ ///
+ private string _signalMeaning = "";
+
+ ///
+ /// File name.
+ ///
+ private string _fileName = "";
+
+ ///
+ /// Line number.
+ ///
+ private int _line = -1;
+
+ ///
+ /// Address.
+ ///
+ private int _address = -1;
+
+ ///
+ /// Function name.
+ ///
+ private string _functionName = "";
+
+ ///
+ /// Error caused by a GDB command that failed.
+ ///
+ private string _error = "";
+
+ ///
+ /// This object manages debug events in the engine.
+ ///
+ private readonly EventDispatcher _eventDispatcher;
+
+ ///
+ /// Boolean variable that indicates if GDB has to resume execution after handling what caused it to enter in break mode.
+ ///
+ public static bool NeedsResumeAfterInterrupt;
+
+ ///
+ /// Used as a communication signal between the Event Dispatcher and the debug engine method responsible for stopping GDB
+ /// execution (IDebugEngine2.CauseBreak()). So, VS is able to wait for GDB's interruption before entering in break mode.
+ ///
+ public static ManualResetEvent m_mre = new ManualResetEvent(false);
+
+ ///
+ /// Constructor.
+ ///
+ /// This object manages debug events in the engine.
+ public HandleProcessExecution(EventDispatcher eventDispatcher)
+ {
+ if (eventDispatcher == null)
+ throw new ArgumentNullException("eventDispatcher");
+
+ _eventDispatcher = eventDispatcher;
+ }
+
+ ///
+ /// This method manages events related to execution control by classifying each of them by sub-type (e.g. thread created, program interrupted, etc.).
+ ///
+ /// String that contains the event description.
+ public void Handle(string ev)
+ {
+ int ini = 0;
+ int end = 0;
+ int numCommas = 0;
+ switch (ev[0])
+ {
+ case '4':
+ switch (ev[1])
+ {
+ case '0':
+ // Thread created. Example: 40,2,20537438
+ EventDispatcher._GDBRunMode = true;
+ ini = 3;
+ end = ev.IndexOf(";", 3);
+ _threadId = Convert.ToInt32(ev.Substring(ini, (end - ini)));
+
+ ini = end + 1;
+ try
+ {
+ _processId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
+ }
+ catch
+ {
+ _processId = 0;
+ }
+
+ _eventDispatcher.Engine._updateThreads = true;
+
+ break;
+ case '1':
+ // Process running. Example: 41,1 (when threadId is 0 means "all threads": example: 41,0)
+ EventDispatcher._GDBRunMode = true;
+ _threadId = Convert.ToInt32(ev.Substring(3, (ev.Length - 3)));
+
+ break;
+ case '2':
+ // Program exited normally. Example: 42
+ _eventDispatcher.EndDebugSession(0);
+
+ break;
+ case '3':
+ // Program was exited with an exit code. Example: 43,1;1 (not sure if there is a threadID, but the last ";" exist)
+ // TODO: not tested yet
+ end = ev.IndexOf(";", 3);
+ uint exitCode = Convert.ToUInt32(ev.Substring(3, (end - 3)));
+ _eventDispatcher.EndDebugSession(exitCode);
+
+ break;
+ case '4':
+ // Program interrupted.
+ // Examples:
+ // 44,ADDR,FUNC,THREAD-ID
+ // 44,ADDR,FUNC,FILENAME,LINE,THREAD-ID
+
+ _eventDispatcher.Engine.ResetStackFrames();
+ EventDispatcher._GDBRunMode = false;
+ numCommas = 0;
+ foreach (char c in ev)
+ {
+ if (c == ';')
+ numCommas++;
+ }
+
+ ini = 3;
+ end = ev.IndexOf(';', ini);
+ _address = Convert.ToInt32(ev.Substring(ini, (end - ini)), 16);
+
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _functionName = ev.Substring(ini, (end - ini));
+
+ if (_functionName == "??")
+ {
+ EventDispatcher._unknownCode = true;
+ }
+ else
+ {
+ EventDispatcher._unknownCode = false;
+ }
+
+ switch (numCommas)
+ {
+ case 3:
+ // Thread ID
+ ini = end + 1;
+ try
+ {
+ _threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
+ }
+ catch (Exception ex)
+ {
+ _threadId = -1;
+ TraceLog.WriteException(ex, "Unable to parse ThreadID from: \"{0}\"", ev);
+ }
+ EventDispatcher._unknownCode = true;
+ break;
+ case 4:
+ // Filename and line number
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _fileName = ev.Substring(ini, (end - ini));
+
+ ini = end + 1;
+ _line = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
+ break;
+ case 5:
+ // Filename, line number and thread ID
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _fileName = ev.Substring(ini, (end - ini));
+
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _line = Convert.ToInt32(ev.Substring(ini, (end - ini)));
+
+ ini = end + 1;
+ _threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
+ break;
+ }
+
+ _eventDispatcher.Engine.CleanEvaluatedThreads();
+
+
+ if (_eventDispatcher.Engine._updateThreads)
+ {
+ _eventDispatcher.Engine.UpdateListOfThreads();
+ }
+ if (_threadId > 0)
+ {
+ var thread =_eventDispatcher.Engine.SelectThread(_threadId.ToString());
+
+ if (thread != null)
+ {
+ thread.SetCurrentLocation(_fileName, (uint) _line);
+ _eventDispatcher.Engine.SetAsCurrentThread(_threadId.ToString());
+ }
+ }
+
+ // Call the method/event that will let SDM know that the debugged program was interrupted.
+ OnInterrupt(_threadId);
+
+ // Signal that interrupt is processed
+ m_mre.Set();
+
+ break;
+
+ case '5':
+ // End-stepping-range.
+ _eventDispatcher.Engine.ResetStackFrames();
+ EventDispatcher._GDBRunMode = false;
+ ini = 3;
+ end = ev.IndexOf(';', 3);
+ if (end == -1)
+ end = ev.Length;
+ string temp = ev.Substring(ini, (end - ini));
+
+ ini = end + 1;
+
+ if (ev.Length > ini)
+ end = ev.IndexOf(';', ini);
+ else
+ end = -1;
+
+ if (end == -1)
+ {
+ // Set sane default values for the missing file and line information
+ _fileName = "";
+ _line = 1;
+ _threadId = Convert.ToInt32(temp);
+ EventDispatcher._unknownCode = true;
+ }
+ else
+ {
+ _fileName = temp;
+ _line = Convert.ToInt32(ev.Substring(ini, (end - ini)));
+
+ ini = end + 1;
+ _threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
+ EventDispatcher._unknownCode = false;
+ }
+
+ _eventDispatcher.Engine.CleanEvaluatedThreads();
+
+
+ if (_eventDispatcher.Engine._updateThreads)
+ {
+ _eventDispatcher.Engine.UpdateListOfThreads();
+ }
+ if (_threadId > 0)
+ {
+ if ((EventDispatcher._unknownCode == false) && (_fileName != ""))
+ _eventDispatcher.Engine.SelectThread(_threadId.ToString()).SetCurrentLocation(_fileName, (uint)_line);
+ _eventDispatcher.Engine.SetAsCurrentThread(_threadId.ToString());
+ }
+
+ OnStepCompleted(_eventDispatcher, _fileName, (uint)_line);
+
+ break;
+ case '6':
+ // Function-finished.
+ _eventDispatcher.Engine.ResetStackFrames();
+ EventDispatcher._GDBRunMode = false;
+ ini = 3;
+ end = ev.IndexOf(';', 3);
+ if (end == -1)
+ {
+ // Set sane default values for the missing file and line information
+ _fileName = "";
+ _line = 1;
+ _threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
+ EventDispatcher._unknownCode = true;
+ }
+ else
+ {
+ _fileName = ev.Substring(ini, (end - ini));
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _line = Convert.ToInt32(ev.Substring(ini, (end - ini)));
+
+ ini = end + 1;
+ _threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
+ EventDispatcher._unknownCode = false;
+ }
+
+ _eventDispatcher.Engine.CleanEvaluatedThreads();
+
+ if (_eventDispatcher.Engine._updateThreads)
+ {
+ _eventDispatcher.Engine.UpdateListOfThreads();
+ }
+ if (_threadId > 0)
+ {
+ if ((EventDispatcher._unknownCode == false) && (_fileName != ""))
+ _eventDispatcher.Engine.SelectThread(_threadId.ToString()).SetCurrentLocation(_fileName, (uint)_line);
+ _eventDispatcher.Engine.SetAsCurrentThread(_threadId.ToString());
+ }
+
+ OnStepCompleted(_eventDispatcher, _fileName, (uint)_line);
+
+ break;
+ case '7':
+ // -exec-interrupt or signal-meaning="Killed". There's nothing to do in this case.
+ _eventDispatcher.Engine.ResetStackFrames();
+ EventDispatcher._GDBRunMode = false;
+
+ _eventDispatcher.Engine.CleanEvaluatedThreads();
+
+ _threadId = Convert.ToInt32(ev.Substring(3, (ev.Length - 3)));
+
+ if (_eventDispatcher.Engine._updateThreads)
+ {
+ _eventDispatcher.Engine.UpdateListOfThreads();
+ }
+ if (_threadId > 0)
+ {
+ if ((EventDispatcher._unknownCode == false) && (_fileName != ""))
+ _eventDispatcher.Engine.SelectThread(_threadId.ToString()).SetCurrentLocation(_fileName, (uint)_line);
+ _eventDispatcher.Engine.SetAsCurrentThread(_threadId.ToString());
+ }
+
+ if (_eventDispatcher.Engine.State != AD7Engine.DebugEngineState.Break)
+ {
+ OnInterrupt(_threadId);
+ }
+ // Signal that interrupt is processed
+ m_mre.Set();
+
+ break;
+ case '8':
+ // SIGKILL
+ _eventDispatcher.EndDebugSession(0);
+ break;
+ case '9':
+ // ERROR, ex: 49,Cannot find bounds of current function
+ _eventDispatcher.Engine.ResetStackFrames();
+ _eventDispatcher.Engine.CleanEvaluatedThreads();
+
+ if (_eventDispatcher.Engine._updateThreads)
+ {
+ _eventDispatcher.Engine.UpdateListOfThreads();
+ }
+
+ if (ev.Length >= 3)
+ {
+ _error = ev.Substring(3, (ev.Length - 3));
+ if (_error == "Cannot find bounds of current function")
+ {
+ // We don't have symbols for this function so further stepping won't be possible. Return from this function.
+ EventDispatcher._unknownCode = true;
+ _eventDispatcher.Engine.Step(_eventDispatcher.Engine.CurrentThread(), enum_STEPKIND.STEP_OUT, enum_STEPUNIT.STEP_LINE);
+ }
+ }
+ break;
+ }
+ break;
+ case '5':
+ switch (ev[1])
+ {
+ case '0':
+ // Quit (expect signal SIGINT when the program is resumed)
+ _eventDispatcher.countSIGINT += 1;
+ if (_eventDispatcher.countSIGINT > 5)
+ {
+ _eventDispatcher.EndDebugSession(0);
+ MessageBoxHelper.Show("Lost communication with GDB. Please refer to documentation for more details.", "GDB failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ break;
+ case '1':
+ // Thread exited. Example: 51,2
+ ini = 3;
+ _threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
+
+ _eventDispatcher.Engine._updateThreads = true;
+
+ break;
+ case '2':
+ // GDB Bugs, like "... 2374: internal-error: frame_cleanup_after_sniffer ...". Example: 52
+ _eventDispatcher.EndDebugSession(0);
+ MessageBoxHelper.Show("This is a known issue that can happen when interrupting GDB's execution by hitting the \"break all\" or toggling a breakpoint in run mode. \n\n GDB CRASHED. Details: \"../../gdb/frame.c:2374: internal-error: frame_cleanup_after_sniffer: Assertion `frame->prologue_cache == NULL' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\" \r\n \nPlease close the app in the device/simulator if you want to debug it again.", "GDB failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
+
+ break;
+ case '3':
+ // Lost communication with device/simulator: ^error,msg="Remote communication error: No error."
+ MessageBoxHelper.Show("Lost communication with the device/simulator.", "Communication lost", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ _eventDispatcher.EndDebugSession(0);
+
+ break;
+ case '4':
+ // Program interrupted due to a segmentation fault.
+ // Examples:
+ // 54,ADDR,FUNC,THREAD-ID
+ // 54,ADDR,FUNC,FILENAME,LINE,THREAD-ID
+
+ _eventDispatcher.Engine.ResetStackFrames();
+ EventDispatcher._GDBRunMode = false;
+ numCommas = 0;
+ foreach (char c in ev)
+ {
+ if (c == ';')
+ numCommas++;
+ }
+
+ ini = 3;
+ end = ev.IndexOf(';', ini);
+ _address = Convert.ToInt32(ev.Substring(ini, (end - ini)), 16);
+
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _functionName = ev.Substring(ini, (end - ini));
+
+ if (_functionName == "??")
+ {
+ EventDispatcher._unknownCode = true;
+ }
+ else
+ {
+ EventDispatcher._unknownCode = false;
+ }
+
+ switch (numCommas)
+ {
+ case 3:
+ // Thread ID
+ ini = end + 1;
+ _threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
+ EventDispatcher._unknownCode = true;
+ break;
+ case 5:
+ // Filename, line number and thread ID
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _fileName = ev.Substring(ini, (end - ini));
+
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _line = Convert.ToInt32(ev.Substring(ini, (end - ini)));
+
+ ini = end + 1;
+ _threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
+ break;
+ }
+
+ MessageBoxHelper.Show("Segmentation Fault: If you continue debugging could take the environment to an unstable state.", "Segmentation Fault", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+
+ _eventDispatcher.Engine.CleanEvaluatedThreads();
+
+ if (_eventDispatcher.Engine._updateThreads)
+ {
+ _eventDispatcher.Engine.UpdateListOfThreads();
+ }
+ if (_threadId > 0)
+ {
+ _eventDispatcher.Engine.SelectThread(_threadId.ToString()).SetCurrentLocation(_fileName, (uint)_line);
+ _eventDispatcher.Engine.SetAsCurrentThread(_threadId.ToString());
+ }
+
+ OnInterrupt(_threadId);
+
+ break;
+
+ case '5':
+ // Exited-signaled. Ex: 55;SIGSEGV;Segmentation fault
+ // or Aborted. Ex: 55;SIGABRT;Aborted
+ ini = 3;
+ end = ev.IndexOf(';', ini);
+ _signalName = ev.Substring(ini, (end - ini));
+
+ ini = end + 1;
+ end = ev.IndexOf(';', ini);
+ _signalMeaning = ev.Substring(ini, (end - ini));
+
+ ini = end + 1;
+ try
+ {
+ _threadId = Convert.ToInt32(ev.Substring(ini, (ev.Length - ini)));
+ }
+ catch
+ {
+ }
+
+ if (_signalMeaning == "Segmentation fault")
+ {
+ MessageBoxHelper.Show("Segmentation Fault: Closing debugger.", "Segmentation Fault", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ _eventDispatcher.EndDebugSession(0);
+ }
+
+ if (_signalMeaning == "Aborted")
+ {
+ MessageBoxHelper.Show("Program aborted: Closing debugger.", "Program Aborted", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ _eventDispatcher.EndDebugSession(0);
+ }
+
+ break;
+ case '6':
+ // GDB Bugs, like "... 3550: internal-error: handle_inferior_event ...". Example: 56
+ _eventDispatcher.EndDebugSession(0);
+ MessageBoxHelper.Show("This is a known issue that can happen while debugging multithreaded programs. \n\n GDB CRASHED. Details: \"../../gdb/infrun.c:3550: internal-error: handle_inferior_event: Assertion ptid_equal (singlestep_ptid, ecs->ptid)' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\" \r\n \nPlease close the app in the device/simulator if you want to debug it again.", "GDB failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
+
+ break;
+ case '7': // Not used
+ break;
+ case '8': // Not used
+ break;
+ case '9': // Not used
+ break;
+ }
+ break;
+ }
+ }
+
+ ///
+ /// Update VS when a step action is completed in GDB.
+ ///
+ /// This object manages debug events in the engine.
+ /// File name.
+ /// Line number.
+ public static void OnStepCompleted(EventDispatcher eventDispatcher, string file, uint line)
+ {
+ if (eventDispatcher.Engine.State == AD7Engine.DebugEngineState.Step)
+ {
+ eventDispatcher.Engine.State = AD7Engine.DebugEngineState.Break;
+ AD7StepCompletedEvent.Send(eventDispatcher.Engine);
+ }
+ }
+
+ ///
+ /// Update VS when the debugging process is interrupted in GDB.
+ ///
+ /// Thread ID.
+ private void OnInterrupt(int threadID)
+ {
+ if (_eventDispatcher.Engine.State == AD7Engine.DebugEngineState.Run)
+ {
+ _eventDispatcher.Engine.State = AD7Engine.DebugEngineState.Break;
+
+ // Only send OnAsyncBreakComplete if break-all was requested by the user
+ if (!NeedsResumeAfterInterrupt)
+ {
+ _eventDispatcher.Engine.Callback.OnAsyncBreakComplete(_eventDispatcher.Engine.SelectThread(threadID.ToString()));
+ }
+ }
+ }
+ }
+}
diff --git a/src_vs2010/DebugEngine/Engine.Impl/VariableInfo.cs b/src_vs2010/DebugEngine/Engine.Impl/VariableInfo.cs
new file mode 100644
index 00000000..61e9a0f1
--- /dev/null
+++ b/src_vs2010/DebugEngine/Engine.Impl/VariableInfo.cs
@@ -0,0 +1,580 @@
+using System;
+using System.Collections;
+using BlackBerry.NativeCore.Debugger;
+
+namespace BlackBerry.DebugEngine
+{
+ ///
+ /// This class contains all information about a variable / expression.
+ ///
+ public sealed class VariableInfo
+ {
+ ///
+ /// Variable's name or expression.
+ ///
+ public readonly string _name;
+
+ ///
+ /// Variable's data type.
+ ///
+ public string _type;
+
+ ///
+ /// Variable's value or the result of an expression.
+ ///
+ public string _value;
+
+ ///
+ /// Variable's name to be used by GDB.
+ ///
+ public string _GDBName;
+
+ ///
+ /// List of variable's children.
+ ///
+ public ArrayList _children;
+
+
+ ///
+ /// Evaluate an expression / Get the value of a variable. This method basically send a "-data-evaluate-expression" command to GDB
+ /// and evaluate the result.
+ ///
+ /// The expression/variable to be evaluated.
+ /// The result of the expression/ value of variable.
+ /// The GDB Name of the variable.
+ /// A boolean value indicating if the expression evaluation was successful or not.
+ public static bool EvaluateExpression(string name, out string result, string gdbName)
+ {
+ if (string.IsNullOrEmpty(name))
+ {
+ result = string.Empty;
+ return false;
+ }
+
+ if (name[name.Length - 1] == '.')
+ name = name.Remove(name.Length - 1);
+
+ // Waits for the parsed response for the GDB/MI command that evaluates "name" as an expression.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Data-Manipulation.html)
+ result = GdbWrapper.SendCommand("-data-evaluate-expression \"" + name + "\"", 2);
+ if (string.IsNullOrEmpty(result) || result.Length < 2)
+ {
+ result = string.Empty;
+ return false;
+ }
+
+ if (result.StartsWith("61")) // If result starts with 61, it means that there is an error.
+ {
+ if (gdbName != null) // Maybe that error was caused because GDB didn't accept the VS name. Use the GDBName if there is one.
+ {
+ // Gets the parsed response for the GDB/MI command that evaluates "GDBName" as an expression.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Data-Manipulation.html)
+ string result2 = GdbWrapper.SendCommand("-data-evaluate-expression \"" + gdbName + "\"", 2);
+ if (result2.StartsWith("60"))
+ result = result2;
+ }
+ }
+
+ // If result starts with 61, it means that there is an error. So, expression is not valid.
+ bool valid = !result.StartsWith("61");
+
+ result = result.Substring(3);
+ result = result.Replace("\\\"", "\"");
+
+ if (valid)
+ {
+ int endString = result.IndexOf("\\\\000");
+ int ini, end = 0;
+ while (endString != -1) // remove garbage from strings
+ {
+ ini = result.IndexOf("\"", end);
+ while ((ini > 0) && (result[ini - 1] == '\\'))
+ ini = result.IndexOf("\"", ini + 1);
+ if (ini == -1)
+ break;
+ end = result.IndexOf("\"", ini + 1);
+ while ((end > 0) && (result[end - 1] == '\\'))
+ end = result.IndexOf("\"", end + 1);
+ if (end == -1)
+ break;
+ while ((endString != -1) && (endString < ini))
+ endString = result.IndexOf("\\\\000", endString + 1);
+ if ((endString > ini) && (endString < end))
+ {
+ result = result.Substring(0, endString) + result.Substring(end, (result.Length - end));
+ end = endString;
+ endString = result.IndexOf("\\\\000", end);
+ }
+ end++;
+ };
+ }
+ return valid;
+ }
+
+ ///
+ /// Gets the information about a variable/expression.
+ ///
+ /// Variable name / expression.
+ /// The event dispatcher.
+ /// Current stack frame.
+ /// Return the VariableInfo object.
+ public static VariableInfo Get(string name, EventDispatcher eventDispatcher, AD7StackFrame frame)
+ {
+ VariableInfo vi = null;
+ string search = "";
+ string separator = "";
+ bool isArray = false;
+ bool isRoot = true;
+
+ do
+ {
+ int dot = name.IndexOf('.');
+ int squareBracket = name.IndexOf('[');
+ int pos = name.IndexOf("->", StringComparison.Ordinal);
+ if (dot == -1)
+ dot = name.Length;
+ if (squareBracket == -1)
+ squareBracket = name.Length;
+ if (pos == -1)
+ pos = name.Length;
+ int stop = dot < squareBracket ? dot : squareBracket;
+ stop = stop < pos ? stop : pos;
+
+ search = search + separator + name.Substring(0, stop);
+ separator = "";
+
+ if (stop < name.Length)
+ {
+ separator = name.Substring(stop, 1);
+ if (separator == "-")
+ {
+ separator = "->";
+ name = name.Substring(stop + 2, name.Length - (stop + 2));
+ }
+ else if (separator == "[")
+ {
+ int aux = name.IndexOf("]");
+ isArray = true;
+ separator = name.Substring(stop, (aux - stop) + 1);
+ name = name.Substring(aux + 1, name.Length - (aux + 1));
+ }
+ else
+ name = name.Substring(stop + 1, name.Length - (stop + 1));
+ }
+ else
+ name = "";
+
+ if (vi == null)
+ {
+ if (frame._locals != null)
+ {
+ foreach (VariableInfo var in frame._locals)
+ {
+ if (var._name == search)
+ { // if the "search" expression is a local variable, it doesn't need to create a VariableInfo object for that.
+ vi = var;
+ break;
+ }
+ }
+ }
+
+ if (vi == null)
+ {
+ if (frame._arguments != null)
+ {
+ foreach (VariableInfo var in frame._arguments)
+ { // if the "search" expression is an argument, it doesn't need to create a VariableInfo object for that.
+ if (var._name == search)
+ {
+ vi = var;
+ break;
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ isRoot = false;
+ VariableInfo vi_child = null;
+ if (vi._children != null)
+ {
+ foreach (VariableInfo var in vi._children)
+ {
+ if (var._name == search)
+ {
+ vi_child = var;
+ break;
+ }
+ }
+ }
+ vi = vi_child;
+ }
+ } while ((vi != null) && ((isArray) || (name != "")));
+
+
+ if (name != "") // variable not found probably because it is in an expression, so return to the original name to evaluate it.
+ search = search + separator + name;
+
+ string result;
+ bool valid;
+ if (vi == null)
+ valid = EvaluateExpression(search, out result, null);
+ else
+ valid = EvaluateExpression(search, out result, vi._GDBName);
+
+ if (vi != null)
+ {
+ if ((vi._value != result) || (!isRoot)) // if is not root means that it can be expanded...
+ {
+ vi._value = result;
+ if (vi._value == null || (vi._type.Contains("*") && (vi._value != "0x0")))
+ {
+ // This is an array, struct, union, or pointer.
+ // Create a variable object so we can list this variable's children.
+ ArrayList GDBNames = new ArrayList();
+ ArrayList VSNames = new ArrayList();
+ bool hasVsNdK;
+ eventDispatcher.CreateVariable(vi._name, out hasVsNdK);
+ if (hasVsNdK)
+ {
+ GDBNames.Add("VsNdK_" + vi._name);
+ VSNames.Add(vi._name);
+ }
+ vi._children = new ArrayList();
+ if (vi._type.Contains("struct"))
+ if (vi._type[vi._type.Length - 1] == '*')
+ vi.ListChildren(eventDispatcher, "*", GDBNames, VSNames, hasVsNdK, null);
+ else if (vi._type.Contains("["))
+ vi.ListChildren(eventDispatcher, "struct[]", GDBNames, VSNames, hasVsNdK, null);
+ else
+ vi.ListChildren(eventDispatcher, "struct", GDBNames, VSNames, hasVsNdK, null);
+ else if (vi._type.Contains("["))
+ vi.ListChildren(eventDispatcher, "[]", GDBNames, VSNames, hasVsNdK, null);
+ else if (vi._type.Contains("*"))
+ vi.ListChildren(eventDispatcher, "*", GDBNames, VSNames, hasVsNdK, null);
+ else
+ vi.ListChildren(eventDispatcher, "", GDBNames, VSNames, hasVsNdK, null);
+ eventDispatcher.DeleteVariable(vi._name, hasVsNdK);
+ }
+ }
+ }
+ else
+ {
+ if (!valid)
+ vi = new VariableInfo(search, "", result, null);
+ else
+ {
+ string aux_exp = search.Replace(" ", "");
+ string datatype;
+
+ // Sending 2 GDB commands to get the data type of "aux_exp" because it is not known, at this moment, if "aux_exp"
+ // is an expression, a primitive or a compound variable.
+
+ // Gets the parsed response for the GDB command that returns the data type of "aux_exp".
+ // (http://sourceware.org/gdb/onlinedocs/gdb/Symbols.html)
+ string firstDatatype = GdbWrapper.SendCommand("whatis " + aux_exp, 3);
+
+ // Gets the parsed response for the GDB command that returns a detailed description of the type.
+ // (http://sourceware.org/gdb/onlinedocs/gdb/Symbols.html)
+ string baseDatatype = GdbWrapper.SendCommand("ptype " + aux_exp, 4);
+
+ if ((baseDatatype[baseDatatype.Length - 1] == '{') && (baseDatatype[baseDatatype.Length - 2] == ' '))
+ baseDatatype = baseDatatype.Remove(baseDatatype.Length - 2);
+ if (baseDatatype.Length < firstDatatype.Length)
+ {
+ if (firstDatatype.Contains(baseDatatype))
+ {
+ baseDatatype = firstDatatype;
+ }
+ }
+ if ((baseDatatype == firstDatatype) || ((baseDatatype.Contains("::")) && (!baseDatatype.Contains("union"))))
+ {
+ baseDatatype = "";
+ datatype = firstDatatype;
+ }
+ else
+ {
+ datatype = baseDatatype;
+ }
+ if (datatype[datatype.Length - 1] == '*')
+ if (result == "0x0")
+ {
+ vi = new VariableInfo(search, firstDatatype, result, null);
+ }
+ else
+ {
+ vi = new VariableInfo(search, firstDatatype, baseDatatype, result, eventDispatcher, null, null);
+ }
+ else if ((datatype.Contains("struct")) || (datatype.Contains("[")))
+ {
+ vi = new VariableInfo(search, firstDatatype, baseDatatype, null, eventDispatcher, null, null);
+ }
+ else
+ {
+ vi = new VariableInfo(search, firstDatatype, result, null);
+ }
+ }
+ }
+ return vi;
+ }
+
+ ///
+ /// Call the right VariableInfo constructor for locals and arguments.
+ ///
+ /// The name of the variable.
+ /// The data type of the variable.
+ /// The value of the variable.
+ /// The event dispatcher.
+ /// Return the VariableInfo created object.
+ public static VariableInfo Create(string name, string type, string value, EventDispatcher dispatcher)
+ {
+ VariableInfo newVar = new VariableInfo(name, type, "", value, dispatcher, null, null);
+ return newVar;
+ }
+
+ ///
+ /// Constructor for Variable Info Object without inquiring for the variable's children.
+ ///
+ /// The name of the variable.
+ /// The data type of the variable.
+ /// The value of the variable.
+ /// The GDB Name of the variable.
+ public VariableInfo(string name, string type, string value, string gdbName)
+ {
+ _name = name;
+ _type = type;
+ _value = value;
+ _children = null;
+ _GDBName = gdbName;
+ }
+
+ ///
+ /// Constructor for Variable Info Object inquiring for the variable's children
+ ///
+ /// The name of the variable.
+ /// The data type of the variable.
+ /// The base type of the variable.
+ /// The value of the variable.
+ /// The event dispatcher.
+ /// The names of the variables used by GDB.
+ /// The Names of the variables used by VS.
+ public VariableInfo(string name, string type, string baseType, string value, EventDispatcher dispatcher, ArrayList gdbNames, ArrayList vsNames)
+ {
+ // numChildren - The result of the createvar returns ERROR or a number from 0 to "n" where "n" is the number of children of the variable.
+
+ _name = name;
+ _type = type;
+ _value = value;
+ _children = null;
+ _GDBName = null;
+
+ if (baseType != "")
+ type = baseType;
+
+ if (gdbNames == null)
+ {
+ gdbNames = new ArrayList();
+ vsNames = new ArrayList();
+ }
+
+ if (value == null || (type.Contains("*") && (value != "0x0")))
+ {
+ // This is an array, struct, union, or pointer.
+ // Create a variable object so we can list this variable's children.
+
+ // Some VS variable names cannot be used by GDB. When that happens, it is added the prefix VsNdK_ to the GDB variable
+ // name and it is stored in the GDBNames array. At the same time, the VS name is stored in the VSNames array using the
+ // same index position. This bool variable just indicate if this prefix is used or not.
+ bool hasVsNdK;
+ string numChildren = dispatcher.CreateVariable(_name, out hasVsNdK);
+
+ if (hasVsNdK)
+ {
+ _GDBName = "VsNdK_" + _name;
+ gdbNames.Add("VsNdK_" + _name);
+ vsNames.Add(_name);
+ }
+
+ try // Catch non-numerical data
+ {
+ if (Convert.ToInt32(numChildren) > 0) // If the variable has children, evaluate them.
+ {
+ _children = new ArrayList();
+ if (type.Contains("struct"))
+ if (type[type.Length - 1] == '*')
+ ListChildren(dispatcher, "*", gdbNames, vsNames, hasVsNdK, null);
+ else if (type.Contains("["))
+ ListChildren(dispatcher, "struct[]", gdbNames, vsNames, hasVsNdK, null);
+ else
+ ListChildren(dispatcher, "struct", gdbNames, vsNames, hasVsNdK, null);
+ else if (type.Contains("["))
+ ListChildren(dispatcher, "[]", gdbNames, vsNames, hasVsNdK, null);
+ else if (type.Contains("*"))
+ ListChildren(dispatcher, "*", gdbNames, vsNames, hasVsNdK, null);
+ else
+ ListChildren(dispatcher, "", gdbNames, vsNames, hasVsNdK, null);
+ }
+ }
+ catch (FormatException)
+ {
+
+ }
+
+ dispatcher.DeleteVariable(_name, hasVsNdK);
+ }
+
+ if (value == null)
+ EvaluateExpression(name, out _value, null);
+ }
+
+ ///
+ /// Gets the list of children for a given variable.
+ ///
+ /// The event dispatcher.
+ /// The variable's parent data type. "*" means it is a pointer; "struct[]" means it is an array of
+ /// structures; "struct" means it is a structure; and "[]" means it is an array.
+ /// The names of the variables used by GDB.
+ /// The Names of the variables used by VS.
+ /// Indicate if the variable name uses or not the prefix "VsNdK_".
+ /// The GDB Name of the variable.
+ public void ListChildren(EventDispatcher dispatcher, string parentType, ArrayList gdbNames, ArrayList vsNames, bool hasVsNdK, string gdbName)
+ {
+ string childListResponse;
+ if (gdbName == null)
+ {
+ if (hasVsNdK)
+ {
+ childListResponse = dispatcher.ListChildren(_GDBName);
+ }
+ else
+ {
+ childListResponse = dispatcher.ListChildren(_name);
+ if ((childListResponse == "ERROR") && (_GDBName != null))
+ {
+ childListResponse = dispatcher.ListChildren(_GDBName);
+ }
+ }
+ }
+ else
+ childListResponse = dispatcher.ListChildren(gdbName);
+
+ if (childListResponse != "ERROR")
+ {
+ childListResponse = (childListResponse.Substring(3)).Replace("#;;;", "");
+
+ string[] childList = childListResponse.Split('#');
+ foreach (string childString in childList)
+ {
+ string name = null;
+ string type = null;
+ string value = null;
+ int numChildren = 0;
+ bool valid = true;
+
+ string[] childProperties = childString.Split(';');
+
+ if (childProperties[0] == "")
+ continue;
+
+ name = childProperties[0];
+
+ if (name.Contains("::")) // discard this GDB expression.
+ {
+ continue;
+ }
+
+ gdbName = name;
+
+ int end = name.Length;
+ if (name[end - 1] == '"')
+ end--;
+ if (((name.Length > 8) && (name.Substring(end - 8, 8) == ".private")) ||
+ ((name.Length > 7) && (name.Substring(end - 7, 7) == ".public")) ||
+ ((name.Length > 10) && (name.Substring(end - 10, 10) == ".protected")) ||
+ ((name.Length > 9) && (name.Substring(end - 9, 9) == ".private.")) ||
+ ((name.Length > 8) && (name.Substring(end - 8, 8) == ".public.")) ||
+ ((name.Length > 11) && (name.Substring(end - 11, 11) == ".protected.")))
+ {
+ // GDB is using an intermediate representation for the variable. Inquire GDB again using this intermediate name.
+ int index = vsNames.IndexOf(_name);
+ if (index != -1)
+ gdbNames[index] = gdbName;
+ else
+ {
+ gdbNames.Add(gdbName);
+ vsNames.Add(_name);
+ }
+ ListChildren(dispatcher, parentType, gdbNames, vsNames, hasVsNdK, gdbName);
+ continue;
+ }
+ else
+ {
+ int dot = name.LastIndexOf(".");
+ if (dot != -1)
+ {
+ int index = gdbNames.IndexOf(name.Substring(0, dot));
+ if (index != -1)
+ {
+ name = vsNames[index].ToString() + name.Substring(dot);
+ }
+ }
+
+ name = name.Replace(".private", "");
+ name = name.Replace(".public", "");
+ name = name.Replace(".protected", "");
+ name = name.Replace("..", ".");
+
+ dot = name.LastIndexOf(".*");
+ if (dot != -1)
+ {
+ name = "*(" + name.Remove(dot) + ")";
+ }
+
+ if (parentType == "*")
+ {
+ dot = name.LastIndexOf('.');
+ if (dot != -1)
+ {
+ name = name.Substring(0, dot) + "->" + name.Substring(dot + 1, name.Length - (dot + 1));
+ }
+ }
+ else if (parentType == "[]")
+ {
+ dot = name.LastIndexOf('.');
+ name = name.Substring(0, dot) + "[" + name.Substring(dot + 1, name.Length - (dot + 1));
+ name = name + "]";
+ }
+ gdbNames.Add(gdbName);
+ vsNames.Add(name);
+ }
+
+ if (childProperties[1] != "")
+ numChildren = Convert.ToInt32(childProperties[1]);
+
+ value = childProperties[2];
+ if ((value == "") || (value.Contains("{...}")) ||
+ ((value.Length >= 2) && (value[0] == '[') && (value[value.Length - 1] == ']')))
+ valid = EvaluateExpression(name, out value, gdbName);
+
+ type = childProperties[3];
+
+ VariableInfo child = new VariableInfo(name, type, value, gdbName);
+
+ if ((valid) && (numChildren > 0 && value != "0x0"))
+ {
+ child._children = new ArrayList();
+ }
+ if (vsNames.Contains(name))
+ {
+ int index = vsNames.IndexOf(name);
+ vsNames.RemoveAt(index);
+ gdbNames.RemoveAt(index);
+ }
+ _children.Add(child); // If VS knows that there are children, it will inquiries again if those children data
+ // were not filled.
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src_vs2010/DebugEngine/Properties/AssemblyInfo.cs b/src_vs2010/DebugEngine/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..9a4dc6ae
--- /dev/null
+++ b/src_vs2010/DebugEngine/Properties/AssemblyInfo.cs
@@ -0,0 +1,51 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+using BlackBerry.NativeCore;
+
+[assembly: AssemblyTitle("BlackBerry DebugEngine")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("BlackBerry")]
+[assembly: AssemblyProduct("BlackBerry.DebugEngine")]
+[assembly: AssemblyCopyright("Copyright © BlackBerry 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("7925a96c-7e19-4796-87ef-41634e94a31a")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion(ConfigDefaults.VersionString)]
+[assembly: AssemblyFileVersion(ConfigDefaults.VersionString)]
diff --git a/src_vs2010/GDBHost/BlackBerry.GDBHost.vcxproj b/src_vs2010/GDBHost/BlackBerry.GDBHost.vcxproj
new file mode 100644
index 00000000..1af1ecdc
--- /dev/null
+++ b/src_vs2010/GDBHost/BlackBerry.GDBHost.vcxproj
@@ -0,0 +1,105 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+
+ {9A560339-44DB-413F-868C-403962C2CF01}
+ Win32Proj
+ GDBWrapper
+
+
+
+ Application
+ true
+ Unicode
+ false
+
+
+ Application
+ false
+ true
+ Unicode
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ $(ProjectDir)$(Configuration)\
+
+
+ false
+ $(ProjectDir)$(Configuration)\
+
+
+
+ Use
+ Level3
+ Disabled
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+
+
+ Console
+ true
+
+
+
+
+
+
+
+
+ Level3
+ Use
+ MaxSpeed
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+
+
+ Console
+ true
+ true
+ true
+ false
+
+
+ xcopy "$(OutDir)BlackBerry.GDBHost.exe" "$(OutputPath)" /d /y
+ Copying Executable to output directory.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Create
+ Create
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src_vs2010/GDBHost/BlackBerry.GDBHost.vcxproj.filters b/src_vs2010/GDBHost/BlackBerry.GDBHost.vcxproj.filters
new file mode 100644
index 00000000..21630635
--- /dev/null
+++ b/src_vs2010/GDBHost/BlackBerry.GDBHost.vcxproj.filters
@@ -0,0 +1,45 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hpp;hxx;hm;inl;inc;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+
\ No newline at end of file
diff --git a/src/GDBWrapper/stdafx.cpp b/src_vs2010/GDBHost/stdafx.cpp
similarity index 100%
rename from src/GDBWrapper/stdafx.cpp
rename to src_vs2010/GDBHost/stdafx.cpp
diff --git a/src_vs2010/GDBHost/stdafx.h b/src_vs2010/GDBHost/stdafx.h
new file mode 100644
index 00000000..263bd874
--- /dev/null
+++ b/src_vs2010/GDBHost/stdafx.h
@@ -0,0 +1,27 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#include "targetver.h"
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+
+#include
+#include
diff --git a/src/GDBWrapper/targetver.h b/src_vs2010/GDBHost/targetver.h
similarity index 100%
rename from src/GDBWrapper/targetver.h
rename to src_vs2010/GDBHost/targetver.h
diff --git a/src_vs2010/NativeCore/BlackBerry.NativeCore.csproj b/src_vs2010/NativeCore/BlackBerry.NativeCore.csproj
new file mode 100644
index 00000000..803237e8
--- /dev/null
+++ b/src_vs2010/NativeCore/BlackBerry.NativeCore.csproj
@@ -0,0 +1,521 @@
+
+
+
+ Debug
+ AnyCPU
+ 8.0.30703
+ 2.0
+ {36D4495B-9A92-478F-BF95-AEA13804A7BA}
+ Library
+ Properties
+ BlackBerry.NativeCore
+ BlackBerry.NativeCore
+ v4.0
+ 512
+
+
+ true
+ full
+ false
+ bin\Debug\
+ TRACE;DEBUG;PLATFORM_VS2010;MAKE_CONFIG_DEFAULTS_PUBLIC
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE;PLATFORM_VS2010;MAKE_CONFIG_DEFAULTS_PUBLIC
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Components\TargetConnectionEventArgs.cs
+
+
+ Components\Targets.cs
+
+
+ Components\TargetStatus.cs
+
+
+ Components\TokenProcessor.cs
+
+
+ Components\UpdateManager.cs
+
+
+ Components\UpdateManagerCompletedEventArgs.cs
+
+
+ ConfigDefaults.cs
+
+
+ Debugger\GdbProcessor.cs
+
+
+ Debugger\GdbWrapper.cs
+
+
+ Debugger\IGdbSender.cs
+
+
+ Debugger\Instruction.cs
+
+
+ Debugger\InstructionCollection.cs
+
+
+ Debugger\Model\BreakpointInfo.cs
+
+
+ Debugger\Model\IResult.cs
+
+
+ Debugger\Model\ProcessInfo.cs
+
+
+ Debugger\Request.cs
+
+
+ Debugger\RequestGroup.cs
+
+
+ Debugger\RequestsFactory.cs
+
+
+ Debugger\Requests\BreakRequest.cs
+
+
+ Debugger\Requests\CliRequest.cs
+
+
+ Debugger\Requests\MiRequest.cs
+
+
+ Debugger\Requests\ProcessListRequest.cs
+
+
+ Debugger\Response.cs
+
+
+ Debugger\ResponseParsedEventArgs.cs
+
+
+ Debugger\ResponseReceivedEventArgs.cs
+
+
+ Debugger\ResponseType.cs
+
+
+ Diagnostics\BlackBerryTraceListener.cs
+
+
+ Diagnostics\QTraceLog.cs
+
+
+ Diagnostics\TimeTracker.cs
+
+
+ Diagnostics\TraceLog.cs
+
+
+ Helpers\BitHelper.cs
+
+
+ Helpers\DeviceHelper.cs
+
+
+ Helpers\GlobalHelper.cs
+
+
+ Helpers\NameValueCollectionHelper.cs
+
+
+ Helpers\PathHelper.cs
+
+
+ Model\ApiInfo.cs
+
+
+ Model\ApiInfoArray.cs
+
+
+ Model\ApiLevelAction.cs
+
+
+ Model\ApiLevelListTypes.cs
+
+
+ Model\ApiLevelTarget.cs
+
+
+ Model\ApiLevelTask.cs
+
+
+ Model\AuthorInfo.cs
+
+
+ Model\CertificateInfo.cs
+
+
+ Model\CskTokenInfo.cs
+
+
+ Model\DebugTokenInfo.cs
+
+
+ Model\DeveloperDefinition.cs
+
+
+ Model\DeviceDebugTokenInfo.cs
+
+
+ Model\DeviceDefinition.cs
+
+
+ Model\DeviceDefinitionType.cs
+
+
+ Model\DeviceFamilyType.cs
+
+
+ Model\DeviceInfo.cs
+
+
+ Model\DeviceTheme.cs
+
+
+ Model\GdbInfo.cs
+
+
+ Model\ImportProjectInfo.cs
+
+
+ Model\NdkDefinition.cs
+
+
+ Model\NdkInfo.cs
+
+
+ Model\PermissionInfo.cs
+
+
+ Model\RuntimeDefinition.cs
+
+
+ Model\RuntimeInfo.cs
+
+
+ Model\SimulatorInfo.cs
+
+
+ Model\Size.cs
+
+
+ NativeMethods.cs
+
+
+ Properties\AssemblyInfo.cs
+
+
+ QConn\HResult.cs
+
+
+ QConn\Model\CapturedLogsEventArgs.cs
+
+
+ QConn\Model\DataReaderBigEndian.cs
+
+
+ QConn\Model\DataReaderLittleEndian.cs
+
+
+ QConn\Model\DecryptedChallenge.cs
+
+
+ QConn\Model\EncryptionChallenge.cs
+
+
+ QConn\Model\Endianess.cs
+
+
+ QConn\Model\IDataReader.cs
+
+
+ QConn\Model\SystemInfoProcess.cs
+
+
+ QConn\Model\TargetFile.cs
+
+
+ QConn\Model\TargetFileDescriptor.cs
+
+
+ QConn\Model\TargetLogEntry.cs
+
+
+ QConn\Model\TargetProcess.cs
+
+
+ QConn\Model\TargetProcessSLog2Info.cs
+
+
+ QConn\Model\TargetSystemType.cs
+
+
+ QConn\Model\Token.cs
+
+
+ QConn\Model\TransferOperation.cs
+
+
+ QConn\Model\VisitorCompletionEventArgs.cs
+
+
+ QConn\Model\VisitorEventArgs.cs
+
+
+ QConn\Model\VisitorFailureEventArgs.cs
+
+
+ QConn\Model\VisitorProgressChangedEventArgs.cs
+
+
+ QConn\QConnAuthenticationEventArgs.cs
+
+
+ QConn\QConnClient.cs
+
+
+ QConn\QConnConnection.cs
+
+
+ QConn\QConnDoor.cs
+
+
+ QConn\QConnException.cs
+
+
+ QConn\QDataSource.cs
+
+
+ QConn\Request\SecureTargetAuthenticateChallengeRequest.cs
+
+
+ QConn\Request\SecureTargetAuthenticateRequest.cs
+
+
+ QConn\Request\SecureTargetChallengeRequest.cs
+
+
+ QConn\Request\SecureTargetCloseRequest.cs
+
+
+ QConn\Request\SecureTargetDecryptedChallengeRequest.cs
+
+
+ QConn\Request\SecureTargetEncryptedRequest.cs
+
+
+ QConn\Request\SecureTargetHelloRequest.cs
+
+
+ QConn\Request\SecureTargetKeepAliveRequest.cs
+
+
+ QConn\Request\SecureTargetRequest.cs
+
+
+ QConn\Request\SecureTargetSendSshPublicKeyRequest.cs
+
+
+ QConn\Request\SecureTargetStartServicesRequest.cs
+
+
+ QConn\Response\SecureTargetAuthenticateChallengeResponse.cs
+
+
+ QConn\Response\SecureTargetEncryptedChallengeResponse.cs
+
+
+ QConn\Response\SecureTargetFeedback.cs
+
+
+ QConn\Response\SecureTargetFeedbackMismatchedVersion.cs
+
+
+ QConn\Response\SecureTargetFeedbackNoPasswordRequired.cs
+
+
+ QConn\Response\SecureTargetFeedbackOK.cs
+
+
+ QConn\Response\SecureTargetFeedbackRejected.cs
+
+
+ QConn\Response\SecureTargetResponse.cs
+
+
+ QConn\Response\SecureTargetResult.cs
+
+
+ QConn\SecureTargetConnectionException.cs
+
+
+ QConn\Services\TargetService.cs
+
+
+ QConn\Services\TargetServiceConsoleLog.cs
+
+
+ QConn\Services\TargetServiceControl.cs
+
+
+ QConn\Services\TargetServiceFile.cs
+
+
+ QConn\Services\TargetServiceLauncher.cs
+
+
+ QConn\Services\TargetServiceSysInfo.cs
+
+
+ QConn\Visitors\BaseFileServiceEnumerator.cs
+
+
+ QConn\Visitors\BaseVisitorMonitor.cs
+
+
+ QConn\Visitors\BufferVisitor.cs
+
+
+ QConn\Visitors\IFileServiceEnumerator.cs
+
+
+ QConn\Visitors\IFileServiceVisitor.cs
+
+
+ QConn\Visitors\IFileServiceVisitorMonitor.cs
+
+
+ QConn\Visitors\LocalCopyVisitor.cs
+
+
+ QConn\Visitors\LocalEnumerator.cs
+
+
+ QConn\Visitors\LoggingVisitor.cs
+
+
+ QConn\Visitors\TargetCopyVisitor.cs
+
+
+ QConn\Visitors\TargetEnumerator.cs
+
+
+ QConn\Visitors\ZipPackageVisitor.cs
+
+
+ Services\IAttachDiscoveryService.cs
+
+
+ Services\IDeviceDiscoveryService.cs
+
+
+ Tools\ApiLevelListLoadRunner.cs
+
+
+ Tools\ApiLevelUpdateLogEventArgs.cs
+
+
+ Tools\ApiLevelUpdateRunner.cs
+
+
+ Tools\ApplicationRemoveRunner.cs
+
+
+ Tools\BBToolRunner.cs
+
+
+ Tools\DebugTokenCreateRunner.cs
+
+
+ Tools\DebugTokenInfoRunner.cs
+
+
+ Tools\DebugTokenUploadRunner.cs
+
+
+ Tools\DeviceConnectRunner.cs
+
+
+ Tools\DeviceInfoRunner.cs
+
+
+ Tools\EventDispatcher.cs
+
+
+ Tools\GdbHostRunner.cs
+
+
+ Tools\GdbRunner.cs
+
+
+ Tools\IEventDispatcher.cs
+
+
+ Tools\KeyToolGenRunner.cs
+
+
+ Tools\KeyToolInfoRunner.cs
+
+
+ Tools\KeyToolRegisterRunner.cs
+
+
+ Tools\KeyToolRemoveRunner.cs
+
+
+ Tools\SshCreateKeyRunner.cs
+
+
+ Tools\ToolRunner.cs
+
+
+ Tools\ToolRunnerEventArgs.cs
+
+
+ Tools\ToolRunnerStartupEventArgs.cs
+
+
+
+
+ Resources\Instructions.txt
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src_vs2010/Package/BlackBerry.Package.csproj b/src_vs2010/Package/BlackBerry.Package.csproj
new file mode 100644
index 00000000..ef0b2147
--- /dev/null
+++ b/src_vs2010/Package/BlackBerry.Package.csproj
@@ -0,0 +1,1235 @@
+
+
+
+ Debug
+ AnyCPU
+ 2.0
+ {3D6EFFAF-FF39-497D-B6F8-0B6169E90C6D}
+ {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ Library
+ Properties
+ BlackBerry.Package
+ BlackBerry.Package
+ false
+ Key.snk
+ v4.0
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ TRACE;DEBUG;PLATFORM_VS2010
+ prompt
+ 4
+ true
+ AnyCPU
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE;PLATFORM_VS2010
+ prompt
+ 4
+ true
+ true
+ AnyCPU
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+ True
+
+
+
+ ..\..\..\..\..\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.XmlEditor\v4.0_10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.XmlEditor.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2}
+ 8
+ 0
+ 0
+ primary
+ False
+ False
+
+
+ {26AD1324-4B7C-44BC-84F8-B86AED45729F}
+ 10
+ 0
+ 0
+ primary
+ False
+ False
+
+
+ {1A31287A-4D7D-413E-8E32-3B374931BD89}
+ 8
+ 0
+ 0
+ primary
+ False
+ False
+
+
+ {2CE2370E-D744-4936-A090-3FFFE667B0E1}
+ 9
+ 0
+ 0
+ primary
+ False
+ False
+
+
+ {1CBA492E-7263-47BB-87FE-639000619B15}
+ 8
+ 0
+ 0
+ primary
+ False
+ False
+
+
+
+
+ BlackBerryPackage.cs
+
+
+ Components\BuildPlatformsManager.cs
+
+
+ Components\ErrorManager.cs
+
+
+ Components\LogManager.cs
+
+
+ Components\ProjectFolderTree.cs
+
+
+ Diagnostics\BlackBerryPaneTraceListener.cs
+
+
+ Diagnostics\PersistentTraceListener.cs
+
+
+ Dialogs\BinaryDiscoveryForm.cs
+ Form
+
+
+ Dialogs\BinaryDiscoveryForm.designer.cs
+ BinaryDiscoveryForm.cs
+
+
+ Dialogs\CachedAuthorForm.cs
+ Form
+
+
+ Dialogs\CachedAuthorForm.designer.cs
+ CachedAuthorForm.cs
+
+
+ Dialogs\FolderForm.cs
+ Form
+
+
+ Dialogs\FolderForm.designer.cs
+ FolderForm.cs
+
+
+ Dialogs\ImportProjectForm.cs
+ Form
+
+
+ Dialogs\ImportProjectForm.designer.cs
+ ImportProjectForm.cs
+
+
+ Editors\BarDescriptorEditorControl.xaml.cs
+ BarDescriptorEditorControl.xaml
+
+
+ Editors\BarDescriptorEditorFactory.cs
+
+
+ Editors\BarDescriptorEditorPane.cs
+
+
+ GuidList.cs
+
+
+ Helpers\AttributeHelper.cs
+
+
+ Helpers\CertHelper.cs
+
+
+ Helpers\CommandHelper.cs
+
+
+ Helpers\DialogHelper.cs
+
+
+ Helpers\DteHelper.cs
+
+
+ Helpers\IconHelper.cs
+
+
+ Helpers\MessageBoxHelper.cs
+
+
+ Helpers\ProjectHelper.cs
+
+
+ Languages\Qml\QmlColorizer.cs
+
+
+ Languages\Qml\QmlLanguageService.cs
+
+
+ Languages\Qml\QmlWindowManager.cs
+
+
+ Model\bar-descriptor.cs
+
+
+ Model\bar-descriptor.Extensions.cs
+
+
+ Model\Integration\ComboBoxItem.cs
+
+
+ Model\Integration\DynamicMenuCommand.cs
+
+
+ Model\Integration\WebBrowserTurbo.cs
+ Component
+
+
+ Model\Wizards\ContextParams.cs
+
+
+ Model\Wizards\NewProjectItemParams.cs
+
+
+ Model\Wizards\NewProjectParams.cs
+
+
+ Options\ApiLevelOptionControl.cs
+ UserControl
+
+
+ Options\ApiLevelOptionControl.designer.cs
+ ApiLevelOptionControl.cs
+
+
+ Options\ApiLevelOptionPage.cs
+ Component
+
+
+ Dialogs\AboutForm.cs
+ Form
+
+
+ Dialogs\AboutForm.designer.cs
+ AboutForm.cs
+
+
+ Dialogs\AddLocalNdkForm.cs
+ Form
+
+
+ Dialogs\AddLocalNdkForm.designer.cs
+ AddLocalNdkForm.cs
+
+
+ Dialogs\CertificateDetailsForm.cs
+ Form
+
+
+ Dialogs\CertificateDetailsForm.designer.cs
+ CertificateDetailsForm.cs
+
+
+ Dialogs\CskRequestForm.cs
+ Form
+
+
+ Dialogs\CskRequestForm.designer.cs
+ CskRequestForm.cs
+
+
+ Dialogs\DebugTokenDeploymentForm.cs
+ Form
+
+
+ Dialogs\DebugTokenDeploymentForm.designer.cs
+ DebugTokenDeploymentForm.cs
+
+
+ Dialogs\DeviceForm.cs
+ Form
+
+
+ Dialogs\DeviceForm.designer.cs
+ DeviceForm.cs
+
+
+ Dialogs\InstallConfirmationForm.cs
+ Form
+
+
+ Dialogs\InstallConfirmationForm.designer.cs
+ InstallConfirmationForm.cs
+
+
+ Dialogs\InstallForm.cs
+ Form
+
+
+ Dialogs\InstallForm.designer.cs
+ InstallForm.cs
+
+
+ Dialogs\ListItemControl.cs
+ UserControl
+
+
+ Dialogs\ListItemControl.designer.cs
+ ListItemControl.cs
+
+
+ Dialogs\MissingNdkInstalledForm.cs
+ Form
+
+
+ Dialogs\MissingNdkInstalledForm.designer.cs
+ MissingNdkInstalledForm.cs
+
+
+ Dialogs\PasswordForm.cs
+ Form
+
+
+ Dialogs\PasswordForm.designer.cs
+ PasswordForm.cs
+
+
+ Dialogs\PinListForm.cs
+ Form
+
+
+ Dialogs\PinListForm.designer.cs
+ PinListForm.cs
+
+
+ Dialogs\RegistrationForm.cs
+ Form
+
+
+ Dialogs\RegistrationForm.designer.cs
+ RegistrationForm.cs
+
+
+ Dialogs\UpdateManagerStatusForm.cs
+ Form
+
+
+ Dialogs\UpdateManagerStatusForm.designer.cs
+ UpdateManagerStatusForm.cs
+
+
+ Options\BackupOptionControl.cs
+ UserControl
+
+
+ Options\BackupOptionControl.designer.cs
+ BackupOptionControl.cs
+
+
+ Options\BackupOptionPage.cs
+ Component
+
+
+ Options\GeneralOptionControl.cs
+ UserControl
+
+
+ Options\GeneralOptionControl.designer.cs
+ GeneralOptionControl.cs
+
+
+ Options\GeneralOptionPage.cs
+ Component
+
+
+ Options\LogsOptionControl.cs
+ UserControl
+
+
+ Options\LogsOptionControl.designer.cs
+ LogsOptionControl.cs
+
+
+ Options\LogsOptionPage.cs
+ Component
+
+
+ Options\SigningOptionControl.cs
+ UserControl
+
+
+ Options\SigningOptionControl.designer.cs
+ SigningOptionControl.cs
+
+
+ Options\SigningOptionPage.cs
+ Component
+
+
+ Options\TargetsOptionControl.cs
+ UserControl
+
+
+ Options\TargetsOptionControl.designer.cs
+ TargetsOptionControl.cs
+
+
+ Options\TargetsOptionPage.cs
+ Component
+
+
+ PackageCommands.cs
+
+
+ Registration\DebugEngineRegistrationAttribute.cs
+
+
+ Registration\ProvideProjects.cs
+
+
+ Registration\ProvideWizardEngineAttribute.cs
+
+
+ Registration\XmlEditorDesignerViewRegistrationAttribute.cs
+
+
+ StandardCommands.cs
+
+
+ ToolWindows\TargetNavigatorControl.xaml.cs
+ TargetNavigatorControl.xaml
+
+
+ ToolWindows\TargetNavigatorPane.cs
+
+
+ ViewModels\ApiLevelOptionViewModel.cs
+
+
+ ViewModels\BackupOptionViewModel.cs
+
+
+ ViewModels\BarEditorViewModel.cs
+
+
+ ViewModels\Common\BinaryToStringConverter.cs
+
+
+ ViewModels\Common\ContentTemplateSelector.cs
+
+
+ ViewModels\Common\CountToVisibilityConverter.cs
+
+
+ ViewModels\Common\NullToVisibilityConverter.cs
+
+
+ ViewModels\ImportProjectViewModel.cs
+
+
+ ViewModels\PackageViewModel.cs
+
+
+ ViewModels\SigningOptionViewModel.cs
+
+
+ ViewModels\TargetNavigatorViewModel.cs
+
+
+ ViewModels\TargetNavigator\BaseViewItem.cs
+
+
+ ViewModels\TargetNavigator\DownloadUploadProgress.cs
+
+
+ ViewModels\TargetNavigator\FileSystemViewItem.cs
+
+
+ ViewModels\TargetNavigator\FileToParentViewItem.cs
+
+
+ ViewModels\TargetNavigator\FileViewItem.cs
+
+
+ ViewModels\TargetNavigator\MessageViewItem.cs
+
+
+ ViewModels\TargetNavigator\ProcessListViewItem.cs
+
+
+ ViewModels\TargetNavigator\ProcessViewItem.cs
+
+
+ ViewModels\TargetNavigator\ProgressViewItem.cs
+
+
+ ViewModels\TargetNavigator\TargetViewItem.cs
+
+
+ ViewModels\TargetsChangedEventArgs.cs
+
+
+ ViewModels\TargetsOptionViewModel.cs
+
+
+ Wizards\BaseWizardEngine.cs
+
+
+ Wizards\PuppetMasterWizardEngine.cs
+
+
+ Dialogs\CachedAuthorForm.resx
+ CachedAuthorForm.cs
+
+
+ Dialogs\ImportProjectForm.resx
+ ImportProjectForm.cs
+
+
+ Options\BackupOptionControl.resx
+ BackupOptionControl.cs
+
+
+
+ Resources\License.txt
+ true
+ Always
+
+
+ Resources\ReleaseNotes.txt
+ true
+
+
+ Resources\StartGuide.txt
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\applicationui.cpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\applicationui.hpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Card\applicationui.cpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Card\applicationui.hpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Card\applicationuibase.cpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Card\applicationuibase.hpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Card\bar-descriptor.xml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Card\cardui.cpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Card\cardui.hpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Card\main.cpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Headless\applicationui.cpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Headless\applicationui.hpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Headless\bar-descriptor.xml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Headless\main-service.cpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Headless\service.cpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Headless\service.hpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\ListView\data.xml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\QtPlayBook\bar-descriptor.xml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\QtPlayBook\main.cpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\QtPlayBook\README.txt
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\bar-descriptor-cascades.xml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\bar-descriptor.xml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\main-cascades.cpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\main-empty.c
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\main-opengl1.c
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\main-opengl2.c
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\main-screen.c
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\precompiled-cascades.h
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\precompiled-empty.h
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\qclass.cpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\qclass.hpp
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\qcontrol.qml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\qdialog.qml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\qpage.qml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\qpane.qml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\qsheet.qml
+ true
+
+
+ Templates\ProjectItems\BlackBerry\Cascades\qcontrol.vsz
+ true
+
+
+ Templates\ProjectItems\BlackBerry\Cascades\qdialog.vsz
+ true
+
+
+ Templates\ProjectItems\BlackBerry\Cascades\qpage.vsz
+ true
+
+
+ Templates\ProjectItems\BlackBerry\Cascades\qpane.vsz
+ true
+
+
+ Templates\ProjectItems\BlackBerry\Cascades\qsheet.vsz
+ true
+
+
+ Templates\Projects\BlackBerry\Cascades\items.vsdir
+ true
+
+
+ Templates\Projects\BlackBerry\cascadesproj.vsz
+ true
+
+
+ Templates\Projects\BlackBerry\libsharedproj.vsz
+ true
+
+
+ Templates\Projects\BlackBerry\libstaticproj.vsz
+ true
+
+
+ Templates\Projects\BlackBerry\openglproj1.vsz
+ true
+
+
+ Templates\Projects\BlackBerry\openglproj2.vsz
+ true
+
+
+ Templates\Projects\BlackBerry\screenproj.vsz
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\main-helloworld.qml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Translations\makefile-cascades
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Translations\qmake-default.pro
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\makefile-cascades
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\qmake-config.pri
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\qmake-default.pro
+ true
+
+
+ Templates\Projects\BlackBerry\Cascades\cascadesproj_card.vsz
+ true
+
+
+ Templates\Projects\BlackBerry\Cascades\cascadesproj_listview.vsz
+ true
+
+
+ Templates\Projects\BlackBerry\Cascades\cascadesproj_navigationpane.vsz
+ true
+
+
+ Templates\Projects\BlackBerry\Cascades\cascadesproj_tabs.vsz
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\main-tabs.qml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Card\card.qml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Card\main.qml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Card\qmake.pro
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\ListView\ItemPage.qml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\ListView\main.qml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\ListView\qmake.pro
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\NavigationPane\DetailsPage.qml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\NavigationPane\main.qml
+ true
+
+
+ Templates\Projects\BlackBerry\Cascades\cascadesproj_headless.vsz
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Headless\main.qml
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Headless\qmake-service.pro
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Assets\Headless\qmake.pro
+ true
+
+
+ Templates\ProjectItems\BlackBerry\bbutil.vsz
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\qtab.qml
+ true
+
+
+ Templates\ProjectItems\BlackBerry\Cascades\qtab.vsz
+ true
+
+
+ Templates\ProjectItems\BlackBerry\makefile.vsz
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\makefile-empty
+ true
+
+
+ Templates\Projects\BlackBerry\Qt\items.vsdir
+ true
+
+
+ Templates\Projects\BlackBerry\Qt\qtproj_playbook.vsz
+ true
+
+
+
+
+
+ Templates\VCWizards\BlackBerry\Shared\Utils\bbutil.c
+ true
+
+
+ Templates\VCWizards\BlackBerry\Shared\Utils\bbutil.h
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ Menus.ctmenu
+ Designer
+
+
+
+ Dialogs\BinaryDiscoveryForm.resx
+ BinaryDiscoveryForm.cs
+
+
+ Dialogs\FolderForm.resx
+ FolderForm.cs
+
+
+ Options\ApiLevelOptionControl.resx
+ ApiLevelOptionControl.cs
+
+
+ Dialogs\AboutForm.resx
+ AboutForm.cs
+
+
+ Dialogs\AddLocalNdkForm.resx
+ AddLocalNdkForm.cs
+
+
+ Dialogs\CertificateDetailsForm.resx
+ CertificateDetailsForm.cs
+
+
+ Dialogs\CskRequestForm.resx
+ CskRequestForm.cs
+
+
+ Dialogs\DebugTokenDeploymentForm.resx
+ DebugTokenDeploymentForm.cs
+
+
+ Dialogs\DeviceForm.resx
+ DeviceForm.cs
+
+
+ Dialogs\InstallConfirmationForm.resx
+ InstallConfirmationForm.cs
+
+
+ Dialogs\InstallForm.resx
+ InstallForm.cs
+
+
+ Dialogs\ListItemControl.resx
+ ListItemControl.cs
+
+
+ Dialogs\MissingNdkInstalledForm.resx
+ MissingNdkInstalledForm.cs
+
+
+ Dialogs\PasswordForm.resx
+ PasswordForm.cs
+
+
+ Dialogs\PinListForm.resx
+ PinListForm.cs
+
+
+ Dialogs\RegistrationForm.resx
+ RegistrationForm.cs
+
+
+ Dialogs\UpdateManagerStatusForm.resx
+ UpdateManagerStatusForm.cs
+
+
+ Options\GeneralOptionControl.resx
+ GeneralOptionControl.cs
+
+
+ Options\LogsOptionControl.resx
+ LogsOptionControl.cs
+
+
+ Options\SigningOptionControl.resx
+ SigningOptionControl.cs
+
+
+ Options\TargetsOptionControl.resx
+ TargetsOptionControl.cs
+
+
+ Resources\Logo.png
+
+
+ Resources\Package.Bitmaps.vsct
+
+
+ Resources\Package.Menu.vsct
+
+
+ Resources\Navigator\folder_closed.png
+
+
+ Resources\Navigator\folder_opened.png
+
+
+ Resources\Navigator\process.png
+
+
+ Resources\Navigator\target.png
+
+
+ Resources\Navigator\target_disconnected.png
+
+
+ Resources\Navigator\thread.png
+
+
+ Resources\Permissions\BlackBerryMessager.bmp
+
+
+ Resources\Permissions\Calendar.bmp
+
+
+ Resources\Permissions\Camera.bmp
+
+
+ Resources\Permissions\CaptureScreen.bmp
+
+
+ Resources\Permissions\Contacts.bmp
+
+
+ Resources\Permissions\DeviceIdentifyingInfo.bmp
+
+
+ Resources\Permissions\EmailPINMessages.bmp
+
+
+ Resources\Permissions\Gamepad.bmp
+
+
+ Resources\Permissions\GPSLocation.bmp
+
+
+ Resources\Permissions\Internet.bmp
+
+
+ Resources\Permissions\Location.bmp
+
+
+ Resources\Permissions\Mircrophone.bmp
+
+
+ Resources\Permissions\MyContactInfo.bmp
+
+
+ Resources\Permissions\Notebooks.bmp
+
+
+ Resources\Permissions\Phone.bmp
+
+
+ Resources\Permissions\PhoneControl.bmp
+
+
+ Resources\Permissions\PostNotifications.bmp
+
+
+ Resources\Permissions\Push.bmp
+
+
+ Resources\Permissions\RunBackgrounded.bmp
+
+
+ Resources\Permissions\SharedFiles.bmp
+
+
+ Resources\Permissions\TextMessages.bmp
+
+
+ Templates\Projects\BlackBerry.vsdir
+ true
+
+
+ Templates\Projects\BlackBerry\emptyproj.vsz
+ true
+
+
+ Templates\Projects\BlackBerry\items.vsdir
+ true
+
+
+ Templates\Projects\BlackBerry\OpenGL\items.vsdir
+ true
+
+
+ Templates\ProjectItems\BlackBerry.vsdir
+ true
+
+
+ Templates\ProjectItems\BlackBerry\bar-descriptor.vsz
+ true
+
+
+ Templates\ProjectItems\BlackBerry\items.vsdir
+ true
+
+
+ Templates\ProjectItems\BlackBerry\Cascades\items.vsdir
+ true
+
+
+ Templates\ProjectItems\BlackBerry\Cascades\qclass.vsz
+ true
+
+
+ Always
+ true
+
+
+ True
+ True
+ Strings.resx
+
+
+
+
+
+
+ Resources\Template.Strings.resx
+
+
+ ResXFileCodeGenerator
+ Strings.Designer.cs
+ Designer
+
+
+ true
+ Package
+ Designer
+
+
+
+
+ Designer
+ Always
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Editors\BarDescriptorEditorControl.xaml
+ MSBuild:Compile
+ Designer
+
+
+ ToolWindows\TargetNavigatorControl.xaml
+ MSBuild:Compile
+ Designer
+
+
+
+
+ False
+ Microsoft .NET Framework 4 %28x86 and x64%29
+ true
+
+
+ False
+ .NET Framework 3.5 SP1 Client Profile
+ false
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
+ False
+ Windows Installer 3.1
+ true
+
+
+
+
+ {59A7B188-E307-4495-A3AF-4ED76B086A87}
+ BlackBerry.DebugEngine
+
+
+ {9A560339-44DB-413F-868C-403962C2CF01}
+ BlackBerry.GDBHost
+ false
+ BuiltProjectOutputGroup%3bBuiltProjectOutputGroupDependencies%3bGetCopyToOutputDirectoryItems%3bSatelliteDllsProjectOutputGroup%3b
+ DebugSymbolsProjectOutputGroup%3b
+
+
+ {36D4495B-9A92-478F-BF95-AEA13804A7BA}
+ BlackBerry.NativeCore
+
+
+
+
+ true
+
+
+
+
+
\ No newline at end of file
diff --git a/src_vs2010/Package/GlobalSuppressions.cs b/src_vs2010/Package/GlobalSuppressions.cs
new file mode 100644
index 00000000..d73697ea
--- /dev/null
+++ b/src_vs2010/Package/GlobalSuppressions.cs
@@ -0,0 +1,25 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+// This file is used by Code Analysis to maintain SuppressMessage
+// attributes that are applied to this project. Project-level
+// suppressions either have no target or are given a specific target
+// and scoped to a namespace, type, member, etc.
+//
+// To add a suppression to this file, right-click the message in the
+// Error List, point to "Suppress Message(s)", and click "In Project
+// Suppression File". You do not need to add suppressions to this
+// file manually.
+
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1017:MarkAssembliesWithComVisible")]
diff --git a/src/VSNDK.Package/Key.snk b/src_vs2010/Package/Key.snk
similarity index 100%
rename from src/VSNDK.Package/Key.snk
rename to src_vs2010/Package/Key.snk
diff --git a/src_vs2010/Package/Properties/AssemblyInfo.cs b/src_vs2010/Package/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..a10364c6
--- /dev/null
+++ b/src_vs2010/Package/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+//* Copyright 2010-2011 Research In Motion Limited.
+//*
+//* Licensed under the Apache License, Version 2.0 (the "License");
+//* you may not use this file except in compliance with the License.
+//* You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+
+using System;
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using BlackBerry.NativeCore;
+using BlackBerry.Package;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+
+[assembly: AssemblyTitle("BlackBerry Native SDK Plugin for Visual Studio")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("BlackBerry")]
+[assembly: AssemblyProduct("BlackBerry.Package")]
+[assembly: AssemblyCopyright("Copyright © BlackBerry 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+[assembly: ComVisible(false)]
+[assembly: CLSCompliant(false)]
+[assembly: NeutralResourcesLanguage("en-US")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion(ConfigDefaults.VersionString)]
+[assembly: AssemblyFileVersion(ConfigDefaults.VersionString)]
+
+#if DEBUG
+[assembly: InternalsVisibleTo("IntegrationTests")]
+[assembly: InternalsVisibleTo("UnitTests")]
+#endif
diff --git a/src_vs2010/Package/Resources/File.ico b/src_vs2010/Package/Resources/File.ico
new file mode 100644
index 00000000..375d2cbc
Binary files /dev/null and b/src_vs2010/Package/Resources/File.ico differ
diff --git a/src/VSNDK.Package/Resources/Images_24bit.bmp b/src_vs2010/Package/Resources/Images_24bit.bmp
similarity index 100%
rename from src/VSNDK.Package/Resources/Images_24bit.bmp
rename to src_vs2010/Package/Resources/Images_24bit.bmp
diff --git a/src/VSNDK.Package/Resources/Images_32bit.bmp b/src_vs2010/Package/Resources/Images_32bit.bmp
similarity index 100%
rename from src/VSNDK.Package/Resources/Images_32bit.bmp
rename to src_vs2010/Package/Resources/Images_32bit.bmp
diff --git a/src_vs2010/Package/Resources/Package.ico b/src_vs2010/Package/Resources/Package.ico
new file mode 100644
index 00000000..c5dd0a3f
Binary files /dev/null and b/src_vs2010/Package/Resources/Package.ico differ
diff --git a/src_vs2010/Package/Resources/Package.resx b/src_vs2010/Package/Resources/Package.resx
new file mode 100644
index 00000000..d83477a7
--- /dev/null
+++ b/src_vs2010/Package/Resources/Package.resx
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+
+
+