debuggingmodules

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
debuggingmodules [2005/09/29 17:14] – CsabaHenkdebuggingmodules [2020/10/19 22:58] (current) – Remove 1 broken link. SashaVigole
Line 1: Line 1:
-The [http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/index.html %%FreeBSD%% Developers' Handbook] has a 
-chapter entitled [http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kerneldebug-kld.html Debugging Loadable Modules Using GDB]. 
- 
 The information in that chapter is somewhat out of date. Here I give simple (that is, less general) instructions which will work with recent (''%%RELENG_6%%'', ''%%7.0-CURRENT%%'') kernels. The information in that chapter is somewhat out of date. Here I give simple (that is, less general) instructions which will work with recent (''%%RELENG_6%%'', ''%%7.0-CURRENT%%'') kernels.
  
Line 17: Line 14:
 <code> <code>
  kgdb /usr/obj/usr/src/sys/GENERIC/kernel.debug /var/crash/vmcore.2}}}  kgdb /usr/obj/usr/src/sys/GENERIC/kernel.debug /var/crash/vmcore.2}}}
 + recently, there is no separate {{{kernel.debug}}}, so now the above will look like
 + {{{
 + kgdb /usr/obj/usr/src/sys/GENERIC/kernel /var/crash/vmcore.2}}}
  ) and add the module's symbol table as it's written in Developers' Handbook, using the pre-computed relocation address, and the ''debug version'' of your   ) and add the module's symbol table as it's written in Developers' Handbook, using the pre-computed relocation address, and the ''debug version'' of your 
  module (eg., {{{foo.ko.debug}}}).  module (eg., {{{foo.ko.debug}}}).
Line 22: Line 22:
  
 You can automate the computation of the relocation address with the help of the following You can automate the computation of the relocation address with the help of the following
-[http://www.freshports.org/lang/ruby18 Ruby] script:+[[http://www.freshports.org/lang/ruby18|Ruby]] script:
 {{{ {{{
 #!/usr/bin/env ruby #!/usr/bin/env ruby
  • debuggingmodules.1128014057.txt.gz
  • Last modified: 2005/09/29 17:14
  • by CsabaHenk