Help! I can’t debug!
I was just coming off of my holidays and thought that I should run a quick check of my mailbox to see what new and exciting things had transpired while I was away and blissfully ignorant of the comings and goings at the office.
I’m not doing (much) IDE development these days but these types of requests still manage to find their way to me because of my dogged insistance that I use our Momentics tools for all of my development and also because I think that printf debugging is for dinosaurs. If the IDE can’t get the job done for you, then we need to fix it so that it can … feel free to tell us so!
Anyway … back those e-mails. They all were stating that they just couldn’t get the IDE debugger to work. The platforms were all different (arm, sh, x86) and the environments were all different (Windows, Linux and Neutrino) but the problem was the same. The application would launch, but the IDE debug session would fail with a cryptic connection error.
Why is this happening? For most IDE services, the qconn target agent is all that needs to be up and running. However, the debugger also makes use of the pdebug debugger target agent. This is launched automatically for you when you start debugging.
… unless it isn’t.
The problem is that since the IDE is telling qconn to launch the pdebug program, pdebug needs to be in one of two places:
- Accessible via qconn’s PATH environment variable
- Located in /usr/bin/pdebug
If the pdebug debugger target agent can’t be launched, then the debug session will fail … and the resulting error message provides absolutely no indication of what is going on and why the debug session failed.
While this bit of information is recorded in the documentation for the IDE, it isn’t the first thing you would find when things go wrong.
So … if debugging wasn’t working for you and you never understood why and flipped back to printf’s take a close look at your configuration (and/or make sure that pdebug is in /usr/bin) and try it again … I think you’ll like it!