a couple questions about kernel debugging with plain "gdb"

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

 



  (side note:  i finally figured out the intricacies of seq files.
i'd explain them, but then you wouldn't read my column about them when
it came out. :-)

  as a followup to my current kernel newbie column over at linux.com,
next week, i'm going to cover how to use stock "gdb" to debug both the
kernel and loadable modules.  following the presentation of exactly
that in LDD3:

  http://lwn.net/Kernel/LDD3/

first, a question or two about using gdb on the kernel itself.

  as long as my running kernel matches my vmlinux image, i can run:

    # gdb vmlinux /proc/kcore

at which point i can display the contents of symbols in kernel space,
such as:

(gdb) p jiffies_64
$1 = 4316697603
(gdb)

Q1:  can i get a full list of the current kernel symbol table while
i'm in gdb?  i've tried

(gdb) info variables

but that just hung.  is there another gdb command?

Q2:  i can also display the vmlinux sections thusly:

(gdb) info files
Symbols from "/home/rpjday/k/f11/vmlinux".
Local core dump file:
	`/proc/kcore', file type elf64-x86-64.
	0xffffffffff600000 - 0xffffffffffe00000 is load1
	0xffffffffa0000000 - 0xffffffffff000000 is load2
	0xffffffff81009000 - 0xffffffff81941000 is load3
	0xffffc90000000000 - 0xffffe8ffffffffff is load4
	0xffff880000000000 - 0xffff880120000000 is load5
Local exec file:
	`/home/rpjday/k/f11/vmlinux', file type elf64-x86-64.
	Entry point: 0x1000000
	0xffffffff81000000 - 0xffffffff81009000 is .text.head
	0xffffffff81009000 - 0xffffffff813f2ecf is .text
	0xffffffff813f2ed0 - 0xffffffff813f304c is .notes
	0xffffffff813f3050 - 0xffffffff813f7140 is __ex_table
	0xffffffff813f8000 - 0xffffffff8158f18a is .rodata
	0xffffffff8158f190 - 0xffffffff815951fc is __bug_table
        ... etc etc ...

is there a similar way i can display the symbol table for a specific
section?

  thanks.  more dumb questions shortly.

rday
--

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

        Linux Consulting, Training and Annoying Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
"Kernel Newbie Corner" column @ linux.com:          http://cli.gs/WG6WYX
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux