Visual Studio debugger

Anne
Posts: 13
Joined: Thu Dec 09, 2010 3:34 pm

Visual Studio debugger

Post by Anne »

Hi!
Thank you for Openvibe and the tutorial, it's very useful for me!
I'm a newbie with Visual Studio (I have on my pc Visual Studio 2008), and I have some questions:
- I would like to run the solution (Project.sln) inside Visual Studio, but at the end of the debugging process (with some warnings but no errors), appear me a window of "No Debugging information". I think I have to change under Configuration Properties/Debugging/Command the file associated, but i don't know what to insert.
- in the output appear the warning D9002 : ignoring unknow option '--mms-bitfields', is it important?
- in the output appear the warning consecutively:
LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
LNK4098: defoult lib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB: library
Are important?

I use winXP.
Thank you in advance :)

Anne

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: Visual Studio debugger

Post by yrenard »

Dear Anne,

thank you for your interest in OpenViBE and welcome on this forum.

Even if using Visual C++ tools to compile OpenViBE, it should not be compiled from the GUI of Visual. You must compile OpenViBE using the win32-build.cmd script. The script that generates the visual projects clearly states the following notice :
IMPORTANT NOTICE:

This script can generate VCProj files in order to help you in the task of debugging some
parts of the code - visual knows what files to load and the projects structure -
This script is _not_ intended to be used in order to actually _build_ the platform
which is 'win32-build.cmd's task. Additionnaly, note that the platform has to be
compiled entirely at least once with 'win32-build.cmd' before thinking of generating
VCProj files.

VCProj files and solutions will go in local-tmp/visual folder.

If you don't understand this notice, you should consider not using this script and
press CTRL+C to abort. Thank you.
This said, the topic of you message suggests you want to attach Visual Studio debugger to an OpenViBE process, let's suppose the OpenViBE designer. Once the Visual solution is opened, this can actually be performed using the Tools > Attach to process then find and select the OpenViBE process you want to debug !

By the way, in order to efficiently debug your code, you probably have to compile the module in DEBUG instead of RELEASE. I let Laurent tell you how to do that (Laurent, this should probably be added to the FAQ or to the Installation manual).

I hope this helps,
Yann

Anne
Posts: 13
Joined: Thu Dec 09, 2010 3:34 pm

Re: Visual Studio debugger

Post by Anne »

Thank you for your reply!! :)
I have understood the first part of your reply, I thought that was necessary using Visual for the debug.
In the second part you said:
yrenard wrote: This said, the topic of you message suggests you want to attach Visual Studio debugger to an OpenViBE process, let's suppose the OpenViBE designer. Once the Visual solution is opened, this can actually be performed using the Tools > Attach to process then find and select the OpenViBE process you want to debug !
Ok, I have studied on internet about Tools > Attach to process function, and this should debug equally as i would like!
I launch the C:\Openvibe\dist\test-acquisition-server.cmd and after, in Visual Studio, I attach the process OpenViBE-acquisition-server-dynamic.exe.
During this part, i have a problem: i have put some breakpoints, but "The breakpoint will not currently be hit".
I have try to understand the causes, and the problem seem to be a Symbols Status problem: if, after have attached the process, i go to Debug > Windows > Modules, under the colum Symbol Status appears the written: "Binary was not build with debug information".
I try to follow this guide found on internet:

1. While debugging in Visual Studio, click on Debug > Windows > Modules. The IDE will dock a Modules window, showing all the modules that have been loaded for your project.
2. Look for your project's DLL, and check the Symbol Status for it.
3. If it says Symbols Loaded, then you're golden. If it says something like Cannot find or open the PDB file, right-click on your module, select Load Symbols, and browse to the path of your PDB.
Once you browse to the location of your PDB file, the Symbol Status should change to Symbols Loaded, and you should now be able to set and catch a breakpoint at your line in code.

but there is no .pdb file in the folder C:\Openvibe\dist\bin, where is the file OpenViBE-acquisition-server-dynamic.exe that I attach. I try also to load the file .pdb under C:\Openvibe\local-tmp\visual\trunc\Debug but appears the written "The symbol file openvibe-acquisition-server-dynamic.pdb does not match the module".
:cry:

Excuse me if my reply is quite long, i have preferred to write all the information that i think could be helpful to find the solution. Thank you for your patience,

Anne

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: Visual Studio debugger

Post by lbonnet »

Hi Ann !

Thanks for your post, it may be a bit longer than usual but much more clear for us when we are trying to help :)

