From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 2 15:51:50 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C97F106566C for ; Mon, 2 Nov 2009 15:51:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 6FF018FC25 for ; Mon, 2 Nov 2009 15:51:48 +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 nA2FpimK002921 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 2 Nov 2009 17:51:45 +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.14.3/8.14.3) with ESMTP id nA2Fpi78031162; Mon, 2 Nov 2009 17:51:44 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nA2Fpibd031161; Mon, 2 Nov 2009 17:51:44 +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: Mon, 2 Nov 2009 17:51:44 +0200 From: Kostik Belousov To: Max Boyarov Message-ID: <20091102155144.GU2147@deviant.kiev.zoral.com.ua> References: <87c7bb540911020552x4a602732pd2caecb17c8c4535@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0iexB5Bk8cF8G6DP" Content-Disposition: inline In-Reply-To: <87c7bb540911020552x4a602732pd2caecb17c8c4535@mail.gmail.com> 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=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org Subject: Re: strange gdb behavior X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Nov 2009 15:51:50 -0000 --0iexB5Bk8cF8G6DP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 02, 2009 at 03:52:33PM +0200, Max Boyarov wrote: > Hi, >=20 > Who could help understand this: >=20 > `--> cat 1.c > int > main(int argc, char **argv) > { > return 0; > } >=20 >=20 > `--> cc -ggdb -o 1 1.c >=20 >=20 > `--> gdb 1 > GNU gdb 6.1.1 [FreeBSD] > Copyright 2004 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you = are > welcome to change it and/or distribute copies of it under certain > conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for detail= s. > This GDB was configured as "i386-marcel-freebsd"... > (gdb) set args test > (gdb) b main > Breakpoint 1 at 0x80483d0: file 1.c, line 3. > (gdb) r > Starting program: /tmp/1 test >=20 > Breakpoint 1, main () at 1.c:3 > 3 { > (gdb) print argc > Error accessing memory address 0x0: Bad address. > (gdb) list > 1 int > 2 main(int argc, char **argv) > 3 { > 4 return 0; > 5 } >=20 > checked on 9.0-CURRENT, 8.0-BETA3 Can you check it on RELENG_7 ? It seems to be another old gdb bug. With gdb 7.0, (gdb) b main Breakpoint 1 at 0x8048414: file hello.c, line 8. (gdb) r Starting program: /usr/home/kostik/build/bsd/6/stuff/hello1 Breakpoint 1, main (argc=3D1, argv=3D0xbfbfe53c) at hello.c:8 8 for (i =3D 0; i < argc; i++) while in-tree gdb shows me the same behaviour as yours. --0iexB5Bk8cF8G6DP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkrvABAACgkQC3+MBN1Mb4ge4gCglNNRTE3Awcjtr6+hXM0nIOcX JM0AoIiUFoGtGiNRh25Mj/uWJ5rb2k6R =il0e -----END PGP SIGNATURE----- --0iexB5Bk8cF8G6DP--