+#if defined (__i386__) || defined(__x86_64__)
+ x86_thread_state_t state;
+ flavor = x86_THREAD_STATE;
+ count = x86_THREAD_STATE_COUNT;
+#elif defined(__arm__)
+ arm_thread_state_t state;
+ flavor = ARM_THREAD_STATE;
+ count = ARM_THREAD_STATE_COUNT;
+#else
+ #error XXX: implement
+#endif
+
+ memset(&state, 0, sizeof(state));
+ mach_msg_type_number_t read(count);
+ _krncall(thread_get_state(thread, flavor, reinterpret_cast<thread_state_t>(&state), &read));
+ _assert(read == count);