• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2015 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 #ifndef ART_RUNTIME_JIT_DEBUGGER_INTERFACE_H_
18 #define ART_RUNTIME_JIT_DEBUGGER_INTERFACE_H_
19 
20 #include <inttypes.h>
21 #include <memory>
22 #include <vector>
23 
24 #include "base/array_ref.h"
25 #include "base/mutex.h"
26 
27 namespace art {
28 
29 // Notify native tools (e.g. libunwind) that DEX file has been opened.
30 // It takes the lock itself. The parameter must point to dex data (not the DexFile* object).
31 void AddNativeDebugInfoForDex(Thread* current_thread, ArrayRef<const uint8_t> dexfile);
32 
33 // Notify native tools (e.g. libunwind) that DEX file has been closed.
34 // It takes the lock itself. The parameter must point to dex data (not the DexFile* object).
35 void RemoveNativeDebugInfoForDex(Thread* current_thread, ArrayRef<const uint8_t> dexfile);
36 
37 // Notify native tools about new JITed code by passing in-memory ELF.
38 // The handle is the object that is being described (needed to be able to remove the entry).
39 // The method will make copy of the passed ELF file (to shrink it to the minimum size).
40 void AddNativeDebugInfoForJit(const void* handle, const std::vector<uint8_t>& symfile)
41     REQUIRES(Locks::native_debug_interface_lock_);
42 
43 // Notify native debugger that JITed code has been removed and free the debug info.
44 void RemoveNativeDebugInfoForJit(const void* handle)
45     REQUIRES(Locks::native_debug_interface_lock_);
46 
47 // Returns approximate memory used by all JITCodeEntries.
48 size_t GetJitNativeDebugInfoMemUsage()
49     REQUIRES(Locks::native_debug_interface_lock_);
50 
51 }  // namespace art
52 
53 #endif  // ART_RUNTIME_JIT_DEBUGGER_INTERFACE_H_
54