OSDN Git Service

am 9f54185b: Set "needFallThroughBranch" flag during block split.
[android-x86/dalvik.git] / vm / Ddm.h
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  * Dalvik Debug Monitor
18  */
19 #ifndef _DALVIK_DDM
20 #define _DALVIK_DDM
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /*
27  * Handle a packet full of DDM goodness.
28  *
29  * Returns "true" if we have anything to say in return; in which case,
30  * "*pReplyBuf" and "*pReplyLen" will also be set.
31  */
32 bool dvmDdmHandlePacket(const u1* buf, int dataLen, u1** pReplyBuf,
33     int* pReplyLen);
34
35 /*
36  * Deal with the DDM server connecting and disconnecting.
37  */
38 void dvmDdmConnected(void);
39 void dvmDdmDisconnected(void);
40
41 /*
42  * Turn thread notification on or off.
43  */
44 void dvmDdmSetThreadNotification(bool enable);
45
46 /*
47  * If thread start/stop notification is enabled, call this when threads
48  * are created or die.
49  */
50 void dvmDdmSendThreadNotification(Thread* thread, bool started);
51
52 /*
53  * If thread start/stop notification is enabled, call this when the
54  * thread name changes.
55  */
56 void dvmDdmSendThreadNameChange(int threadId, StringObject* newName);
57
58 /*
59  * Generate a byte[] full of thread stats for a THST packet.
60  */
61 ArrayObject* dvmDdmGenerateThreadStats(void);
62
63 /*
64  * Let the heap know that the HPIF when value has changed.
65  *
66  * @return true iff the when value is supported by the VM.
67  */
68 bool dvmDdmHandleHpifChunk(int when);
69
70 /*
71  * Let the heap know that the HPSG or NHSG what/when values have changed.
72  *
73  * @param native false for an HPSG chunk, true for an NHSG chunk
74  *
75  * @return true iff the what/when values are supported by the VM.
76  */
77 bool dvmDdmHandleHpsgNhsgChunk(int when, int what, bool native);
78
79 /*
80  * Get an array of StackTraceElement objects for the specified thread.
81  */
82 ArrayObject* dvmDdmGetStackTraceById(u4 threadId);
83
84 /*
85  * Gather up recent allocation data and return it in a byte[].
86  *
87  * Returns NULL on failure with an exception raised.
88  */
89 ArrayObject* dvmDdmGetRecentAllocations(void);
90
91 #ifdef __cplusplus
92 }
93 #endif
94
95 #endif /*_DALVIK_DDM*/