cTrader 3.0 - Debugging (PDB files)

Created at 01 May 2018, 20:40
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
MA

MaRCHeW

Joined 05.05.2012

cTrader 3.0 - Debugging (PDB files)
01 May 2018, 20:40


Hi Spotware,

My breakpoints can't be hit because there are no PDB files loaded to Visual Studio 2017. Can you tell me where can I find them or give me a hint how to debug cBots in VS 2017 and cTrader 3.0?

Regards

MaRCHeW


@MaRCHeW
Replies

MaRCHeW
03 May 2018, 19:55

Hi,

I'd like to notice that the debugging doesn't work for cAlgo 2.01 (Pepperstone).

Please confirm this issue.

Regards

MaRCHeW


@MaRCHeW

ClickAlgo
06 May 2018, 11:13

Hi MarCHeW,

Debugging using Visual Studio 2015 or 2017 does work with cTrader, take a look at the link below which also has a video showing you how to do this, make sure your build configuration is set to Debug and not Release, if you still have an issue it will be the Visual Studio IDE and not the trading platform.

https://clickalgo.com/how-to-debug-ctrader-algo-visual-studio

Paul Hayes
Sales & Marketing
Emailcontact@clickalgo.com
Phone: (44) 203 289 6573
Websitehttps://clickalgo.com

 

 


@ClickAlgo

MaRCHeW
06 May 2018, 13:57

RE:

Hi Paul,

Thanks for your response, but as you know cAlgo is build-in cTrader 3.0 and you can attach only to this process.
Moreover "Debug" is default option used by VS during compilation and I didn't change it to "Release" mode.

 

To Spotware,

I've fixed problem and debugging is working now on both VS2015 and VS2017.

 

Regards

MaRCHeW

 

Paul_Hayes said:

Hi MarCHeW,

Debugging using Visual Studio 2015 or 2017 does work with cTrader, take a look at the link below which also has a video showing you how to do this, make sure your build configuration is set to Debug and not Release, if you still have an issue it will be the Visual Studio IDE and not the trading platform.

https://clickalgo.com/how-to-debug-ctrader-algo-visual-studio

Paul Hayes
Sales & Marketing
Emailcontact@clickalgo.com
Phone: (44) 203 289 6573
Websitehttps://clickalgo.com

 

 

 


@MaRCHeW

acrigney
04 Jun 2018, 03:51

No symbols loaded for cTrader 3.0

Please help!

I have installed the latest cBots from the visual studio market place but I am unable to debug my cbots, I get No symbols loaded.

I created a new cBot and I am still unable to set a break point in the OnStart() event or OnBar events

I tried all of these options.

https://stackoverflow.com/questions/2155930/how-do-i-remedy-the-the-breakpoint-will-not-currently-be-hit-no-symbols-have-b

 

But there are no pdb files generated in the bin folder of the project, the name.algo file gets generated in the Robots folder ok.

 

Best Regards,

                    Alistair


@acrigney

ClickAlgo
04 Jun 2018, 08:53

Hi Alistair,

This is a Microsoft Visual Studio problem, you would be better off posting on StackOverflow.

But first, make sure that you have set the solution configuration to debug and not release.

Paul Hayes
Sales & Marketing
Emailcontact@clickalgo.com
Phone: (44) 203 289 6573
Websitehttps://clickalgo.com


@ClickAlgo

robotic
07 Aug 2018, 20:18 ( Updated at: 21 Dec 2023, 09:20 )

Hello, Paul

Please provide either .pdb files or build cTrader.exe with debug info.
There is no possibility to debug cBot in VS (I use VS2017) without PDB - breakpoint will be missed.


@robotic

PanagiotisCharalampous
08 Aug 2018, 10:39

Hi robotic,

.pdb files are not needed. What you debug is the cBot and not cTrader. If you follow the instructions you should have no problem setting breakpoints.

Best Regards,

Panagiotis


@PanagiotisCharalampous

gonzsanc
27 Sep 2019, 11:44

Hi.

The problem with the symbols is because you start debugging in the wrong way.

The steps are the following ones:

  1. Check that your indicator or bot IS NOT RUNNING on Ctrader. If it is on any of the open charts, then unload it.
  2. Select Edit in Visual Studio as explained in the instructions.
  3. Once Visual Studio is opened, switch to Debug mode as explained and COMPILE.
  4. After successfully compiling, set your breakpoints. And NOW the thing becomes interesting...
  5. Go to Debug > Attach to process and attach as explained to Ctrader.exe (this is written in 2019, so if you read this years later, then check if the process has another name then).
  6. Now you can see that the symbols are not loaded, why? Because YOU ARE NOT RUNNING the indicator/bot on Ctrader.
  7. Switch to your Ctrader application and load your indicator/bot on any of the charts.
  8. Now the indicator is running on Ctrader and when it reaches your breakpoint, you will be able to see the stack and all the other stuff.

Therefore, THE MAIN PROBLEM is that when debugging we have forgotten that we need to also start running our bot/indicator with Ctrader itself after we attach the process on VS.

 


@gonzsanc

testyk
09 Sep 2020, 16:12 ( Updated at: 21 Dec 2023, 09:22 )

Hi,

  I'm using cTrader 3.8  VS 2019 on Windows 10.

  My issue was that the debugger was stopping on a breakpoint, but I couldn't StepOver or StepInto.

  I resolved the issue by selecting "Enable .Net Framework source stepping"  and "Suppress JIT optimization on module load(Managed only)" under Debug->Options->Debugging->General

Next, Clean and Build the solution in Debug mode and stepping through the code works as expected

 


@testyk