This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: processor threads


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






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]