Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Mar 2018 10:37:26 -0800
From:      John Baldwin <jhb@freebsd.org>
To:        Benjamin Kaduk <bjk@freebsd.org>
Cc:        doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org
Subject:   Re: svn commit: r51474 - head/en_US.ISO8859-1/books/developers-handbook/kerneldebug
Message-ID:  <3862948.D1s2xhDMta@ralph.baldwin.cx>
In-Reply-To: <201803090206.w2926dFn037115@repo.freebsd.org>
References:  <201803090206.w2926dFn037115@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, March 09, 2018 02:06:39 AM Benjamin Kaduk wrote:
> Author: bjk
> Date: Fri Mar  9 02:06:39 2018
> New Revision: 51474
> URL: https://svnweb.freebsd.org/changeset/doc/51474
> 
> Log:
>   Update kgdb instructions
>   
>   The port/package should be used now, and build system changes have
>   moved the kernel images in the object tree to a new location (on
>   newer systems)
>   
>   PR:		226015
>   Submitted by:	Phil Eaton <philneaton95@gmail.com>
> 
> Modified:
>   head/en_US.ISO8859-1/books/developers-handbook/kerneldebug/chapter.xml
> 
> Modified: head/en_US.ISO8859-1/books/developers-handbook/kerneldebug/chapter.xml
> ==============================================================================
> --- head/en_US.ISO8859-1/books/developers-handbook/kerneldebug/chapter.xml	Thu Mar  8 12:51:09 2018	(r51473)
> +++ head/en_US.ISO8859-1/books/developers-handbook/kerneldebug/chapter.xml	Fri Mar  9 02:06:39 2018	(r51474)
> @@ -169,7 +169,9 @@
>      <note>
>        <para>This section covers &man.kgdb.1; as found in &os;&nbsp;5.3
>  	and later.  In previous versions, one must use
> -	<command>gdb -k</command> to read a core dump file.</para>
> +	<command>gdb -k</command> to read a core dump file.
> +	Since &os;&nbsp;12 kgdb is acquired by installing
> +	<package>devel/gdb</package>.</para>

All mention of gdb -k should probably be axed as well.  Thanks for updating this.

>      </note>
>  
>      <para>Once a dump has been obtained, getting useful information
> @@ -178,8 +180,12 @@
>        the crash dump, locate the debug version of your kernel
>        (normally called <filename>kernel.debug</filename>) and the path
>        to the source files used to build your kernel (normally
> -      <filename>/usr/obj/usr/src/sys/<replaceable>KERNCONF</replaceable></filename>,
> -      where <filename><replaceable>KERNCONF</replaceable></filename>
> +      <filename>/usr/obj/usr/src/sys/<replaceable>KERNCONF</replaceable></filename>
> +      or
> +      <filename>/usr/obj/usr/src/<replaceable>amd64.amd64</replaceable>/sys/<replaceable>KERNCONF</replaceable></filename>,
> +      where <filename><replaceable>amd64.amd64</replaceable></filename>
> +      is the architecture and
> +      <filename><replaceable>KERNCONF</replaceable></filename>
>        is the <varname>ident</varname> specified in a kernel
>        &man.config.5;).  With those two pieces of info, let the
>        debugging commence!</para>

Hmm, I'd need to look at the larger context, but kgdb can usually find the
matching kernel for you if you just use 'kgdb -n last' (using kgdb from
ports).  Also, kernel.debug is the wrong thing to use now in the obj tree.
You would want to use kernel.full, but even better is to run kgdb against the
installed kernel binary (e.g. /boot/foo/kernel) and let it find the debug
symbols in /usr/lib/debug/boot/foo/kernel.debug automatically.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3862948.D1s2xhDMta>