Forum rss-feed

Forum

Developers: Debugging Set-Up

Most Recent

written by: barnone

All great information thx!

"Eclipse with CDT and pydev loaded can also work quite well, if you set up
an External Makefile project, and if you can get over the frustration of not
having vi as your editor. :-) "

Wanted to try CDT. This is a good excuse.

written by: jsn

Thu, 12 May 2011 09:44:37 +0100 BST

What tools set-up are people using to debug EigenD & its apps? I have an Xcode set-up that allows me to work in the C code, but not debug the python at the same time.

EigenLabs dudes - what's your IDE/tool set-up ?

Does anyone know how do get a simultaneous C/Python debug session working?


written by: geert

Thu, 12 May 2011 10:36:06 +0100 BST

I personally rarely use a debugger as in a multi-threaded real-time system like EigenD it's not often useful. I do use GDB for some C++ debugging at times. Often though it's necessary to see more context and to plot the evolution of how data evolves. In those cases debug print statements while the system is running are really the only way to go. I never felt the need to set up a simultaneous C++/Python debug environment, the tasks of both languages are pretty well confined. I mostly code in vim with some added macros.


written by: 0beron

Thu, 12 May 2011 11:51:44 +0100 BST

Uh oh.. I detect a vim vs. emacs thread developing (ducks)...

What's the accepted way of printlining in EigenD?
pic::logmsg in C++ will stick messages in the MacOS console, does stdout end up there as well? (ie printf and python print statements).


written by: jim

Thu, 12 May 2011 13:06:59 +0100 BST


You can start up EigenD from the command line:

tmp/app/EigenD.app/Contents/MacOSX/EigenD --stdout --noauto

this will suppress the loading of any setup, and log to stdout.

Use pic::logmsg() in C, and print in python.

I use vim, the ctags index lets you navigate around very easily. The fact
that we suffix types with _t and prefix files with a subsystem prefix makes
this particularly easy. You just start vim on the top level and let :ta navigate
you around.

I also find the 'Grep.vim' plugin invaluable, which greps through the whole
source tree and puts the results into the quickfix buffer so you can jump
though the locations quickly. Couldn't live without that.

And although the debugger isn't terribly useful a lot of the time, sometimes
it's invaluable. The trouble is, a breakpoint in the fast thread will usually toss
the USB subsystem which depends on a continuous flow of requests.

So I start up as above, attach the debugger, (gdb or Visual Studio) and then
kick the thing off. One useful thing is to put in code to detect a condition and
call abort() to kick into the debugger.

I've never felt the need for python level debugging..

Eclipse with CDT and pydev loaded can also work quite well, if you set up
an External Makefile project, and if you can get over the frustration of not
having vi as your editor. :-)


written by: jsn

Fri, 27 May 2011 10:46:28 +0100 BST

I can interactively debug the Python portions using PyDev. I find it much easier to understand using an interactive debugger and looking at real data!

If you install PyDev in Eclipse as per Google-able instructions you will need to do the following to debug EigenD (for example):

- go to the Debug Perspective in Eclipse and start the PyDev remote debug server (icon of (de)bug with the P). you will see 'Debug Server' in the Debug tab

- in a Terminal set the PYTHONPATH to point to the location of pydev.py, for example

export PYTHONPATH=/Applications/eclipse/plugins/org.python.pydev.debug_1.6.5.2011020317/pysrc/

- at the point you would like the debugger to halt add the following line:
import pydevd; pydevd.settrace();

- run 'make' to rebuild

- now execute the executable, e.g.
./tmp/app/EigenD.app/Contents/MacOS/EigenD --stdout


- when the process reaches the inserted line the PyDev debugger will stop and show variables/code/etc. as normal with PyDev interactive debugging

- after this point you can insert breakpoints, etc. and it will all work. You can't do hot-code replace, but this is very useful for understanding the objects in the live system and how they work together


written by: barnone

Wed, 5 Oct 2011 22:28:17 +0100 BST

All great information thx!

"Eclipse with CDT and pydev loaded can also work quite well, if you set up
an External Makefile project, and if you can get over the frustration of not
having vi as your editor. :-) "

Wanted to try CDT. This is a good excuse.



Please log in to join the discussions