bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gdb show ?? symbols


From: Tribhuwan Kandpal
Subject: Re: gdb show ?? symbols
Date: Fri, 1 Jan 2010 22:37:52 +0530 (IST)

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

--- On Mon, 28/12/09, Alexandre Rusev <address@hidden> wrote:

From: Alexandre Rusev <address@hidden>
Subject: Re: gdb show ?? symbols
To: "清水河" <address@hidden>
Cc: address@hidden
Date: Monday, 28 December, 2009, 5:20 AM

清水河 wrote:
On Dec 24, 2:00 am, Alexandre Rusev <address@hidden> wrote:
  
你好!;)

清水河 wrote:
    
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                       Kernel debugging
CONFIG_DEBUG_LL                                  Compile the kernel with debug info
CONFIG_DEBUG_BUGVERBOSE          Verbose BUG() reporting


Make sure that you are debugging an executable "vmlinux" in your GDB session.

Got to the directory you compiled your kernel and start debugging of vmlinux 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 debugging 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  /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  /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  0xc0467118 in ?? ()
#1  0xc077db2d in ?? ()
#2  0x00000000 in ?? ()
      
how to solve this problem?
_______________________________________________
bug-gdb mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-gdb
      
_______________________________________________
bug-gdb mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-gdb
  


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

_______________________________________________
bug-gdb mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-gdb


The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
reply via email to

[Prev in Thread] Current Thread [Next in Thread]