[sr-dev] Debugging kamailio module

Ali Shirvani aj.shirvani at gmail.com
Wed Jul 24 12:09:15 CEST 2019


Hello Henning,

Thanks for your suggestion, I switched to UDP and now gdb work fine when I
run kamailio with -D option.

Regards,
Ali

On Tue, Jul 23, 2019 at 11:41 PM Henning Westerholt <hw at skalatan.de> wrote:

> 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> 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 Listsr-users at lists.kamailio.orghttps://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/20190724/4a80eb53/attachment.html>


More information about the sr-dev mailing list