Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* processor threads
@ 2009-10-20  7:35 nagaraju.m
  2009-10-20 17:55 ` Paul Pluzhnikov
  2009-10-20 17:58 ` Michael Snyder
  0 siblings, 2 replies; 9+ messages in thread
From: nagaraju.m @ 2009-10-20  7:35 UTC (permalink / raw)
  To: gdb

Hi All,

    Currently I am using gdb-6.8. My GDB is working fine with single thread.

    The target processor which we are using has 4-threads. So my 
question is how can I debug   multi threaded (processor threads) 
applications with GDB.


    I have Googled for it but I found nothing....

    Are there any documents available??


    Please help me.....


Thanks in advance,
Nag


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: processor threads
  2009-10-20  7:35 processor threads nagaraju.m
@ 2009-10-20 17:55 ` Paul Pluzhnikov
  2009-10-20 17:58 ` Michael Snyder
  1 sibling, 0 replies; 9+ messages in thread
From: Paul Pluzhnikov @ 2009-10-20 17:55 UTC (permalink / raw)
  To: nagaraju.m; +Cc: gdb

On Mon, Oct 19, 2009 at 11:45 PM, nagaraju.m
<nagaraju.m@redpinesignals.com> wrote:

>   Currently I am using gdb-6.8. My GDB is working fine with single thread.
>
>   The target processor which we are using has 4-threads. So my question is
> how can I debug   multi threaded (processor threads) applications with GDB.
>
>
>   I have Googled for it but I found nothing....
>
>   Are there any documents available??
>
>
>   Please help me.....

You'll have to describe your problem a whole lot better before anyone could
help you. Please read this first: http://catb.org/~esr/faqs/smart-questions.html

Cheers,
-- 
Paul Pluzhnikov


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: processor threads
  2009-10-20  7:35 processor threads nagaraju.m
  2009-10-20 17:55 ` Paul Pluzhnikov
@ 2009-10-20 17:58 ` Michael Snyder
  2009-10-21  6:05   ` nagaraju.m
  1 sibling, 1 reply; 9+ messages in thread
From: Michael Snyder @ 2009-10-20 17:58 UTC (permalink / raw)
  To: nagaraju.m; +Cc: gdb

nagaraju.m wrote:
> Hi All,
> 
>     Currently I am using gdb-6.8. My GDB is working fine with single thread.
> 
>     The target processor which we are using has 4-threads. So my 
> question is how can I debug   multi threaded (processor threads) 
> applications with GDB.
> 
> 
>     I have Googled for it but I found nothing....
> 
>     Are there any documents available??
> 
> 
>     Please help me.....

Not understanding your question.
What is your target processor?
What does it mean when you say "the target processor ... has 4 threads"?
Are you talking about processor cores?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: processor threads
  2009-10-20 17:58 ` Michael Snyder
@ 2009-10-21  6:05   ` nagaraju.m
  2009-10-21  8:58     ` Jie Zhang
  2009-10-21 14:34     ` Michael Snyder
  0 siblings, 2 replies; 9+ messages in thread
From: nagaraju.m @ 2009-10-21  6:05 UTC (permalink / raw)
  To: Michael Snyder, Paul Pluzhnikov; +Cc: gdb

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??


Thanks,
Nagaraj.



Michael Snyder wrote:
> nagaraju.m wrote:
>> Hi All,
>>
>>     Currently I am using gdb-6.8. My GDB is working fine with single 
>> thread.
>>
>>     The target processor which we are using has 4-threads. So my 
>> question is how can I debug   multi threaded (processor threads) 
>> applications with GDB.
>>
>>
>>     I have Googled for it but I found nothing....
>>
>>     Are there any documents available??
>>
>>
>>     Please help me.....
>
> Not understanding your question.
> What is your target processor?
> What does it mean when you say "the target processor ... has 4 threads"?
> Are you talking about processor cores?
>
>
>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: processor threads
  2009-10-21  6:05   ` nagaraju.m
@ 2009-10-21  8:58     ` Jie Zhang
  2009-10-21 14:34     ` Michael Snyder
  1 sibling, 0 replies; 9+ messages in thread
From: Jie Zhang @ 2009-10-21  8:58 UTC (permalink / raw)
  To: nagaraju.m; +Cc: Michael Snyder, Paul Pluzhnikov, gdb

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??
> 
Maybe GDB threads support will work for you. Our JTAG GDB stub supports 
dual-core Blackfin processor. The stub treats each core as one thread. 
In gdb, you can use thread commands for cores.


Jie


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: processor threads
  2009-10-21  6:05   ` nagaraju.m
  2009-10-21  8:58     ` Jie Zhang
@ 2009-10-21 14:34     ` Michael Snyder
  2009-10-22 15:23       ` nagaraju.m
  1 sibling, 1 reply; 9+ messages in thread
From: Michael Snyder @ 2009-10-21 14:34 UTC (permalink / raw)
  To: nagaraju.m; +Cc: Paul Pluzhnikov, gdb

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: processor threads
  2009-10-21 14:34     ` Michael Snyder
@ 2009-10-22 15:23       ` nagaraju.m
  2009-10-22 20:19         ` Michael Snyder
  2009-10-24 16:03         ` Jie Zhang
  0 siblings, 2 replies; 9+ messages in thread
From: nagaraju.m @ 2009-10-22 15:23 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb

Michael,

Thanks for replying.

Can you please forward me any links on how to implement threads support 
to a specific target.


Thanks,
Nagraju


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
>
>
>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: processor threads
  2009-10-22 15:23       ` nagaraju.m
@ 2009-10-22 20:19         ` Michael Snyder
  2009-10-24 16:03         ` Jie Zhang
  1 sibling, 0 replies; 9+ messages in thread
From: Michael Snyder @ 2009-10-22 20:19 UTC (permalink / raw)
  To: nagaraju.m; +Cc: gdb

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
>>
>>
>>
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: processor threads
  2009-10-22 15:23       ` nagaraju.m
  2009-10-22 20:19         ` Michael Snyder
@ 2009-10-24 16:03         ` Jie Zhang
  1 sibling, 0 replies; 9+ messages in thread
From: Jie Zhang @ 2009-10-24 16:03 UTC (permalink / raw)
  To: nagaraju.m; +Cc: Michael Snyder, gdb

On Thu, Oct 22, 2009 at 2:52 PM, nagaraju.m
<nagaraju.m@redpinesignals.com> wrote:
> Can you please forward me any links on how to implement threads support to a
> specific target.
>
Besides the links Michael pointed out, you can take gdbproxy as an
example of implementation.

http://blackfin.uclinux.org/gf/project/toolchain/scmsvn/trunk/gdbproxy

Hope this also helps.


Jie


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-10-24 15:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-20  7:35 processor threads nagaraju.m
2009-10-20 17:55 ` Paul Pluzhnikov
2009-10-20 17:58 ` Michael Snyder
2009-10-21  6:05   ` nagaraju.m
2009-10-21  8:58     ` Jie Zhang
2009-10-21 14:34     ` Michael Snyder
2009-10-22 15:23       ` nagaraju.m
2009-10-22 20:19         ` Michael Snyder
2009-10-24 16:03         ` Jie Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox