From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 8C0F3138C9D for ; Sat, 25 Apr 2015 23:42:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 95E5CE083E; Sat, 25 Apr 2015 23:42:33 +0000 (UTC) Received: from mail0131.smtp25.com (mail0131.smtp25.com [75.126.84.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7F8E3E0817 for ; Sat, 25 Apr 2015 23:42:32 +0000 (UTC) Received: from ccs.covici.com (localhost [127.0.0.1]) by ccs.covici.com (8.14.9/8.14.8) with ESMTP id t3PNgUJw005847 for ; Sat, 25 Apr 2015 19:42:30 -0400 From: covici@ccs.covici.com To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] [~amd64] Confusing behavior from gdb In-reply-to: References: Comments: In-reply-to walt message dated "Sat, 25 Apr 2015 16:31:20 -0700." X-Mailer: MH-E 8.5; nmh 1.6; GNU Emacs 23.4.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5845.1430005350.1@ccs.covici.com> Content-Transfer-Encoding: quoted-printable Date: Sat, 25 Apr 2015 19:42:30 -0400 Message-ID: <5846.1430005350@ccs.covici.com> X-SpamH-OriginatingIP: 70.109.53.110 X-SpamH-Filter: d-out-001.smtp25.com-t3PNgUYo018964 X-Archives-Salt: 4063c3e7-b494-45c8-8038-399c95b923be X-Archives-Hash: 07668a5a3ae229f3f8f47bb2f23a53fe walt wrote: > I'm ready to swear on a stack of Knuth volumes that gdb has lost its min= d. > = > But, I'm willing to consider the remote possibility that I don't know ho= w > to use gdb ;) (Because I really don't.) > = > This is my annotated copy/paste from a single gdb session: > = > #gdb /bin/mount > GNU gdb (Gentoo 7.9 vanilla) 7.9 > = > > = > (gdb) start > Temporary breakpoint 1 at 0x403000: file /var/tmp/portage/sys-apps/util-= linux-2.26.1-r1/work/util-linux-2.26.1/sys-utils/mount.c, line 789. > Starting program: /bin/mount = > = > Temporary breakpoint 1, main (argc=3D1, argv=3D0x7ffc3508e108) > at /var/tmp/portage/sys-apps/util-linux-2.26.1-r1/work/util-linux-2.= 26.1/sys-utils/mount.c:789 > 789 { > (gdb) list mount.c:1020 > = > calls the print_all function, which is the one I really want to debug> > = > 1015 !mnt_context_get_target(cxt) && > 1016 !argc && > 1017 !all) { > 1018 if (oper || mnt_context_get_options(cxt)) > 1019 usage(stderr); > 1020 print_all(cxt, types, show_labels); > 1021 goto done; > 1022 } > 1023 = > 1024 /* Non-root users are allowed to use -t to print_all(), > = > = > = > > = > (gdb) break print_all > Breakpoint 2 at 0x4037fd: file /var/tmp/portage/sys-apps/util-linux-2.26= .1-r1/work/util-linux-2.26.1/sys-utils/mount.c, line 130. > = > = > = > gdb set the breakpoint at mount.c:130, but in fact print_all is defined= at > mount.c:123, seven lines earlier> > = > (gdb) list mount.c:123 > 118 else > 119 fputc(*p, stdout); > 120 } > 121 } > 122 = > 123 static void print_all(struct libmnt_context *cxt, char *pattern, int= show_label) > 124 { > 125 struct libmnt_table *tb; > 126 struct libmnt_iter *itr =3D NULL; > 127 struct libmnt_fs *fs; > (gdb) = > = > = > This seems to me to be very buggy behavior, but I'd like to get opinions= from > people who really know gdb, which I don't. I think it wants to put you on the first real statement of the function. -- = Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici@ccs.covici.com