From owner-freebsd-hackers Sun Nov 5 20: 0:15 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from magnesium.net (toxic.magnesium.net [207.154.84.15]) by hub.freebsd.org (Postfix) with SMTP id C15D537B4D7 for ; Sun, 5 Nov 2000 20:00:12 -0800 (PST) Received: (qmail 7004 invoked by uid 1142); 6 Nov 2000 04:00:11 -0000 Date: 5 Nov 2000 20:00:11 -0800 Date: Sun, 5 Nov 2000 20:00:04 -0800 From: Jason Evans To: andrew@ugh.net.au Cc: freebsd-hackers@freebsd.org Subject: Re: gdb & threaded application Message-ID: <20001105200004.O4044@canonware.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from andrew@ugh.net.au on Mon, Nov 06, 2000 at 01:33:21AM +1000 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, Nov 06, 2000 at 01:33:21AM +1000, andrew@ugh.net.au wrote: > Hi, > > I have a program compiled with -pthread and I'm trying to use gdb to debug > it. I run the program in one window and then try to attach to it from > another. I have put a sleep 10 in the program so I can catch it before it > enters the section I want to debug. This is what I get: > > Attaching to program: /usr/home/andrew/work/msgs2/msgs, process 10063 > Reading symbols from /usr/lib/libc_r.so.4...done. > Reading symbols from /usr/libexec/ld-elf.so.1...done. > 0x280b7368 in _thread_sys_poll () from /usr/lib/libc_r.so.4 ^^^^^^^^^^^ For reasons that I don't entirely understand, using gdb with dynamically linked applications usually produces very undesireable (often totally incorrect) results on FreeBSD. I don't know that this is the problem, but the first thing I'd do if I were you would be to link statically. Jason To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message