diff options
| author | kgallowa <kgallowa@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-24 19:56:55 +0000 |
|---|---|---|
| committer | kgallowa <kgallowa@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-24 19:56:55 +0000 |
| commit | 6105e514e2a6ff269a863d2ccbf800d25c17f05e (patch) | |
| tree | 81c3d6faf8e3fc9f0dc589548e6126cab0b8ae84 /libjava/gnu/classpath/jdwp | |
| parent | ae11fff9492e65f8c7693df5273fbbc69fc19c6b (diff) | |
| download | ppe42-gcc-6105e514e2a6ff269a863d2ccbf800d25c17f05e.tar.gz ppe42-gcc-6105e514e2a6ff269a863d2ccbf800d25c17f05e.zip | |
2007-04-24 Kyle Galloway <kgallowa@redhat.com>
* gnu/classpath/jdwp/natVMVirtualMachine.java
(getThreadStatus): Implement.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124117 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/classpath/jdwp')
| -rw-r--r-- | libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc b/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc index c77aed257dd..1dfc52995e0 100644 --- a/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc +++ b/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc @@ -31,6 +31,7 @@ details. */ #include <gnu/classpath/jdwp/Jdwp.h> #include <gnu/classpath/jdwp/JdwpConstants$StepDepth.h> #include <gnu/classpath/jdwp/JdwpConstants$StepSize.h> +#include <gnu/classpath/jdwp/JdwpConstants$ThreadStatus.h> #include <gnu/classpath/jdwp/VMFrame.h> #include <gnu/classpath/jdwp/VMMethod.h> #include <gnu/classpath/jdwp/VMVirtualMachine.h> @@ -622,9 +623,37 @@ getFrameCount (Thread *thread) jint gnu::classpath::jdwp::VMVirtualMachine:: -getThreadStatus (MAYBE_UNUSED Thread *thread) +getThreadStatus (Thread *thread) { - return 0; + jint thr_state, status; + + jvmtiError jerr = _jdwp_jvmtiEnv->GetThreadState (thread, &thr_state); + if (jerr != JVMTI_ERROR_NONE) + throw_jvmti_error (jerr); + + if (thr_state & JVMTI_THREAD_STATE_SLEEPING) + status = gnu::classpath::jdwp::JdwpConstants$ThreadStatus::SLEEPING; + else if (thr_state & JVMTI_THREAD_STATE_RUNNABLE) + status = gnu::classpath::jdwp::JdwpConstants$ThreadStatus::RUNNING; + else if (thr_state & JVMTI_THREAD_STATE_WAITING) + { + if (thr_state & (JVMTI_THREAD_STATE_IN_OBJECT_WAIT + | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER)) + status = gnu::classpath::jdwp::JdwpConstants$ThreadStatus::MONITOR; + else + status = gnu::classpath::jdwp::JdwpConstants$ThreadStatus::WAIT; + } + else + { + // The thread is not SLEEPING, MONITOR, or WAIT. It may, however, be + // alive but not yet started. + if (!(thr_state & (JVMTI_THREAD_STATE_ALIVE + | JVMTI_THREAD_STATE_TERMINATED))) + status = gnu::classpath::jdwp::JdwpConstants$ThreadStatus::RUNNING; + status = gnu::classpath::jdwp::JdwpConstants$ThreadStatus::ZOMBIE; + } + + return status; } java::util::ArrayList * |

