🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #1068

Re: gdb show ?? symbols

#1068
From: Tribhuwan Kandpal
Date: Fri, 01 Jan 2010 17:07
252 lines
13980 bytes
--0-1474651642-1262365672=:52775
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi,
I am not an expert of kernel debugging but I found it so thought of sharing=
 though it is for UML
=C2=A0
1. http://user-mode-linux.sourceforge.net/new/hacking.html
2. http://user-mode-linux.sourceforge.net/old/debugging.html
=C2=A0
Hope it helps.
=C2=A0
~Trib

--- On Mon, 28/12/09, Alexandre Rusev <arusev@ru.mvista.com> wrote:


From: Alexandre Rusev <arusev@ru.mvista.com>
Subject: Re: gdb show ?? symbols
To: "=E6=B8=85=E6=B0=B4=E6=B2=B3" <hushan.jia@gmail.com>
Cc: bug-gdb@gnu.org
Date: Monday, 28 December, 2009, 5:20 AM


=E6=B8=85=E6=B0=B4=E6=B2=B3 wrote:=20
On Dec 24, 2:00=C2=A0am, Alexandre Rusev <aru...@ru.mvista.com> wrote:
 =20
=E4=BD=A0=E5=A5=BD!;)

=E6=B8=85=E6=B0=B4=E6=B2=B3 wrote:
   =20
Hi, I tried to use gdb to debug kernel code.
I compiled with -g -ggdb flags, but it seems gdb cannot show symbols
correctly, instead it shows all ??
      compile kernel with debug information.
In kernel compilation menu "make menuconfig" select Kernel
Hucking->Compile kernel with Debug information,
there are anumber of kernel debugging related options to turn on.

Which processor architecture you compiling your kernel for?
    Hi, it is i386. Seems there is no "Compile kernel with Debug
  the mainstream i386 architecture usually works fine ... strange

information" option, under "kernel debugging", there are several debug
options, like "Debug shared IRQ handlers", "Detect Soft Lockups", etc,
but which one is the option that have the source information?

  Typical settings in .config file (and make menuconfig) would be:

CONFIG_DEBUG_KERNEL=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 Kernel debugging
CONFIG_DEBUG_LL=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Compile the=
 kernel with debug info
CONFIG_DEBUG_BUGVERBOSE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 Verbose BUG() reporting


Make sure that you are debugging an executable "vmlinux" in your GDB sessio=
n.

Got to the directory you compiled your kernel and start debugging of vmlinu=
x likes this:

cd linux-2.6.xx
gdb vmlinux
gdb target remote /dev/pts/11
...

your GDB tool have to have the ELF image of the kernel being debugged and
the sources should present starting from the current path.
I guess that there also may be some issues with GDB itself when you debuggi=
ng the kernel modules,
but if you compile the solid kernel (modules compiled in kernel image) the =
code of
these modules must be step debugged quite well

At the machine you are debugging the kernel run "cat=C2=A0 /proc/kallsyms"
and see if the information about symbol names is really available

Here is beginning of an example of output at x86 target:
cat=C2=A0 /proc/kallsyms
c01002c0 T _stext
c01002c0 t run_init_process
c01002c0 T stext
c01002fc t init
c01005b8 t rest_init
c01005d8 t try_name
c010079f T name_to_dev_t
c0100a0c T calibrate_delay
c0100c70 T hard_smp_processor_id
c0100c80 t target_cpus
c0100c87 t check_apicid_used
c0100c8a t check_apicid_present
c0100c90 t multi_timer_check
c0100c93 t apic_id_registered
c0100c99 t apicid_to_node
c0100c9d t cpu_to_logical_apicid
c0100cb1 t cpu_present_to_apicid
...




Remote debugging using /dev/pts/11
0xc0467118 in ?? ()
(gdb) where
#0 =C2=A00xc0467118 in ?? ()
#1 =C2=A00xc077db2d in ?? ()
#2 =C2=A00x00000000 in ?? ()
     =20
how to solve this problem?
_______________________________________________
bug-gdb mailing list
bug-...@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gdb
      _______________________________________________
bug-gdb mailing list
bug-gdb@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gdb
 =20

-----Inline Attachment Follows-----


_______________________________________________
bug-gdb mailing list
bug-gdb@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gdb
=0A=0A=0A      The INTERNET now has a personality. YOURS! See your Yahoo! H=
omepage. http://in.yahoo.com/
--0-1474651642-1262365672=:52775
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0" ><tr><td valign=3D"=
top" style=3D"font: inherit;"><DIV>Hi,</DIV>
<DIV>I am not an expert of kernel debugging but I found it so thought of sh=
aring though it is for UML</DIV>
<DIV>&nbsp;</DIV>
<DIV>1. <A href=3D"http://user-mode-linux.sourceforge.net/new/hacking.html"=
>http://user-mode-linux.sourceforge.net/new/hacking.html</A></DIV>
<DIV>2. <A href=3D"http://user-mode-linux.sourceforge.net/old/debugging.htm=
l">http://user-mode-linux.sourceforge.net/old/debugging.html</A></DIV>
<DIV>&nbsp;</DIV>
<DIV>Hope it helps.</DIV>
<DIV>&nbsp;</DIV>
<DIV>~Trib<BR><BR>--- On <B>Mon, 28/12/09, Alexandre Rusev <I>&lt;arusev@ru=
.mvista.com&gt;</I></B> wrote:<BR></DIV>
<BLOCKQUOTE style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(=
16,16,255) 2px solid"><BR>From: Alexandre Rusev &lt;arusev@ru.mvista.com&gt=
;<BR>Subject: Re: gdb show ?? symbols<BR>To: "=E6=B8=85=E6=B0=B4=E6=B2=B3" =
&lt;hushan.jia@gmail.com&gt;<BR>Cc: bug-gdb@gnu.org<BR>Date: Monday, 28 Dec=
ember, 2009, 5:20 AM<BR><BR>
<DIV id=3Dyiv1515431656>=E6=B8=85=E6=B0=B4=E6=B2=B3 wrote:=20
<BLOCKQUOTE type=3D"cite"><PRE>On Dec 24, 2:00&nbsp;am, Alexandre Rusev <A =
class=3Dmoz-txt-link-rfc2396E href=3D"http://in.mc953.mail.yahoo.com/mc/com=
pose?to=3Daru...@ru.mvista.com" target=3D_blank rel=3Dnofollow ymailto=3D"m=
ailto:aru...@ru.mvista.com">&lt;aru...@ru.mvista.com&gt;</A> wrote:
  </PRE>
<BLOCKQUOTE type=3D"cite"><PRE>=E4=BD=A0=E5=A5=BD!;)

=E6=B8=85=E6=B0=B4=E6=B2=B3 wrote:
    </PRE>
<BLOCKQUOTE type=3D"cite"><PRE>Hi, I tried to use gdb to debug kernel code.
I compiled with -g -ggdb flags, but it seems gdb cannot show symbols
correctly, instead it shows all ??
      </PRE></BLOCKQUOTE><PRE>compile kernel with debug information.
In kernel compilation menu "make menuconfig" select Kernel
Hucking-&gt;Compile kernel with Debug information,
there are anumber of kernel debugging related options to turn on.

Which processor architecture you compiling your kernel for?
    </PRE></BLOCKQUOTE><PRE>Hi, it is i386. Seems there is no "Compile kern=
el with Debug
  </PRE></BLOCKQUOTE>the mainstream i386 architecture usually works fine ..=
. strange<BR>
<BLOCKQUOTE type=3D"cite"><PRE>information" option, under "kernel debugging=
", there are several debug
options, like "Debug shared IRQ handlers", "Detect Soft Lockups", etc,
but which one is the option that have the source information?

  </PRE></BLOCKQUOTE>Typical settings in .config file (and make menuconfig)=
 would be:<BR><BR>CONFIG_DEBUG_KERNEL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; Kernel debugging<BR>CONFIG_DEBUG_LL&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp; Compile the kernel with debug info<BR>CONFIG_D=
