How to proceed when you want to debug RTC-Tools C++-code from within NGHS1.1 C#-code. This description is specific to that version of the code, since the exact details have changed over time (and probably will change again in the future). It is needed to keep this document up to date.
Prerequisites:
Install CMake, https://cmake.org
Install Visual Studio 2010, with the C++ compiler
Install depends (for troubleshooting), http://www.dependencywalker.com/
Checkout code
Subversion:
https://repos.deltares.nl/repos/delft-tools/branches/nghs-1.1
https://repos.deltares.nl/repos/rtc-tools/branches/RTC-Tools_1_4
Be sure to check that the versions of the dll that is used by the NGHS-code (1) is the same as the version you check out (2).
(1) The kernel exist at the following location in the repository:
<nghs1.1>\src\DeltaShell.Plugins.DelftModels.RealTimeControl\rtc_kernel\
Its version can be checked by examining the svn revision of file ‘RTCTools_OpenMI.dll’
(2)
todo: juiste versie RTC zoeken (svn log op dll, versie 971 (trunk en nghs 1.1-branch)
Build RTC-Tools on your machine:
Execute <rtctools>\oss\RTCTools\cmake\win32\builddebug.bat
As a result of the previous step the file RTCTools.sln was created. Open this in VS2010.
Build the code there.
Copy debug dll’s to nghs1.1 codebase:
Dll’s can be found in the following directory:
<rtctools>\oss\RTCTools\bin
Copy them to the correct location in the Delta Shell sources, which are (1) and
<nghs1.1>\src\DeltaShell.Plugins.DelftModels.RealTimeControl\lib\
Note that some files have the same name, but are bigger. This is because they are debug versions, but this is not reflected in their name.
As an extra, also copy the following files to (1):
<rtctools>\bin\debug\vcomp100d.dll
<rtctools>\bin\debug\RTCTools_OpenMI.pdb
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\redist\Debug_NonRedist\x86\Microsoft.VC100.DebugCRT\msvcp100d.dll
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\redist\Debug_NonRedist\x86\Microsoft.VC100.DebugCRT\msvcr100d.dll
Do a full rebuild, and check that the files are indeed in the correct location:
Todo specify location
Set project properties to make sure the external code can be debugged:
jklf
Make you sure you start in the right configuration (32/64 bits):
jklf