summaryrefslogtreecommitdiff
path: root/gdb/nto-tdep.c
diff options
context:
space:
mode:
authorAleksandar Ristovski <aristovski@qnx.com>2009-07-28 13:20:25 +0000
committerAleksandar Ristovski <aristovski@qnx.com>2009-07-28 13:20:25 +0000
commit3512cd879395961b95fca87326522f3176c4dddc (patch)
tree973a7fdf7041d8e40761169789bafb3eb9e53dee /gdb/nto-tdep.c
parent871ec3815ce61b18e02b48ce43baa542325deae2 (diff)
downloadgdb-3512cd879395961b95fca87326522f3176c4dddc.tar.gz
* 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.
Diffstat (limited to 'gdb/nto-tdep.c')
-rw-r--r--gdb/nto-tdep.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
index 005527cbbb3..8f6dba1b84c 100644
--- a/gdb/nto-tdep.c
+++ b/gdb/nto-tdep.c
@@ -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)
{