bin/110146: Allow arbitrary gdb options to bypass kgdb

Mikhail T. mi at
Fri Mar 9 22:30:06 UTC 2007

>Number:         110146
>Category:       bin
>Synopsis:       Allow arbitrary gdb options to bypass kgdb
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 09 22:30:05 GMT 2007
>Originator:     Mikhail T.
>Release:        FreeBSD 6.2-STABLE amd64
Virtual Estates, Inc. (
System: FreeBSD 6.2-STABLE FreeBSD 6.2-STABLE #1: Fri Mar 2 02:11:01 EST 2007 root at amd64

	Currently, no gdb options can be given to kgdb -- except the
	specially-handled -q and -f.

	This is unfortunate -- in particular, the `-x script' option is
	missing, but possibly others.

	The patch below modifies kgdb to:

	. allow anything after the kernel/core to be sent to gdb_main;
	. eats all options recognized by kgdb itself;
	. removes some redundant strdups
	. re-arrange the command-line loop handling a bit to avoid our
	  own wrapper.

	The following command now becomes possible, for example:

		kgdb -v -c /home/mi/crash/vmcore.1 kernel.debug -x script.txt

	The command-line handling could be improved further to allow
	mixing of gdb and kgdb options (except where they overlap),
	but that is, probably, not needed.

	The common usage (as specified in Handbook) shows kernel.debug
	and vmcore explicitly...



	The up-to-date patch can be found at

More information about the freebsd-bugs mailing list