2 * Copyright (C) 2008 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * Dalvik Debug Monitor
27 * Handle a packet full of DDM goodness.
29 * Returns "true" if we have anything to say in return; in which case,
30 * "*pReplyBuf" and "*pReplyLen" will also be set.
32 bool dvmDdmHandlePacket(const u1* buf, int dataLen, u1** pReplyBuf,
36 * Deal with the DDM server connecting and disconnecting.
38 void dvmDdmConnected(void);
39 void dvmDdmDisconnected(void);
42 * Turn thread notification on or off.
44 void dvmDdmSetThreadNotification(bool enable);
47 * If thread start/stop notification is enabled, call this when threads
50 void dvmDdmSendThreadNotification(Thread* thread, bool started);
53 * If thread start/stop notification is enabled, call this when the
54 * thread name changes.
56 void dvmDdmSendThreadNameChange(int threadId, StringObject* newName);
59 * Generate a byte[] full of thread stats for a THST packet.
61 ArrayObject* dvmDdmGenerateThreadStats(void);
64 * Let the heap know that the HPIF when value has changed.
66 * @return true iff the when value is supported by the VM.
68 bool dvmDdmHandleHpifChunk(int when);
71 * Let the heap know that the HPSG or NHSG what/when values have changed.
73 * @param native false for an HPSG chunk, true for an NHSG chunk
75 * @return true iff the what/when values are supported by the VM.
77 bool dvmDdmHandleHpsgNhsgChunk(int when, int what, bool native);
80 * Get an array of StackTraceElement objects for the specified thread.
82 ArrayObject* dvmDdmGetStackTraceById(u4 threadId);
85 * Gather up recent allocation data and return it in a byte[].
87 * Returns NULL on failure with an exception raised.
89 ArrayObject* dvmDdmGetRecentAllocations(void);
95 #endif /*_DALVIK_DDM*/