From owner-freebsd-bugs@FreeBSD.ORG Fri Mar 9 22:30:05 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E125F16A401 for ; Fri, 9 Mar 2007 22:30:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id BC7C313C467 for ; Fri, 9 Mar 2007 22:30:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l29MU5Df071345 for ; Fri, 9 Mar 2007 22:30:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l29MU5tG071344; Fri, 9 Mar 2007 22:30:05 GMT (envelope-from gnats) Resent-Date: Fri, 9 Mar 2007 22:30:05 GMT Resent-Message-Id: <200703092230.l29MU5tG071344@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Mikhail T." Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 961B316A402 for ; 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 ; 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 ) by mail5.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 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." To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: kan@FreeBSD.org, marcel@FreeBSD.org Subject: bin/110146: Allow arbitrary gdb options to bypass kgdb X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2007 22:30:06 -0000 >Number: 110146 >Category: bin >Synopsis: Allow arbitrary gdb options to bypass kgdb >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >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: >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: >Unformatted: