[Asterisk-Dev] How do you debug Asterisk?

Kevin P. Fleming kpfleming at digium.com
Thu Apr 28 13:29:17 MST 2005


Steve Edwards wrote:

> How do you set breakpoints in the code? Do you set a breakpoint in the 
> module loader and then set the breakpoint after your module is loaded? 
> Do you link a "monotlithic" executable?

You can set the breakpoint for a function name even before the module is 
loaded, and gdb will insert it when the module loads. If you  need to 
set a breakpoint on a particular line of code, though, or a watchpoint 
based on variables, you have to wait until the module is loaded.

Keep also in mind that using gdb (or any debugger) on a multi-threaded 
application is very... well, interesting. It can be very hard to keep 
track of what is going on when other threads are continuing to change 
things.



More information about the asterisk-dev mailing list