From 745a434e1500a955d8d5d4f0a7173b68d33a764e Mon Sep 17 00:00:00 2001 From: Aleksandar Ristovski Date: Tue, 28 Jul 2009 13:20:26 +0000 Subject: * 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. --- gdb/nto-tdep.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'gdb/nto-tdep.c') diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c index 005527c..8f6dba1 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) { -- cgit v1.1