blob: bd0954c8cd5485756899b837736a9098d1c07828 [file] [log] [blame]
Dan Bornstein9ea32b02011-03-09 17:40:41 -08001/*
2 * Copyright (C) 2011 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
Dan Bornstein9ea32b02011-03-09 17:40:41 -080017/*
18 * Handling of method debug info in a .dex file.
19 */
20
Carl Shapiro375fb112011-06-14 20:31:24 -070021#ifndef LIBDEX_DEXDEBUGINFO_H_
22#define LIBDEX_DEXDEBUGINFO_H_
Dan Bornsteina70a3d82011-04-14 13:08:06 -070023
Dan Bornstein9ea32b02011-03-09 17:40:41 -080024#include "DexFile.h"
25
26/*
27 * Callback for "new position table entry".
28 * Returning non-0 causes the decoder to stop early.
29 */
30typedef int (*DexDebugNewPositionCb)(void *cnxt, u4 address, u4 lineNum);
31
32/*
33 * Callback for "new locals table entry". "signature" is an empty string
34 * if no signature is available for an entry.
35 */
36typedef void (*DexDebugNewLocalCb)(void *cnxt, u2 reg, u4 startAddress,
37 u4 endAddress, const char *name, const char *descriptor,
38 const char *signature);
39
40/*
41 * Decode debug info for method.
42 *
43 * posCb is called in ascending address order.
44 * localCb is called in order of ascending end address.
45 */
46void dexDecodeDebugInfo(
47 const DexFile* pDexFile,
48 const DexCode* pDexCode,
49 const char* classDescriptor,
50 u4 protoIdx,
51 u4 accessFlags,
52 DexDebugNewPositionCb posCb, DexDebugNewLocalCb localCb,
53 void* cnxt);
54
Carl Shapiro375fb112011-06-14 20:31:24 -070055#endif // LIBDEX_DEXDEBUGINFO_H_