EBUG_BUGVERBOSE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Verbo=
se BUG() reporting<BR><BR><BR>Make sure that you are debugging an executabl=
e "vmlinux" in your GDB session.<BR><BR>Got to the directory you compiled y=
our kernel and start debugging of vmlinux likes this:<BR><BR>cd linux-2.6.x=
x<BR>gdb vmlinux<BR>gdb target remote /dev/pts/11<BR>...<BR><BR>your GDB to=
ol have to have the ELF image of the kernel being debugged
 and<BR>the sources should present starting from the current path.<BR>I gue=
ss that there also may be some issues with GDB itself when you debugging th=
e kernel modules,<BR>but if you compile the solid kernel (modules compiled =
in kernel image) the code of<BR>these modules must be step debugged quite w=
ell<BR><BR>At the machine you are debugging the kernel run "cat&nbsp; /proc=
/kallsyms"<BR>and see if the information about symbol names is really avail=
able<BR><BR>Here is beginning of an example of output at x86 target:<BR>cat=
&nbsp; /proc/kallsyms<BR>c01002c0 T _stext<BR>c01002c0 t run_init_process<B=
R>c01002c0 T stext<BR>c01002fc t init<BR>c01005b8 t rest_init<BR>c01005d8 t=
 try_name<BR>c010079f T name_to_dev_t<BR>c0100a0c T calibrate_delay<BR>c010=
0c70 T hard_smp_processor_id<BR>c0100c80 t target_cpus<BR>c0100c87 t check_=
apicid_used<BR>c0100c8a t check_apicid_present<BR>c0100c90 t multi_timer_ch=
eck<BR>c0100c93 t apic_id_registered<BR>c0100c99 t
 apicid_to_node<BR>c0100c9d t cpu_to_logical_apicid<BR>c0100cb1 t cpu_prese=
nt_to_apicid<BR>...<BR><BR>
<BLOCKQUOTE type=3D"cite"><PRE></PRE>
<BLOCKQUOTE type=3D"cite">
<BLOCKQUOTE type=3D"cite"><PRE>Remote debugging using /dev/pts/11
0xc0467118 in ?? ()
(gdb) where
#0 &nbsp;0xc0467118 in ?? ()
#1 &nbsp;0xc077db2d in ?? ()
#2 &nbsp;0x00000000 in ?? ()
      </PRE></BLOCKQUOTE>
<BLOCKQUOTE type=3D"cite"><PRE>how to solve this problem?
_______________________________________________
bug-gdb mailing list
<A class=3Dmoz-txt-link-abbreviated href=3D"http://in.mc953.mail.yahoo.com/=
mc/compose?to=3Dbug-...@gnu.org" target=3D_blank rel=3Dnofollow ymailto=3D"=
mailto:bug-...@gnu.org">bug-...@gnu.org</A>
<A class=3Dmoz-txt-link-freetext href=3D"http://lists.gnu.org/mailman/listi=
nfo/bug-gdb" target=3D_blank rel=3Dnofollow>http://lists.gnu.org/mailman/li=
stinfo/bug-gdb</A>
      </PRE></BLOCKQUOTE></BLOCKQUOTE><PRE>________________________________=
_______________
bug-gdb mailing list
<A class=3Dmoz-txt-link-abbreviated href=3D"http://in.mc953.mail.yahoo.com/=
mc/compose?to=3Dbug-gdb@gnu.org" target=3D_blank rel=3Dnofollow ymailto=3D"=
mailto:bug-gdb@gnu.org">bug-gdb@gnu.org</A>
<A class=3Dmoz-txt-link-freetext href=3D"http://lists.gnu.org/mailman/listi=
nfo/bug-gdb" target=3D_blank rel=3Dnofollow>http://lists.gnu.org/mailman/li=
stinfo/bug-gdb</A>
  </PRE></BLOCKQUOTE><BR></DIV><BR>-----Inline Attachment Follows-----<BR><=
BR>
<DIV class=3DplainMail>_______________________________________________<BR>b=
ug-gdb mailing list<BR><A href=3D"http://in.mc953.mail.yahoo.com/mc/compose=
?to=3Dbug-gdb@gnu.org" ymailto=3D"mailto:bug-gdb@gnu.org">bug-gdb@gnu.org</=
A><BR><A href=3D"http://lists.gnu.org/mailman/listinfo/bug-gdb" target=3D_b=
lank>http://lists.gnu.org/mailman/listinfo/bug-gdb</A><BR></DIV></BLOCKQUOT=
E></td></tr></table><br>=0A=0A=0A=0A      <!--1--><hr size=3D1></hr> =0AThe=
 INTERNET now has a personality. YOURS! <a href=3D"http://in.rd.yahoo.com/t=
