From owner-freebsd-hackers@FreeBSD.ORG Thu May 26 00:35:43 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B906106566B for ; Thu, 26 May 2011 00:35:43 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 2FC038FC12 for ; Thu, 26 May 2011 00:35:42 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QPOYA-0000hP-1j for freebsd-hackers@freebsd.org; Thu, 26 May 2011 02:35:42 +0200 Received: from 189.61.203.226 ([189.61.203.226]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 26 May 2011 02:35:41 +0200 Received: from kubito by 189.61.203.226 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 26 May 2011 02:35:41 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Raphael Kubo da Costa Date: Wed, 25 May 2011 21:35:28 -0300 Lines: 56 Message-ID: <87pqn6jo33.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 189.61.203.226 User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.3 (berkeley-unix) Cancel-Lock: sha1:kK1FBSdTPodqu6HQqGtUAD0Zn8s= Subject: Re: Problem with running simple pthreads program under gdb-7.2 (Invalid selected thread) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2011 00:35:43 -0000 Dmitry Krivenok writes: > As you can see program exited normally w/o any errors. > Then I run the same program under gdb-7.2 > > $ /usr/local/bin/gdb72 --args t > GNU gdb (GDB) 7.2 [GDB v7.2 for FreeBSD] > Copyright (C) 2010 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show copying" > and "show warranty" for details. > This GDB was configured as "x86_64-portbld-freebsd8.2". > For bug reporting instructions, please see: > ... > Reading symbols from /big/work/coverage/csxroot/src/t/t...done. > (gdb) r > Starting program: /big/work/coverage/csxroot/src/t/t > [New LWP 100162] > [New Thread 800a041c0 (LWP 100162)] > [New Thread 800a0ae40 (LWP 100171)] > [Thread 800a0ae40 (LWP 100171) exited] > Invalid selected thread. > (gdb) q > A debugging session is active. > > Inferior 1 [process 7756] will be killed. > > Quit anyway? (y or n) y > $ > > In this case I got "Invalid selected thread." right after the thread has exited. > Looks like gdb is unable to switch to another thread. In my case, I get the following error when running your program (and many others) with the gdb72 package (installed via portmaster -PP devel/gdb): (gdb) r Starting program: /tmp/test-base [New LWP 100315] Cannot get thread info, Thread ID=100315, generic error (gdb) q A debugging session is active. Inferior 1 [process 84832] will be killed. Quit anyway? (y or n) y If I compile the port myself, I can't run any binary (PR ports/152896, which has been unanswered despite my efforts): Reading symbols from /usr/local/bin/gdb72...I'm sorry, Dave, I can't do that. Symbol format `elf64-x86-64-freebsd' unknown. This is 8.2-STABLE.