As Yann told you, you don't compile the code directly in Visual Studio GUI. Instead you use the script "win32-build.cmd".
This script uses CMAKE, that calls Visual Studio compiler and builds every project (openvibe-plugins, openvibe-applications, etc.).
The default build type used by CMAKE is Release. Consequently, it doesn't produce any debugging information (i.e. no .pdb files are generated).

However, you can tell CMAKE to build in Debug. To do so, edit the script "win32-build.cmd".
Around line 48 you should have :

Code: Select all

cmake -DCMAKE_INSTALL_PREFIX="%%s" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=" /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR /wd4355" -Wno-dev -DCMAKE_MODULE_PATH="%saved_directory:\=/%/../cmake-modules;${CMAKE_MODULE_PATH}" !OpenViBE_project_name_full! -G"NMake Makefiles"
Change the flag -DCMAKE_BUILD_TYPE to Debug.

Now if you run the script again, it should compile every project in Debug, and you should have all debugging information available when using Tools > Attach to process.

However, building everything in debug is not really useful... It usually slows down the execution, and you will need to compile everything again which is time consuming.
if you just want to build a single project in Debug (i.e. the project you are currently working on, and which needs some debug), you also need to modify the script "win32-init_env_command.cmd".
This script initializes everything before the build, including the build order (i.e. which project will be build and when).
The end of the script (past line 200) writes that build order. Comment the lines corresponding to the projects you don't want to build (comment a line by adding the word "REM" at the beginning).

After editing the win32-init_env_command script, re-run win32-build.cmd to build in debug the selected project.

I hope you will get it work. Tell me if you need more explanation.

Laurent-
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

Anne
Posts: 13
Joined: Thu Dec 09, 2010 3:34 pm

Re: Visual Studio debugger

Post by Anne »

Hi Laurent! :lol:
Thank you!!!! You have solved my problem!
Now finally the program runs the breakpoints, as i would like :)

Thank you again :)

Anne

razano1
Posts: 18
Joined: Wed Jun 20, 2012 1:56 pm

Re: Visual Studio debugger

Post by razano1 »

Hi..

I am using OpenVibe for my SSVEP based thesis project (for Signal Acquisition, Processing, and Stimulus purpose).

I am trying to debug SSVEP demo application, I have build the source using debug configuration of script "win32-build.cmd.
Break points are not being hit as some of the symbol files are not loaded like OgreMain_d.pdb etc ..(In fact these files dont exist in dependencies directory)... I am using VS 2010...



Please help as it is kind of very urgent to me ...

Best Regards

Asim

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: Visual Studio debugger

Post by lbonnet »

