summaryrefslogtreecommitdiffstats
path: root/runtime/trace.h
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2014-04-04 17:50:18 +0200
committerSebastien Hertz <shertz@google.com>2014-04-15 08:39:18 +0200
commit3f52eafe5577b8489f90dc8ed5981b3455206147 (patch)
tree7155df948d345c8a5a2d801c23b396af76527ba0 /runtime/trace.h
parent9b417e4f0f87da6bfe8dc5f02c987acfcb6dca31 (diff)
downloadart-3f52eafe5577b8489f90dc8ed5981b3455206147.zip
art-3f52eafe5577b8489f90dc8ed5981b3455206147.tar.gz
art-3f52eafe5577b8489f90dc8ed5981b3455206147.tar.bz2
Prepare field watchpoint support
Adds field read/write events in the instrumentation. The debugger now registers as a listener for these events so JDWP field access and field modification events can be reported. This CL will be followed by another one to report these events from the interpreter. Therefore no JDWP field access and field modification events can be sent for now. Bug: 8267708 Change-Id: If2a93eb590805567d69015c83cce9cd2ab712cbd
Diffstat (limited to 'runtime/trace.h')
-rw-r--r--runtime/trace.h45
1 files changed, 27 insertions, 18 deletions
diff --git a/runtime/trace.h b/runtime/trace.h
index 1af1283..bf4995a 100644
--- a/runtime/trace.h
+++ b/runtime/trace.h
@@ -32,6 +32,7 @@
namespace art {
namespace mirror {
+ class ArtField;
class ArtMethod;
} // namespace mirror
class Thread;
@@ -54,7 +55,7 @@ enum TracingMode {
kSampleProfilingActive,
};
-class Trace : public instrumentation::InstrumentationListener {
+class Trace FINAL : public instrumentation::InstrumentationListener {
public:
enum TraceFlag {
kTraceCountAllocs = 1,
@@ -78,23 +79,31 @@ class Trace : public instrumentation::InstrumentationListener {
void CompareAndUpdateStackTrace(Thread* thread, std::vector<mirror::ArtMethod*>* stack_trace)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- virtual void MethodEntered(Thread* thread, mirror::Object* this_object,
- mirror::ArtMethod* method, uint32_t dex_pc)
- SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- virtual void MethodExited(Thread* thread, mirror::Object* this_object,
- mirror::ArtMethod* method, uint32_t dex_pc,
- const JValue& return_value)
- SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- virtual void MethodUnwind(Thread* thread, mirror::Object* this_object,
- mirror::ArtMethod* method, uint32_t dex_pc)
- SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- virtual void DexPcMoved(Thread* thread, mirror::Object* this_object,
- mirror::ArtMethod* method, uint32_t new_dex_pc)
- SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- virtual void ExceptionCaught(Thread* thread, const ThrowLocation& throw_location,
- mirror::ArtMethod* catch_method, uint32_t catch_dex_pc,
- mirror::Throwable* exception_object)
- SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+ // InstrumentationListener implementation.
+ void MethodEntered(Thread* thread, mirror::Object* this_object,
+ mirror::ArtMethod* method, uint32_t dex_pc)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) OVERRIDE;
+ void MethodExited(Thread* thread, mirror::Object* this_object,
+ mirror::ArtMethod* method, uint32_t dex_pc,
+ const JValue& return_value)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) OVERRIDE;
+ void MethodUnwind(Thread* thread, mirror::Object* this_object,
+ mirror::ArtMethod* method, uint32_t dex_pc)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) OVERRIDE;
+ void DexPcMoved(Thread* thread, mirror::Object* this_object,
+ mirror::ArtMethod* method, uint32_t new_dex_pc)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) OVERRIDE;
+ void FieldRead(Thread* thread, mirror::Object* this_object,
+ mirror::ArtMethod* method, uint32_t dex_pc, mirror::ArtField* field)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) OVERRIDE;
+ void FieldWritten(Thread* thread, mirror::Object* this_object,
+ mirror::ArtMethod* method, uint32_t dex_pc, mirror::ArtField* field,
+ const JValue& field_value)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) OVERRIDE;
+ void ExceptionCaught(Thread* thread, const ThrowLocation& throw_location,
+ mirror::ArtMethod* catch_method, uint32_t catch_dex_pc,
+ mirror::Throwable* exception_object)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) OVERRIDE;
// Reuse an old stack trace if it exists, otherwise allocate a new one.
static std::vector<mirror::ArtMethod*>* AllocStackTrace();