Driver Development Debug Profile VS2013

Find and share HowTos to various installations / configurations!
7 posts • Page 1 of 1
cjimenez
Posts:6
Joined: Fri May 15, 2015 11:12 pm

Driver Development Debug Profile VS2013

Post by cjimenez »

Hello,

I am developing a driver for WinCC OA 3.13.

After creating the VS project following the instruction, it only appears a Release profile so when we are debugging we cannot see most of the variables.

Is there any way to create a debug profile to access to whole memory?

Thanks!

mpoint
Posts:49
Joined: Thu Oct 28, 2010 11:28 am

Re: Driver Development Debug Profile VS2013

Post by mpoint »

We don't support a real "debug" build (which would e.g. use the "msvcr120d.dll"), because release and debug binaries cannot be mixed easily. But for debugging purposes, you can simply disable the optimizations in the Visual Studio project: In the project properties, go to "C/C++ -> Optimization" and set "Optimization" to "Disabled".

cjimenez
Posts:6
Joined: Fri May 15, 2015 11:12 pm

Re: Driver Development Debug Profile VS2013

Post by cjimenez »

Thanks for answering Markus.

We also wonder why when we print debug values via std::cout, the values do not get printed off in real time, they all are printed off at once, suddenly.

Is there any of your instructions to print out values in the main console of the project or in the driver log?

Thanks again.

mpoint
Posts:49
Joined: Thu Oct 28, 2010 11:28 am

Re: Driver Development Debug Profile VS2013

Post by mpoint »

Where are you observing this stdout behaviour, is it the Windows Command Prompt or the WinCC OA Log Viewer?

If it's in the Command Prompt, then I'm not aware of anything we're doing that would modify the default behaviour of stdout. If it's in the log viewer, then I wouldn't really be surprised, because the log viewer is probably just periodically checking the log files for changes, so what you're seeing could just be the update interval of the log viewer.

cjimenez
Posts:6
Joined: Fri May 15, 2015 11:12 pm

Re: Driver Development Debug Profile VS2013

Post by cjimenez »

When I write std::cout

mpoint
Posts:49
Joined: Thu Oct 28, 2010 11:28 am

Re: Driver Development Debug Profile VS2013

Post by mpoint »

In that case what you're seeing is either the update interval of the log viewer, or since you mentioned that you're writing to std::cout, maybe this is caused by buffering somewhere in-between the std::cout stream and the file to which we're redirecting it. If you want to see the output more quickly, you could try setting the command line option "-log +stderr", which would disable the redirection so that the output goes to the windows console.

cjimenez
Posts:6
Joined: Fri May 15, 2015 11:12 pm

Re: Driver Development Debug Profile VS2013

Post by cjimenez »

Markus Pointner wrote:
you could try setting the command line option "-log +stderr", which would disable the redirection.
Very, very helpful :)

Thank you so much Markus! I already do see memory values.

7 posts • Page 1 of 1