summaryrefslogtreecommitdiff
path: root/runtime/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/thread.h')
-rw-r--r--runtime/thread.h47
1 files changed, 33 insertions, 14 deletions
diff --git a/runtime/thread.h b/runtime/thread.h
index af02dc779e..2e9ae3c42d 100644
--- a/runtime/thread.h
+++ b/runtime/thread.h
@@ -41,7 +41,6 @@
#include "runtime_stats.h"
#include "stack.h"
#include "thread_state.h"
-#include "throw_location.h"
namespace art {
@@ -364,8 +363,6 @@ class Thread {
bool IsExceptionThrownByCurrentMethod(mirror::Throwable* exception) const
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- ThrowLocation GetCurrentLocationForThrow() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
-
void SetTopOfStack(StackReference<mirror::ArtMethod>* top_method) {
tlsPtr_.managed_stack.SetTopQuickFrame(top_method);
}
@@ -380,24 +377,19 @@ class Thread {
}
// If 'msg' is NULL, no detail message is set.
- void ThrowNewException(const ThrowLocation& throw_location,
- const char* exception_class_descriptor, const char* msg)
+ void ThrowNewException(const char* exception_class_descriptor, const char* msg)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
// If 'msg' is NULL, no detail message is set. An exception must be pending, and will be
// used as the new exception's cause.
- void ThrowNewWrappedException(const ThrowLocation& throw_location,
- const char* exception_class_descriptor,
- const char* msg)
+ void ThrowNewWrappedException(const char* exception_class_descriptor, const char* msg)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- void ThrowNewExceptionF(const ThrowLocation& throw_location,
- const char* exception_class_descriptor, const char* fmt, ...)
- __attribute__((format(printf, 4, 5)))
+ void ThrowNewExceptionF(const char* exception_class_descriptor, const char* fmt, ...)
+ __attribute__((format(printf, 3, 4)))
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- void ThrowNewExceptionV(const ThrowLocation& throw_location,
- const char* exception_class_descriptor, const char* fmt, va_list ap)
+ void ThrowNewExceptionV(const char* exception_class_descriptor, const char* fmt, va_list ap)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
// OutOfMemoryError is special, because we need to pre-allocate an instance.
@@ -707,6 +699,16 @@ class Thread {
return tlsPtr_.single_step_control;
}
+ // Indicates whether this thread is ready to invoke a method for debugging. This
+ // is only true if the thread has been suspended by a debug event.
+ bool IsReadyForDebugInvoke() const {
+ return tls32_.ready_for_debug_invoke;
+ }
+
+ void SetReadyForDebugInvoke(bool ready) {
+ tls32_.ready_for_debug_invoke = ready;
+ }
+
// Activates single step control for debugging. The thread takes the
// ownership of the given SingleStepControl*. It is deleted by a call
// to DeactivateSingleStepControl or upon thread destruction.
@@ -715,6 +717,17 @@ class Thread {
// Deactivates single step control for debugging.
void DeactivateSingleStepControl();
+ // Sets debug invoke request for debugging. When the thread is resumed,
+ // it executes the method described by this request then suspends itself.
+ // The thread does not take ownership of the given DebugInvokeReq*, it is
+ // owned by the JDWP thread which is waiting for the execution of the
+ // method.
+ void SetDebugInvokeReq(DebugInvokeReq* req);
+
+ // Clears debug invoke request for debugging. When the thread completes
+ // method invocation, it clears its debug invoke request, signals the
+ // JDWP thread and suspends itself.
+ void ClearDebugInvokeReq();
// Returns the fake exception used to activate deoptimization.
static mirror::Throwable* GetDeoptimizationException() {
@@ -966,7 +979,8 @@ class Thread {
explicit tls_32bit_sized_values(bool is_daemon) :
suspend_count(0), debug_suspend_count(0), thin_lock_thread_id(0), tid(0),
daemon(is_daemon), throwing_OutOfMemoryError(false), no_thread_suspension(0),
- thread_exit_check_count(0), handling_signal_(false), suspended_at_suspend_check(false) {
+ thread_exit_check_count(0), handling_signal_(false), suspended_at_suspend_check(false),
+ ready_for_debug_invoke(false) {
}
union StateAndFlags state_and_flags;
@@ -1010,6 +1024,11 @@ class Thread {
// used to distinguish runnable threads that are suspended due to
// a normal suspend check from other threads.
bool32_t suspended_at_suspend_check;
+
+ // True if the thread has been suspended by a debugger event. This is
+ // used to invoke method from the debugger which is only allowed when
+ // the thread is suspended by an event.
+ bool32_t ready_for_debug_invoke;
} tls32_;
struct PACKED(8) tls_64bit_sized_values {