From owner-freebsd-bugs Mon Jan 21 20:25:20 2002 Delivered-To: freebsd-bugs@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id 3C22F37B400; Mon, 21 Jan 2002 20:25:15 -0800 (PST) Received: from hades.hell.gr (patr530-b165.otenet.gr [212.205.244.173]) by mailsrv.otenet.gr (8.11.5/8.11.5) with ESMTP id g0M4PC420578; Tue, 22 Jan 2002 06:25:12 +0200 (EET) Received: by hades.hell.gr (Postfix, from userid 1001) id 5760634; Tue, 22 Jan 2002 06:25:11 +0200 (EET) Date: Tue, 22 Jan 2002 06:25:11 +0200 From: Giorgos Keramidas To: iedowse@FreeBSD.org Cc: freebsd-bugs@FreeBSD.org Subject: Re: gnu/13427: gdb reports wrong info Message-ID: <20020122042510.GD5095@hades.hell.gr> References: <200201212116.g0LLGfa29560@freefall.freebsd.org> <20020122041503.GC5095@hades.hell.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-7 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20020122041503.GC5095@hades.hell.gr> User-Agent: Mutt/1.3.25i Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Following up to my own post, with one of the tests I did today: I compiled the following small program: #include int hello (char *s) { printf("%s:%d:%s() s=%p \"%s\"\n", __FILE__, __LINE__, __FUNCTION__, s, s); return 0; } int main (void) { printf("%s:%d:%s() just before the call to hello()\n", __FILE__, __LINE__, __FUNCTION__); hello("hello world"); printf("%s:%d:%s() just after the call to hello()\n", __FILE__, __LINE__, __FUNCTION__); return 0; } And here's what happens when I try to debug it: Script started on Tue Jan 22 06:22:42 2002 % env | grep CFLAGS % cc -ggdb hello.c % gdb a.out GNU gdb 4.18 Copyright 1998 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 details. This GDB was configured as "i386-unknown-freebsd"... (gdb) b hello Breakpoint 1 at 0x80484e2: file hello.c, line 5. (gdb) r Starting program: /tmp/a.out hello.c:14:main() just before the call to hello() Breakpoint 1, hello (s=0xbfbff6f0 "<÷żż\a\204\004\b\001") at hello.c:5 5 printf("%s:%d:%s() s=%p \"%s\"\n", (gdb) c Continuing. hello.c:6:hello() s=0x804862c "hello world" hello.c:19:main() just after the call to hello() Program exited normally. (gdb) q % exit Script done on Tue Jan 22 06:23:19 2002 -- Giorgos Keramidas . . . . . . . . . keramida@{ceid.upatras.gr,freebsd.org} FreeBSD Documentation Project . . . http://www.freebsd.org/docproj/ FreeBSD: The power to serve . . . . http://www.freebsd.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message