Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /* |
| 18 | * Dalvik-specific side of debugger support. (The JDWP code is intended to |
| 19 | * be relatively generic.) |
| 20 | */ |
Brian Carlstrom | fc0e321 | 2013-07-17 14:40:12 -0700 | [diff] [blame] | 21 | #ifndef ART_RUNTIME_DEBUGGER_H_ |
| 22 | #define ART_RUNTIME_DEBUGGER_H_ |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 23 | |
| 24 | #include <pthread.h> |
| 25 | |
Sebastien Hertz | 61b7f1b | 2013-11-15 15:59:30 +0100 | [diff] [blame] | 26 | #include <set> |
Elliott Hughes | 3bb8156 | 2011-10-21 18:52:59 -0700 | [diff] [blame] | 27 | #include <string> |
Sebastien Hertz | 4d25df3 | 2014-03-21 17:44:46 +0100 | [diff] [blame] | 28 | #include <vector> |
Elliott Hughes | 3bb8156 | 2011-10-21 18:52:59 -0700 | [diff] [blame] | 29 | |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 30 | #include "jdwp/jdwp.h" |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 31 | #include "jni.h" |
| 32 | #include "jvalue.h" |
Mathieu Chartier | 83c8ee0 | 2014-01-28 14:50:23 -0800 | [diff] [blame] | 33 | #include "object_callbacks.h" |
Jeff Hao | 920af3e | 2013-08-28 15:46:38 -0700 | [diff] [blame] | 34 | #include "thread_state.h" |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 35 | |
| 36 | namespace art { |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 37 | namespace mirror { |
Sebastien Hertz | 3f52eaf | 2014-04-04 17:50:18 +0200 | [diff] [blame] | 38 | class ArtField; |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 39 | class ArtMethod; |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 40 | class Class; |
| 41 | class Object; |
| 42 | class Throwable; |
| 43 | } // namespace mirror |
Elliott Hughes | 545a064 | 2011-11-08 19:10:03 -0800 | [diff] [blame] | 44 | struct AllocRecord; |
Ian Rogers | 1b09b09 | 2012-08-20 15:35:52 -0700 | [diff] [blame] | 45 | class Thread; |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame] | 46 | class ThrowLocation; |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 47 | |
| 48 | /* |
| 49 | * Invoke-during-breakpoint support. |
| 50 | */ |
| 51 | struct DebugInvokeReq { |
Elliott Hughes | 7b3cdfc | 2011-12-08 21:28:17 -0800 | [diff] [blame] | 52 | DebugInvokeReq() |
Sebastien Hertz | d38667a | 2013-11-25 15:43:54 +0100 | [diff] [blame] | 53 | : ready(false), invoke_needed(false), |
| 54 | receiver(NULL), thread(NULL), klass(NULL), method(NULL), |
| 55 | arg_count(0), arg_values(NULL), options(0), error(JDWP::ERR_NONE), |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 56 | result_tag(JDWP::JT_VOID), exception(0), |
Sebastien Hertz | d38667a | 2013-11-25 15:43:54 +0100 | [diff] [blame] | 57 | lock("a DebugInvokeReq lock", kBreakpointInvokeLock), |
| 58 | cond("a DebugInvokeReq condition variable", lock) { |
Elliott Hughes | 475fc23 | 2011-10-25 15:00:35 -0700 | [diff] [blame] | 59 | } |
| 60 | |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 61 | /* boolean; only set when we're in the tail end of an event handler */ |
| 62 | bool ready; |
| 63 | |
| 64 | /* boolean; set if the JDWP thread wants this thread to do work */ |
Sebastien Hertz | d38667a | 2013-11-25 15:43:54 +0100 | [diff] [blame] | 65 | bool invoke_needed; |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 66 | |
| 67 | /* request */ |
Sebastien Hertz | d38667a | 2013-11-25 15:43:54 +0100 | [diff] [blame] | 68 | mirror::Object* receiver; /* not used for ClassType.InvokeMethod */ |
| 69 | mirror::Object* thread; |
| 70 | mirror::Class* klass; |
| 71 | mirror::ArtMethod* method; |
| 72 | uint32_t arg_count; |
| 73 | uint64_t* arg_values; /* will be NULL if arg_count_ == 0 */ |
| 74 | uint32_t options; |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 75 | |
| 76 | /* result */ |
Elliott Hughes | 475fc23 | 2011-10-25 15:00:35 -0700 | [diff] [blame] | 77 | JDWP::JdwpError error; |
Elliott Hughes | d07986f | 2011-12-06 18:27:45 -0800 | [diff] [blame] | 78 | JDWP::JdwpTag result_tag; |
Elliott Hughes | 475fc23 | 2011-10-25 15:00:35 -0700 | [diff] [blame] | 79 | JValue result_value; |
| 80 | JDWP::ObjectId exception; |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 81 | |
| 82 | /* condition variable to wait on while the method executes */ |
Sebastien Hertz | d38667a | 2013-11-25 15:43:54 +0100 | [diff] [blame] | 83 | Mutex lock DEFAULT_MUTEX_ACQUIRED_AFTER; |
| 84 | ConditionVariable cond GUARDED_BY(lock); |
Sebastien Hertz | 61b7f1b | 2013-11-15 15:59:30 +0100 | [diff] [blame] | 85 | |
Mathieu Chartier | 3b05e9b | 2014-03-25 09:29:43 -0700 | [diff] [blame] | 86 | void VisitRoots(RootCallback* callback, void* arg, uint32_t tid, RootType root_type) |
| 87 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 88 | |
Sebastien Hertz | bb43b43 | 2014-04-14 11:59:08 +0200 | [diff] [blame] | 89 | void Clear(); |
| 90 | |
Sebastien Hertz | 61b7f1b | 2013-11-15 15:59:30 +0100 | [diff] [blame] | 91 | private: |
| 92 | DISALLOW_COPY_AND_ASSIGN(DebugInvokeReq); |
| 93 | }; |
| 94 | |
| 95 | // Thread local data-structure that holds fields for controlling single-stepping. |
| 96 | struct SingleStepControl { |
| 97 | SingleStepControl() |
| 98 | : is_active(false), step_size(JDWP::SS_MIN), step_depth(JDWP::SD_INTO), |
| 99 | method(nullptr), stack_depth(0) { |
| 100 | } |
| 101 | |
| 102 | // Are we single-stepping right now? |
| 103 | bool is_active; |
| 104 | |
| 105 | // See JdwpStepSize and JdwpStepDepth for details. |
| 106 | JDWP::JdwpStepSize step_size; |
| 107 | JDWP::JdwpStepDepth step_depth; |
| 108 | |
| 109 | // The location this single-step was initiated from. |
| 110 | // A single-step is initiated in a suspended thread. We save here the current method and the |
| 111 | // set of DEX pcs associated to the source line number where the suspension occurred. |
| 112 | // This is used to support SD_INTO and SD_OVER single-step depths so we detect when a single-step |
| 113 | // causes the execution of an instruction in a different method or at a different line number. |
| 114 | mirror::ArtMethod* method; |
| 115 | std::set<uint32_t> dex_pcs; |
| 116 | |
| 117 | // The stack depth when this single-step was initiated. This is used to support SD_OVER and SD_OUT |
| 118 | // single-step depth. |
| 119 | int stack_depth; |
| 120 | |
Mathieu Chartier | 3b05e9b | 2014-03-25 09:29:43 -0700 | [diff] [blame] | 121 | void VisitRoots(RootCallback* callback, void* arg, uint32_t tid, RootType root_type) |
| 122 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 123 | |
Sebastien Hertz | bb43b43 | 2014-04-14 11:59:08 +0200 | [diff] [blame] | 124 | bool ContainsDexPc(uint32_t dex_pc) const; |
| 125 | |
| 126 | void Clear(); |
| 127 | |
Sebastien Hertz | 61b7f1b | 2013-11-15 15:59:30 +0100 | [diff] [blame] | 128 | private: |
| 129 | DISALLOW_COPY_AND_ASSIGN(SingleStepControl); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 130 | }; |
| 131 | |
Sebastien Hertz | 42cd43f | 2014-05-13 14:15:41 +0200 | [diff] [blame] | 132 | // TODO rename to InstrumentationRequest. |
Sebastien Hertz | 4d25df3 | 2014-03-21 17:44:46 +0100 | [diff] [blame] | 133 | struct DeoptimizationRequest { |
| 134 | enum Kind { |
| 135 | kNothing, // no action. |
Sebastien Hertz | 42cd43f | 2014-05-13 14:15:41 +0200 | [diff] [blame] | 136 | kRegisterForEvent, // start listening for instrumentation event. |
| 137 | kUnregisterForEvent, // stop listening for instrumentation event. |
Sebastien Hertz | 4d25df3 | 2014-03-21 17:44:46 +0100 | [diff] [blame] | 138 | kFullDeoptimization, // deoptimize everything. |
| 139 | kFullUndeoptimization, // undeoptimize everything. |
| 140 | kSelectiveDeoptimization, // deoptimize one method. |
| 141 | kSelectiveUndeoptimization // undeoptimize one method. |
| 142 | }; |
| 143 | |
Sebastien Hertz | 42cd43f | 2014-05-13 14:15:41 +0200 | [diff] [blame] | 144 | DeoptimizationRequest() : kind(kNothing), instrumentation_event(0), method(nullptr) {} |
Sebastien Hertz | 4d25df3 | 2014-03-21 17:44:46 +0100 | [diff] [blame] | 145 | |
| 146 | void VisitRoots(RootCallback* callback, void* arg); |
| 147 | |
| 148 | Kind kind; |
| 149 | |
Sebastien Hertz | 42cd43f | 2014-05-13 14:15:41 +0200 | [diff] [blame] | 150 | // TODO we could use a union to hold the instrumentation_event and the method since they |
| 151 | // respectively have sense only for kRegisterForEvent/kUnregisterForEvent and |
| 152 | // kSelectiveDeoptimization/kSelectiveUndeoptimization. |
| 153 | |
| 154 | // Event to start or stop listening to. Only for kRegisterForEvent and kUnregisterForEvent. |
| 155 | uint32_t instrumentation_event; |
| 156 | |
Sebastien Hertz | 4d25df3 | 2014-03-21 17:44:46 +0100 | [diff] [blame] | 157 | // Method for selective deoptimization. |
| 158 | mirror::ArtMethod* method; |
| 159 | }; |
| 160 | |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 161 | class Dbg { |
Elliott Hughes | ff17f1f | 2012-01-24 18:12:29 -0800 | [diff] [blame] | 162 | public: |
Elliott Hughes | 3bb8156 | 2011-10-21 18:52:59 -0700 | [diff] [blame] | 163 | static bool ParseJdwpOptions(const std::string& options); |
Elliott Hughes | 4ffd313 | 2011-10-24 12:06:42 -0700 | [diff] [blame] | 164 | static void SetJdwpAllowed(bool allowed); |
| 165 | |
Elliott Hughes | d1cc836 | 2011-10-24 16:58:50 -0700 | [diff] [blame] | 166 | static void StartJdwp(); |
| 167 | static void StopJdwp(); |
| 168 | |
Elliott Hughes | 767a147 | 2011-10-26 18:49:02 -0700 | [diff] [blame] | 169 | // Invoked by the GC in case we need to keep DDMS informed. |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 170 | static void GcDidFinish() LOCKS_EXCLUDED(Locks::mutator_lock_); |
Elliott Hughes | 767a147 | 2011-10-26 18:49:02 -0700 | [diff] [blame] | 171 | |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 172 | // Return the DebugInvokeReq for the current thread. |
| 173 | static DebugInvokeReq* GetInvokeReq(); |
| 174 | |
Elliott Hughes | 475fc23 | 2011-10-25 15:00:35 -0700 | [diff] [blame] | 175 | static Thread* GetDebugThread(); |
| 176 | static void ClearWaitForEventThread(); |
| 177 | |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 178 | /* |
| 179 | * Enable/disable breakpoints and step modes. Used to provide a heads-up |
| 180 | * when the debugger attaches. |
| 181 | */ |
| 182 | static void Connected(); |
Sebastien Hertz | 138dbfc | 2013-12-04 18:15:25 +0100 | [diff] [blame] | 183 | static void GoActive() |
Sebastien Hertz | 4d25df3 | 2014-03-21 17:44:46 +0100 | [diff] [blame] | 184 | LOCKS_EXCLUDED(Locks::breakpoint_lock_, deoptimization_lock_, Locks::mutator_lock_); |
| 185 | static void Disconnected() LOCKS_EXCLUDED(deoptimization_lock_, Locks::mutator_lock_); |
Elliott Hughes | 8696433 | 2012-02-15 19:37:42 -0800 | [diff] [blame] | 186 | static void Disposed(); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 187 | |
Elliott Hughes | c0f0933 | 2012-03-26 13:27:06 -0700 | [diff] [blame] | 188 | // Returns true if we're actually debugging with a real debugger, false if it's |
| 189 | // just DDMS (or nothing at all). |
| 190 | static bool IsDebuggerActive(); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 191 | |
Elliott Hughes | c0f0933 | 2012-03-26 13:27:06 -0700 | [diff] [blame] | 192 | // Returns true if we had -Xrunjdwp or -agentlib:jdwp= on the command line. |
| 193 | static bool IsJdwpConfigured(); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 194 | |
Elliott Hughes | 8696433 | 2012-02-15 19:37:42 -0800 | [diff] [blame] | 195 | static bool IsDisposed(); |
| 196 | |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 197 | /* |
| 198 | * Time, in milliseconds, since the last debugger activity. Does not |
| 199 | * include DDMS activity. Returns -1 if there has been no activity. |
| 200 | * Returns 0 if we're in the middle of handling a debugger request. |
| 201 | */ |
| 202 | static int64_t LastDebuggerActivity(); |
| 203 | |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 204 | static void UndoDebuggerSuspensions(); |
| 205 | |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 206 | /* |
| 207 | * Class, Object, Array |
| 208 | */ |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 209 | static std::string GetClassName(JDWP::RefTypeId id) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 210 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 211 | static JDWP::JdwpError GetClassObject(JDWP::RefTypeId id, JDWP::ObjectId& class_object_id) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 212 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 213 | static JDWP::JdwpError GetSuperclass(JDWP::RefTypeId id, JDWP::RefTypeId& superclass_id) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 214 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 215 | static JDWP::JdwpError GetClassLoader(JDWP::RefTypeId id, JDWP::ExpandBuf* pReply) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 216 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 217 | static JDWP::JdwpError GetModifiers(JDWP::RefTypeId id, JDWP::ExpandBuf* pReply) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 218 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 219 | static JDWP::JdwpError GetReflectedType(JDWP::RefTypeId class_id, JDWP::ExpandBuf* pReply) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 220 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 221 | static void GetClassList(std::vector<JDWP::RefTypeId>& classes) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 222 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 223 | static JDWP::JdwpError GetClassInfo(JDWP::RefTypeId class_id, JDWP::JdwpTypeTag* pTypeTag, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 224 | uint32_t* pStatus, std::string* pDescriptor) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 225 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 226 | static void FindLoadedClassBySignature(const char* descriptor, std::vector<JDWP::RefTypeId>& ids) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 227 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 64f574f | 2013-02-20 14:57:12 -0800 | [diff] [blame] | 228 | static JDWP::JdwpError GetReferenceType(JDWP::ObjectId object_id, JDWP::ExpandBuf* pReply) |
| 229 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | fc0e94b | 2013-09-23 23:51:32 -0700 | [diff] [blame] | 230 | static JDWP::JdwpError GetSignature(JDWP::RefTypeId ref_type_id, std::string* signature) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 231 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 232 | static JDWP::JdwpError GetSourceFile(JDWP::RefTypeId ref_type_id, std::string& source_file) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 233 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 234 | static JDWP::JdwpError GetObjectTag(JDWP::ObjectId object_id, uint8_t& tag) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 235 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | aed4be9 | 2011-12-02 16:16:23 -0800 | [diff] [blame] | 236 | static size_t GetTagWidth(JDWP::JdwpTag tag); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 237 | |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 238 | static JDWP::JdwpError GetArrayLength(JDWP::ObjectId array_id, int& length) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 239 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 240 | static JDWP::JdwpError OutputArray(JDWP::ObjectId array_id, int offset, int count, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 241 | JDWP::ExpandBuf* pReply) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 242 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 243 | static JDWP::JdwpError SetArrayElements(JDWP::ObjectId array_id, int offset, int count, |
Elliott Hughes | 4b9702c | 2013-02-20 18:13:24 -0800 | [diff] [blame] | 244 | JDWP::Request& request) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 245 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 246 | |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 247 | static JDWP::ObjectId CreateString(const std::string& str) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 248 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 249 | static JDWP::JdwpError CreateObject(JDWP::RefTypeId class_id, JDWP::ObjectId& new_object) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 250 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 251 | static JDWP::JdwpError CreateArrayObject(JDWP::RefTypeId array_class_id, uint32_t length, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 252 | JDWP::ObjectId& new_array) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 253 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 254 | |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 255 | static bool MatchType(JDWP::RefTypeId instance_class_id, JDWP::RefTypeId class_id) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 256 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 257 | |
Elliott Hughes | ec0f83d | 2013-01-15 16:54:08 -0800 | [diff] [blame] | 258 | // |
| 259 | // Monitors. |
| 260 | // |
| 261 | static JDWP::JdwpError GetMonitorInfo(JDWP::ObjectId object_id, JDWP::ExpandBuf* reply) |
| 262 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 263 | static JDWP::JdwpError GetOwnedMonitors(JDWP::ObjectId thread_id, |
| 264 | std::vector<JDWP::ObjectId>& monitors, |
| 265 | std::vector<uint32_t>& stack_depths) |
Sebastien Hertz | 52d131d | 2014-03-13 16:17:40 +0100 | [diff] [blame] | 266 | LOCKS_EXCLUDED(Locks::thread_list_lock_) |
Elliott Hughes | ec0f83d | 2013-01-15 16:54:08 -0800 | [diff] [blame] | 267 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Sebastien Hertz | 52d131d | 2014-03-13 16:17:40 +0100 | [diff] [blame] | 268 | static JDWP::JdwpError GetContendedMonitor(JDWP::ObjectId thread_id, |
| 269 | JDWP::ObjectId& contended_monitor) |
| 270 | LOCKS_EXCLUDED(Locks::thread_list_lock_) |
Elliott Hughes | ec0f83d | 2013-01-15 16:54:08 -0800 | [diff] [blame] | 271 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 272 | |
| 273 | // |
| 274 | // Heap. |
| 275 | // |
| 276 | static JDWP::JdwpError GetInstanceCounts(const std::vector<JDWP::RefTypeId>& class_ids, |
| 277 | std::vector<uint64_t>& counts) |
| 278 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 3b78c94 | 2013-01-15 17:35:41 -0800 | [diff] [blame] | 279 | static JDWP::JdwpError GetInstances(JDWP::RefTypeId class_id, int32_t max_count, |
| 280 | std::vector<JDWP::ObjectId>& instances) |
| 281 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 0cbaff5 | 2013-01-16 15:28:01 -0800 | [diff] [blame] | 282 | static JDWP::JdwpError GetReferringObjects(JDWP::ObjectId object_id, int32_t max_count, |
| 283 | std::vector<JDWP::ObjectId>& referring_objects) |
| 284 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 64f574f | 2013-02-20 14:57:12 -0800 | [diff] [blame] | 285 | static JDWP::JdwpError DisableCollection(JDWP::ObjectId object_id) |
| 286 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 287 | static JDWP::JdwpError EnableCollection(JDWP::ObjectId object_id) |
| 288 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 289 | static JDWP::JdwpError IsCollected(JDWP::ObjectId object_id, bool& is_collected) |
| 290 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 291 | static void DisposeObject(JDWP::ObjectId object_id, uint32_t reference_count) |
| 292 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | ec0f83d | 2013-01-15 16:54:08 -0800 | [diff] [blame] | 293 | |
Elliott Hughes | 9777ba2 | 2013-01-17 09:04:19 -0800 | [diff] [blame] | 294 | // |
| 295 | // Methods and fields. |
| 296 | // |
Elliott Hughes | a96836a | 2013-01-17 12:27:49 -0800 | [diff] [blame] | 297 | static std::string GetMethodName(JDWP::MethodId method_id) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 298 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 299 | static JDWP::JdwpError OutputDeclaredFields(JDWP::RefTypeId ref_type_id, bool with_generic, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 300 | JDWP::ExpandBuf* pReply) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 301 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 302 | static JDWP::JdwpError OutputDeclaredMethods(JDWP::RefTypeId ref_type_id, bool with_generic, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 303 | JDWP::ExpandBuf* pReply) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 304 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 305 | static JDWP::JdwpError OutputDeclaredInterfaces(JDWP::RefTypeId ref_type_id, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 306 | JDWP::ExpandBuf* pReply) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 307 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 308 | static void OutputLineTable(JDWP::RefTypeId ref_type_id, JDWP::MethodId method_id, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 309 | JDWP::ExpandBuf* pReply) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 310 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 311 | static void OutputVariableTable(JDWP::RefTypeId ref_type_id, JDWP::MethodId id, bool with_generic, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 312 | JDWP::ExpandBuf* pReply) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 313 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Jeff Hao | 579b024 | 2013-11-18 13:16:49 -0800 | [diff] [blame] | 314 | static void OutputMethodReturnValue(JDWP::MethodId method_id, const JValue* return_value, |
| 315 | JDWP::ExpandBuf* pReply) |
| 316 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Sebastien Hertz | 3f52eaf | 2014-04-04 17:50:18 +0200 | [diff] [blame] | 317 | static void OutputFieldValue(JDWP::FieldId field_id, const JValue* field_value, |
| 318 | JDWP::ExpandBuf* pReply) |
| 319 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 9777ba2 | 2013-01-17 09:04:19 -0800 | [diff] [blame] | 320 | static JDWP::JdwpError GetBytecodes(JDWP::RefTypeId class_id, JDWP::MethodId method_id, |
| 321 | std::vector<uint8_t>& bytecodes) |
| 322 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 323 | |
Elliott Hughes | a96836a | 2013-01-17 12:27:49 -0800 | [diff] [blame] | 324 | static std::string GetFieldName(JDWP::FieldId field_id) |
| 325 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 326 | static JDWP::JdwpTag GetFieldBasicTag(JDWP::FieldId field_id) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 327 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 328 | static JDWP::JdwpTag GetStaticFieldBasicTag(JDWP::FieldId field_id) |
Brian Carlstrom | f69863b | 2013-07-17 21:53:13 -0700 | [diff] [blame] | 329 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 330 | static JDWP::JdwpError GetFieldValue(JDWP::ObjectId object_id, JDWP::FieldId field_id, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 331 | JDWP::ExpandBuf* pReply) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 332 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 333 | static JDWP::JdwpError SetFieldValue(JDWP::ObjectId object_id, JDWP::FieldId field_id, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 334 | uint64_t value, int width) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 335 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 336 | static JDWP::JdwpError GetStaticFieldValue(JDWP::RefTypeId ref_type_id, JDWP::FieldId field_id, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 337 | JDWP::ExpandBuf* pReply) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 338 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 339 | static JDWP::JdwpError SetStaticFieldValue(JDWP::FieldId field_id, uint64_t value, int width) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 340 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 341 | |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 342 | static std::string StringToUtf8(JDWP::ObjectId string_id) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 343 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Jeff Hao | 579b024 | 2013-11-18 13:16:49 -0800 | [diff] [blame] | 344 | static void OutputJValue(JDWP::JdwpTag tag, const JValue* return_value, JDWP::ExpandBuf* pReply) |
| 345 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 346 | |
| 347 | /* |
| 348 | * Thread, ThreadGroup, Frame |
| 349 | */ |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 350 | static JDWP::JdwpError GetThreadName(JDWP::ObjectId thread_id, std::string& name) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 351 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) |
| 352 | LOCKS_EXCLUDED(Locks::thread_list_lock_); |
Sebastien Hertz | 52d131d | 2014-03-13 16:17:40 +0100 | [diff] [blame] | 353 | static JDWP::JdwpError GetThreadGroup(JDWP::ObjectId thread_id, JDWP::ExpandBuf* pReply) |
| 354 | LOCKS_EXCLUDED(Locks::thread_list_lock_); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 355 | static std::string GetThreadGroupName(JDWP::ObjectId thread_group_id); |
| 356 | static JDWP::ObjectId GetThreadGroupParent(JDWP::ObjectId thread_group_id) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 357 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 358 | static JDWP::ObjectId GetSystemThreadGroupId() |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 359 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 360 | static JDWP::ObjectId GetMainThreadGroupId(); |
| 361 | |
Jeff Hao | 920af3e | 2013-08-28 15:46:38 -0700 | [diff] [blame] | 362 | static JDWP::JdwpThreadStatus ToJdwpThreadStatus(ThreadState state); |
Sebastien Hertz | 52d131d | 2014-03-13 16:17:40 +0100 | [diff] [blame] | 363 | static JDWP::JdwpError GetThreadStatus(JDWP::ObjectId thread_id, |
| 364 | JDWP::JdwpThreadStatus* pThreadStatus, |
| 365 | JDWP::JdwpSuspendStatus* pSuspendStatus) |
| 366 | LOCKS_EXCLUDED(Locks::thread_list_lock_); |
| 367 | static JDWP::JdwpError GetThreadDebugSuspendCount(JDWP::ObjectId thread_id, |
| 368 | JDWP::ExpandBuf* pReply) |
| 369 | LOCKS_EXCLUDED(Locks::thread_list_lock_, |
| 370 | Locks::thread_suspend_count_lock_); |
Brian Carlstrom | 7934ac2 | 2013-07-26 10:54:15 -0700 | [diff] [blame] | 371 | // static void WaitForSuspend(JDWP::ObjectId thread_id); |
Elliott Hughes | caf7654 | 2012-06-28 16:08:22 -0700 | [diff] [blame] | 372 | |
Elliott Hughes | 026b146 | 2012-06-28 20:43:49 -0700 | [diff] [blame] | 373 | // Fills 'thread_ids' with the threads in the given thread group. If thread_group_id == 0, |
Elliott Hughes | caf7654 | 2012-06-28 16:08:22 -0700 | [diff] [blame] | 374 | // returns all threads. |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 375 | static void GetThreads(JDWP::ObjectId thread_group_id, std::vector<JDWP::ObjectId>& thread_ids) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 376 | LOCKS_EXCLUDED(Locks::thread_list_lock_) |
| 377 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | caf7654 | 2012-06-28 16:08:22 -0700 | [diff] [blame] | 378 | static void GetChildThreadGroups(JDWP::ObjectId thread_group_id, std::vector<JDWP::ObjectId>& child_thread_group_ids); |
| 379 | |
Sebastien Hertz | 52d131d | 2014-03-13 16:17:40 +0100 | [diff] [blame] | 380 | static JDWP::JdwpError GetThreadFrameCount(JDWP::ObjectId thread_id, size_t& result) |
| 381 | LOCKS_EXCLUDED(Locks::thread_list_lock_); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 382 | static JDWP::JdwpError GetThreadFrames(JDWP::ObjectId thread_id, size_t start_frame, |
| 383 | size_t frame_count, JDWP::ExpandBuf* buf) |
Sebastien Hertz | 52d131d | 2014-03-13 16:17:40 +0100 | [diff] [blame] | 384 | LOCKS_EXCLUDED(Locks::thread_list_lock_) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 385 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 386 | |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 387 | static JDWP::ObjectId GetThreadSelfId() |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 388 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 389 | static void SuspendVM() |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 390 | LOCKS_EXCLUDED(Locks::thread_list_lock_, |
| 391 | Locks::thread_suspend_count_lock_); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 392 | static void ResumeVM(); |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 393 | static JDWP::JdwpError SuspendThread(JDWP::ObjectId thread_id, bool request_suspension = true) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 394 | LOCKS_EXCLUDED(Locks::mutator_lock_, |
| 395 | Locks::thread_list_lock_, |
| 396 | Locks::thread_suspend_count_lock_); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 397 | |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 398 | static void ResumeThread(JDWP::ObjectId thread_id) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 399 | LOCKS_EXCLUDED(Locks::thread_list_lock_, |
| 400 | Locks::thread_suspend_count_lock_) |
| 401 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 402 | static void SuspendSelf(); |
| 403 | |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 404 | static JDWP::JdwpError GetThisObject(JDWP::ObjectId thread_id, JDWP::FrameId frame_id, |
| 405 | JDWP::ObjectId* result) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 406 | LOCKS_EXCLUDED(Locks::thread_list_lock_, |
| 407 | Locks::thread_suspend_count_lock_) |
| 408 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Sebastien Hertz | cb19ebf | 2014-03-11 15:26:35 +0100 | [diff] [blame] | 409 | static JDWP::JdwpError GetLocalValue(JDWP::ObjectId thread_id, JDWP::FrameId frame_id, int slot, |
| 410 | JDWP::JdwpTag tag, uint8_t* buf, size_t expectedLen) |
Sebastien Hertz | 52d131d | 2014-03-13 16:17:40 +0100 | [diff] [blame] | 411 | LOCKS_EXCLUDED(Locks::thread_list_lock_) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 412 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Sebastien Hertz | cb19ebf | 2014-03-11 15:26:35 +0100 | [diff] [blame] | 413 | static JDWP::JdwpError SetLocalValue(JDWP::ObjectId thread_id, JDWP::FrameId frame_id, int slot, |
| 414 | JDWP::JdwpTag tag, uint64_t value, size_t width) |
Sebastien Hertz | 52d131d | 2014-03-13 16:17:40 +0100 | [diff] [blame] | 415 | LOCKS_EXCLUDED(Locks::thread_list_lock_) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 416 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 417 | |
Sebastien Hertz | 52d131d | 2014-03-13 16:17:40 +0100 | [diff] [blame] | 418 | static JDWP::JdwpError Interrupt(JDWP::ObjectId thread_id) |
| 419 | LOCKS_EXCLUDED(Locks::thread_list_lock_); |
Elliott Hughes | f950170 | 2013-01-11 11:22:27 -0800 | [diff] [blame] | 420 | |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 421 | /* |
| 422 | * Debugger notification |
| 423 | */ |
| 424 | enum { |
Elliott Hughes | 8696433 | 2012-02-15 19:37:42 -0800 | [diff] [blame] | 425 | kBreakpoint = 0x01, |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 426 | kSingleStep = 0x02, |
| 427 | kMethodEntry = 0x04, |
| 428 | kMethodExit = 0x08, |
| 429 | }; |
Sebastien Hertz | 3f52eaf | 2014-04-04 17:50:18 +0200 | [diff] [blame] | 430 | static void PostFieldAccessEvent(mirror::ArtMethod* m, int dex_pc, mirror::Object* this_object, |
| 431 | mirror::ArtField* f) |
| 432 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 433 | static void PostFieldModificationEvent(mirror::ArtMethod* m, int dex_pc, |
| 434 | mirror::Object* this_object, mirror::ArtField* f, |
| 435 | const JValue* field_value) |
| 436 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 437 | static void PostException(const ThrowLocation& throw_location, mirror::ArtMethod* catch_method, |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 438 | uint32_t catch_dex_pc, mirror::Throwable* exception) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 439 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 440 | static void PostThreadStart(Thread* t) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 441 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 442 | static void PostThreadDeath(Thread* t) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 443 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 444 | static void PostClassPrepare(mirror::Class* c) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 445 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 446 | |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame] | 447 | static void UpdateDebugger(Thread* thread, mirror::Object* this_object, |
Sebastien Hertz | 8379b22 | 2014-02-24 17:38:15 +0100 | [diff] [blame] | 448 | mirror::ArtMethod* method, uint32_t new_dex_pc, |
| 449 | int event_flags, const JValue* return_value) |
jeffhao | 09bfc6a | 2012-12-11 18:11:43 -0800 | [diff] [blame] | 450 | LOCKS_EXCLUDED(Locks::breakpoint_lock_) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 451 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 91bf6cd | 2012-02-14 17:27:48 -0800 | [diff] [blame] | 452 | |
Sebastien Hertz | 4d25df3 | 2014-03-21 17:44:46 +0100 | [diff] [blame] | 453 | // Records deoptimization request in the queue. |
| 454 | static void RequestDeoptimization(const DeoptimizationRequest& req) |
| 455 | LOCKS_EXCLUDED(deoptimization_lock_) |
Sebastien Hertz | 138dbfc | 2013-12-04 18:15:25 +0100 | [diff] [blame] | 456 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 457 | |
Sebastien Hertz | 7ec2f1c | 2014-03-27 20:06:47 +0100 | [diff] [blame] | 458 | // Support delayed full undeoptimization requests. This is currently only used for single-step |
| 459 | // events. |
| 460 | static void DelayFullUndeoptimization() LOCKS_EXCLUDED(deoptimization_lock_); |
| 461 | static void ProcessDelayedFullUndeoptimizations() |
| 462 | LOCKS_EXCLUDED(deoptimization_lock_) |
| 463 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 464 | |
Sebastien Hertz | 4d25df3 | 2014-03-21 17:44:46 +0100 | [diff] [blame] | 465 | // Manage deoptimization after updating JDWP events list. Suspends all threads, processes each |
| 466 | // request and finally resumes all threads. |
Sebastien Hertz | 138dbfc | 2013-12-04 18:15:25 +0100 | [diff] [blame] | 467 | static void ManageDeoptimization() |
Sebastien Hertz | 4d25df3 | 2014-03-21 17:44:46 +0100 | [diff] [blame] | 468 | LOCKS_EXCLUDED(deoptimization_lock_) |
Sebastien Hertz | 138dbfc | 2013-12-04 18:15:25 +0100 | [diff] [blame] | 469 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 470 | |
| 471 | // Breakpoints. |
Sebastien Hertz | 4d25df3 | 2014-03-21 17:44:46 +0100 | [diff] [blame] | 472 | static void WatchLocation(const JDWP::JdwpLocation* pLoc, DeoptimizationRequest* req) |
| 473 | LOCKS_EXCLUDED(Locks::breakpoint_lock_) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 474 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Sebastien Hertz | 4d25df3 | 2014-03-21 17:44:46 +0100 | [diff] [blame] | 475 | static void UnwatchLocation(const JDWP::JdwpLocation* pLoc, DeoptimizationRequest* req) |
| 476 | LOCKS_EXCLUDED(Locks::breakpoint_lock_) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 477 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Sebastien Hertz | 138dbfc | 2013-12-04 18:15:25 +0100 | [diff] [blame] | 478 | |
| 479 | // Single-stepping. |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 480 | static JDWP::JdwpError ConfigureStep(JDWP::ObjectId thread_id, JDWP::JdwpStepSize size, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 481 | JDWP::JdwpStepDepth depth) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 482 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Sebastien Hertz | 61b7f1b | 2013-11-15 15:59:30 +0100 | [diff] [blame] | 483 | static void UnconfigureStep(JDWP::ObjectId thread_id) |
Sebastien Hertz | 52d131d | 2014-03-13 16:17:40 +0100 | [diff] [blame] | 484 | LOCKS_EXCLUDED(Locks::thread_list_lock_) |
Sebastien Hertz | 61b7f1b | 2013-11-15 15:59:30 +0100 | [diff] [blame] | 485 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 486 | |
Elliott Hughes | 88d6309 | 2013-01-09 09:55:54 -0800 | [diff] [blame] | 487 | static JDWP::JdwpError InvokeMethod(JDWP::ObjectId thread_id, JDWP::ObjectId object_id, |
| 488 | JDWP::RefTypeId class_id, JDWP::MethodId method_id, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 489 | uint32_t arg_count, uint64_t* arg_values, |
| 490 | JDWP::JdwpTag* arg_types, uint32_t options, |
| 491 | JDWP::JdwpTag* pResultTag, uint64_t* pResultValue, |
| 492 | JDWP::ObjectId* pExceptObj) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 493 | LOCKS_EXCLUDED(Locks::thread_list_lock_, |
| 494 | Locks::thread_suspend_count_lock_) |
| 495 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 496 | static void ExecuteMethod(DebugInvokeReq* pReq); |
| 497 | |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 498 | /* |
| 499 | * DDM support. |
| 500 | */ |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 501 | static void DdmSendThreadNotification(Thread* t, uint32_t type) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 502 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Sebastien Hertz | 52d131d | 2014-03-13 16:17:40 +0100 | [diff] [blame] | 503 | static void DdmSetThreadNotification(bool enable) |
| 504 | LOCKS_EXCLUDED(Locks::thread_list_lock_); |
Elliott Hughes | 4b9702c | 2013-02-20 18:13:24 -0800 | [diff] [blame] | 505 | static bool DdmHandlePacket(JDWP::Request& request, uint8_t** pReplyBuf, int* pReplyLen); |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 506 | static void DdmConnected() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 507 | static void DdmDisconnected() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 508 | static void DdmSendChunk(uint32_t type, const std::vector<uint8_t>& bytes) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 509 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 510 | static void DdmSendChunk(uint32_t type, size_t len, const uint8_t* buf) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 511 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 512 | static void DdmSendChunkV(uint32_t type, const iovec* iov, int iov_count) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 513 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 767a147 | 2011-10-26 18:49:02 -0700 | [diff] [blame] | 514 | |
Mathieu Chartier | 3b05e9b | 2014-03-25 09:29:43 -0700 | [diff] [blame] | 515 | static void VisitRoots(RootCallback* callback, void* arg) |
| 516 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 517 | |
Elliott Hughes | 545a064 | 2011-11-08 19:10:03 -0800 | [diff] [blame] | 518 | /* |
| 519 | * Recent allocation tracking support. |
| 520 | */ |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 521 | static void RecordAllocation(mirror::Class* type, size_t byte_count) |
Sebastien Hertz | 52d131d | 2014-03-13 16:17:40 +0100 | [diff] [blame] | 522 | LOCKS_EXCLUDED(alloc_tracker_lock_) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 523 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Sebastien Hertz | 52d131d | 2014-03-13 16:17:40 +0100 | [diff] [blame] | 524 | static void SetAllocTrackingEnabled(bool enabled) LOCKS_EXCLUDED(alloc_tracker_lock_); |
Ian Rogers | 719d1a3 | 2014-03-06 12:13:39 -0800 | [diff] [blame] | 525 | static bool IsAllocTrackingEnabled() { |
| 526 | return recent_allocation_records_ != nullptr; |
| 527 | } |
Sebastien Hertz | 52d131d | 2014-03-13 16:17:40 +0100 | [diff] [blame] | 528 | static jbyteArray GetRecentAllocations() |
| 529 | LOCKS_EXCLUDED(alloc_tracker_lock_) |
| 530 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 719d1a3 | 2014-03-06 12:13:39 -0800 | [diff] [blame] | 531 | static size_t HeadIndex() EXCLUSIVE_LOCKS_REQUIRED(alloc_tracker_lock_); |
Sebastien Hertz | 52d131d | 2014-03-13 16:17:40 +0100 | [diff] [blame] | 532 | static void DumpRecentAllocations() LOCKS_EXCLUDED(alloc_tracker_lock_); |
Elliott Hughes | 545a064 | 2011-11-08 19:10:03 -0800 | [diff] [blame] | 533 | |
Mathieu Chartier | 412c7fc | 2014-02-07 12:18:39 -0800 | [diff] [blame] | 534 | // Updates the stored direct object pointers (called from SweepSystemWeaks). |
Mathieu Chartier | 83c8ee0 | 2014-01-28 14:50:23 -0800 | [diff] [blame] | 535 | static void UpdateObjectPointers(IsMarkedCallback* callback, void* arg) |
Sebastien Hertz | 52d131d | 2014-03-13 16:17:40 +0100 | [diff] [blame] | 536 | LOCKS_EXCLUDED(alloc_tracker_lock_) |
Mathieu Chartier | 412c7fc | 2014-02-07 12:18:39 -0800 | [diff] [blame] | 537 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 538 | |
Elliott Hughes | 767a147 | 2011-10-26 18:49:02 -0700 | [diff] [blame] | 539 | enum HpifWhen { |
| 540 | HPIF_WHEN_NEVER = 0, |
| 541 | HPIF_WHEN_NOW = 1, |
| 542 | HPIF_WHEN_NEXT_GC = 2, |
| 543 | HPIF_WHEN_EVERY_GC = 3 |
| 544 | }; |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 545 | static int DdmHandleHpifChunk(HpifWhen when) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 546 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 767a147 | 2011-10-26 18:49:02 -0700 | [diff] [blame] | 547 | |
| 548 | enum HpsgWhen { |
| 549 | HPSG_WHEN_NEVER = 0, |
| 550 | HPSG_WHEN_EVERY_GC = 1, |
| 551 | }; |
| 552 | enum HpsgWhat { |
| 553 | HPSG_WHAT_MERGED_OBJECTS = 0, |
| 554 | HPSG_WHAT_DISTINCT_OBJECTS = 1, |
| 555 | }; |
| 556 | static bool DdmHandleHpsgNhsgChunk(HpsgWhen when, HpsgWhat what, bool native); |
| 557 | |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 558 | static void DdmSendHeapInfo(HpifWhen reason) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 559 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 560 | static void DdmSendHeapSegments(bool native) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 561 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | 545a064 | 2011-11-08 19:10:03 -0800 | [diff] [blame] | 562 | |
Mathieu Chartier | 412c7fc | 2014-02-07 12:18:39 -0800 | [diff] [blame] | 563 | static void AllowNewObjectRegistryObjects() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 564 | static void DisallowNewObjectRegistryObjects() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 565 | |
Elliott Hughes | 545a064 | 2011-11-08 19:10:03 -0800 | [diff] [blame] | 566 | private: |
Brian Carlstrom | 2d88862 | 2013-07-18 17:02:00 -0700 | [diff] [blame] | 567 | static void DdmBroadcast(bool connect) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 568 | static void PostThreadStartOrStop(Thread*, uint32_t) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 569 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Elliott Hughes | a215526 | 2011-11-16 16:26:58 -0800 | [diff] [blame] | 570 | |
Sebastien Hertz | 8379b22 | 2014-02-24 17:38:15 +0100 | [diff] [blame] | 571 | static void PostLocationEvent(mirror::ArtMethod* method, int pcOffset, |
| 572 | mirror::Object* thisPtr, int eventFlags, |
| 573 | const JValue* return_value) |
| 574 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 575 | |
Sebastien Hertz | 3f52eaf | 2014-04-04 17:50:18 +0200 | [diff] [blame] | 576 | static JDWP::ObjectId GetThisObjectIdForEvent(mirror::Object* this_object) |
| 577 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 578 | |
Sebastien Hertz | 4d25df3 | 2014-03-21 17:44:46 +0100 | [diff] [blame] | 579 | static void ProcessDeoptimizationRequest(const DeoptimizationRequest& request) |
| 580 | EXCLUSIVE_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 581 | |
Sebastien Hertz | 7ec2f1c | 2014-03-27 20:06:47 +0100 | [diff] [blame] | 582 | static void RequestDeoptimizationLocked(const DeoptimizationRequest& req) |
| 583 | EXCLUSIVE_LOCKS_REQUIRED(deoptimization_lock_) |
| 584 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 585 | |
Ian Rogers | 719d1a3 | 2014-03-06 12:13:39 -0800 | [diff] [blame] | 586 | static Mutex* alloc_tracker_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER; |
| 587 | |
| 588 | static AllocRecord* recent_allocation_records_ PT_GUARDED_BY(alloc_tracker_lock_); |
| 589 | static size_t alloc_record_max_ GUARDED_BY(alloc_tracker_lock_); |
| 590 | static size_t alloc_record_head_ GUARDED_BY(alloc_tracker_lock_); |
| 591 | static size_t alloc_record_count_ GUARDED_BY(alloc_tracker_lock_); |
| 592 | |
Sebastien Hertz | 4d25df3 | 2014-03-21 17:44:46 +0100 | [diff] [blame] | 593 | // Guards deoptimization requests. |
Sebastien Hertz | 42cd43f | 2014-05-13 14:15:41 +0200 | [diff] [blame] | 594 | // TODO rename to instrumentation_update_lock. |
Sebastien Hertz | 4d25df3 | 2014-03-21 17:44:46 +0100 | [diff] [blame] | 595 | static Mutex* deoptimization_lock_ ACQUIRED_AFTER(Locks::breakpoint_lock_); |
| 596 | |
| 597 | // Deoptimization requests to be processed each time the event list is updated. This is used when |
| 598 | // registering and unregistering events so we do not deoptimize while holding the event list |
| 599 | // lock. |
Sebastien Hertz | 42cd43f | 2014-05-13 14:15:41 +0200 | [diff] [blame] | 600 | // TODO rename to instrumentation_requests. |
Sebastien Hertz | 4d25df3 | 2014-03-21 17:44:46 +0100 | [diff] [blame] | 601 | static std::vector<DeoptimizationRequest> deoptimization_requests_ GUARDED_BY(deoptimization_lock_); |
| 602 | |
| 603 | // Count the number of events requiring full deoptimization. When the counter is > 0, everything |
| 604 | // is deoptimized, otherwise everything is undeoptimized. |
| 605 | // Note: we fully deoptimize on the first event only (when the counter is set to 1). We fully |
| 606 | // undeoptimize when the last event is unregistered (when the counter is set to 0). |
| 607 | static size_t full_deoptimization_event_count_ GUARDED_BY(deoptimization_lock_); |
| 608 | |
Sebastien Hertz | 7ec2f1c | 2014-03-27 20:06:47 +0100 | [diff] [blame] | 609 | // Count the number of full undeoptimization requests delayed to next resume or end of debug |
| 610 | // session. |
| 611 | static size_t delayed_full_undeoptimization_count_ GUARDED_BY(deoptimization_lock_); |
| 612 | |
Sebastien Hertz | 42cd43f | 2014-05-13 14:15:41 +0200 | [diff] [blame] | 613 | static size_t* GetReferenceCounterForEvent(uint32_t instrumentation_event); |
| 614 | |
| 615 | // Instrumentation event reference counters. |
| 616 | // TODO we could use an array instead of having all these dedicated counters. Instrumentation |
| 617 | // events are bits of a mask so we could convert them to array index. |
| 618 | static size_t dex_pc_change_event_ref_count_ GUARDED_BY(deoptimization_lock_); |
| 619 | static size_t method_enter_event_ref_count_ GUARDED_BY(deoptimization_lock_); |
| 620 | static size_t method_exit_event_ref_count_ GUARDED_BY(deoptimization_lock_); |
| 621 | static size_t field_read_event_ref_count_ GUARDED_BY(deoptimization_lock_); |
| 622 | static size_t field_write_event_ref_count_ GUARDED_BY(deoptimization_lock_); |
| 623 | static size_t exception_catch_event_ref_count_ GUARDED_BY(deoptimization_lock_); |
| 624 | static uint32_t instrumentation_events_ GUARDED_BY(Locks::mutator_lock_); |
| 625 | |
Ian Rogers | 719d1a3 | 2014-03-06 12:13:39 -0800 | [diff] [blame] | 626 | DISALLOW_COPY_AND_ASSIGN(Dbg); |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 627 | }; |
| 628 | |
| 629 | #define CHUNK_TYPE(_name) \ |
Elliott Hughes | 8218847 | 2011-11-07 18:11:48 -0800 | [diff] [blame] | 630 | static_cast<uint32_t>((_name)[0] << 24 | (_name)[1] << 16 | (_name)[2] << 8 | (_name)[3]) |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 631 | |
| 632 | } // namespace art |
| 633 | |
Brian Carlstrom | fc0e321 | 2013-07-17 14:40:12 -0700 | [diff] [blame] | 634 | #endif // ART_RUNTIME_DEBUGGER_H_ |