Products | Versions |
---|---|
TIBCO DataSynapse GridServer | - |
Not Applicable | - |
Resolution:
How to debug CPP Services using the Release Mode
GS4.2u19 GS5.1, VS8
Since the debug mode is not officially supported, here is a suggested way for debugging a CPP Service code using the release mode:
* Set the specific Service Type:
o On the relevant Service Type Registry, set unloadNativeLibrary to false and save it.
* Reconfigure the release mode (VC8):
o Right click on the service project > Properties > C/C++.
+ Under General, change the Debug Info Format to Program DB for Edit & Config (/ZI).
+ Under Optimization, Disable Optimization (Disabled (/OD)) and set Inline Function Expansion to Default.
o On the left window of the Property Pages, choose Linker > Debugging > Generate Debug Info set to Yes (/Debug). This should link the PDB file to the service, so PDB files are not needed to be deployed.
* Build the Service project, deploy it and run the client. (we only run the client here to load the Service DLL to the engines memory)
* Using Process Explorer on the engine side, make sure the service dll is still loaded and can be found in memory (under the invoke.exe process)
* Back on VC8, attach the process:
o Open a new empty VC8 window and drag and drop the service project into it. Now you should have two VS windows open.
o In the new VS window: Tool > attach to process > tick "show processes from all use" > locate the invoke.exe and attach it (double click on invoke.exe)
o Set break points for the debugger.
o Rerun the client (from the "old" VS).
o The debugger stops on the first breaking point. Use the "new" VS to debug the code.
* When done, reset the unloadNativeLibrary in the Service Type Registry back to false.