blob: 7f5d24d06e1d1fdea47ac4973e49d91e78061383 [file] [log] [blame]
David Srbecky3b9d57a2015-04-10 00:22:14 +01001/*
David Srbeckyc5bfa972016-02-05 15:49:10 +00002 * Copyright (C) 2016 The Android Open Source Project
David Srbecky3b9d57a2015-04-10 00:22:14 +01003 *
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 Srbeckyc5bfa972016-02-05 15:49:10 +000017#ifndef ART_COMPILER_DEBUG_ELF_DEBUG_WRITER_H_
18#define ART_COMPILER_DEBUG_ELF_DEBUG_WRITER_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 Srbeckyc5bfa972016-02-05 15:49:10 +000030namespace debug {
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>
David Srbeckyfe736b72016-03-09 11:44:44 +000034void WriteDebugInfo(
35 ElfBuilder<ElfTypes>* builder,
36 const ArrayRef<const MethodDebugInfo>& method_infos,
37 dwarf::CFIFormat cfi_format,
38 bool write_oat_patches);
David Srbecky3b9d57a2015-04-10 00:22:14 +010039
David Srbeckyfe736b72016-03-09 11:44:44 +000040std::vector<uint8_t> MakeMiniDebugInfo(
41 InstructionSet isa,
42 const InstructionSetFeatures* features,
43 size_t rodata_section_size,
44 size_t text_section_size,
45 const ArrayRef<const MethodDebugInfo>& method_infos);
David Srbecky5b1c2ca2016-01-25 17:32:41 +000046
David Srbeckyfe736b72016-03-09 11:44:44 +000047ArrayRef<const uint8_t> WriteDebugElfFileForMethods(
48 InstructionSet isa,
49 const InstructionSetFeatures* features,
50 const ArrayRef<const MethodDebugInfo>& method_infos);
Tamas Berghammer86e42782016-01-05 14:29:02 +000051
David Srbeckyfe736b72016-03-09 11:44:44 +000052ArrayRef<const uint8_t> WriteDebugElfFileForClasses(
53 InstructionSet isa,
54 const InstructionSetFeatures* features,
55 const ArrayRef<mirror::Class*>& types)
Tamas Berghammer86e42782016-01-05 14:29:02 +000056 SHARED_REQUIRES(Locks::mutator_lock_);
David Srbecky5cc349f2015-12-18 15:04:48 +000057
David Srbeckyc5bfa972016-02-05 15:49:10 +000058} // namespace debug
David Srbecky3b9d57a2015-04-10 00:22:14 +010059} // namespace art
60
David Srbeckyc5bfa972016-02-05 15:49:10 +000061#endif // ART_COMPILER_DEBUG_ELF_DEBUG_WRITER_H_