1 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 // -*- Mode: C++ -*- 3 // 4 // Copyright (C) 2013-2021 Oracle, Inc. 5 // 6 // Author: Jose E. Marchesi 7 8 /// @file 9 /// 10 /// This file contains declarations implementing the different status 11 /// in which a corpus read from an ELF file can result. It is used by 12 /// the readers based on ELF files, such as DWARF and CTF. 13 /// 14 /// More generally, this file contains declarations related to 15 /// facilities shared by the various readers that handle the ELF 16 /// format, e.g, the DWARF and CTF realder. 17 18 #ifndef __ABG_ELF_READER_COMMON_H__ 19 #define __ABG_ELF_READER_COMMON_H__ 20 21 #include <string> 22 23 namespace abigail 24 { 25 26 /// The namespace for an ELF based reader. 27 namespace elf_reader 28 { 29 30 /// The status of the @ref read_corpus_from_elf() call. 31 enum status 32 { 33 /// The status is in an unknown state 34 STATUS_UNKNOWN = 0, 35 36 /// This status is for when the call went OK. 37 STATUS_OK = 1, 38 39 /// This status is for when the debug info could not be read. 40 STATUS_DEBUG_INFO_NOT_FOUND = 1 << 1, 41 42 /// This status is for when the alternate debug info could not be 43 /// found. 44 STATUS_ALT_DEBUG_INFO_NOT_FOUND = 1 << 2, 45 46 /// This status is for when the symbols of the ELF binaries could 47 /// not be read. 48 STATUS_NO_SYMBOLS_FOUND = 1 << 3, 49 }; 50 51 std::string 52 status_to_diagnostic_string(status s); 53 54 status 55 operator|(status, status); 56 57 status 58 operator&(status, status); 59 60 status& 61 operator|=(status&, status); 62 63 status& 64 operator&=(status&, status); 65 66 }// end namespace elf_reader 67 68 }// end namespace abigail 69 70 #endif //__ABG_ELF_READER_COMMON_H__ 71