<div dir="ltr">Hello Henning,<div><br></div><div>Thanks for your suggestion, I switched to UDP and now gdb work fine when I run kamailio with -D option.</div><div><br></div><div>Regards,</div><div>Ali</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 23, 2019 at 11:41 PM Henning Westerholt <<a href="mailto:hw@skalatan.de">hw@skalatan.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div bgcolor="#FFFFFF">
<p>Hello Ali,</p>
<p>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.</p>
<p>Cheers,</p>
<p>Henning<br>
</p>
<div class="gmail-m_3686131942010283750moz-cite-prefix">Am 23.07.19 um 19:29 schrieb Ali Shirvani:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hello Henning,
<div><br>
</div>
<div>Thanks for your help. I test both -D and -DD option when running kamailio in gdb. </div>
<div>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.</div>
<div><br>
</div>
<div>In summary:</div>
<div>$ sudo gdb kamailio</div>
<div>(gdb) b isc_from_as</div>
<div>(gdb) r -f /path/to/kamailio.cfg -D   ---> doesn't accept TCP requests</div>
<div>(gdb) r -f /path/to/kamailio.cfg -DD   ----> gdb doesn't stop on break point</div>
<div><br>
</div>
<div>Regards,</div>
<div>Ali</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, Jul 23, 2019 at 9:12 PM Henning Westerholt <<a href="mailto:hw@skalatan.de" target="_blank">hw@skalatan.de</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>(adding sr-dev to CC)</p>
<p>Hello Ali,</p>
<p>have a look to the kamailio binary parameter and the children parameter in configuration. You can actually start kamailio with (almost) no forking.</p>
<p>You will get a lot of debugging information if you enable the kamailio debugging in the cfg.
<br>
</p>
<p>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.<br>
</p>
<p>Cheers,</p>
<p>Henning<br>
</p>
<p><br>
</p>
<p>Am 23.07.19 um 11:39 schrieb Ali Shirvani:<br>
</p>
<blockquote type="cite">
<div dir="ltr">Hi all,
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>How should I start gdb and set break points? it seems gdb couldn't handle kamailio child processes that forked in start.</div>
<div><br>
</div>
<div>Regards,</div>
<div>Ali</div>
</div>
<br>
<fieldset class="gmail-m_3686131942010283750gmail-m_4150171520911274823mimeAttachmentHeader"></fieldset>
<pre class="gmail-m_3686131942010283750gmail-m_4150171520911274823moz-quote-pre">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="gmail-m_3686131942010283750gmail-m_4150171520911274823moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>
<a class="gmail-m_3686131942010283750gmail-m_4150171520911274823moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="gmail-m_3686131942010283750gmail-m_4150171520911274823moz-signature" cols="72">-- 
Henning Westerholt - <a class="gmail-m_3686131942010283750gmail-m_4150171520911274823moz-txt-link-freetext" href="https://skalatan.de/blog/" target="_blank">https://skalatan.de/blog/</a>
Kamailio services - <a class="gmail-m_3686131942010283750gmail-m_4150171520911274823moz-txt-link-freetext" href="https://skalatan.de/services" target="_blank">https://skalatan.de/services</a></pre>
</div>
</blockquote>
</div>
</blockquote>
<pre class="gmail-m_3686131942010283750moz-signature" cols="72">-- 
Henning Westerholt - <a class="gmail-m_3686131942010283750moz-txt-link-freetext" href="https://skalatan.de/blog/" target="_blank">https://skalatan.de/blog/</a>
Kamailio services - <a class="gmail-m_3686131942010283750moz-txt-link-freetext" href="https://skalatan.de/services" target="_blank">https://skalatan.de/services</a></pre>
</div>

</blockquote></div>