diff options
author | Aleksandar Ristovski <aristovski@qnx.com> | 2009-07-28 13:20:26 +0000 |
---|---|---|
committer | Aleksandar Ristovski <aristovski@qnx.com> | 2009-07-28 13:20:26 +0000 |
commit | 745a434e1500a955d8d5d4f0a7173b68d33a764e (patch) | |
tree | a7a8f29efe7548321750ef93aebdcd5de3423fa6 /gdb/nto-tdep.c | |
parent | 4ad4f3cb145c84f47512dfde2c1ff32be30659fd (diff) | |
download | gdb-745a434e1500a955d8d5d4f0a7173b68d33a764e.zip gdb-745a434e1500a955d8d5d4f0a7173b68d33a764e.tar.gz gdb-745a434e1500a955d8d5d4f0a7173b68d33a764e.tar.bz2 |
* 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.c | 34 |
1 files changed, 34 insertions, 0 deletions
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) { |