Skip to content

Commit

Permalink
Rename DEBUG enum variants
Browse files Browse the repository at this point in the history
  • Loading branch information
Leland Jansen authored and romainthomas committed May 6, 2024
1 parent b2b56a7 commit ef824c7
Show file tree
Hide file tree
Showing 19 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion api/python/lief/ELF.pyi
Expand Up @@ -952,7 +952,7 @@ class DynamicEntry(lief.Object):
ANDROID_REL_OFFSET: ClassVar[DynamicEntry.TAG] = ...
ANDROID_REL_SIZE: ClassVar[DynamicEntry.TAG] = ...
BIND_NOW: ClassVar[DynamicEntry.TAG] = ...
DEBUG: ClassVar[DynamicEntry.TAG] = ...
DEBUG_TAG: ClassVar[DynamicEntry.TAG] = ...
FINI: ClassVar[DynamicEntry.TAG] = ...
FINI_ARRAY: ClassVar[DynamicEntry.TAG] = ...
FINI_ARRAYSZ: ClassVar[DynamicEntry.TAG] = ...
Expand Down
2 changes: 1 addition & 1 deletion api/python/lief/PE.pyi
Expand Up @@ -768,7 +768,7 @@ class DataDirectory(lief.Object):
BOUND_IMPORT: ClassVar[DataDirectory.TYPES] = ...
CERTIFICATE_TABLE: ClassVar[DataDirectory.TYPES] = ...
CLR_RUNTIME_HEADER: ClassVar[DataDirectory.TYPES] = ...
DEBUG: ClassVar[DataDirectory.TYPES] = ...
DEBUG_DIR: ClassVar[DataDirectory.TYPES] = ...
DELAY_IMPORT_DESCRIPTOR: ClassVar[DataDirectory.TYPES] = ...
EXCEPTION_TABLE: ClassVar[DataDirectory.TYPES] = ...
EXPORT_TABLE: ClassVar[DataDirectory.TYPES] = ...
Expand Down
2 changes: 1 addition & 1 deletion api/python/lief/__init__.pyi
Expand Up @@ -154,7 +154,7 @@ class ENDIANNESS:
class Function(Symbol):
class FLAGS:
CONSTRUCTOR: ClassVar[Function.FLAGS] = ...
DEBUG: ClassVar[Function.FLAGS] = ...
DEBUG_INFO: ClassVar[Function.FLAGS] = ...
DESTRUCTOR: ClassVar[Function.FLAGS] = ...
EXPORTED: ClassVar[Function.FLAGS] = ...
IMPORTED: ClassVar[Function.FLAGS] = ...
Expand Down
2 changes: 1 addition & 1 deletion api/python/src/Abstract/pyFunction.cpp
Expand Up @@ -41,7 +41,7 @@ void create<Function>(nb::module_& m) {
.value(PY_ENUM(Function::FLAGS::EXPORTED))
.value(PY_ENUM(Function::FLAGS::CONSTRUCTOR))
.value(PY_ENUM(Function::FLAGS::DESTRUCTOR))
.value(PY_ENUM(Function::FLAGS::DEBUG));
.value(PY_ENUM(Function::FLAGS::DEBUG_INFO));

pyfunction
.def(nb::init())
Expand Down
2 changes: 1 addition & 1 deletion api/python/src/ELF/objects/pyDynamicEntry.cpp
Expand Up @@ -56,7 +56,7 @@ void create<DynamicEntry>(nb::module_& m) {
ENTRY(RELSZ)
ENTRY(RELENT)
ENTRY(PLTREL)
ENTRY(DEBUG)
ENTRY(DEBUG_TAG)
ENTRY(TEXTREL)
ENTRY(JMPREL)
ENTRY(BIND_NOW)
Expand Down
2 changes: 1 addition & 1 deletion api/python/src/PE/objects/pyDataDirectory.cpp
Expand Up @@ -41,7 +41,7 @@ void create<DataDirectory>(nb::module_& m) {
.value(PY_ENUM(DataDirectory::TYPES::EXCEPTION_TABLE))
.value(PY_ENUM(DataDirectory::TYPES::CERTIFICATE_TABLE))
.value(PY_ENUM(DataDirectory::TYPES::BASE_RELOCATION_TABLE))
.value(PY_ENUM(DataDirectory::TYPES::DEBUG))
.value(PY_ENUM(DataDirectory::TYPES::DEBUG_DIR))
.value(PY_ENUM(DataDirectory::TYPES::ARCHITECTURE))
.value(PY_ENUM(DataDirectory::TYPES::GLOBAL_PTR))
.value(PY_ENUM(DataDirectory::TYPES::TLS_TABLE))
Expand Down
4 changes: 2 additions & 2 deletions api/rust/cargo/lief/src/elf/dynamic.rs
Expand Up @@ -28,7 +28,7 @@ pub enum Tag {
RELSZ,
RELENT,
PLTREL,
DEBUG,
DEBUG_TAG,
TEXTREL,
JMPREL,
BIND_NOW,
Expand Down Expand Up @@ -153,7 +153,7 @@ impl Tag {
0x00000012 => Tag::RELSZ,
0x00000013 => Tag::RELENT,
0x00000014 => Tag::PLTREL,
0x00000015 => Tag::DEBUG,
0x00000015 => Tag::DEBUG_TAG,
0x00000016 => Tag::TEXTREL,
0x00000017 => Tag::JMPREL,
0x00000018 => Tag::BIND_NOW,
Expand Down
4 changes: 2 additions & 2 deletions api/rust/cargo/lief/src/pe/data_directory.rs
Expand Up @@ -20,7 +20,7 @@ pub enum Type {
EXCEPTION_TABLE,
CERTIFICATE_TABLE,
BASE_RELOCATION_TABLE,
DEBUG,
DEBUG_DIR,
ARCHITECTURE,
GLOBAL_PTR,
TLS_TABLE,
Expand All @@ -42,7 +42,7 @@ impl Type {
0x00000003 => Type::EXCEPTION_TABLE,
0x00000004 => Type::CERTIFICATE_TABLE,
0x00000005 => Type::BASE_RELOCATION_TABLE,
0x00000006 => Type::DEBUG,
0x00000006 => Type::DEBUG_DIR,
0x00000007 => Type::ARCHITECTURE,
0x00000008 => Type::GLOBAL_PTR,
0x00000009 => Type::TLS_TABLE,
Expand Down
2 changes: 1 addition & 1 deletion include/LIEF/Abstract/Function.hpp
Expand Up @@ -45,7 +45,7 @@ class LIEF_API Function : public Symbol {
DESTRUCTOR,

//! The function is associated with Debug information
DEBUG,
DEBUG_INFO,

//! The function is exported by the binary and the address() method
//! returns its virtual address in the binary
Expand Down
2 changes: 1 addition & 1 deletion include/LIEF/ELF/DynamicEntry.hpp
Expand Up @@ -66,7 +66,7 @@ class LIEF_API DynamicEntry : public Object {
RELSZ = 18,/**< Size of Rel relocation table. */
RELENT = 19,/**< Size of a Rel relocation entry. */
PLTREL = 20,/**< Type of relocation entry used for linking. */
DEBUG = 21,/**< Reserved for debugger. */
DEBUG_TAG = 21,/**< Reserved for debugger. */
TEXTREL = 22,/**< Relocations exist for non-writable segments. */
JMPREL = 23,/**< Address of relocations associated with PLT. */
BIND_NOW = 24,/**< Process all relocations before execution. */
Expand Down
2 changes: 1 addition & 1 deletion include/LIEF/PE/DataDirectory.hpp
Expand Up @@ -51,7 +51,7 @@ class LIEF_API DataDirectory : public Object {
EXCEPTION_TABLE,
CERTIFICATE_TABLE,
BASE_RELOCATION_TABLE,
DEBUG,
DEBUG_DIR,
ARCHITECTURE,
GLOBAL_PTR,
TLS_TABLE,
Expand Down
2 changes: 1 addition & 1 deletion include/LIEF/PE/enums.hpp
Expand Up @@ -672,7 +672,7 @@ enum class PE_SECTION_TYPES : uint8_t {
RESOURCE = 5,
RELOCATION = 6,
EXPORT = 7,
DEBUG = 8,
DEBUG_TYPE = 8,
LOAD_CONFIG = 9,
UNKNOWN = 10
};
Expand Down
2 changes: 1 addition & 1 deletion src/Abstract/EnumToString.cpp
Expand Up @@ -84,7 +84,7 @@ const char* to_string(ENDIANNESS e) {

const char* to_string(Function::FLAGS e) {
CONST_MAP(Function::FLAGS, const char*, 5) enumStrings {
{ LIEF::Function::FLAGS::DEBUG, "DEBUG" },
{ LIEF::Function::FLAGS::DEBUG_INFO, "DEBUG_INFO" },
{ LIEF::Function::FLAGS::CONSTRUCTOR, "CONSTRUCTOR" },
{ LIEF::Function::FLAGS::DESTRUCTOR, "DESTRUCTOR" },
{ LIEF::Function::FLAGS::IMPORTED, "IMPORTED" },
Expand Down
2 changes: 1 addition & 1 deletion src/ELF/DynamicEntry.cpp
Expand Up @@ -134,7 +134,7 @@ const char* to_string(DynamicEntry::TAG tag) {
ENTRY(RELSZ),
ENTRY(RELENT),
ENTRY(PLTREL),
ENTRY(DEBUG),
ENTRY(DEBUG_TAG),
ENTRY(TEXTREL),
ENTRY(JMPREL),
ENTRY(BIND_NOW),
Expand Down
2 changes: 1 addition & 1 deletion src/PE/Binary.cpp
Expand Up @@ -96,7 +96,7 @@ Binary::Binary(PE_TYPE type) :
data_directories_.push_back(std::make_unique<DataDirectory>(DataDirectory::TYPES::EXCEPTION_TABLE));
data_directories_.push_back(std::make_unique<DataDirectory>(DataDirectory::TYPES::CERTIFICATE_TABLE));
data_directories_.push_back(std::make_unique<DataDirectory>(DataDirectory::TYPES::BASE_RELOCATION_TABLE));
data_directories_.push_back(std::make_unique<DataDirectory>(DataDirectory::TYPES::DEBUG));
data_directories_.push_back(std::make_unique<DataDirectory>(DataDirectory::TYPES::DEBUG_DIR));
data_directories_.push_back(std::make_unique<DataDirectory>(DataDirectory::TYPES::ARCHITECTURE));
data_directories_.push_back(std::make_unique<DataDirectory>(DataDirectory::TYPES::GLOBAL_PTR));
data_directories_.push_back(std::make_unique<DataDirectory>(DataDirectory::TYPES::TLS_TABLE));
Expand Down
2 changes: 1 addition & 1 deletion src/PE/DataDirectory.cpp
Expand Up @@ -65,7 +65,7 @@ const char* to_string(DataDirectory::TYPES e) {
{ DataDirectory::TYPES::EXCEPTION_TABLE, "EXCEPTION_TABLE" },
{ DataDirectory::TYPES::CERTIFICATE_TABLE, "CERTIFICATE_TABLE" },
{ DataDirectory::TYPES::BASE_RELOCATION_TABLE, "BASE_RELOCATION_TABLE" },
{ DataDirectory::TYPES::DEBUG, "DEBUG" },
{ DataDirectory::TYPES::DEBUG_DIR, "DEBUG_DIR" },
{ DataDirectory::TYPES::ARCHITECTURE, "ARCHITECTURE" },
{ DataDirectory::TYPES::GLOBAL_PTR, "GLOBAL_PTR" },
{ DataDirectory::TYPES::TLS_TABLE, "TLS_TABLE" },
Expand Down
2 changes: 1 addition & 1 deletion src/PE/EnumToString.cpp
Expand Up @@ -42,7 +42,7 @@ const char* to_string(PE_SECTION_TYPES e) {
{ PE_SECTION_TYPES::RESOURCE, "RESOURCE" },
{ PE_SECTION_TYPES::RELOCATION, "RELOCATION" },
{ PE_SECTION_TYPES::EXPORT, "EXPORT" },
{ PE_SECTION_TYPES::DEBUG, "DEBUG" },
{ PE_SECTION_TYPES::DEBUG_TYPE, "DEBUG" },
{ PE_SECTION_TYPES::UNKNOWN, "UNKNOWN" },
};
const auto it = enumStrings.find(e);
Expand Down
2 changes: 1 addition & 1 deletion src/PE/Parser.cpp
Expand Up @@ -607,7 +607,7 @@ ok_error_t Parser::parse_symbols() {
ok_error_t Parser::parse_debug() {
LIEF_DEBUG("Parsing debug directory");

DataDirectory* dir = binary_->data_directory(DataDirectory::TYPES::DEBUG);
DataDirectory* dir = binary_->data_directory(DataDirectory::TYPES::DEBUG_DIR);
if (dir == nullptr) {
return make_error_code(lief_errors::not_found);
}
Expand Down
4 changes: 2 additions & 2 deletions src/PE/Parser.tcc
Expand Up @@ -201,10 +201,10 @@ ok_error_t Parser::parse_data_directories() {
}
}

if (DataDirectory* dir = binary_->data_directory(DataDirectory::TYPES::DEBUG)) {
if (DataDirectory* dir = binary_->data_directory(DataDirectory::TYPES::DEBUG_DIR)) {
if (dir->RVA() > 0) {
if (Section* sec = dir->section()) {
sec->add_type(PE_SECTION_TYPES::DEBUG);
sec->add_type(PE_SECTION_TYPES::DEBUG_TYPE);
}
parse_debug();
}
Expand Down

0 comments on commit ef824c7

Please sign in to comment.