From owner-freebsd-current@FreeBSD.ORG Fri Nov 21 06:38:47 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B13B816A4CE; Fri, 21 Nov 2003 06:38:47 -0800 (PST) Received: from vbook.fbsd.ru (asplinux.ru [195.133.213.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 70A0543F75; Fri, 21 Nov 2003 06:38:46 -0800 (PST) (envelope-from vova@vbook.fbsd.ru) Received: from vova by vbook.fbsd.ru with local (Exim 4.24; FreeBSD) id 1ANCRw-0000ln-HW; Fri, 21 Nov 2003 17:39:56 +0300 To: FreeBSD-gnats-submit@freebsd.org From: Vladimir Grebenschikov X-send-pr-version: 3.113 X-GNATS-Notify: Message-Id: Sender: Vladimir Grebenschikov Date: Fri, 21 Nov 2003 17:39:56 +0300 cc: current@freebsd.org Subject: Problem with GDB on latest -CURRENT X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Vladimir Grebenschikov List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2003 14:38:47 -0000 >Submitter-Id: current-users >Originator: Vladimir Grebenschikov >Organization: SWsoft >Confidential: no >Synopsis: Problem with GDB on latest -CURRENT >Severity: non-critical >Priority: medium >Category: bin >Class: sw-bug >Release: FreeBSD 5.1-CURRENT i386 >Environment: System: FreeBSD vbook.fbsd.ru 5.1-CURRENT FreeBSD 5.1-CURRENT #2: Mon Nov 17 08:10:40 MSK 2003 root@walder.asplinux.ru:/ext/obj/ext/current/src/sys/VBOOK i386 % g++ -v Using built-in specs. Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 3.3.3 [FreeBSD] 20031106 % gdb -v GNU gdb 5.2.1 (FreeBSD) Copyright 2002 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-undermydesk-freebsd". >Description: FreeBSD gdb fails to show some valid C++ objects >How-To-Repeat: % cat str.cpp #include using namespace std; class a { public: string x; }; int main() { a s; s.x = "Test1"; return 0; } % g++ -g -o str str.cpp % gdb str GNU gdb 5.2.1 (FreeBSD) ... (gdb) b main Breakpoint 1 at 0x8048665: file str.cpp, line 12. (gdb) r Starting program: /usr/local/home/vova/str Breakpoint 1, main () at str.cpp:12 12 a s; (gdb) n 13 s.x = "Test1"; (gdb) p a Attempt to use a type name as an expression (gdb) p s $1 = {x = {static npos = Error accessing memory address 0x83c451c: Bad address. (gdb) >Fix: gdb53 from ports works as expected: % gdbada str GNU gdb 5.3 (FreeBSD) ... This GDB was configured as "i386-portbld-freebsd5.1"... (gdb) b main Breakpoint 1 at 0x8048665: file str.cpp, line 12. (gdb) r Starting program: /usr/local/home/vova/str Breakpoint 1, main () at str.cpp:12 12 a s; (gdb) n 13 s.x = "Test1"; (gdb) p s $1 = {x = {static npos = 4294967295, _M_dataplus = {> = {}, _M_p = 0x281326b8 ""}, static _S_empty_rep_storage = {0, 0, 1, 0}}} (gdb) PS: Another question, why gdb53-ada present in packages directory as ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-current/Latest/gdb.tbz