Date: Mon, 2 Nov 2009 17:51:44 +0200 From: Kostik Belousov <kostikbel@gmail.com> To: Max Boyarov <m.boyarov@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: strange gdb behavior Message-ID: <20091102155144.GU2147@deviant.kiev.zoral.com.ua> In-Reply-To: <87c7bb540911020552x4a602732pd2caecb17c8c4535@mail.gmail.com> References: <87c7bb540911020552x4a602732pd2caecb17c8c4535@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091102155144.GU2147>