1.\" Copyright (c) 2004 Marcel Moolenaar 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 18.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 20.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" SUCH DAMAGE. 24.\" 25.\" $FreeBSD: src/gnu/usr.bin/gdb/kgdb/kgdb.1,v 1.10 2006/10/21 17:39:35 ru Exp $ 26.\" 27.Dd October 11, 2006 28.Os 29.Dt KGDB 1 30.Sh NAME 31.Nm kgdb 32.Nd "kernel debugger" 33.Sh SYNOPSIS 34.Nm 35.Op Fl a | Fl f | Fl fullname 36.Op Fl q | Fl quiet 37.Op Fl v 38.Op Fl w 39.Op Fl d Ar crashdir 40.Op Fl c Ar core | Fl n Ar dumpnr | Fl r Ar device 41.Op Ar kernel Op Ar core 42.Sh DESCRIPTION 43The 44.Nm 45utility is a debugger based on 46.Xr gdb 1 47that allows debugging of kernel core files. 48.Pp 49The options are as follows: 50.Bl -tag -width ".Fl d Ar crashdir" 51.It Fl a 52Increase the annotation level. 53An annotation level of 1 features the historical 54.Fl fullname 55option of 56.Xr gdb 1 . 57This is useful when running 58.Nm 59in Emacs. 60The 61.Fl f 62or 63.Fl fullname 64options are supported for backward compatibility as well. 65.It Fl q 66Suppress printing of the banner when the debugger starts. 67The 68.Fl quiet 69form is supported for compatibility as well. 70.It Fl v 71Increase verbosity. 72.It Fl w 73Opens kmem-based targets in read-write mode. 74.It Fl d Ar crashdir 75Use 76.Ar crashdir 77instead of the default, 78.Pa /var/crash 79to locate kernel core dump files in. 80The name 81.Pa vmcore. 82plus the dump number will be appended to determine 83the actual dump file name. 84.It Fl c Ar core 85Explicitly use 86.Ar core 87as the core dump file. 88.It Fl n Ar dumpnr 89Use the kernel core dump file numbered 90.Ar dumpnr 91for debugging. 92.It Fl r Ar device 93Use 94.Ar device 95to connect 96.Nm 97to for a remote debugging session. 98.El 99.Pp 100The 101.Fl c , n , 102and 103.Fl r 104options are mutually exclusive. 105.Pp 106Optionally, the name of the kernel symbol file and 107the name of the core dump file can be supplied on the 108command-line as positional arguments. 109If no kernel symbol file name has been given, the 110symbol file of the currently running kernel will be 111used. 112If no core dump file has been specified through either 113of the options or the last command-line argument, 114.Pa /dev/mem 115will be opened to allow debugging the currently running 116kernel. 117.Sh FILES 118.Bl -tag -width ".Pa /var/crash" 119.It Pa /dev/mem 120Default memory image to open if no core dump file 121has been specified. 122.It Pa /var/crash 123Default directory to locate kernel core dump files. 124.El 125.Sh SEE ALSO 126.Xr gdb 1 127.Sh HISTORY 128The 129.Nm 130utility first appeared in its current form in 131.Fx 5.3 132and was later ported to 133.Dx 1.5 . 134