Bug 127253

Summary: Error in Handbook: http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug-ddd.html
Product: Documentation Reporter: Fritz Katz <frtzkatz>
Component: Books & ArticlesAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Fritz Katz 2008-09-09 17:30:02 UTC
   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

Fix: 

Replace the offending line in the Handbook with:

  # ddd --debugger kgdb kernel.debug /var/crash/vmcore.0
How-To-Repeat: 
Read the handbook and attempt to follow it's instructions.
Comment 1 John Baldwin freebsd_committer freebsd_triage 2008-09-09 18:22:00 UTC
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
Comment 2 Gavin Atkinson freebsd_committer freebsd_triage 2008-09-11 19:44:21 UTC
Responsible Changed
From-To: freebsd-doc->gavin

I'm already working on this section
Comment 3 Gavin Atkinson freebsd_committer freebsd_triage 2010-01-31 10:02:18 UTC
Responsible Changed
From-To: gavin->freebsd-docs

Throw this back into the pook, I'm not sure when I'm going to get a chance 
to finish the overhaul of this documentation
Comment 4 Gavin Atkinson freebsd_committer freebsd_triage 2010-03-22 22:18:06 UTC
Responsible Changed
From-To: freebsd-docs->freebsd-doc

Fix assignment
Comment 5 dfilter service freebsd_committer freebsd_triage 2010-12-02 14:53:49 UTC
ale         2010-12-02 14:53:45 UTC

  FreeBSD doc repository

  Modified files:
    en_US.ISO8859-1/books/developers-handbook/kerneldebug 
                                                          chapter.sgml 
  Log:
  Fix 'ddd' command-line parameters for kernel debug.
  
  PR:             docs/127253
  Submitted by:   Fritz Katz <frtzkatz@yahoo.com>
  
  Revision  Changes    Path
  1.80      +1 -1      doc/en_US.ISO8859-1/books/developers-handbook/kerneldebug/chapter.sgml
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 6 Alex Dupre freebsd_committer freebsd_triage 2010-12-02 14:53:56 UTC
State Changed
From-To: open->closed

Fixed, thanks!