From ba6fb69665dc2aa3612b04221b94b32c4fd1d63e Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Mon, 26 Feb 2018 14:20:11 -0800 Subject: [PATCH] initial add of 1.1.14 legacy SDK support for visual studio. Updated documentation --- .gitignore | 4 +- Visual Studio/SimpleSerialAnalyzer.sln | 8 ++- Visual Studio/SimpleSerialAnalyzer.vcxproj | 72 ++++++++++++++++++++++ docs/Analyzer SDK Setup.md | 33 ++++------ readme.md | 20 ++---- 5 files changed, 98 insertions(+), 39 deletions(-) diff --git a/.gitignore b/.gitignore index 45f00b1..6d27ab2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ Debug/ Release/ +Debug-Legacy-1.1.14/ *.VC.db *.VC.opendb *.suo -*.sln.ecd \ No newline at end of file +*.sln.ecd +*.vcxproj.user \ No newline at end of file diff --git a/Visual Studio/SimpleSerialAnalyzer.sln b/Visual Studio/SimpleSerialAnalyzer.sln index fa20107..4b1727f 100644 --- a/Visual Studio/SimpleSerialAnalyzer.sln +++ b/Visual Studio/SimpleSerialAnalyzer.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimpleSerialAnalyzer", "SimpleSerialAnalyzer.vcxproj", "{D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}" EndProject @@ -9,6 +9,8 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 + Debug-Legacy-1.1.14|Win32 = Debug-Legacy-1.1.14|Win32 + Debug-Legacy-1.1.14|x64 = Debug-Legacy-1.1.14|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection @@ -17,6 +19,10 @@ Global {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Debug|Win32.Build.0 = Debug|Win32 {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Debug|x64.ActiveCfg = Debug|x64 {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Debug|x64.Build.0 = Debug|x64 + {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Debug-Legacy-1.1.14|Win32.ActiveCfg = Debug-Legacy-1.1.14|Win32 + {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Debug-Legacy-1.1.14|Win32.Build.0 = Debug-Legacy-1.1.14|Win32 + {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Debug-Legacy-1.1.14|x64.ActiveCfg = Debug-Legacy-1.1.14|x64 + {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Debug-Legacy-1.1.14|x64.Build.0 = Debug-Legacy-1.1.14|x64 {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Release|Win32.ActiveCfg = Release|Win32 {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Release|Win32.Build.0 = Release|Win32 {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Release|x64.ActiveCfg = Release|x64 diff --git a/Visual Studio/SimpleSerialAnalyzer.vcxproj b/Visual Studio/SimpleSerialAnalyzer.vcxproj index f7ffdd9..93aca51 100644 --- a/Visual Studio/SimpleSerialAnalyzer.vcxproj +++ b/Visual Studio/SimpleSerialAnalyzer.vcxproj @@ -1,6 +1,14 @@  + + Debug-Legacy-1.1.14 + Win32 + + + Debug-Legacy-1.1.14 + x64 + Debug Win32 @@ -42,11 +50,21 @@ v140 Unicode + + DynamicLibrary + v140 + Unicode + DynamicLibrary v140 Unicode + + DynamicLibrary + v140 + Unicode + @@ -59,9 +77,15 @@ + + + + + + <_ProjectFileVersion>14.0.24720.0 @@ -71,9 +95,17 @@ $(Platform)\$(Configuration)\ true + + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + true + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ @@ -102,6 +134,27 @@ MachineX86 + + + Disabled + $(ProjectDir)..\LegacyAnalyzerSDK\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;SIMPLESERIALANALYZER_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + Analyzer.lib;%(AdditionalDependencies) + $(ProjectDir)..\LegacyAnalyzerSDK\lib;%(AdditionalLibraryDirectories) + true + Windows + MachineX86 + + Disabled @@ -121,6 +174,25 @@ Windows + + + Disabled + $(ProjectDir)..\LegacyAnalyzerSDK\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;SIMPLESERIALANALYZER_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + Analyzer64.lib;%(AdditionalDependencies) + $(ProjectDir)..\LegacyAnalyzerSDK\lib;%(AdditionalLibraryDirectories) + true + Windows + + MaxSpeed diff --git a/docs/Analyzer SDK Setup.md b/docs/Analyzer SDK Setup.md index fafd36d..2d8d1f9 100644 --- a/docs/Analyzer SDK Setup.md +++ b/docs/Analyzer SDK Setup.md @@ -29,44 +29,33 @@ Once you have set that directory and restarted the software, your new custom ana ## Debugging an Analyzer with Visual Studio -Newer versions of the Saleae software cannot be used to debug custom analyzers. This means that older versions of the software and SDK must be used if you wish to attach a debugger and step through your code. +Newer versions of the Saleae software cannot be used to debug custom analyzers on Windows. This means that older versions of the software and SDK must be used if you wish to attach a debugger and step through your code. This complicates debugging on Windows, unfortunately, but it can be done. *Note: it is impossible to attach a debugger to any version of the software that supports the new products. We are working on a solution to this problem, but for now that means you must rely on the simulation data generator for your analyzer to produce captures you can then debug in the older software.* -To debug your custom analyzer, we recommend you use the 1.1.14 SDK with the 1.1.18 software. Because older versions of the software and SDK are 32 bit only, you will only be able to compile for 32 bit initially. Later, when you build the analyzer with the latest version of the SDK, you will be able to compile for 32 bit and 64 bit. +To debug your custom analyzer, you will need to download the 32-bit standalone copy of our older, 1.1.18 software. -The SampleAnalyzer repository and the AnalyzerSDK repository have been setup to make switching versions of the SDK easy. The SampleAnalyzer repository has a branch named "1.1.14-for-win32-debug". This branch and the master branch have exactly the same source code - the only difference is the project settings and the AnalyzerSDK submodule reference, which now points to the 1.1.14 AnalyzerSDK. - -Download the 32 bit stand-alone copy of the 1.1.18 software. The 32 bit standalone copy is required because the normal installer will not let you install the 32 bit software on a 64 bit operating system. - -Logic 1.1.18, 32 bit stand-alone: http://downloads.saleae.com/betas/1.1.18/Logic1.1.18BetaWin32Standalone.zip -This is also convenient because you will not need to uninstall the latest Saleae Logic software, or install this version. Simply unzip and run the 1.1.18 software. +This is a sandalone download and does not need to be installed. Just extract the zip file and run the contained Logic.exe. Please note - switching between Saleae Logic software versions has a tendency to reset the software's settings. This could cause the analyzer developer directory to get reset. If you no longer see your analyzer in the list, please verify that the analyzer developer directory is still set properly. -To build and and debug your custom analyzer using the 1.1.14 sofware, follow these steps: +To build and and debug your custom analyzer using the 1.1.14 software, follow these steps: -- Switch to the "1.1.14-for-win32-debug" branch of the SampleAnalyzer repository. - Using Visual Studio, open the solution file in the Visual Studio Folder. -- Switch the solution platform to from x64 to Win32. x64 is not able to build on this branch. -- Build the debug configuration. -- Launch the 1.1.18 32-bit Logic software. If the analyzer directory is not already configured, set that, and restart the software. +- Select the solution configuration "Debug-Legacy-1.1.14" +- Select the platform "Win32" +- Build the solution +- Launch the 1.1.18 32-bit Logic software. If the analyzer directory is not already configured, set that to the `Visual Studio\Win32\Debug-Legacy-1.1.14` directory, and restart the software. - The analyzer should now be visible in the list of analyzers you can add. - In visual studio, open the Debug Menu, and select "Attach to process..." - Locate Logic.exe in the list, select it, and click the Attach button. -- Add a break point on any line near the top of the WorkerThread() function, such as line 27, *mSampleRateHz = GetSampleRate();* +- Add a break point on any line near the top of the WorkerThread() function, such as line 27, mSampleRateHz = GetSampleRate(); - In the Logic software, add your custom analyzer if you haven't already, and start a simulation. -- The breakpoint should hit. - - -**Updating to the latest SDK** - -Once you have finished debugging your analyzer using the "1.1.14-for-win32-debug" branch, we recommend committing your changes and then cherry-picking your commits to the master branch. Please do not simply merge changed into the master branch, as that may pick up other project settings not compatible with the latest SDK. - -In the future, we would like to simplify this even more, so branch switching is not required. +- The breakpoint should hit +Optionally you can change the debugger command in visual studio to point to the older Logic.exe binary. Then you will be able to start debugging simply by pressing run in Visual Studio. **Common issues on Windows** diff --git a/readme.md b/readme.md index 660e3e5..d468764 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,5 @@ # Saleae Analyzer SDK Sample Analyzer -The Saleae Analyzer SDK is used to create custom plugins for the Saleae Logic software. These plugins are used to decode protocol data from captured waveforms. +The Saleae Analyzer SDK is used to create custom plugins for the Saleae Logic software. These plugins are used to decode protocol data from captured waveforms. The libraries required to build a custom analyzer are stored in another git repository, located here: [https://github.com/saleae/AnalyzerSDK](https://github.com/saleae/AnalyzerSDK) @@ -10,6 +10,8 @@ First, fork, clone or download this repository. Forking is recommended if you pl Note - This repository contains a submodule. Be sure to include submodules when cloning, for example `git clone --recursive https://github.com/saleae/SampleAnalyzer.git`. If you download the repository from Github, the submodules are not included. In that case you will also need to download the AnalyzerSDK repository linked above and place the AnalyzerSDK folder inside of the SampleAnalyzer folder. +*Note: an additional submodule is used for debugging on Windows, see section on Windows debugging for more information.* + Once downloaded, first run the script rename_analyzer.py. This script is used to rename the sample analyzer automatically. Specifically, it changes the class names in the source code, it changes the text name that will be displayed once the custom analyzer has been loaded into the Saleae Logic software, and it updates the visual studio project. There are two names you need to provide to rename_analyzer. The first is the class name. For instance, if you are developing a SPI analyzer, the class names would be SPIAnalyzer, SPIAnalyzerResults, SPIAnalyzerSettings, etc. @@ -31,18 +33,6 @@ To build on Linux or OSX, run the build_analyzer.py script. The compiled librari python build_analyzer.py -To debug on Windows, please first review the article here: +To debug on Windows, please first review the section titled `Debugging an Analyzer with Visual Studio` in the included `doc/Analyzer SDK Setup.md` document. -[How do I develop custom analyzers for the Logic software on Windows?](http://support.saleae.com/hc/en-us/articles/208666946) - -On Windows, it is not possible to attach a debugger to the latest software. In order to debug custom analyzers on Windows, you need to use an older version of the Windows software. -Specifically, you will need the Saleae Logic 1.1.18 Windows 32 bit standalone release. You can find it here: - -[Older Saleae Logic Beta Downloads](http://support.saleae.com/hc/en-us/articles/210245603) - -You will also need the 1.1.14 SDK, the last SDK release to support software versions 1.1.14-1.1.18. That is available on a separate branch of the Saleae AnalyzerSDK Github repository. Simply change the submodule configuration to point to that branch, and the existing visual studio project will just work. Be sure to only compile for 32 bit, since the 1.1.14 SDK was released before Saleae began targeting 64 bit Windows. This is also why the 32 bit standalone version of the 1.1.18 software is required. -It's also worth noting that you should use a #define and #ifdef to remove the contents of your Analyzer's GenerateFrameTabularText methods, because the methods ClearTabularText and AddTabularText were not yet present in the 1.1.14 SDK. - -The Sample Analyzer Project also contains a branch, 1.1.14-for-win32-debug, which already contains the updated git submodule branch. Simply merge your changes into that branch, and then you will not need to switch submodule branches. - -In the future, I would like to update this so that no branch changes are required, and the visual studio project just contains configurations for both the latest SDK and the 1.1.14 SDK. +Unfortunately, debugging is limited on Windows to using an older copy of the Saleae Logic software that does not support the latest hardware devices. Details are included in the above document. \ No newline at end of file