From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16703 invoked by alias); 22 Oct 2009 18:07:12 -0000 Received: (qmail 16694 invoked by uid 22791); 22 Oct 2009 18:07:11 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Oct 2009 18:07:05 +0000 Received: from jupiter.vmware.com (mailhost5.vmware.com [10.16.68.131]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 679C4602B; Thu, 22 Oct 2009 11:07:04 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by jupiter.vmware.com (Postfix) with ESMTP id 5A5DEDC053; Thu, 22 Oct 2009 11:07:04 -0700 (PDT) Message-ID: <4AE09DB8.40801@vmware.com> Date: Thu, 22 Oct 2009 20:19:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: "nagaraju.m" CC: "gdb@sourceware.org" Subject: Re: processor threads References: <4ADD5C6F.10002@redpinesignals.com> <4ADDF828.6060504@vmware.com> <4ADE9F3E.1040200@redpinesignals.com> <4ADF1871.5080004@vmware.com> <4AE00144.5020201@redpinesignals.com> In-Reply-To: <4AE00144.5020201@redpinesignals.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-10/txt/msg00342.txt.bz2 nagaraju.m wrote: > Michael, > > Thanks for replying. > > Can you please forward me any links on how to implement threads support > to a specific target. Probably you want to look at the remote serial protocol. Start here: http://sourceware.org/gdb/current/onlinedocs/gdb_37.html#SEC677 Look for the messages pertaining to threads. There are several. For instance. * set and query the "current" thread * query if a thread is still alive There is not a special query for the registers of a particular thread. Instead, gdb will ask the target to set the "current" thread for thread queries, and then gdb will just ask for registers. It being implied that the registers should come from the "current" thread. > Michael Snyder wrote: >> nagaraju.m wrote: >>> Hi Michael, >>> >>> I mean to say that we are having 4 hardware threads. Our company >>> has its own processor on which we will be working. The >>> processor currently we are working has 4 threads in it. >>> >>> Each thread has it own set of registers (ex: program counter). >>> >>> Currently the GDB which we are using is supporting only single >>> thread (ex: thread 0). >>> Now we trying to use GDB for remaining threads. >>> >>> My Question is does GDB handles hardware threads?? >> Good, thank you for the clarification. >> >> The answer is "yes and no". GDB supports threads, per se, but >> it doesn't have any special knowledge about hardware threads >> as opposed to any other kind of threads. >> >> What you can do (and what others have done successfully before), >> is just teach your remote server/stub/agent to tell gdb >> "I have four threads, and here are their register sets". >> >> Gdb will then just think of them as ordinary threads. >> Should be enough for you to get the job done, with maybe >> a few extra tweaks that can be snuck in as off-band >> monitor commands. >> >> Good luck, >> Michael >> >> >> >