From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6638 invoked by alias); 28 Dec 2009 10:28:14 -0000 Received: (qmail 6625 invoked by uid 22791); 28 Dec 2009 10:28:13 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from fg-out-1718.google.com (HELO fg-out-1718.google.com) (72.14.220.152) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Dec 2009 10:28:10 +0000 Received: by fg-out-1718.google.com with SMTP id e21so1184138fga.12 for ; Mon, 28 Dec 2009 02:28:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.37.4 with SMTP id p4mr4001982muj.44.1261996087380; Mon, 28 Dec 2009 02:28:07 -0800 (PST) In-Reply-To: References: <8ac60eac0912261936q49f50cf6ofabf2c56055621af@mail.gmail.com> <4B381A0F.70803@analog.com> <4B383264.30604@analog.com> <4B385274.1000100@analog.com> Date: Mon, 28 Dec 2009 10:28:00 -0000 Message-ID: Subject: Re: gdb symbol problem From: Hushan Jia To: Hui Zhu Cc: Paul Pluzhnikov , gdb@sourceware.org, Jie Zhang Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-12/txt/msg00170.txt.bz2 On Mon, Dec 28, 2009 at 3:36 PM, Hui Zhu wrote: > Maybe your address is a part of a LKM. > If so, find it out with "cat /proc/modules", and use gdb cmd > "add-symbol-file module_dir_name address" add symbol message to gdb. > > Hui > > On Mon, Dec 28, 2009 at 14:38, Jie Zhang wrote: >> On 12/28/2009 01:09 PM, Hushan Jia wrote: >>> >>> On Mon, Dec 28, 2009 at 12:21 PM, Jie Zhang =A0wr= ote: >>>> >>>> On 12/28/2009 12:14 PM, Hushan Jia wrote: >>>>> >>>>> On Mon, Dec 28, 2009 at 10:38 AM, Jie Zhang >>>>> =A0wrote: >>>>>> >>>>>> On 12/27/2009 11:45 AM, Hushan Jia wrote: >>>>>>> >>>>>>> On Sun, Dec 27, 2009 at 11:36 AM, Paul Pluzhnikov >>>>>>> =A0 =A0 =A0wrote: >>>>>>>> >>>>>>>> On Sat, Dec 26, 2009 at 6:16 PM, Hushan Jia >>>>>>>> =A0wrote: >>>>>>>> >>>>>>>>> I invoke gdb like this: >>>>>>>>> >>>>>>>>> [hushan@hushan-t linux-2.6.31.3]$ gdb ./vmlinux >>>>>>>> >>>>>>>> Oh, you are not debugging a regular application. You probably shou= ld >>>>>>>> have mentioned that in your initial message. >>>>>>> >>>>>>> Sorry for forget the important information. >>>>>>> >>>>>> What's the output of "readelf -S vmlinux"? >>>>> >>>>> Hi, The output is: >>>>> >>>>> # readelf -S vmlinux >>>>> There are 77 section headers, starting at offset 0x3b569cc: >>>>> >>>>> Section Headers: >>>>> =A0 [Nr] Name =A0 =A0 =A0 =A0 =A0 =A0 =A0Type =A0 =A0 =A0 =A0 =A0 =A0= Addr =A0 =A0 Off =A0 =A0Size =A0 ES Flg >>>>> Lk >>>>> Inf Al >>>>> =A0 [ 0] =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 NULL =A0 =A0 =A0 =A0 =A0= =A000000000 000000 000000 00 >>>>> =A00 >>>>> =A0 0 =A00 >>>>> =A0 [ 1] .text.head =A0 =A0 =A0 =A0PROGBITS =A0 =A0 =A0 =A0c1000000 0= 01000 0000a9 00 =A0AX >>>>> =A00 >>>>> =A0 0 =A04 >>>>> =A0 [ 2] .rel.text.head =A0 =A0REL =A0 =A0 =A0 =A0 =A0 =A0 00000000 3= b575d4 000070 08 >>>>> =A075 =A0 1 =A04 >>>>> =A0 [ 3] .text =A0 =A0 =A0 =A0 =A0 =A0 PROGBITS =A0 =A0 =A0 =A0c10000= c0 0010c0 291284 00 =A0AX >>>>> =A00 >>>>> =A0 0 32 >>>> >>>> It seems the machine was not executing code of your vmlinux. The code = in >>>> your vmlinux starts from 0xc1000000. But when you connected with GDB, = the >>>> stopped PC was 0xc0467118, which was just ahead of code sections of yo= ur >>>> vmlinux. Is it possbile the linux kernel running in your qemu was not = the >>>> one you told GDB? >>> >>> Hi, I compiled the kernel on the host machine, and then copy kernel >>> and modules files to the qemu virtual machine, they are the same >>> files. >> >> OK. Then you need to find out what's at the address 0xc0467118. GDB cann= ot >> show you the symbol and source line which it doesn't know. /proc/kallsyms >> might be helpful if that address is in kernel. >> >>> and the kgdb seems does not work, if I run c in gdb, then I cannot >>> interrupt it using CTRL-C, and the breakpoints are never hit. >>> The attached file is the kernel config, and kernel is >>> linux-2.6.31.3.tar.bz2, downloaded from kernel.org. >>> >> I have no idea about kgdb. >> >> >> Jie >> > Thanks for all your replies, the kgdb kernel cannot boot, maybe it is a config problem. --=20 Thanks & Regards, Hushan Jia