Using Visual Studio Debugger
search cancel

Using Visual Studio Debugger

book

Article ID: 228127

calendar_today

Updated On:

Products

CA Plex

Issue/Introduction

WinC PLEX function (which is part of a really big project) that works fine in a development environment.

Unfortunately doesn't work in some deployment environments. (All works fine except this function)

Need to debug this function in the deployment environment to detect the problem.

Would like to use Visual Studio to Debug.

 

Environment

Release: 7.2

 

Resolution

Please find the steps outlined below to debug the specific function along with binaries built with release mode.

Following the below instructions will build the specific function's binaries in Release With PDB mode that is ready for debugging.

Open specific function Project in Visual Studio e.g. <FunctionImplentationName>.vcxproj from Gen/Project folder.

After the project opens, ensure the configuration selected is Release.           

Select Project -> Right Click and Properties.             

In the Project Properties Window, change the compilation properties.

4.1. Set Optimization from Minimize (/01) to – Disabled (/0d)         

4.2. Set Debug Information Format from Empty to Program Database (/Zi)              

4.3. Set Generate Debug Info from Empty to Yes (/DEBUG)           

4.4. Set Precompiled Header from Use (/Yu) to Create (/Yc)             

4.5. Close the Project Property window and make sure the changes have been saved.

Build the Project - Right Click on the project name and select Build/Rebuild.

Build should be successful.

Now, you should have a debug version of binaries (Release With PDB) for a specific function.

You can close this open project.

Now you can debug this specific function.

Deploy the specific function-built binaries (Dll, PDB).

Launch the application (top-level EXE).

Open Visual Studio IDE and click on the tool menu “Debug -> Attach to Process..” and select the top-level application you have just launched in step 10.             

Click on Attach push button.

Open the generated source code file (File -> Open) <FunctionImplementationName>.CPP e.g. AA2F.cpp.

Keep a breakpoint accordingly in the opened source file, possibly to start with the constructor of the function.

Execute the process flow in your launched application that can load the function that you want to debug here.

Once the breakpoint is triggered, continue to debug the application as required.

This will help to debug the business logic within the specific function.

Additional Information

https://docs.microsoft.com/en-us/cpp/build/how-to-debug-a-release-build?view=msvc-160

https://community.broadcom.com/enterprisesoftware/communities/community-home/digestviewer/viewthread?GroupId=1921&MID=820776&CommunityKey=a6f323f2-4e9f-4dc3-a1d8-663ba79c3eaf&tab=digestviewer