agline_yyi_1/*http://in.yahoo.com/" target=3D"_blank">See your Yahoo! Homep=
age</a>.
--0-1474651642-1262365672=:52775--
Technical Details
Message-ID: <mailman.522.1262365686.18930.bug-gdb@gnu.org>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.glorb.com!news2.glorb.com!usenet.stanford.edu!news.stanford.edu!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: f0ead4270c,955655e246b1cee4,start
X-Google-Attributes: gidf0ead4270c,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,UTF8
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.glorb.com!news2.glorb.com!usenet.stanford.edu!news.stanford.edu!not-for-mail
From: Tribhuwan Kandpal <tribhuwan.kandpal@yahoo.co.in>
Newsgroups: gnu.gdb.bug
Subject: Re: gdb show ?? symbols
Date: Fri, 1 Jan 2010 22:37:52 +0530 (IST)
Lines: 254
Approved: bug-gdb@gnu.org
Message-ID: <mailman.522.1262365686.18930.bug-gdb@gnu.org>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="0-1474651642-1262365672=:52775"
X-Trace: news.stanford.edu 1262365689 22453 199.232.76.165 (1 Jan 2010 17:08:09 GMT)
X-Complaints-To: news@news.stanford.edu
Cc: bug-gdb@gnu.org
To: æļ…æ°īæēģ <hushan.jia@gmail.com>,
 Alexandre Rusev <arusev@ru.mvista.com>
Envelope-to: bug-gdb@gnu.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.in; s=s1024;
 t=1262365672; bh=thhfyyWbM3F7ERsNjPOEOmL4ZsXedYfc/SXTypEMOkY=;
 h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type;
 b=kT7U3OdWMuAnaotdoxS27arDei6OCVMlkMoZTXfhLdB6UTdMxkXYdObP+lQaLOmbdjbceVnw8PZgAiYqYTA2tTZZZzsGb+arGizNRZo2r2HSeotWOuDTozJimJRE5xW+ZElvn58oVJTy7J8VZMgIfA9WNEEtaR34spEp6sBj3A8=
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in;
 h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type;
 b=kVL1m8ADKp5nEeWh0EPkJgmxHthyUdDckVNlQqR96ebo6CRBr5/yWJ34TgSVJbU0e4rB392Y+DnxFXNidvhSgzBvVbVbhwNsj3C++jfViYts89TDS3W8LhA7oOs6/BemN9LFKu8MDs+XiBw6JLvpTKr7gx37mqA1mKCmR1ddDbM=;
X-YMail-OSG: Knf30u0VM1ld.U9KGQyj7WcyP5Il_2_qoEPp41pFMoLUoRnE0r0C7bnsFlntde8wt26dyb4pt4.sXIsQ5WgVPsEnj7bcTkYFBqg3Lre6T0G1WjuGY4T59OzaZYZVWfVfiz8YiP0YOIvq2bbh3yhzAyZY2B0fX25XWxIjC_L3qjzP.c3BsQOWHu16mPpRdvTP_.VKhauh42BHTi4l3dS7k4_iX2fJLPR1.DKRZH_EKdhDTSwSvFrLYQdL9.w4pUE2.7UV.s0hjiCy2XJ6207bIZHU2y9b9iC5NCdwTOCBZxipeSYPMSuLhjfjm1ghJnqXtEnN30_mmDflMw--
X-Mailer: YahooMailClassic/9.0.20 YahooMailWebService/0.8.100.260964
In-Reply-To: <4B38B0B7.4020803@ru.mvista.com>
X-detected-operating-system: by monty-python.gnu.org: FreeBSD 6.x (1)
X-BeenThere: bug-gdb@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "Bug reports for GDB, the GNU debugger" <bug-gdb.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-gdb>
List-Post: <mailto:bug-gdb@gnu.org>
List-Help: <mailto:bug-gdb-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=subscribe>