From mi@aldan.algebra.com  Fri Mar  9 22:23:10 2007
Return-Path: <mi@aldan.algebra.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 961B316A402
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  9 Mar 2007 22:23:10 +0000 (UTC)
	(envelope-from mi@aldan.algebra.com)
Received: from mail5.sea5.speakeasy.net (mail5.sea5.speakeasy.net [69.17.117.7])
	by mx1.freebsd.org (Postfix) with ESMTP id 3BBF913C481
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  9 Mar 2007 22:23:09 +0000 (UTC)
	(envelope-from mi@aldan.algebra.com)
Received: (qmail 10853 invoked from network); 9 Mar 2007 22:23:09 -0000
Received: from aldan.algebra.com ([216.254.65.224])
          (envelope-sender <mi@aldan.algebra.com>)
          by mail5.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP
          for <FreeBSD-gnats-submit@freebsd.org>; 9 Mar 2007 22:23:09 -0000
Received: from aldan.algebra.com (aldan [127.0.0.1])
	by aldan.algebra.com (8.13.8/8.13.8) with ESMTP id l29MN8ie008048
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 9 Mar 2007 17:23:08 -0500 (EST)
	(envelope-from mi@aldan.algebra.com)
Received: (from mi@localhost)
	by aldan.algebra.com (8.13.8/8.13.8/Submit) id l29MN7Nl008047;
	Fri, 9 Mar 2007 17:23:07 -0500 (EST)
	(envelope-from mi)
Message-Id: <200703092223.l29MN7Nl008047@aldan.algebra.com>
Date: Fri, 9 Mar 2007 17:23:07 -0500 (EST)
From: "Mikhail T." <mi@aldan.algebra.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: marcel@freebsd.org, kan@freebsd.org
Subject: Allow arbitrary gdb options to bypass kgdb
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         110146
>Category:       bin
>Synopsis:       [patch] [request] Allow arbitrary gdb(1) options to bypass kgdb
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    joerg
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 09 22:30:05 GMT 2007
>Closed-Date:    
>Last-Modified:  Wed May 25 08:42:42 MEST 2011
>Originator:     Mikhail T.
>Release:        FreeBSD 6.2-STABLE amd64
>Organization:
Virtual Estates, Inc. (http://libpipe.virtual-estates.com/)
>Environment:
System: FreeBSD aldan.algebra.com 6.2-STABLE FreeBSD 6.2-STABLE #1: Fri Mar 2 02:11:01 EST 2007 root@aldan.algebra.com:/meow/obj/var/src/sys/SILVER amd64

>Description:
	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...

>How-To-Repeat:

>Fix:

	The up-to-date patch can be found at

		http://aldan.algebra.com/~mi/kgdb-gdb.patch
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->joerg 
Responsible-Changed-By: joerg 
Responsible-Changed-When: Wed May 25 08:41:03 MEST 2011 
Responsible-Changed-Why:  
I think I'll be able to handle that, I'm currently trying to improve 
KGDB's behaviour when running from within Emacs.  Alas, the old patch 
no longer applies cleanly.  Are you willing to provide an updated 
patch? 


http://www.freebsd.org/cgi/query-pr.cgi?pr=110146 
>Unformatted:
