From owner-freebsd-current@FreeBSD.ORG Tue Feb 27 10:41:17 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A05B116A403; Tue, 27 Feb 2007 10:41:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by mx1.freebsd.org (Postfix) with ESMTP id EAC0F13C478; Tue, 27 Feb 2007 10:41:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.227] (helo=fw.zoral.com.ua) by relay02.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.60) (envelope-from ) id 1HLzla-000N0i-9W; Tue, 27 Feb 2007 12:41:14 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by fw.zoral.com.ua (8.13.4/8.13.4) with ESMTP id l1RAetOw008423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 27 Feb 2007 12:40:55 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.13.8/8.13.8) with ESMTP id l1RAesIm028529; Tue, 27 Feb 2007 12:40:54 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.13.8/8.13.8/Submit) id l1RAeqGZ028527; Tue, 27 Feb 2007 12:40:52 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 27 Feb 2007 12:40:52 +0200 From: Kostik Belousov To: John Baldwin Message-ID: <20070227104052.GG77131@deviant.kiev.zoral.com.ua> References: <20070223061822.GA1497@obelix.dsto.defence.gov.au> <20070223113439.GK39168@deviant.kiev.zoral.com.ua> <200702261834.13911.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="O8XZ+2Hy8Kj8wLPZ" Content-Disposition: inline In-Reply-To: <200702261834.13911.jhb@freebsd.org> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.88.7, clamav-milter version 0.88.7 on fw.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-0.1 required=5.0 tests=ALL_TRUSTED,SPF_NEUTRAL autolearn=failed version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on fw.zoral.com.ua X-Scanner-Signature: fa718887f43e9e3967a9d10f43843ba4 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 814 [Feb 27 2007] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {received from trusted relay: not dialup} X-SpamTest-Method: none X-SpamTest-Method: Local Lists X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release Cc: freebsd-current@freebsd.org, "Wilkinson, Alex" Subject: Re: kgdb(1) ... is it broken ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2007 10:41:17 -0000 --O8XZ+2Hy8Kj8wLPZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 26, 2007 at 06:34:13PM -0500, John Baldwin wrote: > > Try this patch, it shall allow to see useful backtrace in kgdb (I really > > like to receive feedback on this one): > >=20 > > Index: gnu/usr.bin/gdb/kgdb/trgt_i386.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > RCS file: /usr/local/arch/ncvs/src/gnu/usr.bin/gdb/kgdb/trgt_i386.c,v > > retrieving revision 1.5 > > diff -u -r1.5 trgt_i386.c > > --- gnu/usr.bin/gdb/kgdb/trgt_i386.c 11 Sep 2005 05:36:30 -0000 1.5 > > +++ gnu/usr.bin/gdb/kgdb/trgt_i386.c 23 Feb 2007 11:31:39 -0000 > > @@ -146,7 +146,7 @@ > > *realnump =3D -1; > > =20 > > ofs =3D (regnum >=3D I386_EAX_REGNUM && regnum <=3D I386_FS_REGNUM) > > - ? kgdb_trgt_frame_offset[regnum] : -1; > > + ? kgdb_trgt_frame_offset[regnum] + 4 : -1; > > if (ofs =3D=3D -1) > > return; >=20 > You can make the patch by dependent on the kern.osreldate (__FreeBSD_vers= ion) > which is accesible as the global var 'osreldate' in the kernel and use the > old offset for kernels before Kip's change so it works for both old and n= ew. That was my intent (in fact, I would prefer to check instruction at calltrap label directly). I noted that kgdb machine-specific code pulls sys/proc.h, machine/frame.h and machine/pcb.h. As result, kgdb have to be built from the same tree as the kernel itself. Due to this, I do not see high need for such check. Anyway, I think that I implement it later this week. --O8XZ+2Hy8Kj8wLPZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFF5Aq0C3+MBN1Mb4gRArlyAJ9Lscz2nTCBjVwwBl8ICFy1BoqBnACgoH8i itpJl3fAdkZlnwmswv7Uthc= =k8lg -----END PGP SIGNATURE----- --O8XZ+2Hy8Kj8wLPZ--