[sr-dev] Debugging kamailio module

Henning Westerholt hw at skalatan.de
Tue Jul 23 21:11:11 CEST 2019


Hello Ali,

the problem is that TCP depends somehow on forking processes. If you can't switch to UDP, have you tried to just connect with gdb to the PID of the TCP process? Configure just one TCP child to make this easier for you to catch the right one.

Cheers,

Henning

Am 23.07.19 um 19:29 schrieb Ali Shirvani:
Hello Henning,

Thanks for your help. I test both -D and -DD option when running kamailio in gdb.
When running kamailio with -D it doesn't accept any request on TCP, and when I run with -DD option gdb doesn't stop on the break point.

In summary:
$ sudo gdb kamailio
(gdb) b isc_from_as
(gdb) r -f /path/to/kamailio.cfg -D   ---> doesn't accept TCP requests
(gdb) r -f /path/to/kamailio.cfg -DD   ----> gdb doesn't stop on break point

Regards,
Ali

On Tue, Jul 23, 2019 at 9:12 PM Henning Westerholt <hw at skalatan.de<mailto:hw at skalatan.de>> wrote:

(adding sr-dev to CC)

Hello Ali,

have a look to the kamailio binary parameter and the children parameter in configuration. You can actually start kamailio with (almost) no forking.

You will get a lot of debugging information if you enable the kamailio debugging in the cfg.

If you want to debug only the internals of the core or a specific Kamailio module, there is also a debugger module available that can be useful to debug only certain parts of the server. You can also set breakpoints at certain points in the cfg, or dump internal state with it.

Cheers,

Henning


Am 23.07.19 um 11:39 schrieb Ali Shirvani:

Hi all,

I want to trace function calls in a kamailio module, e.g. ims_isc module. I installed kamailio-dbg package and started the kamailio with gdb: `gdb kamailio` I also set break point on target function, but it seems gdb doesn't stop on that break point.

How should I start gdb and set break points? it seems gdb couldn't handle kamailio child processes that forked in start.

Regards,
Ali



_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services

--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20190723/21c5c984/attachment-0001.html>


More information about the sr-dev mailing list