Discussion:
Unable to debug snmpd with gdb, compiled with "-g"
(too old to reply)
Bhartendu Maheshwari
2005-10-31 16:23:37 UTC
Permalink
--0-988319361-1130775718=:81597
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi All,

I am trying to debug snmpd but unable to do so, the logs are dumped below. As per my understaning if I compile with "-g" option then we can run with gdb, I checked the snmpd and snmplib is successfully compiled with "-g" option but showing error as "no debugging symbols found". I am not able to understand why? Please correct me if I am wrong. Do I need to attach gdb with the snmpd task id. Please help me in debugging snmpd.

GCC Output
==========
/bin/sh ../libtool --mode=link gcc -g -O2 -Dlinux -o snmpd snmpd.lo libnetsnmpagent.la libnetsnmpmibs.la helpers/libnetsnmphelpers.la ../snmplib/libnetsnmp.la -ldl -lm
gcc -g -O2 -Dlinux -o .libs/snmpd snmpd.o ./.libs/libnetsnmpagent.so ./.libs/libnetsnmpmibs.so helpers/.libs/libnetsnmphelpers.so ../snmplib/.libs/libnetsnmp.so -ldl -lm -Wl,--rpath -Wl,/usr/local/lib
creating snmpd

GDB Output
==========
[***@localhost sbin]# gdb snmpd
GNU gdb Red Hat Linux (6.1post-1.20040607.43rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...(no debugging symbols found)...Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb)

Thanks & Regards
Bhartendu



---------------------------------
Enjoy this Diwali with Y! India Click here
--0-988319361-1130775718=:81597
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

<DIV>
<DIV>Hi All,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I am trying to&nbsp;debug snmpd but unable to do so, the logs are dumped below. As per my understaning if I compile with "-g" option then we can run with gdb, I checked the snmpd and snmplib is successfully compiled with "-g" option but&nbsp;showing error as&nbsp;"no debugging symbols found". I am not able to understand why? Please correct me if I am wrong. Do I need to attach gdb with the snmpd task id. Please help me in debugging snmpd.</DIV>
<DIV>&nbsp;</DIV>
<DIV>GCC Output<BR>==========</DIV>
<DIV>/bin/sh ../libtool&nbsp; --mode=link gcc -g -O2 -Dlinux&nbsp; -o snmpd snmpd.lo&nbsp;&nbsp;&nbsp; libnetsnmpagent.la libnetsnmpmibs.la helpers/libnetsnmphelpers.la&nbsp; ../snmplib/libnetsnmp.la -ldl -lm<BR>gcc -g -O2 -Dlinux -o .libs/snmpd snmpd.o&nbsp; ./.libs/libnetsnmpagent.so ./.libs/libnetsnmpmibs.so helpers/.libs/libnetsnmphelpers.so ../snmplib/.libs/libnetsnmp.so -ldl -lm&nbsp; -Wl,--rpath -Wl,/usr/local/lib<BR>creating snmpd</DIV>
<DIV><BR>GDB Output<BR>==========</DIV>
<DIV>[***@localhost sbin]# gdb snmpd<BR>GNU gdb Red Hat Linux (6.1post-1.20040607.43rh)<BR>Copyright 2004 Free Software Foundation, Inc.<BR>GDB is free software, covered by the GNU General Public License, and you are<BR>welcome to change it and/or distribute copies of it under certain conditions.<BR>Type "show copying" to see the conditions.<BR>There is absolutely no warranty for GDB.&nbsp; Type "show warranty" for details.<BR>This GDB was configured as "i386-redhat-linux-gnu"...(no debugging symbols found)...Using host libthread_db library "/lib/tls/libthread_db.so.1".</DIV>
<DIV>(gdb)</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks &amp; Regards</DIV>
<DIV>Bhartendu</DIV></DIV><p>
<hr size=1>
Enjoy this Diwali with Y! India <a href="http://in.promos.yahoo.com/fabmall/index.html">Click here</a>
--0-988319361-1130775718=:81597--


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
Dave Shield
2005-10-31 16:34:17 UTC
Permalink
Post by Bhartendu Maheshwari
I am trying to debug snmpd but unable to do so, the logs are dumped
below.... showing error as "no debugging symbols found". I am not able
to understand why?
The file 'snmpd' is actually a shell-script wrapper round the
real binary (which is hidden away in a Safe Place). This is
probably confusing 'gdb'
Try running

../libtool gdb snmpd

instead.
That should pick up the real binary, and the various libraries.

Dave



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
Bhartendu Maheshwari
2005-11-04 04:45:21 UTC
Permalink
--0-947071894-1131079419=:10331
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi all,

Thank you dave, I am able to debug snmpd.

I need one more input, I need the Net-snmp architecture and design document, as I have to understand and change some part of the code.

Can anyone tell me where I can find the document.
I am able to find the following link
http://net-snmp.sourceforge.net/dev/agent/index.html

If there is any other documents or website available, please update me.

Thanks & Regards
Bhartendu
Post by Bhartendu Maheshwari
I am trying to debug snmpd but unable to do so, the logs are dumped
below.... showing error as "no debugging symbols found". I am not able
to understand why?
The file 'snmpd' is actually a shell-script wrapper round the
real binary (which is hidden away in a Safe Place). This is
probably confusing 'gdb'
Try running

../libtool gdb snmpd

instead.
That should pick up the real binary, and the various libraries.

Dave



---------------------------------
Enjoy this Diwali with Y! India Click here
--0-947071894-1131079419=:10331
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit <DIV>Hi all,</DIV> <DIV>&nbsp;</DIV> <DIV>Thank you dave, I am able to debug snmpd.</DIV> <DIV>&nbsp;</DIV> <DIV>I need one more input, I need the Net-snmp architecture and design document, as I have to understand and change some part of the code.</DIV> <DIV>&nbsp;</DIV> <DIV>Can anyone tell me where I can find the document.</DIV> <DIV>I am able to find the following link</DIV> <DIV><A href="http://net-snmp.sourceforge.net/dev/agent/index.html">http://net-snmp.sourceforge.net/dev/agent/index.html</A></DIV> <DIV>&nbsp;</DIV> <DIV>If there is any other documents or website available, please update me.</DIV> <DIV>&nbsp;</DIV> <DIV>Thanks &amp; Regards</DIV> <DIV>Bhartendu<BR><BR><B><I>Dave Shield &lt;***@csc.liv.ac.uk&gt;</I></B> wrote:</DIV> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">On Mon, 2005-10-31 at 16:21 +0000, Bhartendu Maheshwari wrote:<BR>&gt; I am trying to debug snmpd but unable to do so, the logs are dumped<BR>&gt; below.... showing error as "no debugging symbols found". I am not able<BR>&gt; to understand why?<BR><BR>The file 'snmpd' is actually a shell-script wrapper round the<BR>real binary (which is hidden away in a Safe Place). This is<BR>probably confusing 'gdb'<BR><BR><BR>&gt; [***@localhost sbin]# gdb snmpd<BR><BR>Try running<BR><BR>../libtool gdb snmpd<BR><BR>instead.<BR>That should pick up the real binary, and the various libraries.<BR><BR>Dave<BR><BR></BLOCKQUOTE><p>
<hr size=1>
Enjoy this Diwali with Y! India <a href="http://in.promos.yahoo.com/fabmall/index.html">Click here</a>
--0-947071894-1131079419=:10331--


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
Loading...