From patchwork Thu Dec 10 14:14:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 9960 Received: (qmail 112984 invoked by alias); 10 Dec 2015 14:15:13 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 112970 invoked by uid 89); 10 Dec 2015 14:15:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 10 Dec 2015 14:15:02 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 3CC0842E5D6 for ; Thu, 10 Dec 2015 14:15:01 +0000 (UTC) Received: from brno.lan (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBAEF0Ob024873 for ; Thu, 10 Dec 2015 09:15:00 -0500 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/doc] There's always a thread Date: Thu, 10 Dec 2015 14:14:59 +0000 Message-Id: <1449756899-18063-1-git-send-email-palves@redhat.com> This warning is a few years out of date -- there's always a thread nowadays. gdb/doc/ChangeLog: * gdb.texinfo (Threads): Replace warning with explanation/example about single-threaded programs. --- gdb/doc/gdb.texinfo | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index e8b419c..df3a313 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -2844,24 +2844,6 @@ the user specify which @code{libthread_db} to use if the default choice isn't compatible with the program. @end itemize -@quotation -@emph{Warning:} These facilities are not yet available on every -@value{GDBN} configuration where the operating system supports threads. -If your @value{GDBN} does not support threads, these commands have no -effect. For example, a system without thread support shows no output -from @samp{info threads}, and always rejects the @code{thread} command, -like this: - -@smallexample -(@value{GDBP}) info threads -(@value{GDBP}) thread 1 -Thread ID 1 not known. Use the "info threads" command to -see the IDs of currently known threads. -@end smallexample -@c FIXME to implementors: how hard would it be to say "sorry, this GDB -@c doesn't support threads"? -@end quotation - @cindex focus of debugging @cindex current thread The @value{GDBN} thread debugging facility allows you to observe all @@ -2903,6 +2885,13 @@ further qualifier. For debugging purposes, @value{GDBN} associates its own thread number---always a single integer---with each thread in your program. +From @value{GDBN}'s perspective, a process always has at least one +thread. In other words, on systems that require linking programs with +a threading library to access threading features +(e.g,. @code{libpthread}), even if the program does not link with said +library, @value{GDBN} assigns a thread number to the program's main +thread. + @table @code @kindex info threads @item info threads @r{[}@var{id}@dots{}@r{]}