You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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/

Install both versions (32bits and 64 bits), in separate directories. Use the one that matches the architecture of the dll or exe that you are troubleshooting.

Checkout code

Subversion:

https://repos.deltares.nl/repos/delft-tools/branches/nghs-1.1

https://svn.oss.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)    Use subversions 'update item to revision' option to switch to the right version of (2), if needed.

At the time of writing this document, the RTCTools_OpenMI.dll had no version number. If this gets fixed in the future, this version can be found in the file properties (right mouse button click on file, 'Properties', tab 'Details').

The steps I took now:

  1. right mouse button click on fRTCTools_OpenMI.dll, 'TortoiseSVN', 'SVN log'. This shows the following information 
  2. If you follow the links you will learn that the file is built the following teamcity configuration 
  3. If you check the settings of that configuration it shows that the subversion root is 
  4. Do the same for the other file (Deltares.RtcTools.Net.dll), and you'll learn that it's root is the same

Build RTC-Tools on your machine:

Execute <rtctools>\oss\RTCTools\cmake\win32\builddebug.bat

You might need to edit the script to include the absolute path to cmake (if you have not added it to your path).

As a result of the previous step the file RTCTools.sln was created. Open this in VS2010.

Build the code there, in debug mode. This should not cause any issues.

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

 

  • No labels