From owner-freebsd-stable Wed Mar 1 19:51:53 2000 Delivered-To: freebsd-stable@freebsd.org Received: from ns.yogotech.com (ns.yogotech.com [206.127.79.126]) by hub.freebsd.org (Postfix) with ESMTP id 4636D37BCC1 for ; Wed, 1 Mar 2000 19:51:50 -0800 (PST) (envelope-from nate@yogotech.com) Received: from nomad.yogotech.com (nomad.yogotech.com [206.127.79.115]) by ns.yogotech.com (8.9.3/8.9.3) with ESMTP id UAA10674 for ; Wed, 1 Mar 2000 20:51:45 -0700 (MST) (envelope-from nate@nomad.yogotech.com) Received: (from nate@localhost) by nomad.yogotech.com (8.8.8/8.8.8) id UAA04126; Wed, 1 Mar 2000 20:51:44 -0700 (MST) (envelope-from nate) Date: Wed, 1 Mar 2000 20:51:44 -0700 (MST) Message-Id: <200003020351.UAA04126@nomad.yogotech.com> From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: freebsd-stable@FreeBSD.org Subject: GDB on C++ programs under FreeBSD 3.X X-Mailer: VM 6.34 under 19.16 "Lille" XEmacs Lucid Reply-To: nate@yogotech.com (Nate Williams) Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Any idea what would cause this? A co-worker is debugging a C++ program, and this sort of things works fine under 2.2, but doesn't work under 3.X. > The "-static" linker flag did not appear to change anything. > Any additional insights would be greatly appreciated. > > FreeBSD Version: 3.3-RELEASE > > GDB Version: GNU gdb 4.18 > > Typical GDB Output: > =-=-= > (gdb) p pkt > $1 = (CpfPkt *) 0x8d28a04 > (gdb) call pkt->printAll(0, (void *)0) > Cannot resolve method CpfPkt::printAll to any overloaded instance > (gdb) call pkt->printAll() > Cannot resolve method CpfPkt::printAll to any overloaded instance > (gdb) call CpfSimNodeNameGet() > Segmentation fault(core dumped) > =-=-= I tried creating a simple test program, but the test program works as expected. Under FreeBSD 2.2.8-stable. (gdb) print pkt $1 = (CpfPkt *) 0xa83a04 (gdb) call pkt->printAll(0, (void *)0) node3: 0.056106 Pkt [0xa83a04] object CpfPkt: originated in node3/br.0 node3: 0.056106 CpfProtoComm CpfPkt: originated in node3/br.0 node node3 node3: 0.056106 Owner Broadcast Radio MAC (1a2eb04), Current proto Broadcast Radio MAC (1a2eb04) node3: 0.056106 Retain flag 0, Notify flag 0, Notify type 0x10000000 .... You get the point. I'll keep trying to develop a simple test case, but this is a rather large C++ program, and breaking things down into smaller pieces don't seem to work. In the same vein, I have other weird behavior that occurs, which may shed some light. I tried linking statically to see if that would help, and that doesn't seem to do anything. To link statically, I add '-static' to the link line, but the resulting executable is still created as a dynamic executable (at least according to file). www:~/roof/cpt/examples/hier % file prog prog: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, not stripped However, if I run ldd on the resulting 'dynamic' executable, the following error occurs. www:~/roof/cpt/examples/hier % ldd prog prog: ELF interpreter /usr/lib/libc.so.1 not found prog: signal 6 I don't have any 4.* systems, nor do I have the resources to create one, so I can't test there. Thanks for any help you can provide! Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message