Hi Asim,
Break points are not being hit as some of the symbol files are not loaded like OgreMain_d.pdb etc ..(In fact these files dont exist in dependencies directory)... I am using VS 2010...
If you built the SSVEP application project in Debug with visual, you should have access to breakpoints within the application itself.
Run the application, attach the application process to the debugger (in VS2010 it's in tools -> attach to process), and breakpoints are hit.
You won't be able to go into the dependencies source code, but it should be ok for every part of the SSVEP application.


We provide the debug libraries of Ogre, but PDB files are generated by Visual Studio. You can have them only if you build Ogre3D with VS in Debug.

Hope this helps !

Laurent-
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

razano1
Posts: 18
Joined: Wed Jun 20, 2012 1:56 pm

Re: Visual Studio debugger

Post by razano1 »

Thanks for your prompt response..

What exactly do you mean by
If you built the SSVEP application project in Debug with visual
Currently i build ssvep project employing VS2010 Solution (Projects) created using win32-generate-vc-proj.cmd (that uses cmake to generate VS projects)....
Do you mean this ?? or Creating VS2010 project manually and then building ssvep source. ??

After building ssvep project if i run the project in VS, off course it asks for the openvibe environment and dependencies to be set and i am doing this configuration as well

Meanwhile I replaced my compiled SSVEP exe in dist folder with the one already there and tried attaching this process with the code in VS2010, it produces the same result. i.e no break point hit ...
I observed that it even dont load ssvep project pdb (openvibe-ssvep-demo-dynamic.pdb) though i put it in dist/bin along with exe ... and when i try to load this pdb manually it gives an error of symbol mismatch.....

beside debugging i have a query related to SSVEP performance on openvibe. i wana know about maximum accuracy that can be attained with openvibe ... so far i have around 70 - 80 percent ....
Best Regards

jlegeny
Posts: 239
Joined: Tue Nov 02, 2010 8:51 am
Location: Mensia Technologies Paris FR
Contact:

Re: Visual Studio debugger

Post by jlegeny »

Hello,

the standard procedure for debugging with visual is described above.

You generate the project with the wi32-build.cmd script set to debug mode. Then you run any OpenViBE application normally by running the appropriate launching script in the dist folder. Finally you attach the Visual Studio debugger to the process after it is running.

If this does not work you might try a solution made by toncho11 : http://openvibe.inria.fr/community/adjustopenvibe/ this script will generate a Visual Studio project that you can compile directly from within the Visual Studio without the need of the scripts.

---

As for the performances, the best we can get here is around 95% for the three of the frequencies. Note that these performances are only valid per-frequency, when you combine the three classifiers the actual performance decreases.

Cheers
Jozef

razano1
Posts: 18
Joined: Wed Jun 20, 2012 1:56 pm

Re: Visual Studio debugger

Post by razano1 »

Hi...

Thanks a lot
worked for me ... Standard debugging procedure still fails. but its fine for me as i have to stick to VS2010 in Windows environment ....

95 % is quite good .. i am using 4 frequencies ... and i am looking forward to produce average accuracy around 90% .
i will initiate a separate thread on this as i might need some guidance on ssvep in particular ....

Best Regards

Asim

toncho11
Posts: 124
Joined: Tue Apr 19, 2011 7:58 pm

Re: Visual Studio debugger

Post by toncho11 »

Hi,

I have produced the AdjustOpenVibe application.

If you can clarify what happens when you try to debug then I can help you.

But I have not tried AdjustOpenVibe on SSVEP demo indeed.

One problem (that I do not remember exactly) is that we have problem with Ogre in our demo in VS2010 in my lab. Ogre initialization was failing, so we actually do not use VS2010 for our demo application. Ogre libs in OpenVibe are release mode compiled (or the opposite) and when you compile with VS in debug mode then it crashes or it did not link properly.

I haven't had time to find a fix for this problem so far and you might be encountering the same problem.

Cheers,
Anton

razano1
Posts: 18
Joined: Wed Jun 20, 2012 1:56 pm

Re: Visual Studio debugger

Post by razano1 »

Dear Anton...

Thanks for your concern ...

Actually your utility worked for me.. I managed to debug demo ssvep from within VS2010 rather than running it(batch file) from dist and attaching the process in VS..
I am modifying it a bit for my own requirements....
Infact Standard debugging procedure failed, as it is not been able to find debug information (i.e. pdb files) for ogre and few other dependencies as well....


Best Regards

Asim

jlegeny
Posts: 239
Joined: Tue Nov 02, 2010 8:51 am
Location: Mensia Technologies Paris FR
Contact:

Re: Visual Studio debugger

Post by jlegeny »

Hello Asim,

as the developer of the SSVEP demo I would like to know if you had issues with the program and where. In order to make the application better I'd like to know if there are any problems (slowdowns, crashes, missing features).

Thank you
Jozef

razano1
Posts: 18
Joined: Wed Jun 20, 2012 1:56 pm

Re: Visual Studio debugger

Post by razano1 »

Dear Jozef..

I am modifying the ssvep demo as per my requirements.. Actually i am working on a browser based BCI application. Client application is complete, i have integrated and tested it with openvibe by using a sample scenario that sends keyboard inputs to client application via vrpnnet in order to navigate in application. in real scenario this client application will take ssvep classifiers as input. i have tried many client end technologies for stimulus generation and management but nothing worked for me.. in the end i have two choices either to use python or this ogre based demo.. i choose ssvep demo as it is being already tested...

Now coming back to my requirements, I have to use four stimulus and i want them in separate small rendering windows in order to have better performance. For training there will be an extra window containing static stimulus which will be replaced by browser window in online session. (see attached image). Starting from the scratch will consume lot much time which i dont have right now... so i am going to rely on modifying this ssvep demo. i need to know whether

- SSVEP demo has got the room for the requirements i have mentioned above?? and if yes then what will be best possible design strategy.
i know my query is quite generic but as u worked on this application so you can guide me in a better way...
any help would be greatly appreciated ..

best Regards
Asim
Attachments
design.jpg
design.jpg (46.03 KiB) Viewed 18263 times

razano1
Posts: 18
Joined: Wed Jun 20, 2012 1:56 pm

Re: Visual Studio debugger

Post by razano1 »

Dear Jozef...

I have implemented multiple window SSSVEP Stimulus App ..now the problem is stimulus do work but frame rate is too slow to achieve the specified frequencies...
there are lags in between the flickers as well.

I am using separate scene manager, camera, viewport, for each rendering window, 1x1 main rendering window(without scene manager, camera and viewport, which is attached with input command structure) is being created in parent class, while other rendering windows are created in the child classes for training and online ssvep session...

any input is greatly appreciated....


Best regards

Asim

Post Reply