* nto-tdep.c (nto_thread_state_str): New array.

(nto_extra_thread_info): New function definition.
	* nto-tdep.h (gdbthread.h): New include.
	(private_thread_info): New struct.
	(nto_extra_thread_info): New declaration.
	* nto-procfs.c (procfs_thread_alive): Properly check if
	thread is still alive.
	(update_thread_private_data_name, update_thread_private_data): New
	function definition.
	(procfs_find_new_threads): Fetch thread private data.
	(init_procfs_ops): Register to_extra_thread_info.
This commit is contained in:
Aleksandar Ristovski
2009-07-28 13:20:26 +00:00
parent 4ad4f3cb14
commit 745a434e15
4 changed files with 167 additions and 9 deletions

View File

@@ -341,6 +341,40 @@ nto_elf_osabi_sniffer (bfd *abfd)
return GDB_OSABI_UNKNOWN;
}
static const char *nto_thread_state_str[] =
{
"DEAD", /* 0 0x00 */
"RUNNING", /* 1 0x01 */
"READY", /* 2 0x02 */
"STOPPED", /* 3 0x03 */
"SEND", /* 4 0x04 */
"RECEIVE", /* 5 0x05 */
"REPLY", /* 6 0x06 */
"STACK", /* 7 0x07 */
"WAITTHREAD", /* 8 0x08 */
"WAITPAGE", /* 9 0x09 */
"SIGSUSPEND", /* 10 0x0a */
"SIGWAITINFO", /* 11 0x0b */
"NANOSLEEP", /* 12 0x0c */
"MUTEX", /* 13 0x0d */
"CONDVAR", /* 14 0x0e */
"JOIN", /* 15 0x0f */
"INTR", /* 16 0x10 */
"SEM", /* 17 0x11 */
"WAITCTX", /* 18 0x12 */
"NET_SEND", /* 19 0x13 */
"NET_REPLY" /* 20 0x14 */
};
char *
nto_extra_thread_info (struct thread_info *ti)
{
if (ti && ti->private
&& ti->private->state < ARRAY_SIZE (nto_thread_state_str))
return (char *)nto_thread_state_str [ti->private->state];
return "";
}
void
nto_initialize_signals (void)
{