Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 _LIBUNWINDSTACK_MAP_INFO_H |
| 18 | #define _LIBUNWINDSTACK_MAP_INFO_H |
| 19 | |
| 20 | #include <stdint.h> |
| 21 | |
| 22 | #include <string> |
| 23 | |
| 24 | // Forward declarations. |
| 25 | class Elf; |
| 26 | class Memory; |
| 27 | |
| 28 | struct MapInfo { |
| 29 | uint64_t start; |
| 30 | uint64_t end; |
| 31 | uint64_t offset; |
| 32 | uint16_t flags; |
| 33 | std::string name; |
| 34 | Elf* elf = nullptr; |
| 35 | // This value is only non-zero if the offset is non-zero but there is |
| 36 | // no elf signature found at that offset. This indicates that the |
| 37 | // entire file is represented by the Memory object returned by CreateMemory, |
| 38 | // instead of a portion of the file. |
| 39 | uint64_t elf_offset; |
| 40 | |
| 41 | Memory* CreateMemory(pid_t pid); |
Christopher Ferris | 0d7cf3e | 2017-04-19 15:42:19 -0700 | [diff] [blame] | 42 | Elf* GetElf(pid_t pid, bool init_gnu_debugdata = false); |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | #endif // _LIBUNWINDSTACK_MAP_INFO_H |