David Srbecky | 3b9d57a | 2015-04-10 00:22:14 +0100 | [diff] [blame] | 1 | /* |
David Srbecky | c5bfa97 | 2016-02-05 15:49:10 +0000 | [diff] [blame] | 2 | * Copyright (C) 2016 The Android Open Source Project |
David Srbecky | 3b9d57a | 2015-04-10 00:22:14 +0100 | [diff] [blame] | 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 Srbecky | c5bfa97 | 2016-02-05 15:49:10 +0000 | [diff] [blame] | 17 | #ifndef ART_COMPILER_DEBUG_ELF_DEBUG_WRITER_H_ |
| 18 | #define ART_COMPILER_DEBUG_ELF_DEBUG_WRITER_H_ |
David Srbecky | 3b9d57a | 2015-04-10 00:22:14 +0100 | [diff] [blame] | 19 | |
David Srbecky | 09c2a6b | 2016-03-11 17:11:44 +0000 | [diff] [blame] | 20 | #include <vector> |
| 21 | |
David Srbecky | 2faab00 | 2019-02-12 16:35:48 +0000 | [diff] [blame] | 22 | #include "arch/instruction_set_features.h" |
David Brazdil | d9c9037 | 2016-09-14 16:53:55 +0100 | [diff] [blame] | 23 | #include "base/array_ref.h" |
Tamas Berghammer | 86e4278 | 2016-01-05 14:29:02 +0000 | [diff] [blame] | 24 | #include "base/macros.h" |
| 25 | #include "base/mutex.h" |
David Srbecky | 32210b9 | 2017-12-04 14:39:21 +0000 | [diff] [blame] | 26 | #include "debug/debug_info.h" |
David Srbecky | 2faab00 | 2019-02-12 16:35:48 +0000 | [diff] [blame] | 27 | #include "dwarf/dwarf_constants.h" |
| 28 | #include "elf/elf_builder.h" |
David Srbecky | 3b9d57a | 2015-04-10 00:22:14 +0100 | [diff] [blame] | 29 | |
| 30 | namespace art { |
David Srbecky | 09c2a6b | 2016-03-11 17:11:44 +0000 | [diff] [blame] | 31 | class OatHeader; |
David Srbecky | 8fc2f95 | 2019-07-31 18:40:09 +0100 | [diff] [blame] | 32 | struct JITCodeEntry; |
Tamas Berghammer | 86e4278 | 2016-01-05 14:29:02 +0000 | [diff] [blame] | 33 | namespace mirror { |
| 34 | class Class; |
Andreas Gampe | deae7db | 2017-05-30 09:56:41 -0700 | [diff] [blame] | 35 | } // namespace mirror |
David Srbecky | c5bfa97 | 2016-02-05 15:49:10 +0000 | [diff] [blame] | 36 | namespace debug { |
Tamas Berghammer | 86e4278 | 2016-01-05 14:29:02 +0000 | [diff] [blame] | 37 | struct MethodDebugInfo; |
David Srbecky | 3b9d57a | 2015-04-10 00:22:14 +0100 | [diff] [blame] | 38 | |
David Srbecky | e0febdf | 2015-12-17 20:53:07 +0000 | [diff] [blame] | 39 | template <typename ElfTypes> |
David Srbecky | fe736b7 | 2016-03-09 11:44:44 +0000 | [diff] [blame] | 40 | void WriteDebugInfo( |
David Srbecky | 2faab00 | 2019-02-12 16:35:48 +0000 | [diff] [blame] | 41 | ElfBuilder<ElfTypes>* builder, |
David Srbecky | 7370d92 | 2019-02-12 14:00:30 +0000 | [diff] [blame] | 42 | const DebugInfo& debug_info); |
David Srbecky | 3b9d57a | 2015-04-10 00:22:14 +0100 | [diff] [blame] | 43 | |
David Srbecky | fe736b7 | 2016-03-09 11:44:44 +0000 | [diff] [blame] | 44 | std::vector<uint8_t> MakeMiniDebugInfo( |
| 45 | InstructionSet isa, |
| 46 | const InstructionSetFeatures* features, |
David Srbecky | f4886df | 2017-12-11 16:06:29 +0000 | [diff] [blame] | 47 | uint64_t text_section_address, |
David Srbecky | fe736b7 | 2016-03-09 11:44:44 +0000 | [diff] [blame] | 48 | size_t text_section_size, |
David Srbecky | 32210b9 | 2017-12-04 14:39:21 +0000 | [diff] [blame] | 49 | uint64_t dex_section_address, |
| 50 | size_t dex_section_size, |
| 51 | const DebugInfo& debug_info); |
David Srbecky | 5b1c2ca | 2016-01-25 17:32:41 +0000 | [diff] [blame] | 52 | |
David Srbecky | f4886df | 2017-12-11 16:06:29 +0000 | [diff] [blame] | 53 | std::vector<uint8_t> MakeElfFileForJIT( |
David Srbecky | fe736b7 | 2016-03-09 11:44:44 +0000 | [diff] [blame] | 54 | InstructionSet isa, |
| 55 | const InstructionSetFeatures* features, |
David Srbecky | f4886df | 2017-12-11 16:06:29 +0000 | [diff] [blame] | 56 | bool mini_debug_info, |
David Srbecky | be50f9a | 2018-12-05 10:48:42 +0000 | [diff] [blame] | 57 | const MethodDebugInfo& method_info); |
Tamas Berghammer | 86e4278 | 2016-01-05 14:29:02 +0000 | [diff] [blame] | 58 | |
David Srbecky | 0b21e41 | 2018-12-05 13:24:06 +0000 | [diff] [blame] | 59 | std::vector<uint8_t> PackElfFileForJIT( |
David Srbecky | e09b87e | 2019-08-19 21:31:31 +0100 | [diff] [blame] | 60 | ArrayRef<const JITCodeEntry*> jit_entries, |
David Srbecky | 8fc2f95 | 2019-07-31 18:40:09 +0100 | [diff] [blame] | 61 | ArrayRef<const void*> removed_symbols, |
David Srbecky | 76b9c69 | 2019-04-01 19:36:33 +0100 | [diff] [blame] | 62 | bool compress, |
David Srbecky | 0b21e41 | 2018-12-05 13:24:06 +0000 | [diff] [blame] | 63 | /*out*/ size_t* num_symbols); |
| 64 | |
Vladimir Marko | 93205e3 | 2016-04-13 11:59:46 +0100 | [diff] [blame] | 65 | std::vector<uint8_t> WriteDebugElfFileForClasses( |
David Srbecky | fe736b7 | 2016-03-09 11:44:44 +0000 | [diff] [blame] | 66 | InstructionSet isa, |
| 67 | const InstructionSetFeatures* features, |
| 68 | const ArrayRef<mirror::Class*>& types) |
Andreas Gampe | bdf7f1c | 2016-08-30 16:38:47 -0700 | [diff] [blame] | 69 | REQUIRES_SHARED(Locks::mutator_lock_); |
David Srbecky | 5cc349f | 2015-12-18 15:04:48 +0000 | [diff] [blame] | 70 | |
David Srbecky | c5bfa97 | 2016-02-05 15:49:10 +0000 | [diff] [blame] | 71 | } // namespace debug |
David Srbecky | 3b9d57a | 2015-04-10 00:22:14 +0100 | [diff] [blame] | 72 | } // namespace art |
| 73 | |
David Srbecky | c5bfa97 | 2016-02-05 15:49:10 +0000 | [diff] [blame] | 74 | #endif // ART_COMPILER_DEBUG_ELF_DEBUG_WRITER_H_ |