From owner-freebsd-arch@FreeBSD.ORG Thu Jul 1 21:27:44 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E5F21065673 for ; Thu, 1 Jul 2010 21:27:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id DCDC38FC08 for ; Thu, 1 Jul 2010 21:27:43 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o61LRAV0040531 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 2 Jul 2010 00:27:10 +0300 (EEST) (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.14.4/8.14.4) with ESMTP id o61LRA17003932; Fri, 2 Jul 2010 00:27:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o61LRAtw003931; Fri, 2 Jul 2010 00:27:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 2 Jul 2010 00:27:10 +0300 From: Kostik Belousov To: John Baldwin Message-ID: <20100701212710.GP13238@deviant.kiev.zoral.com.ua> References: <20100701134217.GM13238@deviant.kiev.zoral.com.ua> <201007011705.26173.john@baldwin.cx> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d81eMP4bt36Qfuc6" Content-Disposition: inline In-Reply-To: <201007011705.26173.john@baldwin.cx> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-arch@freebsd.org Subject: Re: Access to siginfo for the signal from debugger X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jul 2010 21:27:44 -0000 --d81eMP4bt36Qfuc6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 01, 2010 at 05:05:26PM -0400, John Baldwin wrote: > On Thursday 01 July 2010 09:42:17 am Kostik Belousov wrote: > > Hi, > > below is the patch that provides the debugger with access to siginfo > > of the signal that stopped the debuggee. This allows to see a lot more > > details for the cause of the process stop. E.g. you can see a fault > > address if process get SIGSEGV or SIGBUS, you can distinguish between > > breakpoint-generated SIGTRAP and non-breakpoint, whether the signal > > was send due to external event etc. > >=20 > > The change to struct ptrace_lwpinfo is backward-compatible in the sense > > that programs that were compiled with old definition for the struct will > > work on new kernels. >=20 > Nice! Does gdb "just work" with these changes or does it need patching a= s=20 > well? It should "just work", and my testing seems to confirm this. gdb uses PT_LWPINFO to enumerate the thread ids, and I checked it on mt process. As I said, the change is ABI backward-compatible, i.e. you do not need even to recompile the old program for new kernel. Sure, gdb cannot show additional available information without modifications. --d81eMP4bt36Qfuc6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwtCC0ACgkQC3+MBN1Mb4jjAwCdG8/1I3EXl1uzNfqNjI35ZbBj 7eYAn2ZRUrNca7m/H6aUMRBTlTyjMhsM =sduh -----END PGP SIGNATURE----- --d81eMP4bt36Qfuc6--