for an upcoming column on how to debug the kernel (and modules) with
gdb, i'm showing how to use the above and, since it's been a while, i
need a refresher.
once i'm in gdb, i can list the section breakdown of the vmlinux
file with:
(gdb) info files
...
Local exec file:
`/home/rpjday/k/f11/vmlinux', file type elf64-x86-64.
Entry point: 0x1000000
0xffffffff81000000 - 0xffffffff81009000 is .text.head
0xffffffff81009000 - 0xffffffff813f2d3f is .text
0xffffffff813f2d40 - 0xffffffff813f2ebc is .notes
0xffffffff813f2ec0 - 0xffffffff813f6f80 is __ex_table
0xffffffff813f7000 - 0xffffffff8158e10a is .rodata
0xffffffff8158e110 - 0xffffffff8159417c is __bug_table
0xffffffff81594180 - 0xffffffff81595810 is .pci_fixup
0xffffffff81595810 - 0xffffffff81595838 is .tracedata
0xffffffff81595840 - 0xffffffff815a26c0 is __ksymtab
0xffffffff815a26c0 - 0xffffffff815a91d0 is __ksymtab_gpl
0xffffffff815a91d0 - 0xffffffff815a91e0 is __ksymtab_unused
0xffffffff815a91e0 - 0xffffffff815bf743 is __ksymtab_strings
0xffffffff815bf750 - 0xffffffff815eacd0 is __init_rodata
0xffffffff815eacd0 - 0xffffffff815ed000 is __param
0xffffffff815ed000 - 0xffffffff8165ae60 is .data
... and so on.
if i try to list the variables (obviously a looooong list) with
(gdb) info variables
gdb just goes away (perhaps I'm just asking for too much?). is there
a way to ask for the variable/symbol list within a single section? i
don't see the gdb command for that.
also (and a simpler question), as an example of how to print kernel
variables once you're in gdb, i always start with one of:
(gdb) p jiffies
(gdb) p jiffies_64
depending on your architecture. are there some other kernel vars that
are informative and obvious to print? there's loops_per_jiffy as
well, but off the top of peoples' heads, given the stunning number of
possible kernel variables to print, which ones would be good examples
that would be meaningful for a newbie column? thanks.
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 [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