blob: c5bf6092176eb529ad7dc39cd32f727412de24df [file] [log] [blame]
David Srbecky3b9d57a2015-04-10 00:22:14 +01001/*
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
David Srbecky4fda4eb2016-02-05 13:34:46 +000017#ifndef ART_COMPILER_DEBUG_ELF_WRITER_DEBUG_H_
18#define ART_COMPILER_DEBUG_ELF_WRITER_DEBUG_H_
David Srbecky3b9d57a2015-04-10 00:22:14 +010019
Tamas Berghammer86e42782016-01-05 14:29:02 +000020#include "base/macros.h"
21#include "base/mutex.h"
David Srbecky4fda4eb2016-02-05 13:34:46 +000022#include "debug/dwarf/dwarf_constants.h"
Tamas Berghammer86e42782016-01-05 14:29:02 +000023#include "elf_builder.h"
Vladimir Marko10c13562015-11-25 14:33:36 +000024#include "utils/array_ref.h"
David Srbecky3b9d57a2015-04-10 00:22:14 +010025
26namespace art {
Tamas Berghammer86e42782016-01-05 14:29:02 +000027namespace mirror {
28class Class;
29}
David Srbecky3b9d57a2015-04-10 00:22:14 +010030namespace dwarf {
Tamas Berghammer86e42782016-01-05 14:29:02 +000031struct MethodDebugInfo;
David Srbecky3b9d57a2015-04-10 00:22:14 +010032
David Srbeckye0febdf2015-12-17 20:53:07 +000033template <typename ElfTypes>
34void WriteDebugInfo(ElfBuilder<ElfTypes>* builder,
35 const ArrayRef<const MethodDebugInfo>& method_infos,
David Srbecky579942f2016-01-28 20:01:28 +000036 CFIFormat cfi_format,
37 bool write_oat_patches);
David Srbecky3b9d57a2015-04-10 00:22:14 +010038
David Srbeckyae5d2732016-02-05 09:40:10 +000039std::vector<uint8_t> MakeMiniDebugInfo(InstructionSet isa,
40 size_t rodata_section_size,
41 size_t text_section_size,
42 const ArrayRef<const MethodDebugInfo>& method_infos);
David Srbecky5b1c2ca2016-01-25 17:32:41 +000043
Tamas Berghammer86e42782016-01-05 14:29:02 +000044ArrayRef<const uint8_t> WriteDebugElfFileForMethod(const dwarf::MethodDebugInfo& method_info);
45
Tamas Berghammerfffbee42016-01-15 13:09:34 +000046ArrayRef<const uint8_t> WriteDebugElfFileForClasses(const InstructionSet isa,
47 const ArrayRef<mirror::Class*>& types)
Tamas Berghammer86e42782016-01-05 14:29:02 +000048 SHARED_REQUIRES(Locks::mutator_lock_);
David Srbecky5cc349f2015-12-18 15:04:48 +000049
David Srbecky3b9d57a2015-04-10 00:22:14 +010050} // namespace dwarf
51} // namespace art
52
David Srbecky4fda4eb2016-02-05 13:34:46 +000053#endif // ART_COMPILER_DEBUG_ELF_WRITER_DEBUG_H_