PixInsight Forum (historical)

Software Development => PCL and PJSR Development => Topic started by: georg.viehoever on 2011 June 29 11:22:59

Title: How to debug?
Post by: georg.viehoever on 2011 June 29 11:22:59
Hi,

I am currently developing a module. When compiled with diagnostics, I get the message below when loading a project. I have problems to debug this.
- The program claims to be terminating (but in reality, PI continue)
- PI does not write a core dump that would help to debug the situation
- I tried to debug the situation using DDD, but I have not been able to catch this signal.

Advice would be welcome (and dont tell me to add std::cerr<<"..." to the code. This is only an option when you have an idea where the problem happens.)

Georg

PS: Diagnostics level is 2 (the output in the screenshot wrongly claims it is 0).
Title: Re: How to debug?
Post by: Juan Conejero on 2011 June 29 11:38:09
Hi Georg,

OK, let's recognize it: diagnostics code is broken in the latest PCL versions. So please don't use it, for now. I have to make a deep review of all diagnostics code to fix it. Until then, please set diagnostics level to zero and use standard debugging techniques.

If the std::cout trickery is not nice for you (it is for me in a 95% of situations), I strongly recommend you create an Eclipse project for your module, then launch the PI Core application to start a GDB session from Eclipse. If you are accustomed to Visual Studio, then you'll find Eclipse's debugging interface very familiar. You have everything: breakpoints, conditional breakpoints, call stack, step-by-step execution, local symbols and so on. And if your code signals a system exception, GDB will stop execution and you'll find where it was thrown very easily.