DragonFly BSD
DragonFly kernel List (threaded) for 2004-10
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: New debug kernel installation mechanism committed to HEAD


From: Andrew Atrens <atrens@xxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Oct 2004 04:45:25 -0400

Richard Nyberg wrote:
> I do this on a regular basis:
> gdb -k kernel.debug vmcore.9
> 
> follow this chain to get the address of my module
> *linker_files.tqh_first.link.tqe_next.link.tqe_next
> 
> objdump --headers /usr/arla/bin/nnpfs.ko | grep text
> to see the relocation address.
> 
> add address and relocation address
> 
> add-symbol-file /usr/arla/bin/nnpfs.ko sum-of-addresses
> 
> bt

Yes, looks like this works, cool! :)

(kgdb) print
*linker_files.tqh_first.link.tqe_next.link.tqe_next.link.tqe_next
$4 = {refs = 1, userrefs = 1, flags = 1, link = {tqe_next = 0xc272b148,
    tqe_prev = 0xcc38641c}, filename = 0xcc38613c "fade_saver.ko", id = 5,
  address = 0xd59ef000 "\177ELF\001\001\001\t", size = 8192, ndeps = 1,
  deps = 0xc2644368, common = {stqh_first = 0x0, stqh_last = 0xcc386124},
  modules = {tqh_first = 0xc26200f0, tqh_last = 0xc26200f8}, priv =
0xcc366ac0,
  ops = 0xc046d16c}
(kgdb) print
*linker_files.tqh_first.link.tqe_next.link.tqe_next.link.tqe_next.link.tqe_next
$5 = {refs = 1, userrefs = 1, flags = 1, link = {tqe_next = 0xc272b198,
    tqe_prev = 0xcc386104}, filename = 0xc272b18c "ndis.ko", id = 6,
  address = 0xd5a6e000 "\177ELF\001\001\001\t", size = 57344, ndeps = 1,
  deps = 0xc26444c8, common = {stqh_first = 0x0, stqh_last = 0xc272b174},
  modules = {tqh_first = 0xc2623298, tqh_last = 0xc26232a0}, priv =
0xcc366d30,
  ops = 0xc046d16c}
(kgdb) print
*linker_files.tqh_first.link.tqe_next.link.tqe_next.link.tqe_next.link.tqe_next.link.tqe_next
$6 = {refs = 1, userrefs = 1, flags = 1, link = {tqe_next = 0x0,
    tqe_prev = 0xc272b154}, filename = 0xc272b1dc "if_ndis.ko", id = 7,
  address = 0xd5af0000 "\177ELF\001\001\001\t", size = 360448, ndeps = 1,
  deps = 0xc26444d0, common = {stqh_first = 0x0, stqh_last = 0xc272b1c4},
  modules = {tqh_first = 0xc26232d0, tqh_last = 0xc2705548}, priv =
0xcc366d98,
  ops = 0xc046d16c}

List looks to be NULL terminated (link.tqe_next == 0x0)

and -

-- root@atrens: /usr/src/sys/compile/ATRENS (04:30) --
# objdump --headers /if_ndis.ko | egrep 'text|Idx'
Idx Name          Size      VMA       LMA       File off  Algn
  4 .text         00003a76  00002840  00002840  00002840  2**4


Andrew.




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