Turn on #![deny(missing_debug_implementations)]

This helps ensure we're deriving Debug, as it's generally always helpful. This helps avoid issues like #33
This commit is contained in:
Christopher Cole 2023-06-08 13:51:21 -07:00
parent a853cb24bd
commit bee2d247bd
No known key found for this signature in database
GPG Key ID: 0AC856975983E9DB
11 changed files with 24 additions and 1 deletions

View File

@ -12,6 +12,7 @@ use crate::parse::{ParseAt, ParseError};
/// C-style 32-bit ELF Compression Header definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[derive(Debug)]
#[repr(C)]
pub struct Elf32_Chdr {
pub ch_type: u32,
@ -22,6 +23,7 @@ pub struct Elf32_Chdr {
/// C-style 64-bit ELF Compression Header definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[derive(Debug)]
#[repr(C)]
pub struct Elf64_Chdr {
pub ch_type: u32,

View File

@ -8,6 +8,7 @@ pub type DynamicTable<'data, E> = ParsingTable<'data, E, Dyn>;
/// C-style 32-bit ELF Dynamic section entry definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[derive(Debug)]
#[repr(C)]
pub struct Elf32_Dyn {
pub d_tag: i32,
@ -18,6 +19,7 @@ pub struct Elf32_Dyn {
/// C-style 64-bit ELF Dynamic section entry definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[derive(Debug)]
#[repr(C)]
pub struct Elf64_Dyn {
pub d_tag: i64,

View File

@ -61,6 +61,7 @@ use crate::symbol::{Symbol, SymbolTable};
/// .collect();
/// println!("There are {} PT_LOAD segments", all_load_phdrs.len());
/// ```
#[derive(Debug)]
pub struct ElfBytes<'data, E: EndianParse> {
pub ehdr: FileHeader<E>,
data: &'data [u8],
@ -142,7 +143,7 @@ fn find_phdrs<'data, E: EndianParse>(
}
/// This struct collects the common sections found in ELF objects
#[derive(Default)]
#[derive(Debug, Default)]
pub struct CommonElfData<'data, E: EndianParse> {
/// .symtab section
pub symtab: Option<SymbolTable<'data, E>>,

View File

@ -23,6 +23,7 @@ use crate::file::FileHeader;
/// This type encapsulates the stream-oriented interface for parsing ELF objects from
/// a `Read + Seek`.
#[derive(Debug)]
pub struct ElfStream<E: EndianParse, S: std::io::Read + std::io::Seek> {
pub ehdr: FileHeader<E>,
shdrs: Vec<SectionHeader>,
@ -670,6 +671,7 @@ impl<E: EndianParse, S: std::io::Read + std::io::Seek> ElfStream<E, S> {
}
}
#[derive(Debug)]
struct CachingReader<R: Read + Seek> {
reader: R,
stream_len: u64,

View File

@ -13,6 +13,7 @@ pub enum Class {
/// C-style 32-bit ELF File Header definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[derive(Debug)]
#[repr(C)]
pub struct Elf32_Ehdr {
pub e_ident: [u8; abi::EI_NIDENT],
@ -34,6 +35,7 @@ pub struct Elf32_Ehdr {
/// C-style 64-bit ELF File Header definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[derive(Debug)]
#[repr(C)]
pub struct Elf64_Ehdr {
pub e_ident: [u8; abi::EI_NIDENT],

View File

@ -14,6 +14,7 @@ pub struct SymbolRequirement<'data> {
pub hidden: bool,
}
#[derive(Debug)]
pub struct SymbolDefinition<'data, E: EndianParse> {
pub hash: u32,
pub flags: u16,
@ -44,6 +45,7 @@ impl<'data, E: EndianParse> Iterator for SymbolNamesIterator<'data, E> {
}
}
#[derive(Debug)]
pub struct SymbolVersionTable<'data, E: EndianParse> {
version_ids: VersionIndexTable<'data, E>,

View File

@ -128,6 +128,8 @@
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(all(feature = "nightly", not(feature = "std")), feature(error_in_core))]
#![deny(missing_debug_implementations)]
pub mod abi;
pub mod compression;

View File

@ -9,6 +9,7 @@ pub type RelaIterator<'data, E> = ParsingIterator<'data, E, Rela>;
/// C-style 32-bit ELF Relocation definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[derive(Debug)]
#[repr(C)]
pub struct Elf32_Rel {
pub r_offset: u32,
@ -18,6 +19,7 @@ pub struct Elf32_Rel {
/// C-style 64-bit ELF Relocation definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[derive(Debug)]
#[repr(C)]
pub struct Elf64_Rel {
pub r_offset: u64,
@ -72,6 +74,7 @@ impl ParseAt for Rel {
/// C-style 32-bit ELF Relocation (with addend) definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[derive(Debug)]
#[repr(C)]
pub struct Elf32_Rela {
pub r_offset: u32,
@ -82,6 +85,7 @@ pub struct Elf32_Rela {
/// C-style 64-bit ELF Relocation (with addend) definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[derive(Debug)]
#[repr(C)]
pub struct Elf64_Rela {
pub r_offset: u64,

View File

@ -8,6 +8,7 @@ pub type SectionHeaderTable<'data, E> = ParsingTable<'data, E, SectionHeader>;
/// C-style 32-bit ELF Section Header definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[derive(Debug)]
#[repr(C)]
pub struct Elf32_Shdr {
pub sh_name: u32,
@ -25,6 +26,7 @@ pub struct Elf32_Shdr {
/// C-style 64-bit ELF Section Header definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[derive(Debug)]
#[repr(C)]
pub struct Elf64_Shdr {
pub sh_name: u32,

View File

@ -8,6 +8,7 @@ pub type SegmentTable<'data, E> = ParsingTable<'data, E, ProgramHeader>;
/// C-style 32-bit ELF Program Segment Header definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[derive(Debug)]
#[repr(C)]
pub struct Elf32_Phdr {
pub p_type: u32,
@ -23,6 +24,7 @@ pub struct Elf32_Phdr {
/// C-style 64-bit ELF Program Segment Header definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[derive(Debug)]
#[repr(C)]
pub struct Elf64_Phdr {
pub p_type: u32,

View File

@ -9,6 +9,7 @@ pub type SymbolTable<'data, E> = ParsingTable<'data, E, Symbol>;
/// C-style 32-bit ELF Symbol definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[derive(Debug)]
#[repr(C)]
pub struct Elf32_Sym {
pub st_name: u32,
@ -22,6 +23,7 @@ pub struct Elf32_Sym {
/// C-style 64-bit ELF Symbol definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[derive(Debug)]
#[repr(C)]
pub struct Elf64_Sym {
pub st_name: u32,