seemingly good gdbinit for freebsd kernel errors out

Sanjeev Kumar.S sanjeevfiles at yahoo.com
Wed Apr 2 04:05:19 PDT 2008


Hi,
     Im trying to debug a gdb init script that errors 
     out saying: too few arguments in function call

     Here is the script

define kldload
  set $kld = linker_files.tqh_first
  set $done = 0
  while ($kld != 0 && $done == 0)
    if ($kld->filename == $arg0)
      set $done = 1
    else
      set $kld = $kld->link.tqe_next
    end
  end
  if ($done == 1)
    shell /usr/bin/objdump -h $arg0 | \
      awk '/ .text/ { print "set \$offset = 0x" $6 }' > .kgdb.temp
    source .kgdb.temp
    add-symbol-file $arg0 $kld->address + $offset
  end
end

document kldload
  Loads a module. Arguments are module name and offset of text section.
end

Any thoughts ?

Thanks,
Sanjeev.

       
---------------------------------
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.


More information about the freebsd-hackers mailing list