PowerBuilder IDE provides PowerScript and C++ cross-language integrated debugging for scenarios such as a PowerBuilder application calls the C# assembly. The cross-language debugging allows you to use the PowerBuilder debugger to debug PowerScripts and use SnapDevelop to debug the C# assembly. When the PowerBuilder debugger goes to the script where the DotNetObject object executes the C# functions, SnapDevelop will be launched automatically to assist the debug; and when SnapDevelop finishes debugging the C# functions, it will return you to the PowerBuilder debugger and you can continue debugging the remaining PowerScripts.
However, before you can use the PowerScript and C++ cross-language debugging, you will need to compile the C# assembly and configure the PowerBuilder IDE as required below.
Step 1: Build the C# assembly DLL under the debug mode in SnapDevelop.
When build completes, you shall be able to find the DLL file and the PDB file in the same folder.
About the PDB file
The PDB file stores the debugging and project state information about the DLL file. It must be placed with the DLL file while debugging.
The DLL file and the PDB file must exactly match with each other in order for debugging to work. You cannot use a PDB file from a different build even though the source files are exactly the same (exact duplication). It is recommended that you build the C# assembly DLL again in the same machine where debugging will be performed, so that the DLL file and the PDB file can exactly match with each other and comply with the current environment.
Step 2: Make sure to always place the DLL file and the PDB file together in the same folder, if you need to move the DLL and PDB files (for example, copy them to a location that can be called by the PowerBuilder application).
Step 3: Enable the Launch SnapDevelop to debug C# assemblies option in the PowerBuilder IDE so that when you debug the PowerBuilder application which calls the C# assembly, SnapDevelop can be launched automatically to debug the C# assembly.
-
Select Tools | System Options menu in the PowerBuilder IDE.
-
Make sure the Launch SnapDevelop to debug C# assemblies option is selected on the General tab.
After that, you can start the PowerBuilder debugger in the PowerBuilder IDE and select Step In to run through the scripts; when the debugger goes to the script where the C# function is executed, SnapDevelop will be launched automatically to debug the C# function.