docs/127253: Error in Handbook: http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug-ddd.html

John Baldwin jhb at freebsd.org
Tue Sep 9 21:04:26 UTC 2008


On Tuesday 09 September 2008 12:27:19 pm Fritz Katz wrote:
> 
> >Number:         127253
> >Category:       docs
> >Synopsis:       Error in Handbook: 
http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug-ddd.html
> >Confidential:   no
> >Severity:       serious
> >Priority:       medium
> >Responsible:    freebsd-doc
> >State:          open
> >Quarter:        
> >Keywords:       
> >Date-Required:
> >Class:          doc-bug
> >Submitter-Id:   current-users
> >Arrival-Date:   Tue Sep 09 16:30:02 UTC 2008
> >Closed-Date:
> >Last-Modified:
> >Originator:     Fritz Katz
> >Release:        7.0-RELEASE i386
> >Organization:
> AAArt
> >Environment:
> # uname -rm
> 7.0-RELEASE i386
> 
> >Description:
>    This page in the handbook appears to give bad advice:
>       
http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug-ddd.html
>     
>         # ddd -k /var/crash/kernel.0 /var/crash/vmcore.0
>         
>    Is the handbook out-of-date? Has the '-k' option been removed from 'ddd'?
> 
>    I think the correct invocation for 'ddd' should be:
>    
>         # ddd --debugger kgdb kernel.debug /var/crash/vmcore.0
>     
>     Following instructions in the handbook results in this message: 
>     "GDB could not be started.", and the ddd console window prints:
>     
>         GNU DDD 3.3.11 (i386-portbld-freebsd7.0), 
>           by Dorothea Lutkehaus and Andreas Zeller. 
>         ...
>         gdb: unrecognized option '-k'
>         Use 'gdb --help' for a complete list of options.
> 
>     Which appears to be correct since,
>         # ddd --help
>     and
>         # gdb --help
>     shows there is no option '-k' 
>     _________________
>     
>     also, the second option, '/var/crash/kernel.0', also appears to
>     be incorrect. That file or executable does not exist. 
>     
>     Is that the executable? If so, my 'kernel' is located in:
>     
>        # cd /usr/obj/usr/src/sys/AAART/
>        # ls kernel*
>          kernel  kernel.debug   kernel.symbols
>     
>     _________________
> 
>     Attempting:
>         # ddd --core=/var/crash/vmcore.0
>     gives this message:
>         "/var/crash/vmcore.0" is not a core dump: File format not recognized
>         (gdb)
>         
>   However, the instructions for the command line debugger, 'kgdb', on this
>   page are OK:
>   
>     
http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug-gdb.html
>   
>   and the /var/crash/vmcore.0 is recognized.
>  
>   # cd /usr/obj/usr/src/sys/AAART/
>   # kgdb kernel.debug /var/crash/vmcore.0 
> >How-To-Repeat:
> 
> Read the handbook and attempt to follow it's instructions.
> >Fix:
> Replace the offending line in the Handbook with:
> 
>   # ddd --debugger kgdb kernel.debug /var/crash/vmcore.0

I think your updates are correct.  The old usage is from FreeBSD 4.x when one 
used 'gdb -k' rather than 'kgdb'.  Crash dumps on 4.x also left a kernel 
image in /var/crash which explains the /var/crash/kernel.0 reference.

-- 
John Baldwin



More information about the freebsd-doc mailing list