[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [HACKERS] how to use eclipse when debugging postgreSQL backend
From:       Rajanikant Chirmade <rajanikant.chirmade () enterprisedb ! com>
Date:       2009-09-30 6:15:51
Message-ID: febaa93e0909292303u3a0bf603o6f05e2aaa59c54 () mail ! gmail ! com
[Download RAW message or body]

Hello Hongchan,

You need go to through following steps :


   1. Debug Perspective => Run => Debug Configuration
   2. On left side of menu you can see "C/C++ Attach to Application"
   3. Right click on "C/C++ Attach to Application" and create new debug
   configuration,
   4. Set Project,  Build Configuration as "Use Active" , C/C++ Application
   as "postgres" executable path,
   5. Start postmaster & one instant of postgresql client (for creating one
   new postgres),
   6. Click on Debug which will show current process list,
   7. Select forked "postgres" process you want to debug
   8. Put breakpoint in your function,

this is working for me.

Hopefully this helps you.

Thanks & Regards,
Rajanikant Chirmade.




2009/9/28 ³ëÈ« ù <fallsmal@cs.yonsei.ac.kr>

>  Hello hackers,
>
>
>
>
>
> I really appreciate Mr. Cecchet¡¯s effort to establish the wiki page
> (working_with_eclipse,
> http://archives.postgresql.org/pgsql-hackers/2008-10/msg00312.php).
>
>
>
> I set up my PostgreSQL development environment with Eclipse, following the
> page¡¯s instructions.
>
>
>
> However, I¡¯m stuck to thesituation that I cannot debug the modified backend
> source of PostgreSQL
>
>
>
> since the gdb incorporated with Eclipse doesn¡¯t support the debugging of
> the forked child processes.
>
>
>
>
>
> When I start debugging process by using the project default, it can only
> debug the postmaster process,
>
>
>
> since the postmaster process forks child processes each of which is
> actually postgres backend process responsible for the response to each
> client process (psql).
>
>
>
> What I¡¯m trying to debug is the storage-related part of the backend source,
> so the gdb should be able to access the forked processes.
>
>
>
> I tried several ways like making the default option of gdb to be ¡®set
> follow-fork-mode child¡¯, but those tries didn¡¯t work.
>
>
>
> For sure, there is another option, giving up using eclipse when debugging
> and using the console-mode gdb,
>
>
>
> but I prefer using graphical development environment and that¡¯s the reason
> why I chose to use eclipse as a default development tool in the very first
> start.
>
>
>
> (This try might be regarded as silly though, I might be supposed to get
> familiar to console development environment,
>
>
>
> but if someone went through the same situation before and he or she can
> help me, it will be very time-saving)
>
>
>
>
>
> If someone can let me know how to set Eclipse or several steps needed to
> access the forked process while Elipse debugging,
>
>
>
> It will be very much helpful to me.
>
>
>
> Thank you for reading this
>
>
>
>
>
> *- Best Regards
>   Hongchan
>   (fallsmal@cs.yonsei.ac.kr, (02)2123-7757) -*
>
>
>
>
>

[Attachment #3 (text/html)]

Hello Hongchan,<br><br>You need go to through following steps :<br><br><ol><li>Debug \
Perspective =&gt; Run =&gt; Debug Configuration</li><li>On left side of menu you can \
see &quot;C/C++ Attach to Application&quot;</li><li> Right click on &quot;C/C++ \
Attach to Application&quot; and create new debug configuration,</li><li>Set \
Project,&nbsp; Build Configuration as &quot;Use Active&quot; , C/C++ Application as \
&quot;postgres&quot; executable path,</li> <li>Start postmaster &amp; one instant of \
postgresql client (for creating one new postgres),<br></li><li>Click on Debug which \
will show current process list,</li><li>Select forked &quot;postgres&quot; process \
you want to debug</li> <li>Put breakpoint in your function,</li></ol>this is working \
for me.<br><br>Hopefully this helps you.<br><br>Thanks &amp; Regards,<br>Rajanikant \
Chirmade.<br><br><br><br><br><div class="gmail_quote">2009/9/28 ³ëÈ« ù <span \
dir="ltr">&lt;<a href="mailto:fallsmal@cs.yonsei.ac.kr">fallsmal@cs.yonsei.ac.kr</a>&gt;</span><br>
 <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); \
margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">








<div link="blue" vlink="purple" lang="EN-US">

<div>

<p>Hello hackers,</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>I really appreciate Mr. Cecchet&rsquo;s effort to establish the
wiki page (working_with_eclipse, <a \
href="http://archives.postgresql.org/pgsql-hackers/2008-10/msg00312.php" \
target="_blank">http://archives.postgresql.org/pgsql-hackers/2008-10/msg00312.php</a>).</p>


<p>&nbsp;</p>

<p>I set up my PostgreSQL development environment with Eclipse,
following the page&rsquo;s instructions.</p>

<p>&nbsp;</p>

<p>However, I&rsquo;m stuck to thesituation that I cannot debug the
modified backend source of PostgreSQL </p>

<p>&nbsp;</p>

<p>since the gdb incorporated with Eclipse doesn&rsquo;t support the
debugging of the forked child processes.</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>When I start debugging process by using the project default,
it can only debug the postmaster process,</p>

<p>&nbsp;</p>

<p>since the postmaster process forks child processes each of
which is actually postgres backend process responsible for the response to each
client process (psql).</p>

<p>&nbsp;</p>

<p>What I&rsquo;m trying to debug is the storage-related part of the
backend source, so the gdb should be able to access the forked processes.</p>

<p>&nbsp;</p>

<p>I tried several ways like making the default option of gdb
to be &lsquo;set follow-fork-mode child&rsquo;, but those tries didn&rsquo;t \
work.</p>

<p>&nbsp;</p>

<p>For sure, there is another option, giving up using eclipse
when debugging and using the console-mode gdb, </p>

<p>&nbsp;</p>

<p>but I prefer using graphical development environment and that&rsquo;s
the reason why I chose to use eclipse as a default development tool in the very
first start.</p>

<p>&nbsp;</p>

<p>(This try might be regarded as silly though, I might be
supposed to get familiar to console development environment,</p>

<p>&nbsp;</p>

<p>but if someone went through the same situation before and he
or she can help me, it will be very time-saving)</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>If someone can let me know how to set Eclipse or several
steps needed to access the forked process while Elipse debugging, </p>

<p>&nbsp;</p>

<p>It will be very much helpful to me.</p>

<p>&nbsp;</p>

<p>Thank you for reading this</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p style=""><b><span style="font-size: 9pt; color: rgb(31, 73, 125);">- Best \
Regards<br> &nbsp; Hongchan<br>
&nbsp; (<a href="mailto:fallsmal@cs.yonsei.ac.kr" target="_blank"><span style="color: \
blue;">fallsmal@cs.yonsei.ac.kr</span></a>, (02)2123-7757) -</span></b><span \
style="font-size: 9pt;"></span></p>

<p><span style="font-size: 9pt;">&nbsp;</span></p>

<p>&nbsp;</p>

</div>

</div>


</blockquote></div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic