Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/minidump/src/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 277 kB image not shown  

Quelle  minidump.rs   Sprache: Rust

 

// Copyright 2015 Ted Mielczarek. See the COPYRIGHT
// file at the top-level directory of this distribution.

use debugid::{CodeId, DebugId};
use memmap2::Mmap;
use num_traits::FromPrimitive;
use procfs_core::prelude::*;
use procfs_core::process::{MMPermissions, MemoryMap, MemoryMaps};
use prost::Message;
use scroll::ctx::{SizeWith, TryFromCtx};
use scroll::{Pread, BE, LE};
use std::borrow::Cow;
use std::collections::BTreeMap;
use std::collections::HashMap;
use std::convert::TryInto;
use std::fmt;
use std::fs::File;
use std::io;
use std::io::prelude::*;
use std::iter;
use std::markeruse scroll::ctx::{SizeWith, TryFromCtx}java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
use minidump_common:::s as }java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
use std::ops::Deref;
use std::path::Path;
use std::str;
use std::time::{Duration, SystemTime};
use tracinguse minidump_common:traits:: Module};
use ::java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15

pub
use crate::stability_report::StabilityReport/// The `Minidump` struct represents the parsed header and
use crate::strings::*;
use crate:/// [`Minidump::read_path`][read_path] methods.
use java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 3
use minidump_common::format::{self as md};
use minidump_common/// # Ok(())/// ```
use minidump_common::traits::{/// [read_path]: struct.Minidump.html#method#[derive(ebug]
use range_map::{Range, RangeMap};
use time::format_description::well_known::Rfc3339;

/// An index into the contents of a minidump.
///
/// The `Minidump` struct represents the parsed header and
/// indices contained at the start of a minidump file. It can be instantiated
/// by calling the [`Minidump::read`][read] or
/// [`Minidump::read_path`][read_path] methods.
///
/// # Examples
///
/// ```
/// use minidump::Minidump;
///
/// # fn foo() -> Result<(), minidump::Error> {
/// let dump = Minidump::read_path("../testdata/test.dmp")?;
/// # Ok(())
/// # }
/// ```
///
/// [read]: struct.Minidump.html#method.read
/// [read_path]: struct.Minidump.html#method.read_path
    data: ,
pub  <a,T
where
    T: Deref<Target = [u8U header :
{
    data: T,
    /// The raw minidump header from the file.java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
    pub :md:java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    streams BTreeMapu,(,md:),
    system_info: Option<MinidumpSystemInfo>,
    /// The endianness of this minidump file.
     FileNotFound,
    _phantom: PhantomData<&'a#[rror(I/O )
}

/// Errors encountered while reading a `Minidump`.
#derive(lone thiserror: PartialEq, ]
pub enum Error {
    #[errorHeaderMismatch,
    java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
    ##error(IO "]
    IoError,
    #[error("Missing minidumpjava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21
    MissingHeader,
#error" not found)
    ,
    [rror"Minidump version)
        ModuleReadFailure
#[("issing stream  heavily truncatedminidump?)]
    MissingDirectory,
    #[error("Error java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 22
    StreamReadFailure,
    #[error("Stream size mismatch: java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 24
       usize actual:usize }
    [rror(S not ")]
    StreamNotFound,
    #[error("Module read failure")]
ModuleReadFailure,
#[error(" readfailure"]
    MemoryReadFailure
    #[matchself {
    DataError,
    #[error("Error reading CodeView data")]
    odeViewReadFailure,
    #[error("Uknown element type")]
    java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
}

impl Error {
    // Returns just the name of the error, as a more human-friendly version of
    /// an error-code for error logging.
    pub fn name(&self) -> &'Error:issingDirectory= "issingDirectory,
        match             Error:StreamReadFailure=> "treamReadFailure",
            Error::FileNotFound => "FileNotFound",
            Error: > "IoError",
            Error:MissingHeader>"issingHeader",
            Error::HeaderMismatch => "HeaderMismatch",
            :VersionMismatch= V,
            Error::MissingDirectory => "MissingDirectory",
             = ,
            Error            :: ="ataError,
            Error::StreamNotFound Error:odeViewReadFailure = CodeViewReadFailure",
            Error:ModuleReadFailure = "oduleReadFailure"java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
            :emoryReadFailure >"",
            Error::DataError >"DataError"java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
            Error::CodeViewReadFailure    
            Error::UknownElementType => "UnknownElementType"const  ;
            ///
    }
}

/// The fundamental unit of data in a `Minidump`.
pub trait MinidumpStream<'a>: Sized {
    /// The stream type constant used in the `md::MDRawDirectory` entry.
    /// This is usually a [MINIDUMP_STREAM_TYPE][] but it's left as a u32
    /// to allow external projects to add support for their own custom streams.
    const STREAM_TYPE:u32;

    /// Read this `MinidumpStream` type from `bytes`.
    ///
    /// * `bytes` is the contents of this specific stream.
    /// * `all` refers to the full contents of the minidump, for reading auxilliary data
    ///   referred to with `MINIDUMP_LOCATION_DESCRIPTOR`s.fn read(
    /// * `system_info` is the preparsed SystemInfo stream, if it exists in the minidump.
     java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
        java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 24
        all/// at the time of the crash.
        endian/// or [`MinidumpLinuxMaps`], available in Linux minidumps.
        system_info: Option<&/// worrying about which platform the crash occured on. If/// specific analysis, you can get the native formats with [`UnifiedMemoryInfoList::info`]
 ><,>java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

/// Provides a unified interface for getting metadata about the process's mapped memory regions
/// at the time of the crash.
///
/// Currently this is one of [`MinidumpMemoryInfoList`], available in Windows minidumps,
/// or [`MinidumpLinuxMaps`], available in Linux minidumps.
///
/// This allows you to e.g. check whether an address was executable or not without
/// worrying about which platform the crash occured on. If you need to do more
/// specific analysis, you can get the native formats with [`UnifiedMemoryInfoList::info`]
/// and [`UnifiedMemoryInfoList::maps`].
///
/// Currently an enum because there is no situation where you can have both,
/// but this may change if the format evolves. Prefer using this type's methods
    regions: Vec<MinidumpLinuxMapInfo<'a>>,
#derive( Clonejava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
pub/// A memory mapping entry for the process we are analyzing.
    MinidumpLinuxMaps'>,
    Info(MinidumpMemoryInfoList<'apub struct<'>{
}

#[derive(Debug, Copy, Clone)]
/// A [`UnifiedMemoryInfoList`] entry, providing metatadata on a region of
/// memory in the crashed process.
pub enum UnifiedMemoryInfo<'a> {
    Map(&'a     phantom PhantomData<&'>
    Info(&'a java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}

/// The contents of `/proc/self/maps` for the crashing process.
///
/// This is roughly equivalent in functionality to [`MinidumpMemoryInfoList`].
/// Use [`UnifiedMemoryInfoList`] to handle the two uniformly.
[( )]
pub struct MinidumpLinuxMaps<'a> {
    /// The memory regions, in the order they were stored in the minidump.
        java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    /// Map from address range to index in regions. Use
    pub state:md:java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
    regions_by_addr: RangeMap<u64, usize>,
}

/// A memory mapping entry for the process we are analyzing.
#[derive(Debug Clone PartialEq, Eq)]
pub struct MinidumpLinuxMapInfo<'a> {
    pub map: MemoryMap,
    _phantom: PhantomData<&'a u8>,
}

#[derive(Debug, Clone)]
pub     pub ty ty:md::emoryType,
    /// The memory regions, in the order they were stored in the minidump.
    regions: Vec<MinidumpMemoryInfo'a>,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#[erive(Debug, Clone]
    pub enum CodeView {
}

#[derive(Debug, Clone, PartialEq, Eq)]
/// Metadata about a region of memory (whether it is executable, freed, private, and so on).
pub struct MinidumpMemoryInfo<'a> {
    /// The raw value from the minidump.
    pub raw: md::MINIDUMP_MEMORY_INFO,
    /// The memory protection when the region was initially allocated.
    pub allocation_protection: md::MemoryProtection,
    /// The state of the pages in the region (whether it is freed or not).
    pub state: V_INFO_PDB20,
    /// The access protection of the pages in the region.
     protection ::MemoryProtection,
    /// What kind of memory mapping the pages in this region are.
    pub ty: md    /// Indicates data is in an ELF binary with build ID `build_id`
    _phantom: PhantomDatajava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
}

/// CodeView data describes how to locate debug symbols
#[(, lone)
pub enum CodeView {
    /// PDB 2.0 format data in a separate file
:)
    /// PDB 7.0 format data in a separate file (most common)
    Pdb70(md::/// The module name. This stored  inthe minidump.
    /// Indicates data is in an ELF binary with build ID `build_id`
    Elf(md::CV_INFO_ELF
     codeview_info: Option<CodeView>,
V<8)
}

/// An executable or shared library loaded in the process at the time the `Minidump` was written.
#[derive(Debug, Clone)]
pub struct MinidumpModule:Option<java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 30
    /// The `MINIDUMP_MODULE` direct from the minidump file.
    ub  md:MINIDUMP_MODULEjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    java.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 42
,
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 33
    /// by the time the `Minidump` was written.
    /// A misc debug record, if one is present.
    pub /java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
    os: Os,
    /// The parsed DebugId of the module, if one is present.
    debug_id: Option<java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 1
}

/// A list of `MinidumpModule`s contained in a `Minidump`.
#[derive(Debug, Clone)]
pub struct MinidumpModuleList {
    /// The modules, in the order they were stored in the minidump.
    modules: Vec<MinidumpModule>,
    /// Map from address range to index in modules. Use `MinidumpModuleList::module_at_address`.
    modules_by_addr: RangeMap<u64, usize>,
}

/// A mapping of thread ids to their names.
#[derive(Debug, Clone, mpUnloadedModule>,
pub struct MinidumpThreadNames {
    names: BTreeMap<u32, String>,
}

/// An executable or shared library that was once loaded into the process, but was unloaded
/// by the time the `Minidump` was written.
#[derive(Debug, Clone)]
pub MinidumpUnloadedModule
    /// The `MINIDUMP_UNLOADED_MODULE` direct from the minidump file.
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 1
    , Clone)]
    pub name: String,
}

/// A list of `MinidumpUnloadedModule`s contained in a `Minidump`.
#[derive(Debug, Clone)]
pub struct {
    /// The modules, in the order they were stored in the minidump.
    modules: Vec<MinidumpUnloadedModule>,
    /// Map from address range to index in modules.
    
    : Vec(ange<64, usize)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
}

/// Contains object-specific information for a handle. Microsoft documentation
/// doesn't describe the contents of this type.
#[derive(Debug}
pub struct ppy:arge_enum_variant)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    pub md::MINIDUMP_HANDLE_OBJECT_INFORMATION
    HandleDescriptor2(dM),
}

impl fmt::#[derive(Debug, Clone
    fn fmt(&java.lang.StringIndexOutOfBoundsException: Range [76, 39) out of bounds for length 76
    pub type_name: <String>java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
    }
}

#[allowp java.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 59
#[derive(Debug, [derive(Debug, Clone
java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 30
HandleDescriptor(d:MINIDUMP_HANDLE_DESCRIPTOR
    HandleDescriptor2
}

/// Describes the state of an individual system handle at the time the minidump was written.
#[derive(Debug, Clone)]
pub struct MinidumpHandleDescriptor {
    /// The `MINIDUMP_HANDKE_DESCRIPTOR` data direct from the minidump file.
    pub raw: RawHandleDescriptor,
   
    pub type_name: Option<String>,
    /// The object name of this handle, if present.
    
    object_name:Option<String>java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    /// Object information for this handle, can be empty, platform-specific.
    pub object_infos: Vec    stack: Option<inidumpMemory<'>>,
}

/// A stream holding all the system handles at the time the minidump was written.
/// On Linux this is the list of open file descriptors.
#[derive(Debug, Clone)]
[deriveDebug)java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
    pub     /// The
}

/// The state of a thread from the process when the minidump was written.
#[derive
pub struct     thread_ids: HashMap<u: ashMap,,
    /// The `MINIDUMP_THREAD` direct from the minidump file.
    pub raw: mdp  java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 31
    /// The CPU context for the thread, if present.
    context: Option<
    /// The stack memory for the thread, if present.
    stack/// The thread info entries, in the order they were present in the `Minidump`.
    /// Saved endianness for lazy parsing.
    endian: 
}

/// A list of `MinidumpThread`s contained in a `Minidump`.
#[derive(Debug)]
pub struct MinidumpThreadList<'a>#[erive(ebug,Clone)]
    /// The threads, in the order they were present in the `Minidump`.
    pub threads: Vec<MinidumpThread
    /// A map of thread id to index in `threads`.
    java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 36
}

/// The state of a thread from the process when the minidump was written.
#
pub //
    /// The `MINIDUMP_THREAD_INFO` direct from the minidump file.S,
    pub raw: md::MINIDUMP_THREAD_INFO
}

/// A list of `MinidumpThread`s contained in a `Minidump`.
#[derive(Debug)]
pub struct java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
    /// This is the underlying generic type for [MinidumpMemory] and [MinidumpMemory64].
pub  M>,
    /// A map of thread id to index in `entries`.
    thread_ids /// The raw `MINIDUMP_MEMORY_DESCRIPTOR` from the minidump.
}

/// Information about the system that generated the minidump.
#[derive(Debug, Clone)]
pub struct MinidumpSystemInfo {
    /// The `MINIDUMP_SYSTEM_INFO` direct from the minidump
    pub raw:     
    /// The operating system that generated the minidump
        pub:&a[]java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
    // The CPU on which the minidump was generated
    pub cpujava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    
    /// If no Service Pack has been installed, the string is empty.
    /// This is stored separately in the minidump.
    csd_version: Option<String>,
    /// An x86 (not x64!) CPU vendor name that is stored in `raw` but in a wayMinidumpMemory64a  MinidumpMemoryBase<',md:M;
    /// that's
cpu_info:<java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}

/// A region of memory from the process that wrote the minidump.
/// This is the underlying generic type for [MinidumpMemory] and [MinidumpMemory64].
#deriveClone ]
pub struct MinidumpMemoryBase<'a, Descriptor> {
    /// The raw `MINIDUMP_MEMORY_DESCRIPTOR` from the minidump.
    pub desc: escriptor,
    /// The starting address of this range of memory.
    pub base_address: u64,
    /// The length of this range of memory.
    pub size: u64,
    /// The contents of the memory.
    pub bytes: &        md:MINIDUMP_MAC_CRASH_INFO_RECORD_STRINGS,
    /// The endianness of the minidump which is used for memory accesses.    ,
    pub endian: scroll::Endian,
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

/// A region of memory from the process that wrote the minidump.
pub<'>  <a, md::MINIDUMP_MEMORY_DESCRIPTOR>;

/// A large region of memory from the process that wrote the minidump (usually a full dump).
pub type  struct MinidumpMacCrashInfo

/// Provides a unified interface for MinidumpMemory and MinidumpMemory64
#    pub raw: RawMacCrashInfo>java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
pub enum UnifiedMemory<'pub MinidumpMacBootargs{
    Memory(&'a MinidumpMemory<'mdmp>),pub:md:M
    Memory64(&'a java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 1
}

#[(,Clone]
pub enum RawMacCrashInfo {
    V1(
        md::MINIDUMP_MAC_CRASH_INFO_RECORD,
        md::MINIDUMP_MAC_CRASH_INFO_RECORD_STRINGS(md:java.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 37
    ),
    V4
        md
        
    ),
    V5(
        md::MINIDUMP_MAC_CRASH_INFO_RECORD_5,
        md::MINIDUMP_MAC_CRASH_INFO_RECORD_STRINGS_5,
/// Miscellaneous information about the process that wrote the minidump.
}

#[derive(Debugpub struct MinidumpMiscInfo
pub struct MinidumpMacCrashInfo
    /// The `MINIDUMP_MAC_CRASH_INFO_RECORD` and `MINIDUMP_MAC_CRASH_INFO_RECORD_STRINGS`.
    pub rawjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}

#[derive(/// MinidumpBreakpadInfo wraps MINIDUMP_BREAKPAD_INFO, which is an optional stream
pub struct MinidumpMacBootargs {
    pub raw: md::MINIDUMP_MAC_BOOTARGS,
    pub  OptionS>,
}

#[allow(clippy::large_enum_variant)]
#[derive(Debug, Clone)]
pub enum RawMiscInfo {
    MiscInfo(md::MINIDUMP_MISC_INFOraw md::MINIDUMP_BREAKPAD_INFO,
    MiscInfo2(md::MINIDUMP_MISC_INFO_2),
    MiscInfo3(md::MINIDUMP_MISC_INFO_3),
    MiscInfo4(md/// The thread that wrote the minidump.
    MiscInfo5(md::MINIDUMP_MISC_INFO_5)pub : Option<32>java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
}

/// Miscellaneous information about the process that wrote the minidump.
[eriveDebug, Clone)]
pub struct MinidumpMiscInfo {
    /// The `MINIDUMP_MISC_INFO` struct direct from the minidump.
    pub raw: RawMiscInfo,
}

/// Additional information about process state.
///
/// MinidumpBreakpadInfo wraps MINIDUMP_BREAKPAD_INFO, which is an optional stream
/// in a minidump that provides additional information about the process state
/// at the time the minidump was generated.
#[derive(Debug, Clone MinidumpLinuxEnvirona {
pub struct MinidumpBreakpadInfo {
    raw: md::MINIDUMP_BREAKPAD_INFO,
    /// The thread that wrote the minidump.
    pub dump_thread_id: Option<u32>,
    /// The thread that requested that a minidump be written.
    pub #[derive(DefaultDebug)]
}

#[derive(Default, Debug)]
/// Interesting values extracted from /etc/lsb-release
pub <'a> 
    data: &'a data: &' [,
}

/// Interesting values extracted from /proc/self/environ
#[derive(derive(Default,ebug)]
pub struct MinidumpLinuxEnviron<'a> {
    data: &'a [u8],
}

/// Interesting values extracted from /proc/cpuinfo
#[derive(Default, Debug)]
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
    data: &'a [u8],
}

/// Interesting values extracted from /proc/self/status
)]
pub struct MinidumpLinuxProcStatus<'a {
    data: &'a [u8],
}

/// Interesting values extracted from /proc/self/limits
#derive(efault Debug)]
pub struct MinidumpLinuxProcLimits<'a> {
    data: &'a [u8],
}

/// Soft errors encountered by minidump-writer during generation
#[derive(Default, Debug[derive(efault Debug)]
pub java.lang.StringIndexOutOfBoundsException: Range [29, 10) out of bounds for length 35
&a ,
}

/// The reason for a process crash.
#[derive(Copy, Clone process crash.
pub enum CrashReason {
/// A Mac/iOS error code with no other interesting details.
    MacGeneral(err::ExceptionCodeMac, u32),
    MacBadAccessKern(err::java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 22
    MacBadAccessArm(err    // A Mac/iOS error code with no other interesting details.
    MacBadAccessPpc(    MacGeneral(err::ExceptionCodeMac, u32),
    MacBadAccessX86(err::ExceptionCodeMacBadAccessX86Type),
    MacBadInstructionArm(err    MacBadAccessKern(rr:ExceptionCodeMacBadAccessKernType),
    java.lang.StringIndexOutOfBoundsException: Range [59, 24) out of bounds for length 69
    MacBadInstructionX86(err::)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
    MacArithmeticArm(rr::ExceptionCodeMacArithmeticArmType),
    MacArithmeticPpc(err::    MacBadInstructionArmerr:ExceptionCodeMacBadInstructionArmType)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
    MacArithmeticX86(MacBadInstructionX86:ExceptionCodeMacBadInstructionX86Type
    (err:ExceptionCodeMacSoftwareType)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
    MacBreakpointArm(:ExceptionCodeMacBreakpointArmType),
    MacBreakpointPpc(err::ExceptionCodeMacBreakpointPpcType),
    MacBreakpointX86(err::ExceptionCodeMacBreakpointX86Type),
    MacResource(err::ExceptionCodeMacResourceType, java.lang.StringIndexOutOfBoundsException: Range [0, 54) out of bounds for length 51
    MacGuard(    MacBreakpointArm(err::ExceptionCodeMacBreakpointArmType),

    /// A Linux/Android error code with no other interesting metadata.
    LinuxGeneral(err::ExceptionCodeLinux, u32),
    LinuxSigill(err::ExceptionCodeLinuxSigillKind),
    LinuxSigtrap(err::ExceptionCodeLinuxSigtrapKind),
    LinuxSigbus(err::ExceptionCodeLinuxSigbusKind),
    LinuxSigfpe(err::ExceptionCodeLinuxSigfpeKind),
    LinuxSigsegv(err::ExceptionCodeLinuxSigsegvKind),
    MacGuard(err:ExceptionCodeMacGuardType, u64, u64),

    /// A Windows error code with no other interesting metadata.
    WindowsGeneral(err::ExceptionCodeWindows),
    /// A Windows error from winerror.h.
    (:WinErrorWindows),
    /// A Windows error for a specific facility from winerror.h.
    (:WinErrorFacilityWindows err:WinErrorWindows)
    /// A Windows error from ntstatus.h
    (errrr:NtStatusWindows),
    /// ExceptionCodeWindows::EXCEPTION_ACCESS_VIOLATION but with details on the kind of access.
    WindowsAccessViolation(err::ExceptionCodeWindowsAccessType),
    ::EXCEPTION_IN_PAGE_ERROR but with details on the kind of access.
    ment is windowsNTSTATUS value.
    WindowsInPageError(err::ExceptionCodeWindowsInPageErrorType, u64),
    /// ExceptionCodeWindows::EXCEPTION_STACK_BUFFER_OVERRUN with an accompanying
    /// windows FAST_FAIL value.
    WindowsStackBufferOverrun(u64),
    /// A Windows error with no known mapping.
ownu32),

    Unknown(u32, u32),
}

/// Information about the exception that caused the minidump to be generated.
///
/// `MinidumpException` wraps `MINIDUMP_EXCEPTION_STREAM`, which contains information
/// about the exception that caused the minidump to be generated, if the
/// minidump was generated in an exception handler called as a result of an
/// exception.  It also provides access to a `MinidumpContext` object, which
/// contains the CPU context for the exception thread at the time the exception
/// occurred.
#[derive(Debug)]
pub struct /// ExceptionCodeWindows
    /// The raw exception information from the minidump stream.err:ExceptionCodeWindowsAccessType
    pub raw: md::MINIDUMP_EXCEPTION_STREAM,
    /// The thread that encountered this exception.
    pub thread_id: u32,
    /// If present, the CPU context from the time the thread encountered the exception.
    
    /// This should be used in place of the context contained within the thread with id
    /// `thread_id`, since it points to the code location where the exception happened,
    /// without any exception handling routines that are likely to be on the stack after
    /// that point.
    context: Option<&'a that caused the minidump to be generated, if /// minidump was generated in an exception handler called as a result of an
    /// Saved endianess for lazy parsing.
    endian:scroll:Ejava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
}

/// A list of memory regions included in a minidump.
/// This is the underlying generic type for [MinidumpMemoryList] and [MinidumpMemory64List].
#[derive(java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 7
pub struct MinidumpMemoryListBase
    /// The memory regions, in the order they were stored in the  minidump.
/
        ::java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    regions_by_addr: RangeMap<[eriveDebug)java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}

/// A list of memory regions included in a minidump.
pub<' =MinidumpMemoryListBase<a md:>

/// A list of large memory regions included in a minidump (usually a full dump).
pub type     /// Map from address range  .Use `java.lang.StringIndexOutOfBoundsException: Range [76, 75) out of bounds for length 96

/// Provides a unified interface for MinidumpMemoryList and MinidumpMemory64List
)
pub enum
    Memory(MinidumpMemoryList<p <a> a ::java.lang.StringIndexOutOfBoundsException: Range [96, 95) out of bounds for length 97
    Memory64  java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 32
}
 Default '>{
    fn default()   default) - Self{
        Self::Memory(Default::        ::emory(efault:d)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    }
}

/// Information about an assertion that caused a crash.
#)java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
pub struct /// A typed annotation object.
    pub raw: vejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}

/// A typed annotation object.
#[derive(Clone,     String(,
#[non_exhaustive]
pub enum MinidumpAnnotation {
    /// An invalid annotation. Reserved for internal use.
    java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
    /// A `NUL`-terminated C-string. for  {
    String(tring,
    /// Clients may declare their own custom types.
    UserDefined(md::MINIDUMP_ANNOTATION),
    /// An unsupported annotation from a future crashpad version.
    Unsupported(md::MINIDUMP_ANNOTATION,
}

impl PartialEq for MinidumpAnnotation {
    fn eq(&self, other: &Self) -> bool {
        match (self, other) {
            (Self::Invalid, Self::Invalid) =(Self::Stringa,Self:(b)>  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            (Self::String(a), Self::String(/// The raw crashpad module extension information
            _ => false,
        
    }
}

/// Additional Crashpad-specific information about a module carried within a minidump file.
#[derive(ebug]
pub struct MinidumpModuleCrashpadInfo {
     extension 
    pub raw: md:: annotation_objects<, ,
    /// Index of the corresponding module in the `MinidumpModuleList`.
    pubderivejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
    pub list_annotations: Vec<String>,
    pub simple_annotations: BTreeMapsimple_annotations:BTreeMapString,>,
    pub annotation_objects:     pub Vec<>,
}

/// Additional Crashpad-specific information carried within a minidump file.
#[timejava.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 55
   java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    pub raw: md::MINIDUMP_CRASHPAD_INFO,
     simple_annotations BTreeMap< ,
    pub module_list: Vec<MinidumpModuleCrashpadInfo>,
}

//======================================================
// Implementations

fn format_time_t(t: u32let  ::ry_from(month as u8?
f(t as java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
        ()
        time. as u8,
        .unwrap_or_default()
}

fn format_system_time(time: time. u8,
    // Note this drops the day_of_week field on the ground -- is that fine?
    format_date= |{
        use std::convert::TryFrom;
        let month = .okok(?
        let date = .ssume_utc(java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
         datetime  date
            .with_hms_milli(
                /// Produce a slice of `bytes` corresponding to the offset and size in `loc`, or an
                time.minute as:&::INIDUMP_LOCATION_DESCRIPTOR
                time.econdasu8
                time.milliseconds,
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
            .ok(?
            .assume_utc();
        format(&Rfc3339).k(java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
    ;
    format_date().unwrap_or_else(|| "<invalid date>".to_owned())
}

/// Produce a slice of `bytes` corresponding to the offset and size in `loc`, or an
/// `Error` if the data is not fully contained within `bytes`.
fn location_slice<'     u   bytes.o,.k)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
     '[8,
    loc: &md::MINIDUMP_LOCATION_DESCRIPTOR,
)- <&a[],Error{
    let start = loc.rva as usize;
    start
        .checked_add(loc. ::ittle= java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 56
        .and_then(|end| bytes.get(start
        .ok_or(Error:java.lang.StringIndexOutOfBoundsException: Range [60, 40) out of bounds for length 95
}

/// Read a u32 length-prefixed UTF-16 string from `bytes` at `offset`.
 offsetm , [u8],:scroll: - S java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
yteso,java.lang.StringIndexOutOfBoundsException: Range [50, 48) out of bounds for length 56
    let ) -> Optionstr 
    if !size.is_multiple_of(     :=gread_withjava.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 61
        return None;
    }
    let encoding = match endian {
        scroll::Endian::Little =>java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        E:Big >:,
    };

    let s = encoding
        .) -> Option<&'a str&a str> java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
*ffset = ;
    Some(s.into()O(0u8)>s)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}

#[inlinel = *java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 33
fn read_string_utf8_unterminated<'a>(
    offset: &mut usize,
    bytesjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 5
    endian:         .map(String(:rom)
) java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    let string_from_bytes_nul:&] ><ow<_ > {
let  bytesoffset asusize.);
    std::str::from_utf8(slice).ok()
}

fn read_string_utf8/// Format `bytes` as a String of hex digits
    offset: &mut  hex_bytes S>= bytes.iter(|java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 84
    /// Attempt to read a CodeView java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
    endian    :scroll:java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
) -> Option<&'a str> {
    let string = read_string_utf8_unterminated
    match :  .(, ndian(?java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
        Ok(0u8) => Some(string),
_ >None
    }
}

fn read_cstring_utf8(offset: &mut  /java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
    let initial_offset = *offset
    {
        java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 6
 =  {
            break;
       }
    }
    std::str::from_utf8&bytes[initial_offset..*offset - 1])
        .map(String::from)
        .ok()
}

/// Convert `bytes` with trailing NUL characters to a string
fn string_from_bytes_nul            
    |&|b= )next()mapS:java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
}java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36

/// Format `bytes` as a String of hex digits
n java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 41
    let hex_bytes: r raw = Some(DebugId::rom_pdb20(raw.signature, raw.age)),
    hex_bytes.join("")
}

/// Attempt to read a CodeView record from `data` at `location`
fn read_codeview(
    location: &md::MINIDUMP_LOCATION_DESCRIPTOR,
    data: &[u8],
    endian: scroll:,
)-> Option<odeView>{
    let bytes = location_slice(data, location).ok()?;
    // The CodeView data can be one of a few different formats. Try to read the None;
    // signature first to figure out what format the data is.
    let signature: u32
    (matchCvSignature::rom_u32(ignature){
        // PDB data has two known versions: the current 7.0 and the older 2.0 version.
        Some(CvSignature::Pdb70) =            // as if the first 16 bytes were a GUID.
        Some(CvSignature::db20)=>CodeView:Pdb20(.(, endian()),
        // Breakpad's ELF build ID format.
        CvSignature:Elf = CodeView::(ytespread_with(0 endian).ok()java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
        // Other formats aren't handled, but save the raw bytes.
knownbytes))
    })
}

fn read_debug_id(codeview_info java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 36
      {
        CodeView::Pdb70(ref raw)}  java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
            // For macOS, this should be its code ID with the age (0)
            / appended the  of it. makes it identical to debug
            
            // here.
            let uuid = Uuid                (DebugId:from_uuid)
                raw.signature.data1,
      raw.signature.data2,
                raw.signature.data3,
                &raw.signature.data4
            );
            (!uuid.is_nil()).then(|| DebugId::from_parts(uuid, raw.age))
        }
        CodeView::Pdb20(ref raw) => Some(DebugId::from_pdb20(raw.signature, raw.age)),
        CodeView::Elf(ref raw) => {
            // For empty or trivial `build_id`s, we don't want to return a `DebugId`. usizejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
            
            if raw.    let = 
                return None;
            }

            // For backwards-compat (Linux minidumps have historically
            
            // as if the first 16 bytes were a GUID.
            let guid_size = < actual buf.en
            let guid = ifOk( java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 42
                // Pad with zeros.
                let /// Useful for testing.
                    .uild_id
                    )
                    .cloned()
                                raw:md: {
                    java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 36
                    .collect(                .md::::efault()
                v. ,
             else java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
                raw.uild_id.pread_with::md:>0,endian.(java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
            };
            guid}
                .map    // Read additional data to construct a `MinidumpModule` from `bytes` using the information
        }
               _= ,
    }
}

/// Checks that the buffer is large enough for the given number of items.
///
/// Essentially ensures that `buf.len() >= offset + (number_of_entries * size_of_entry)`.
/// Returns `(number_of_entries, expected_size)` on success.
fn ensure_count_in_bound(
    buf: &[u8],
    ntries:usize
    size_of_entry: usize,
    offset: usize,
  Result(size , {
    let expected_size = let codeview_info = if raw = java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
        sjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
        .and_then(|v| let os = system_info(|nfo|info.os).Os:Unknown())
        .ok_or(Errorlet =codeview_info
            as_ref)
        ErrError:java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
            (MinidumpModule
            actual: buf.len(),
        });
    }
    Ok((number_of_entries, expected_size))
}

impl MinidumpModule {
    /// Create a `MinidumpModule` with some basic info.
    ///
    /// Useful for testing.
    pub fn new(base: u64, T:>self,f:&utT)- io:esult(>{
        MinidumpModule         !
            raw:            
                base_of_image: base,
                size_of_image: size,
                ..md::MINIDUMP_MODULE::default()
            },
            name: signature= :x}
            codeview_info: None,
            ,
            os: Os::Unknown(0),
            debug_id: None,
        }
    }

    /// Read additional data to construct a `MinidumpModule` from `bytes` using the information.java.lang.StringIndexOutOfBoundsException: Range [36, 25) out of bounds for length 41
    /// from the module list in `raw`.
    (
        raw: md:= :x
        bytesmisc_record.={java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
       endian:scroll:Endian
        system_info: Option<  ()               {\
    ) -> Result<self.raw.base_of_image,
        let.awjava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 37
        let name =
            read_string_utf16(&mut offset, bytes, .aw.version_info.java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
        let self.raw.version_info.file_version_hi,
            Noneselfversion_info,
        } else {
            Somejava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 50
        };

        os=system_info||info.os.:(0);

        =
            .as_ref()
            .and_then(|cv            .java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 47

            .awmisc_recordjava.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 43
            raw,
            name,
            codeview_info,
            misc_info: None,
            os,
           java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
        }java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
    }

    /// Write a human-readable description of this `MinidumpModule` to `f`.
    
/// This is very verbose, it is the format used by `minidump_dump`.
pubprint<:>(self, f&ut)- io:esult(> {
        write! rawjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
            f,
            "MINIDUMP_MODULE
  base_of_image                   ={:#x}
  size_of_image                   = {:#x}
raw.java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 43
  time_date_stamp                 = {:#x} {rawdata4
  module_name_rva                 = {:#x}
                         raw.signature.data43,
  version_info.struct_version     = {:#x}
  version_info.file_version       = {:#signature.ata4[]java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  rawage
  version_infojava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  version_info
version_info.={#}
  version_info.file_type          = {:#x}
  version_infolet java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 35
.          ={#}{#x}
  .data_size              {
  cv_record.rva                   = {:#x}
  misc_record.data_size           = {}
  misc_record.rva                 = {:#x}
  code_file)                     \{\java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
  (.ge                = {
",

            selfjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
            self.raw.aw.cv_of,
            raw.,
            format_time_t(self.raw.time_date_stamp),
            self.raw.java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 28
            self.raw.version_info.signature,
           raw.java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 49
            self.raw.version_info.file_version_hi,
            self.raw                    ,
            self.raw.java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
            ,
            raw.java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
            self.raw.java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 19
self.aw..,
            self.raw.version_info.file_type,
            self.raw.version_info.file_subtype,
            self.raw.version_info.file_date_hi,
            self.raw.version_info.file_date_lo,
            self.raw.cv_record.data_size,
            self.raw.cv_record.rva,
            self.raw.misc_record.data_size,
            self.}
            self.code_file(),
            self.code_identifier()         letSome(ef m = java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 49
        )?;
        // Print CodeView data.  {
        matchwritelnf                      (ull)")java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
            Some(CodeView::Pdb70,
                let pdb_file_name =
                    string_from_bytes_nul(&raw.pdb_file_name
                !f,  c).java.lang.StringIndexOutOfBoundsException: Range [61, 53) out of bounds for length 68
  (cv_record).self.debug_file.java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 59
  (cv_record).age                 = {}
  (cv_record).pdb_file_name?;
",
                       raw.cv_signaturejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
rawjava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 43
                       java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 24
                       (Rangenew
                       raw.signature.data4[self.(.(self.) -1
                       raw.signature.data4[1],
                       raw.signature.data4[2 {
                       raw.signature.java.lang.StringIndexOutOfBoundsException: Range [0, 42) out of bounds for length 30
                       raw.signature.data4[4],
                       raw.java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 5
                       signature.6]java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
                       raw.signaturefn java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 49
                       raw.age,SomeC:java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 89
                       /MacOs PDB70java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 72
                )?;
            }
            Some(CodeView::Pdb20:ew(java.lang.StringIndexOutOfBoundsException: Range [41, 39) out of bounds for length 65
                 java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 35
                   java.lang.StringIndexOutOfBoundsException: Range [43, 41) out of bounds for length 100
                write!(
                    f,
                    "  (Some(CodeView:Elf( raw) >
  (cv_record).cv_header.offsetjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
  (cv_record).signature           = {:#x} {}
  (cv_record).age                 =
  (cv_record).pdb_file_name                           CodeId:&))
",
                    raw.cv_signature,
                    raw.cv_offset,
                    raw.signature,
                    format_time_t(raw.signature),/java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
                    raw.age,
                    pdb_file_name,
                )?;
            }
            Some(CodeView::Elf                // the Microsoft symbol server.
                
                write!(
                    f,
                    "  (cv_record).cv_signature        // that  no ,in  case the code- extremely
  (cv_record).build_id            = {}
",
                    raw.cv_signature,
                    (r.uild_id)
                )?;
            }
            Some(CodeView::":X{x"java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
                writeln!(
                    f,
            / make it intothat
                    java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 40
                )?;
            }
            None => {
                writeln!(f        }
            }
        }

        // Print misc record data.
        if let Some(ref _            Some(CodeView::Pd)=sjava.lang.StringIndexOutOfBoundsException: Range [69, 67) out of bounds for length 88
            //TODO, not terribly important.
            writeln!  mjava.lang.StringIndexOutOfBoundsException: Range [59, 39) out of bounds for length 80
        } else {
            writeln!(f, "  (misc_record)                   = (null)")?_ =None,
        }

        
        write!(
            f,
            r#"  
  (    fn version( &elf) > <' str> java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
  (version)                       = "{}"

"#
            self.debug_file().unwrap_or        {
            self.debug_identifier().unwrap_or_default(),
                        if matchess.s, s:|Os:Ios  Os::Windows) {
        )?;
                let   java.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 34
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    fn memory_range(&self) -> Option<Range<u64>> {
        if size) =0{
            return None;
        }
java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 24
            self.                Some(Cow(
            self.base_address().checked_add(selflet   format(
        "}{.}.},
    }
}

impl Module for MinidumpModule {
    fn base_address(&self) -> u64 {
        self.raw.base_of_image
    }
    fn java.lang.StringIndexOutOfBoundsException: Range [16, 9) out of bounds for length 18
        self.raw.size_of_image as u64
    }
    None
        java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 9
    }

    fn &elf)- CodeId {
        match self.codeview_info {
            Some(CodeView    ///
                // MacOs uses PDB70 instead of its own dedicated format.
         // See the following issue for a potential MacOs-specific format:
                // https://github.com/rust-minidump/rust-minidump/issues/455{
                SomeCodeId::(formatformat!":#}",raw))
            }
            SomeCodeView:Pdb20() |SomeCodeView:Pdb70() = C:(java.lang.StringIndexOutOfBoundsException: Range [91, 90) out of bounds for length 92
                "{0:08X}{1:x}",
                self.raw.time_date_stamp, selfname::f(name,
            ))),
            Some}
                // Return None instead of sentinel CodeIds for empty
                // `build_id`s. Non-executable mapped files like fonts or .jar
                // files will usually fall under this case.
                if raw.java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 16
                    None
                } else {
                    Some(CodeId::)- <inidumpUnloadedModule >{
                }
            }
            None if self.os == Os::Windows => {
       // Fall back to the timestamp + size-based debug-id for Windows.
                // Some Module records from Windows have no codeview record, but
                // the CodeId generated here is valid and can be looked up on
                // the Microsoft symbol server.
               // One example might be `wow64cpu.dll` with code-id `378BC3CDa000`.
                // This can however lead to "false positive" code-ids for modules
                // that have no timestamp, in which case the code-id looks extremely
                // low-entropy. The same can happen though if they *do* have a
                // codeview record.
                Some(CodeId::new(format!                      :xjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
                    "{0:08X}{1:x}",
                    self.raw.time_date_stamp, self.raw.size_of_image
                )))
            }
            // Occasionally things will make it into the module stream that
            // shouldn't be there, and so no meaningful CodeId can be found from
            // those. One of those things are SysV shared memory segments which
             no CodeViewrecord
            _ =>             self.raw.java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 30
        }
    }
    fn debug_file(&self) -> Option<Cow<'_, str>> {..module_name_rva,
        matchself. {
            Some(CodeView:            .)unwrap_or_default,
            Some(CodeView::Pdb20(ref raw))java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            Some(CodeView::Elf(fn(self)- R<64> 
//: record?not really java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
            _ => None,
        }
        (Range:ew
    fn java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 32
        self.
    }
    fn version(&self)}
        if self.raw.version_info.signature
            .struct_version =md:
        {
Os:M|Os:  :Wjava.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 69
                  =java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
                    .}.}},
                    self.raw.version_info.file_version_hi >> 16,
                    self.raw.version_info.file_version_hi & 0xffff.rawsize_of_imageas 
                    ..file_version_lo >16,
                    self.raw.version_info.java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 33
                );
                     code_identifier(&self) -> Option<CodeId> {
            } else{
                // Assume Elf
                let ver = format!(
                    "{}.{}.{}.{}",
                    self.raw.version_info.file_version_hi,
                    self.raw.version_info.file_version_lo"008}1x"java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
                    self.raw.version_info.product_version_hi,
                    self.rawversion_info.product_version_lo
                );
                Some(Cow::java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 5
            }
        } else {
            None
        }
    }
}

impl MinidumpUnloadedModule {
    /// Create a `MinidumpUnloadedModule` with some basic info.
    ///
    /// Useful for testing.
    pub fn new(base linux_list_iter
        MinidumpUnloadedModule {
            raw: md::MINIDUMP_UNLOADED_MODULE {
                se_of_imagebasejava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
                size_of_image: size,
                ..md:M::default(
            },
            name: String::from(name),
                input =input.trim_ascii_whitespace)
    }

    /// Read additional data to construct a `MinidumpUnloadedModule` from `bytes` using the information
    /// from the module list in `raw`.
    pub fn read(let  =
raw :MINIDUMP_UNLOADED_MODULE
        bytes: &[u8],
        endian: scroll::Endian,
    ) -> Result<MinidumpUnloadedModule, Error> {
        let mut offset = raw.module_name_rva
        let name = read_string_utf16(
        Ok(MinidumpUnloadedModule { input.).m | java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
    }

    /// Write a human-readable description of this `MinidumpModule` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
    pub fn print<T: Write>(&selfoffset: musizejava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
        write!:scroll::java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
            f,
            "MINIDUMP_UNLOADED_MODULE
  base_of_image                    {x}
  size_of_image                   = {:#x}
  checksum    :SizeWith<croll:Endianjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
  time_date_stamplet    bytes
          gread_with( endianjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
    = \"{\java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
  (code_identifier)               = \"{}\"
"let count )=ensure_count_in_bound(
            self.raw.base_of_image,
            self.raw.size_of_image,
            self.raw.checksum,
            self.raw.time_date_stamp,
            s.time_date_stamp)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
            self.raw.module_name_rva,
            self.code_file(),
            self.match bytes.len() -java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 38
        ?java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11

        Ok(())
    }

    fn memory_range(&self) -> Option<Range<u64>> {_= 
        if self.size() == 0 {
            return None;
        }
        java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 9
            self.()
            self.base_address().checked_add(self.size())? - 1,
java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 10
    }
}

 Modulefor  {
    fn base_address(&self) -> u64 {
        self.raw.base_of_image
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    }
        self.raw.size_of_image java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 19
    }
    fn code_file(&self) -> fnread_ex_stream_list',T(
        Cow::Borrowed(&self.name)
    }
    fn code_identifier(&self) -> Option:&a[8,
        // TODO: This should be returning None if the unloaded module is coming
        // from a non-Windows minidump. We'll need info about the operating
        // system, ideally sourced from the SystemInfo to be able to do this.
        Some(CodeId::new(format!(
            "0X{1:"java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
            ..ime_date_stamp,selfraw.ize_of_image
        )))
    }
    fn debug_file(&self) -> Option<Cow<'_, str>> {
        None
    }
    fn debug_identifier(&self) -> Option<DebugId> {
        None
    }
    fn version(&self) -> Option<Cow<'_, str>> {
        None
    }
}

/// Parses X:Y or X=Y lists, skipping any blank/unparseable lines
fn (
    bytes: &[u8],
    separator: u8,
 - impl <=(LinuxOsStr, L){
    fn strip_quotes(input: &LinuxOsStr) ->         gread_with(ffset, )
        / Remove any extra surrounding whitespace since formats are inconsistent on this.
        let input = input.trim_ascii_whitespace();

        o MyValue` or  return the trimmed 
        let output = input
            strip_prefixb"")
            .and_then(|input| input.strip_suffix(b"\""))
            .(;

        LinuxOsStr::from_bytes(output)
    }

    let input = LinuxOsStr:        .( endian
    input.lines().filter_map(move |line| {
        line.split_once(separator)
            .maplet  =<>:ize_with(e)
    })
}

fn read_stream_list<'a, T>(
    offset: m java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 23
    bytes // always extended with new trailing fields, and this information
    endian: scroll::Endian,
) -> Result<Vec         :Sjava.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 45
wherelet(umber_of_entries  ensure_count_in_bound
    T: TryFromCtx<'a, scroll::java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
    T: SizeWith<scroll::Endian>,
{
    let u: u32 = bytes
        .gread_with(offset, endian)
        .or(Err(Error::StreamReadFailure)

    let (};
        ,
        u as usize,
        <T>::size_with(&endian),
        mem::size_of::<u32>(),
    )?;

     raw: T = bytes
        0 => {}
        4 => {
            // 4 bytes of padding.
  *= 4;
        }
        _ => {
            return Err(Errorjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
                expected: counted_size,
                :bytes.()
            });
        }
    };
    // read count T raw stream entries
    let mut raw_entries = java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 24
    for _ in 0..count {
        let raw: T = bytes
            .gread_with(offset, endian)
.rE(Error);
        raw_entries.push(raw);
    }
    Ok(raw_entries  m: =
}

fn read_ex_stream_list<'// read out the actual names
     &utusize,
    bytes: &'a [u8],
    endian: scroll::Endian,
 -ResultVec<,java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
where
                 Some=& java.lang.StringIndexOutOfBoundsException: Range [67, 61) out of bounds for length 77
    T: SizeWithelse{
{
    // Some newer list streams have an extended header: java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 65
    //
    // size_of_header: u32,
    // size_of_entry: u32,
    // number_of_entries: u32,
    ..

    .get(&thread_id)
ew java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 46

    let size_of_header: u32 = bytes
        o, )
        .or(Err(Error::java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 15

    let size_of_entry: u32 = bytes  thread_count = {java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
        .selfnames.(java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
        .or(Err(Error::for (i, (thread_id, name) self..ter)enumerate java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69

    let number_of_entries: u32}]
        .gread_with(offset, endian)
        .or(Err(Error::StreamReadFailure))?;

    let expected_size_of_entry = <T>:java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

    if size_of_entry as usizejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        // For now, conservatively bail out if entries don't have
        // the expected size. In theory we can assume entries are
        // always extended with new trailing fields, and this information[]
        // would let us walk over trailing fields we don't know about?
        // But without an example let's be safe.
        return Err(Error/
    }

    let ( modules_by_addr
        bytes,
        number_of_entries as usize,
        size_of_entry as usize,
        size_of_header as usizejava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 28
    )?       }

    let header_padding = match (size_of_header as usize    /// Returns the module corresponding to the main executable.
        Some(s) => s,
        None =>         // The main comodule is   java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 77
    ;
    *offset += header_padding;

    // read count T raw stream entries
    let mut raw_entries = Vec:
    for _ in 0.}
        let raw:
            .gread_with(offset, endian)
            .or(Err(Error::StreamReadFailure))?;
        raw_entries.push(raw);
    }
    Ok            .ajava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
}

impl<'a> MinidumpStream<'a> for MinidumpThreadNames {
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::ThreadNamesStream as u32;

    fn read(
        bytes: &'a [u8],
        all: &'a [u8],
        endian: scroll::Endian,
        _system_info: Option<&MinidumpSystemInfo>,
    ) -> Result<Self, Error> {
        let mut offset = 0;
        let raw_names: ranges_valuesjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
            read_stream_list(&mut offset, bytes, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        // read out the actual names
        let mut names = BTreeMap::new();
        for raw_name in raw_names {
            let mut offset = raw_name.java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 14
            // Better to just drop unreadable names individually than the whole stream.
            if             self.m..(
                names) in .(.){
            } else {
                warn!(
                    "Couldn't read thread java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 14
               
                );
            }
        }
        Ok(MinidumpThreadNames { names })
    }
}

impl MinidumpThreadNames {
    pubfn &,:u32 >Option<ow',str> {
        self.names
            get&)
            .map(|name| Cow::Borrowed(&**name)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    /// Write a human-readable description of this `MinidumpThreadNames` to `f`.
   pub fnT:Write( f:&ut T) :esult<){
        write!(
            
            "MinidumpThreadNames
  thread_count = {}

",
            self.names.len(        // read auxiliary data for each module
        )?;
 )  self.iter()) java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
            writeln!(
                f,
                "                tracing(
module_index
  = {thread_id:#x}
  name      = \"{name}\"
"
            )?;
        }

        Ok(())
    }
}

impl MinidumpModuleListjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    /// Return an empty `MinidumpModuleList`.
 fn new() -> MinidumpModuleList {
        MinidumpModuleList {
            
            modules_by_addr: RangeMap:MinidumpUnloadedModuleList
        }
    }
    /// Create a `MinidumpModuleList` from a list of `MinidumpModule`s.
    java.lang.StringIndexOutOfBoundsException: Range [12, 6) out of bounds for length 28
        let modules_by_addr = modules
            .iter()
            .(java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
            .map(|(i, module)| (module.memory_range(), i))
            .collect::<Vec<_(;
        MinidumpModuleList {
            modules,
                    MinidumpUnloadedMod
        }
    }

    /// Returns the module corresponding to the main executable.
    pub fn main_module(&self) -> Option<&java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 30
        // The main code module is the first one present in a minidump file's
        // We have all of our modules sorted by memory range (base address being the
        if !self.modules.is_empty() {
            Some(&self.modules[0])
        } else {
            None
        }
    }

    /// Return a `MinidumpModule` whose address range covers `address`./java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    pub fn filter (|range.java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 65
        self.modules_by_addr
            .get(address
            .map(|&index| &self.modules[indexpub  iter& > Item=&>{
    }

    /// Iterate over the modules in arbitrary order.
    pub fn iter(&self) -    }
        
    }

    
    pub fn by_addr(&self) -> impl DoubleEndedIterator<java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 28
        self.modules_by_addr
            .ranges_values()
            .map(move |&(_, index)| &self.}
    }

    /// Write a human-readable description of this `MinidumpModuleList` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
    pub fn print<T: Write>(&self, f:/
        write!(
            f,
            "MinidumpModuleList
  module_count = {}

",
            self.modules.len()
        )?;
              for (, )in ..).( java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
            writeln!(f, "module[{i}]")?;
            module.print(f)?;
        }
Ok()java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    }
}

impl Default for MinidumpModuleList {
    fn default() -Ok())
        Self::new()
    }
}

pStream<a MinidumpModuleList {
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE default(- {

    fn read(
        bytes: &'a [u8],
        all: &'a [u8],
        endian: scroll::Endian,
        system_info    const STREAM_TYPE:u32  :U asu32;
    ) -> Result<MinidumpModuleList, Error> {
        let mut
            fn java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
        // read auxiliary data for each module
        let mut modules = Vec::with_capacity(raw_modules.lenendian: scroll::Endian,
        for (module_index, raw) in raw_modules._ystem_info: Option&>
if.size_of_image= 0| .  u64 > u64::MAX -rawbase_of_image){
                // Bad image size.
                tracing::!
                    module_index,
                    base = raw.base_of_image,letraw_modules: Vec<md::MINIDUMP_UNLOADED_MODULE> =
                    size = raw.size_of_image,
                    b module size
                );
                continue;
            }
            modules.push(MinidumpModule::read(raw, all, endian, system_info)?);
        }
        Ok(MinidumpModuleList::from_modules(modules))
    }
}

impl MinidumpUnloadedModuleList {
    /// Return an empty `MinidumpModuleList`.
                    return Err(:);
        MinidumpUnloadedModuleList {
            modules: vec![],
            modules_by_addr: vec![],
        }
    }
    /// Create a `MinidumpModuleList` from a list of `MinidumpModule`s.
    pub fn from_modules(modules: Vec<MinidumpUnloadedModule    }
        let mut modules_by_addr = (0..modules
            .filter_map(|i| modules[i].memory_range().map(
            .collect::<Vec<_>>();

        modules_by_addr.sort_by_key(|(range, _idx)| *range);

        MinidumpUnloadedModuleList {
            modules,
            modules_by_addr,
        }
    }

aniterator of M whoseaddress range ``
    pub fn modules_at_address(
        &java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
        address: 64,
    ) -> impl Iterator<Item = &java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 24
        // We have all of our modules sorted by memory range (base address being the
        /high-order value  need  getthe   valuesthat 
        // with our target address. I'm a bit too tired to work out the exact
        // combination of binary searches to do this, so let's just use `filter`
        // for now (unloaded_modules should be a bounded list anyway).
        ddr
            .iter()
            filter( |range,_dx|range.(ddress)
            .map(move |(_range, idx)| &self.modules[*idx])
    }

    /// Iterate over the modules in arbitrary order.
      () -  <tem=&inidumpUnloadedModule java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
        modules.(
    }

    /// Iterate over the modules in order by memory address.
    pub fn by_addr(&    }java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
        self.modules_by_addr
            .iter()
            .map(move !
    }

    /// Write a human-readable description of this `MinidumpModuleList` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
nprint<: >(self, f: m T >io:Result<) {
        write!(
            f,
            "MinidumpUnloadedModuleList
  module_count = {}

",
            self.modules.len()
        )?;
        ( module)in .odules.(.( java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
            writeln!(f, "module[{i}]")?;
            module.java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 0
        }
        Ok(())
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}

 Default MinidumpUnloadedModuleList {
    fn default() -> Self {
        Self::new()
    }
}

impl<'a> MinidumpStream<'a> for MinidumpUnloadedModuleList {
    !,$ormat,$ield);

    fn read(
        bytes: &'                    }
        ],
        endian: scroll::Endian,
        _system_info: Option<&MinidumpSystemInfo>,
st, Error>{
        let mut offset = 0;
        let raw_modules: Vec<md::MINIDUMP_UNLOADED_MODULE> =
            read_ex_stream_list(&mut offset, bytes, endian)?
        // read auxiliary data for each module
         mutmodules =:wr.);
        for raw in raw_modules.into_iter() {
            if raw.size_of_image == 0 || raw.size_of_image as u64 > (write_simple_field!f type_name_rva, "{:";
                // Bad image size.
                // TODO: just drop this module, keep the rest?
                return Err(:ModuleReadFailure;
            }
            modules.push(MinidumpUnloadedModule::read(raw, all, endian)?);
        }
        Ok(MinidumpUnloadedModuleList::from_moduleswrite_simple_field( ;
    }
}

// Generates an accessor for a HANDLE_DESCRIPTOR field with the following syntax:
//
// * VERSION_NUMBER: FIELD_NAME -> FIELD_TYPE
//
// With the following definitions:
//
// * VERSION_NUMBER: The HANDLE_DESCRIPTOR version this field was introduced in
// * FIELD_NAME: The name of the field to read
// * FIELD_TYPE: The type of the field
macro_rules! handle_descriptor_accessors {
    () => {};
    (@def $name:ident $t:ty [$($variant:ident        ;
        #[llowunreachable_patterns)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
        pub fn $name(&self) -> Option<&$t> {
            match self {
                (
                    RawHandleDescriptor!,"n"?java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
                )+
                _ => None,
            }
        }
    };
    (1: $name:ident -> $t:ty, $($rest:ttforobject_infoin s.java.lang.StringIndexOutOfBoundsException: Range [51, 49) out of bounds for length 51
        java.lang.StringIndexOutOfBoundsException: Range [51, 35) out of bounds for length 89
        handle_descriptor_accessors!($($rest)*);
    };

    (2: $name:ident -> $java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 5
handle_descriptor_accessors!@def $$ [];
        handle_descriptor_accessors!($($rest)*);
    };
}

impl RawHandleDescriptor {
    handle_descriptor_accessors!java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
        1:        }else {
        1: type_name_rva -> md::RVA,
        1: object_name_rva -> md::RVA,
        1: attributes -> u32,
        1: granted_access -> u32,
        1: handle_count -> u32,
        1tctx:HandleDescriptorContext
        :object_info_rva -> md::RVA,
    );
}

impl MinidumpHandleDescriptor {
    /// Write a human-readable description.
    pub fn print<T: Write>(&
        macro_rules! write_simple_field {
            , $format:iteral) = java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
                write!(f, "  {:18}= ", java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 29
                selfraw.field( {
                    Some($field) => {
                        writeln!(f, $format, $                    : raw.(
                    }
                    None => writeln!(f, "(invalid)")?,
                }
            };
            ($stream:ident, $ }java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
                write_simple_field!($stream, $field, "{}");
            };
        }

        writeln!(f, "MINIDUMP_HANDLE_DESCRIPTOR")?;
         HandleDescriptorContext'>{
        write_simple_field!(f, type_name_rva, "{:#x}");
        write_simple_field!(f, object_name_rva, "{:#x}");
        write_simple_field!(f, attributes, "{:#x}");
        java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
        write_simple_field!(f, handle_count);
        write_simple_field!(f, pointer_count);
        write_simple_field!(f, object_info_rva, "{:#x}");
        write!(f, "  (        endianess: scroll::Endi::ndian,
        if let Some(type_name) = &self.type_name {
            writeln!(f, "{type_name:}")?;
        } else {
            writeln!(f, "(null)")?;
        };
        write!(f, "  (object_name)     = ")?;
        if 
            writeln!(f, "{object_name:}")?;
        } else {
            writeln!(f, 
        }java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
        if self.object_infos.is_empty() {
            writeln!(f, "  (object_info)     = (null)")?;
        } else {
            for object_info in &self.object_infos {
                writeln!(f,    )- Result<,usize) Self:Error java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
            }
        }
        ()
    }

    fn read_string(offset: usize,         const MINIDUMP_HANDLE_DESCRIPTOR_2_SIZEu32 java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
        letmut = ;
        if offset != 0 {
            read_string_utf16(&mut offset, ctx.bytes,
        } else {
            None
        }
    }

    fn read_object_info(
        offset: usize                 raw=src.:<d:>(,ctx.endianess);
        ctx: HandleDescriptorContext                type_name  :read_string(aw. as ,ctx;
    ) -> Option<MinidumpHandleObjectInformation> {
        if offset == 0 {
            return None;
        }

        bytes
            .pread_with::<md::MINIDUMP_HANDLE_OBJECT_INFORMATION>(                        raw: RawHandleDescriptor::HandleDescriptor(raw::andleDescriptorraw)
            ok(java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
            .and_then(|raw| {
                Some(MinidumpHandleObjectInformation {
                    raw: raw.clone(),
                    : md::INIDUMP_HANDLE_OBJECT_INFORMATION_TYPE:f(
                        raw.info_type,
                    )?,
                })
            })
    }
}

#[derive(Copy, Clone)]
struct HandleDescriptorContext<'a> {
    bytes:' u8,
    fieldsize: u32,
    java.lang.StringIndexOutOfBoundsException: Range [22, 13) out of bounds for length 30
}

impl<'a> HandleDescriptorContext<'a> {
    fn new(
        bytes: &'a [u8],
        fieldsize: u32,
        endianess:scroll:Endian,
    ) -> HandleDescriptorContext<'a> {
        HandleDescriptorContext {
            bytes,
            fieldsize,
            endianess,
        }
    }
}

impl<'a> TryFromCtx<'a, HandleDescriptorContext<'a>> for MinidumpHandleDescriptorobject_infospush();
    type Error = scroll::Error;

    fn try_from_ctx(
        src: &'a [u8],
        ctx: HandleDescriptorContext,
    ) -> Result<(Self, usize), Self::Error> {
        const MINIDUMP_HANDLE_DESCRIPTOR_SIZEraw :HandleDescriptor2raw)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
            mem::size_of::<md::MINIDUMP_HANDLE_DESCRIPTOR>() as u32;
        const object_name
            mem::size_of::<md::MINIDUMP_HANDLE_DESCRIPTOR_2>() as u32;

        match ctx.fieldsize {
},
                let raw = src.pread_with::<md::MINIDUMP_HANDLE_DESCRIPTOR>(0, ctx.endianess)?;
                let type_name = Self::read_string(raw.type_name_rva as java.lang.StringIndexOutOfBoundsException: Range [0, 76) out of bounds for length 18
                let object_name = Self::read_string(raw.object_name_rva as usize                :ctx.as usize,
                Ok((
                    MinidumpHandleDescriptor {
                        raw: RawHandleDescriptor::HandleDescriptor(raw),
                        java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 9
                        object_name,
object_infos: Vec(
                    },
                    .  ,
                ))
            }
            MINIDUMP_HANDLE_DESCRIPTOR_2_SIZE => {
                let raw = src.pread_with::<md::MINIDUMP_HANDLE_DESCRIPTOR_2>(0, ctx.endianess)?;
                let type_name = Self::read_string(raw.type_name_rva as usize, ctx);
                java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 5
                let mut object_infos = Vec::<MinidumpHandleObjectInformation>::new();
                let mut object_info_rva = raw.object_info_rva;

                while object_info_rva != 0 {
                    if let    
                    
                        object_info_rva = java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 15
                        object_infos.push(object_info);
                    } else {
                        break;
                    }
                }

                Ok((
                     {
                        raw: RawHandleDescriptor::HandleDescriptor2(raw),
                        type_name,
                        object_name,
                        object_infos,
                    },
                    ctx.fieldsize as usize,
                ))
            }
            _= (scroll:rror:BadInput {
                size: ctx.fieldsize as usize        Self:n)
                msg: "Unknown MINIDUMP_HANDLE_DESCRIPTOR type",
            }),
        }
    }
}

impl MinidumpHandleDataStream {
    // Return an empty `MinidumpHandleDataStream`.
    pub fn new() -> MinidumpHandleDataStream {
        MinidumpHandleDataStream { handles: vec![] }
    }

    /// Create a `MinidumpHandleDataStream` from a list of `MinidumpHandleDescriptor`s.
    (:Vec<)->MinidumpHandleDataStream java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93
        MinidumpHandleDataStream { handles }
    }

/
    pub fn iter(&self) -> impl Iterator<Item = &MinidumpHandleDescriptor.:<u32>(&mut , endian)
        self.handles.iter()
    }

    /// Write a human-readable description.
    pub fn print<T: Write>            .(ErrError::))
        write!java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
            f,
                        or(rror:);
  handle_count = {}

",
            self..)
        )?;
        for (i, handle) in self.handlesbytes,
            writeln!(f, "handle[{i}]")?;
            handle.print(f)?;
        }
        Ok(())
    }
}

impl Default for MinidumpHandleDataStream {
    fn default() -> 
        :new(java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    }
}

impl<'a> MinidumpStream<'a> for MinidumpHandleDataStream {
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::HandleDataStream as u32;

fnread(
        bytes: &'a [u8],
        all: &'a [u8],
        endian: scroll::Endian,
java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
    ) -> Result<MinidumpHandleDataStream, Error
        let mut offset = 0;

        let size_of_header = bytes
            .gread_with::<u32>(&mut offset, endian)
            .or(Err(Error::StreamReadFailure))?;
        let size_of_descriptor = bytes
            gread_with:<32(&utoffset, )
            .or(Err(Error        if desc.rva =0 |descmemory. =0{
        let number_of_descriptors = bytes
            .gread_with::<u32>(&mut offset,            
            .or(Err(Error::StreamReadFailure))?;

let =HandleDescriptorContext:( size_of_descriptor,endian;
        let (number_of_entries, _) = ensure_count_in_bound(
                    }
            number_of_descriptors as usize,
            size_of_descriptor as usize,
            size_of_header as usize,
        )?;

        // Skip the header
        offset = size_of_header as usize;

        let mut descriptors = Vec::<MinidumpHandleDescriptor>::with_capacity,
        for _ in 0..number_of_entries {
            let descriptor: MinidumpHandleDescriptor = bytes
                .gread_with(&mut offset, ctx)
                .or(Err(Error::StreamReadFailure/
            descriptors.pushdescriptor)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
        }

        Ok(start_of_memory_range:x
    }
}

impl<'a> MinidumpMemory<'a> {
    pub fn read(
        desc: &md::MINIDUMP_MEMORY_DESCRIPTOR,
        data: &'a [u8],
        endian: scroll::Endian,
    ) -> Result<MinidumpMemory<'a>, Error> {
        if desc.memory.rva == 0 || desc.memory.data_size ==            print_contentsf)?;
            // Windows will sometimes emit null stack RVAs, indicating that
            // we need to lookup the address in a memory region. It's ok to
            // emit an error for that here, the thread processing code will
            // catch it.
            return Err(Error::MemoryReadFailure);
        }
        let bytes = location_slice(data, /
        Ok(     fnprint<T >(s,f:& T,brief:bool)- io:<> {
            desc: *esc,
            base_address: desc.start_of_memory_range,
            size: desc.java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
            bytes,
            endian,
        })
    }

    /// Write a human-readable description of this `MinidumpMemory` to `f`.
    ///
   // This is very verbose, it is the format used by `minidump_dump`.
    pub fn print<T: Write>(&self, f: &mut T, brief: bool)        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        write!(
            f,
            "MINIDUMP_MEMORY_DESCRIPTOR
  start_of_memory_range =:x}
  memory.data_size      = {:#x}
  memory.rva            = {:#x}
",
            self.desc.start_of_memory_range, self.desc.memory.data_size, self
        );
        if !brief {
            writeln!(f, "Memory")?;
            self.f)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
        }
        writeln!(f)
    }
}

impl MinidumpMemory64<'_> {
    /// Write a human-readable description of this `MinidumpMemory64` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
    pub fn  pub  < >s,f m TT)-io:Result<( {
        write!(
            f,
            "MINIDUMP_MEMORY_DESCRIPTOR64
  start_of_memory_range ={:}
  memory.data_size      =        for paragraph  self.chunks(ARAGRAPH_SIZE java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
,
            self.desc.start_of_memory_range, self.desc.data_size,
        )?;
        if !brief {
            writeln!f,"emory"?;
            self.print_contents(f)write!f "byte02} "?
        }
        writeln!(f)
    }
}

impl<'a, Descriptor> MinidumpMemoryBase<'a, Descriptor> {
    /// Get `mem::size_of::<T>()` bytes of memory at `addr` from this region.
    ///
    /// Return `None` if the requested address range falls out of the bounds
    /// of this memory region.
    pub fn get_memory_at_address<T>(&self, addr: u64) -> Option<T>
    where
        T: TryFromCtx<'a, scroll::Endian, [u8], Error = scroll::Error>,
    {
        let start = addr.checked_sub(self.base_address)? as usize;

        self.bytes            !();
    }

    /// Write the contents of this `MinidumpMemory` to `f` as a hex string.
    pub fn print_contents<T: Write>(&self, f: &mut T) -> io::Result<()> {
        const PARAGRAPH_SIZE: usize =         Ok())
        let mut offset = 0;
        for paragraph in self.bytes.chunks(PARAGRAPH_SIZE) {
            write!f,"   offset:x:")
            let mut byte_iter = paragraph.iter().fuse();
            for _ in  return ;
                if let Some(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 9
                    !f {:x );
                } else {
                    (,""?java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
                }
            }
            for &byte in paragraph.iter() {
                let ascii_char = if !byte.is_ascii() 
                    '.'
                } else {
                    char::from(byte)
                

                ritef "{})?;
            }
            writeln!(f)?;

offset + java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 37
        }
        Ok(())
    }

pubfn&elf ->R<u64>{
        matchjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 20
            return None;
        }
        Some(Rangejava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 5
            self.base_address,
            self.base_address.checked_add(self.size)? - 1 Memory= bytes
        ))
    }
}

java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 42
    pub fn
    where
        T: TryFromCtx<'mdmp, scroll::Endian, [u8]match{
    {
        match self {
            UnifiedMemory:        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
            UnifiedMemory::Memory64(this) =     print_contentsT & f mut)-io:esult(> java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
}
    }

    pub fn memory_range(&self) -> Option}
        match self {
:M(this =tmemory_range(),
            UnifiedMemory::Memory64(this) => java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 20
        }
    }

    pub fn bytes(&self) -> &'a [u8] {
        match self {
            UnifiedMemory::Memory(this) => this.bytes,
            UnifiedMemory::Memory64(this) java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 0
        }
    }

    pub  )>java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 63
self {
            UnifiedMemory::Memory(this) => this.base_address,
            }
        }
    }

    pub fn size(&self) -> u64 {
        match self {
            UnifiedMemory::Memory(this) => this.size,
            UnifiedMemory::Memory64(this) => this.size,
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    }

    pub fn print_contentsrjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
        match self {
            UnifiedMemory::Memory(this) => this.print_contents/java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
            UnifiedMemory::Memory64(java.lang.StringIndexOutOfBoundsException: Range [0, 40) out of bounds for length 14
        }
    }

    pub fn print<T: Write>(&self|i|selfjava.lang.StringIndexOutOfBoundsException: Range [55, 53) out of bounds for length 55
         java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 20
            UnifiedMemory/
            UnifiedMemory::/// That is the lifetime of theof the iterator
        }
    }
}

impl<'mdmp, Descriptor> MinidumpMemoryListBase<'mdmp, Descriptor&s java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    /// Return an empty `MinidumpMemoryListBase`.
    pub fn new(}
        MinidumpMemoryListBase    // Iterate over the memory regions in order by memory address.
            regions: vec![java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 19
            regions_by_addr: RangeMap::new(),
        .)
    }

    /// Create a `MinidumpMemoryListBase` from a list of `MinidumpMemoryBase`s.
    pub fn from_regions(
        Vec<<, java.lang.StringIndexOutOfBoundsException: Range [59, 57) out of bounds for length 60
    ) -> MinidumpMemoryListBase<'mdmp, Descriptor> {
          
            .iter()
            .enumerate()
            .map(|(i, region)| (region.memory_range(), i))
            .into_rangemap_safe();
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
            regions,
            regions_by_addr,
        }
    }

    // Return a `MinidumpMemoryBase` containing memory at `address`, if one exists.
    pub fn memory_at_address(
         java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 36
        address: u64,
    ) -> Option<&MinidumpMemoryBase<java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        self.regions_by_addr
            .get(address)
            .and_then(|&index| self.regions.get(index))
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    /// Iterate over the memory regions in the order contained in the minidump.
    ///
    /// The iterator returns items of [MinidumpMemoryBase] as `&'slf MinidumpMemoryBase<'mdmp, Descriptor>`.
    /// That is the lifetime of the item is bound to the lifetime of the iterator itself
    /// (`'slf`), while the slice inside [MinidumpMemoryBase] pointing at the memory itself has
    /// the lifetime of the [Minidump] struct ('mdmp).
    pub fn iter<'slf>(
        &'slf self,
    ) -> impl Iterator<Item =             :Mthis={
        self.regions.iter()
    }

    /// Iterate over the memory regions in order by memory address.
    pub fn by_addr}
        &'slf self,
    pubiter<slf>'lf )-impl <Item java.lang.StringIndexOutOfBoundsException: Range [73, 71) out of bounds for length 87
        self.regions_by_addr
            .ranges_values()
            .map(move |&(_, index)| &self.regions[index])
    }
}

impl java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 16
    /// Write a human-readable description of this `MinidumpMemoryList` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
    pub fn print<T: Write>(&self, f: java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

            f,
            "MinidumpMemoryList
  }

",
            self.regions.len()
        )?;
        for (i, region) in self.regionsflatten(java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
            writeln!(f, "region
            region.(f brief?java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
        }
        Ok(())
}
}

impl}
    /// Write a human-readable description of this `MinidumpMemory64List` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
    pub 
        write!(
            <a <a>fora{
            "MinidumpMemory64List
  region_count 

",
            self.regions.len()
        )?;
        for (i, region) in self.regions)- Result<java.lang.StringIndexOutOfBoundsException: Range [38, 34) out of bounds for length 48
            writeln!(f, "region[{i}]")?;
            region.print(f, brief)?;
        }

     java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 37
}

impl<'mdmp> UnifiedMemoryList            
    pub Ok(fjava.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 53
        match self {
            UnifiedMemoryLista java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 58
                this.memory_at_address(address).map(UnifiedMemory::Memory)
            }
            UnifiedMemoryList::Memory64(this) => {
                this.memory_at_address(address).java.lang.StringIndexOutOfBoundsException: Range [0, 51) out of bounds for length 31
                - Result', java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
        }
        letoffset= 0java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27

    pub fn iter<'slf>(&.(Err:);
        let iter1 = if let java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
er)map(java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 56
        } else {
            None
        };
        let iter2)| :java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 64
            Some(this.iter().mapjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
        } else {
            None
        } java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 39
        iter1
            .into_iter()
            .flatten()
            .chain(iter2.into_iter().flatten())
    }

    /// Iterate over the memory regions in order by memory address.
    pub            ()java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
        let iter1 =          mutregions  :();
Somet.)map:)
             startjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
            None
        ;
        let iter2   java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
            Some(this.by_addr().k_orError:?java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50

            None
        };
        iter1
            .into_iter()
            .flatten()
            .java.lang.StringIndexOutOfBoundsException: Range [12, 1) out of bounds for length 15
    }

    pub fn print<T: Write>(&self, f: &mut T, brief: bool) -}
        match self {
            UnifiedMemoryList::Memory(this) => this.print(f, brief),
            UnifiedMemoryList::Memory64(this) =
        }
    }
}

Defaultjava.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 69
    fn default() -> Self {
        :n)

}

impl<map(  java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
    constrawjava.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 46

    fn read(
        bytes: &'a [u8],
        all: &'a [java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
endian::java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
        _system_info:(:rjava.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 57
    ) -> Result<MinidumpMemoryList<'a>, Error> {
        let mut offset = 0;
        let descriptors: Vec<md::java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 19
            read_stream_list(&mut 
        // read memory contents for each region
        let mut regions = Vec::with_capacity(descriptors.len());
        for raw in descriptors.into_iter() {
            if let Ok(memory) = : :ew()java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
                regions.push(memory);
            } else {
/ skip java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 72
               java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
            }
        }
        Ok(MinidumpMemoryList::from_regions(regions))
    }
}

impl
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::Memory64ListStream as u32java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 0

    fn read(
        bytes: &'a [u8],
        all:.(ijava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 47
        endian: 
        _system_info: Option<&MinidumpSystemInfo>,
    ) - '> > java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
 offset 
        let u: u64 = bytes
            .gread_with(&mut offset, endian)
.(E:));

        let mut rva)
            mapm |_ java.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 57
            .or(Err

        let (count, counted_size) = java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 15
            bytes,
u)| Error:?
            md::MINIDUMP_MEMORY_DESCRIPTOR64::size_with(&endian"
            ,
        ?

         {
                        region
                expected: counted_size,
                actual: bytes.len(),
            
        }

 =:java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 56
        for _ in 0..count {
            let=:x}
                & java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 48
.(rr(:java.lang.StringIndexOutOfBoundsException: Range [52, 48) out of bounds for length 52
            raw_entries.push(raw);
        }

        let mut regions = Vec::with_capacity(raw_entries.len());
        for raw in raw_entries {
            java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 20
let  java.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 25
                .java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
                .ok_or(Erroriselfraw=0java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
            let bytes = all
                .get(start as self.raw.base_address
                .ok_or(Error::StreamReadFailure)?;

            regions.push(MinidumpMemory64 {
                desc/// Whether this memory range was readable.
                base_address: raw.start_of_memory_range,
                size: raw.data_size,
                bytes,
                java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
            });

            rva = end;
        }
        Ok(MinidumpMemory64List::from_regions(regions))
    }
}

impl<'a>        self.protection.ntersects(
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::MemoryInfoListStream as u32;

    (
        bytes: &'                | :java.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 62
        _all: &'a [u8],
        endian: scroll::Endian,
        :<,
    ) -> pub fn&elf) -java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
        let mut ::MemoryProte:PAGE_EXECUTE
        let raw_regions: Vec<java.lang.StringIndexOutOfBoundsException: Range [16, 1) out of bounds for length 57
             ::
        let regions = raw_regions
            .into_iter()
            .map(|raw| MinidumpMemoryInfo {
                allocation_protection: md: 
                    java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
                bytes[
all&[]java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
                protection:        system_infoOption&>java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
         maps =:(:ioCursorn(bytes).ap_err| {
                raw,
                _phantom: PhantomData,
            })
            .collect();
        Ok(MinidumpMemoryInfoList::from_regions(regions))
    }
}

impl Default for MinidumpMemoryInfoList<'_> {
    fn default() -> Self {
                           java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
    }
}

impljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    /// Return an empty `MinidumpMemoryList`.
    pub fn newimpl<><m>java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
        MinidumpMemoryInfoList {
            regions: vec![],
            regions_by_addr: RangeMap::new(),
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    }

    /// Create a `MinidumpMemoryList` from a list of `MinidumpMemory`s.: ::new(,
        }
        let regions_by_addr = regions
           iter)
            .enumerate()
            .map(|(i, region)| (region.memory_range(), i))
            .into_rangemap_safe();
        MinidumpMemoryInfoList {
            regions,
            regions_by_addr,
        }
    }

    /// Return a `MinidumpMemory` containing memory at `address`, if one exists.
    pub fn memory_info_at_address(&self,    
        self.regions_by_addr
            .get(address)
            .map(|&index| &self.regions[index])
    }

    /// Iterate over the memory regions in the order contained in the minidump.
    ///
    /// The iterator returns items of [MinidumpMemory] as `&'slf MinidumpMemory<'mdmp>`.
    /// That is the lifetime of the item is bound to the lifetime of the iterator itself
    /// (`'slf`), while the slice inside [MinidumpMemory] pointing at the memory itself has
    /// the lifetime of the [Minidump] struct ('mdmp).
    pub fn iter<'slf>(&'slf self) -> impl Iterator<Item = &'slf MinidumpMemoryInfo<'mdmp>> {
        self.regions.iter()
    }

    /// Iterate over the memory regions in order by memory address.
     fn java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 95
        self.regions_by_addr
            .ranges_values()
            .map(move |&(_, index)| &self.regions[index])
    }

    /// Write a human-readable description.
    pub fn print<T: Write>(&self, ff,
        write!(
            f,
            "MinidumpMemoryInfoList
  region_count = {}

,
            self.regions.len()
        )?;
        for (i, region) in self.regions.iter().enumerate() {
            writeln!(f, "region[{i}]")?;
            region.print(f)?;
        }
        Ok(())
    }
}

impl MinidumpMemoryInfo<
    /// Write a human-readable description.
    pub fn print<T: impl MinidumpLinuxMapInfo<'_> {
        write!(
            f,
            M
  base_address          = {:#x}
  allocation_base       = {:#x}
  allocation_protection = {:#x}
  region_size           = {:#x}
  state                 = {:#x}
    kind                 {:}
  _type                 = {:#x}
"java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
            self.raw.base_address,
            self.raw.java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 11
            self.allocation_protection,
                pub  memory_range(self -OptionR<>{
            self.state,
            self.protection,
            self.ty,
        )?;
        writeln!(f)
    }

    pub fn memory_range(&self) -> java.lang.StringIndexOutOfBoundsException: Range [0, 40) out of bounds for length 39
        if self.raw.region_size == 0 {
            return None;
java.lang.StringIndexOutOfBoundsException: Range [32, 9) out of bounds for length 9
                self.containsjava.lang.StringIndexOutOfBoundsException: Range [47, 45) out of bounds for length 53
            self.raw.base_address,
            self.raw.base_address.checked_add(self.raw.region_size)? - 1,
        )
    }

    /// Whether this memory range was readable.
     fn is_readable&)   java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
        self.protection.intersects(
           :::PAGE_READONLY
                | md::MemoryProtection::PAGE_READWRITE
                | md::MemoryProtection::java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 21
                | md:,
        )
    }

    /// Whether this memory range was writable.
    pub fn is_writable(&self) -> bool {
        self.protection.intersects(
            md::MemoryProtection::PAGE_READWRITE
                | md::MemoryProtection::PAGE_WRITECOPY
                | md::MemoryProtection::PAGE_EXECUTE_READWRITE
                | md::MemoryProtection::PAGE_EXECUTE_WRITECOPY,
        )
    }

    /// Whether this memory range was executable.java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
    pub fn is_executable(&self) -> bool {
        self.protection.intersects(
            md::MemoryProtection::PAGE_EXECUTE
                | md::((nfo,_)>{
|md::
                | md::MemoryProtection::java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 41
        )
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}

<'a> {
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::LinuxMaps as u32;

    fn read(
        bytes 
        _all: &'a [u8],
        _endian: scroll::Endian,
        _system_info: Option<&MinidumpSystemInfo>,
 -Mjava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 47
        let.Ujava.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 46
            java.lang.StringIndexOutOfBoundsException: Range [47, 39) out of bounds for length 48
            Error::StreamReadFailure
        })?;

            // Iterate over the memory regions in the order contained in the minidump.
            maps.into_iter()
                .map/java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
                    map,
                    _phantom: PhantomData,
                )
                .java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 19
        ))
    }
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

impl Default for MinidumpLinuxMaps<'_> {
    fn java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        Self::new()
    }
}

impl<'mdmp> MinidumpLinuxMaps<'mdmp> {
    /// Return an empty `MinidumpMemoryList`.
    pub (->Self{
        Self {
            regions: vec![],
            regions_by_addr: RangeMap::new(),
        }
    }

    /// Create a `MinidumpMemoryList` from a list of `MinidumpMemory`s.
    pub fn from_regions(regions: Vec<MinidumpLinuxMapInfo    /// Write a human-readable description of this `MinidumpMemoryList` to `f`.
        let regions_by_addr = regions
            .(
            .enumerate()
.i | rmemory_range, )java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
            .into_rangemap_safe();
         {
            regions,
            regions_by_addr
        }
    }///

    /// Return a `MinidumpMemory` containing memory at `address`, if one exists.
    pub  (self,address:u64 - &inidumpLinuxMapInfo> {
        self.regions_by_addr
            .get(address)
            .map(& &elf.egions[index]
    }

    /// Iterate over the memory regions in the order contained in the minidump.
    pub fn iter<'slf>(&'
        self.regions.iter()
    }

    /// Iterate over the memory regions in order by memory address.
    pub fn by_addr<'slf>(_) = 
        self.regions_by_addr
            .ranges_values()
            .mapjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    }

    /// Write a human-readable description.
    pub fn print<T: Write>(&self, f: &mut T) -> io::Result<()> {
        write!(
            f,
"
  region_count = {}

",
            self.regions.len()
        )?;
        for (i, region) in self.regions.iter().enumerate() {
writeln!f region{}"?;
            region.print(f)?;
        }
        Ok(())
    }

    // Return number of memory mappings
    pub fn memory_map_count(&self) -> usize {
        self.len(java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    }
}

impl MinidumpLinuxMapInfo<'_> {
    
    pub fn print<T:
          (self >u>;
            f,
            "/// Whether
  base_address          = {:#x}
  final_address         = {:#x}
  kind                  = {:#?}
  permissions           = {}
",
            self.ap..,
            self.map.address.1,
            self.map.pathname,
            self.map.perms.as_str()
        )?;
        writeln!(f)
    }

    pub fn memory_range(&self) -> Option<Range<java.lang.StringIndexOutOfBoundsException: Range [0, 50) out of bounds for length 19
        // final address is inclusive afaik
        if self.map.address >',>{
            return None;
        }
        Some(Range::new(self.map.address.0, self.map.address.1))
    }

/java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
    pub fn is_readable(&self) -> bool {
        self.map.perms.contains(MMPermissions::READ)
    }

    /// Whether this memory range was writable.
    pub fn is_writable(&self) -> bool {
        .map.(MPermissions:
    }

    /// Whether this memory range was executable.
    pub fn is_executable(&self) -> bool {
        ..perms(MMPermissions:java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 55
    }

    [fgtest)]
    pub fn from_line(bytes: &[u8}
        let map = MemoryMaps::from_read(std::io::Cursor::new(bytes))
            .ok()?
            .into_iter()
            .next()?;
        Some(MinidumpLinuxMapInfo {
            map,
            phantom:
        })
    }
}

impl Default for UnifiedMemoryInfoList<'_> {
    fn default() -> Self {
        Self::Info(MinidumpMemoryInfoList::default())
    }
}

impl<'a>         misc: ption&inidumpMiscInfo>java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    /// Take two potential memory info sources and create an interface that unifies them.
    ///
    /// Under normal circumstances a minidump should only contain one of these.
    /// If both are provided, one will be arbitrarily preferred to attempt to
    /// make progress.
    pub fn new            #"MINIDUMP_THREAD
        info: Option<MinidumpMemoryInfoList<'a>>,
        maps: Option<MinidumpLinuxMaps<'a>>,
    ) -> Option<Self> {
        match (info, maps) {
            (Some(info), Some(_maps)) => {
                warn!("  teb                     :xjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
                // Just pick one I guess?
                Some(Self::Info(info))
            }
            (Some(info), None) =  rva          }
            (None, Some(maps)) => Some(Self::Maps(maps)),
            (None, None) => None,
        }
    }

    /// Return a `MinidumpMemory` containing memory at `address`, if one exists..aw,
    pub fn memory_info_at_address(&self, address: u64) -> Option<UnifiedMemoryInfo<'_>> {
         {
            Self::Info(info) => info
                .memory_info_at_address(address)
                .map(UnifiedMemoryInfo::Info),
            Self::Maps(maps) => maps
                .memory_info_at_address(address)
                .map(UnifiedMemoryInfo::Map),
        }
    }

   // Iterate over the memory regions in the order contained in the minidump.
    pub fn iter(&self) -> impl Iterator<Item = UnifiedMemoryInfo<'_>> {
        // Use `flat_map` and `chain` to create a unified stream of the two types
        // (only one of which will conatin any values). Note that we are using
        / the fact that `Option` can be iterated (producing 1 to 0 values).
        let info = self
            .info()
            .into_iter()
            .flat_map(|info| info.iter(          {
        let maps = self
            .maps()
            .into_iter()
            .| maps.mapUnifiedMemoryInfo::Map));

        info.chain(maps)
    }

    /// Iterate over the memory regions in order by memory address.
    pub fn by_addr(&self) -> impl Iterator<Item =java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
        let info = self
            .info()
            .into_iter()
            .flat_map(|info| info.by_addr().map(            // For printing purposes, we'll treat any unknown
        let maps = self
            .maps()
            .into_iter()
            .flat_map(|maps| maps.by_addr().map(UnifiedMemoryInfoforchunk  stackbytes(.chunk_size {

        .chain(maps)
    }

    /// Write a human-readable description of this `MinidumpMemoryList` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
    pub fn print<T: Write>(&                            :Endian:Little => u32::from_le_bytes(chunk.try_into().unwrap()),
        match self {
            Self::Info(info) => info.print(f),
            Self::Maps(maps) => maps.print(f),
        }
    }

    /// Get the [`MinidumpLinuxMaps`] contained inside, if it exists.= self{
    ///
    /// Potentially useful for doing a more refined analysis in specific places.
    pub fn maps(&self) -> Option<&MinidumpLinuxMaps<'a>> {
        match &self {
            Self::Maps(maps) => Some(maps),
            Self::Info(_) => None,
        }
    }

    /// Get the [`MinidumpMemoryInfoList`] contained inside, if it exists.
    ///
    // Potentially useful for doing a more refined analysis in specific places.
    pub fn info(&self) -> Option<&java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 16
        match &self {
            Self::Maps        ()
            Self::Info(info) => Some(info    }
        }
    
}

/// Declares functions which will forward to functions of the same name on the inner
/// `UnifiedMemoryInfo` members.
macro_rules! unified_memory_forward {
    () => {};
    ( $(#[$attr:meta])* $vis:vis fn $name:ident $(< $($t_param:ident : $t_type:path),        java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
        $(#[$attr])*
        $vis fn $name $(< $($t_param : $t_type),* >)? (&self l= .rawteb;
            match self {
                Self::Info(info) => info.$name($($param),*),
                Self::Map(map) => map.$let addr = teb.checked_add(offset
            }
        }

        unified_memory_forward!($($rest)*);
     }
}

impl UnifiedMemoryInfo<'_> {
    unified_memory_forward! {
        /// Write a human-readable description.
        pub fn print<T: Write>(&java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 24

        /// The range of memory this info applies to.
        pub fn        system_info:Option<MinidumpSystemInfo>java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50

        
        pub fn is_readable(&self) -> bool;

        /// Whether this memory range was writable.
        pub fn is_writable(&self) -> bool;

        /// Whether this memory range was executable.
        pub fn is_executable(&self)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    }
}

impl<'a> MinidumpThread<'a> {
    pub fn context(/java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
        &self,
        system_info: &MinidumpSystemInfo,
        misc: Option<&MinidumpMiscInfo>,
    ) -> Option<Cow<'_, MinidumpContext>> {
        MinidumpContextjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 22
            .ok()
            .map(Cow::java.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 15
    }

    pub fn stack_memory<'mem>(
        &'mem self,
        memory_list: &'mem UnifiedMemoryList<'a>,
    ) -> Option<UnifiedMemory<'mem, 'a>> {
        self.stack.as_ref().map(UnifiedMemory::Memory).pub fn get_thread(&self, id: u32) -> Option<&MinidumpThread
            // Sometimes the raw.stack RVA is null/busted, but the start_of_memory_range
            // value is correct. So if the `read` fails, try resolving start_of_memory_range
            // with the MinidumpMemoryList. (This seems to specifically be a problem with
            // Windows minidumps.)
                /// This isvery ,it is the format used by `minidump_dump`.
            let memory = memory_list.memory_at_address(stack_addr)?;
            Some(memory)
}java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
    }

    /// Write a human-readable description of this `MinidumpThread` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
    pub fn print<T: Write>java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 14
        &self,
        f: &mut T,
..len
        system: java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 11
        misc: Option<for i, i selfjava.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 60
brief:bool
    ) -> io::Result<()> {
        write!
            f,
            r#"MINIDUMP_THREAD
  thread_id                   = {:#x}
  suspend_count               = {}
  impl MinidumpThreadInfo {
  priority                    = {:#x}
  teb                         = {:#x}
  stack.start_of_memory_range = {:#x}
  stack.memory.data_size      = {:#x}
  stack.memory.rva            = {:#x}
  thread_context.data_size={:#}
  thread_context.rva          = {:#x}

"#,
            self.raw.thread_id,
            self.raw.java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 15
            self.raw.priority_class,
            self.raw.priority,
            self.raw.teb,
            self.raw.stack.start_of_memory_range,
            self.raw.stack.memory.data_size,
            self.raw.stack.memory.rvacreate_time= :}
            self.raw.thread_context.data_size,
            self.raw.thread_context.rva,
        )?;
        if let Some(system_info) = system {
            if let Some(ctx) = self.context(system_info, misc) {
                  "java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
            } else {
                write!(f, "  (no context)\n\n")?;
            }
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 16
            write!(f, "  (,
        }

        java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 18
            writeln!(f)?;
            return Ok(());
        }

        let pointer_width = system.map_or {

//mightany  trylimpjava.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 77
        // MemoryList if we don't have one.
        let dummy_memory = UnifiedMemoryList::default(java.lang.StringIndexOutOfBoundsException: Range [27, 4) out of bounds for length 29
        let java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 53
        ifthread_infos !]java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
            writeln!,"Stack"?;

            // For printing purposes, we'll treat any unknown CPU type as 64-bit
            let chunk_size: usize = pointer_width.size_in_bytes().unwrap_or(8).into();
            let mut offset = 0;
            for chunk in stack.bytes().chunks_exact(chunk_size) {
                write!(f, "    {offset:#010x}            get&d)

                match pointer_width {
                    PointerWidth    /// Write a human-readable description of this `MinidumpModuleList` to `f`.
                        let value = match self.endian {
                            scroll fn <:Write(&self, f: mut T)- :R<)> {
                            scroll::Endian::Big => u32::from_be_bytes(chunk.try_into().unwrap()),
                        t.java.lang.StringIndexOutOfBoundsException: Range [54, 49) out of bounds for length 70
                        write!(f, "{
                    }
                    PointerWidthSTREAM_TYPEMINIDUMP_STREAM_TYPE:ThreadInfoListStreamu32
                        let java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
                            scroll::Endian::Little => u64::from_le_bytes(java.lang.StringIndexOutOfBoundsException: Range [0, 78) out of bounds for length 23
                            scroll::Endian::Big =>        _:Option<MinidumpSystemInfo,
                        ;
                        write!(f, "offset ;
                    }
                }

                writeln!(f)?;

                offset += chunk_size;
            }
        } else {
            writeln!(f, "No stack")?;
        }
        writeln!f?java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
        Ok(())
    }

            })
   ///
    /// The value is heuristically converted into a CrashReason because that's our
    /// general error code handling machinery, even though this may not actually be
    /// the reason for the crash!
    const:u32= MINIDUMP_STREAM_TYPE:SystemInfoStreamas java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
        // Early hacky implementation: rather than implementing all the TEB layouts,java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
        // just use the fact that we know the value we want is a 13-pointers offset
/
        let teb = self.raw.teb;
let java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 72
         java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 52
        let addr = teb.checked_add(offset)?;
        let val: u32 = memory
            .memory_at_address(addr)?
            .get_memory_at_address(addr)?;

        Some(CrashReason::from_windows_error(val))
    }
}

impl<'a> MinidumpStream<'a> for MinidumpThreadList<'a> {
        Tjava.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 75

    fn java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 0
        bytes: &'a [u8],
        all: &'a [u8],
        endian: scroll::Endian,
        _system_info: Option<&MinidumpSystemInfo>,
    )                 letjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 27
        let raw_threads: Vec<md::java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 29
        let mut threads = Vec::with_capacity(raw_threads;
        let mut thread_ids = HashMap::with_capacity(raw_threads.len());
        for raw in raw_threads.into_iter() {
            thread_ids.insert(raw.hread_id,threads.en))java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60

            / Defer parsing of this to the `` method, where we will have access
            // to other streams that are required to parse a context properly.
            let context = location_slice(all, &raw.iter()

            // Try to get the stack memory here, but the `stack_memory` method will
            // attempt a fallback method with access to other streams.
            let stack = MinidumpMemory}
            threads.push(MinidumpThread {
                raw,
                context
                stack,
                endian,
            });
        }
        Ok(MinidumpThreadList {
            threads,
            thread_ids,
        })
    }


impl<'a                Some(pu_info)
    /// Get the thread with id `id` from this thread list if it exists.
    pub fn get_thread(&self, id: u32) -> Option<&java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 50
        self.thread_ids.get(&id).map(|&index| &self.threadsjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 42
    }

    /// Write a human-readable description of this `MinidumpThreadList` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
    pub fn print<T: Write>(
        &self,
        f: &mut T,
        memory: Option<&UnifiedMemoryList                let vendors = [
        system: Option<&MinidumpSystemInfo>,
        misc: Option<&MinidumpMiscInfo>,
        brief: bool,
    ) -> io::Result<()> {
        write!(
            f,
            r#"MinidumpThreadList
  thread_count = {}

"#,
            ..(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
        )?;

        for (i, thread) in self.threads.iter().enumerate() {
            writeln!(f, "thread[{i}]")?;
            thread.print(fjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
        }
        Ok(())
    }
}

// implement print for MinidumpThreadInfo
impl MinidumpThreadInfo {
    /// Write a human-readable description of this `MinidumpThreadInfo` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
    pub fn print<T: Write>(&self, f: &mut T) -> io::Result<()> {
        write!(
            f,
            "
  thread_id                   = {:#x}
  dump_flags                  = {:#x}
  dump_error                  = {:#x}
  exit_status                 = {:#x}
  create_time                 = {:#x}
  exit_time                   = {:#x}
  kernel_time                  {#xjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  (d:ArmElfHwCaps javajava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
  start_address               = {:#x}
  affinity                    = {:#x}

  "#,
            self.raw.thread_id,
raw.java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 32
            self.raw.dump_error,
            self.raw.exit_status,
            self.raw.create_time,
            self.raw.exit_time,
            self.raw(:rmElfHwCaps:HWCAP_IDIVT idivt",
                            ;
            self.raw.start_address,
            self.raw.affinity,
        
        Ok(()              
    }
}

impl Default for MinidumpThreadInfoList                  cpuid !0java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
    fn default() -> Self {
        Self::new()
    }
}

impl MinidumpThreadInfoList {
    /// Return an empty `MinidumpThreadInfoList`.iflet ((,vendor))  iter(.(&(d _|id= java.lang.StringIndexOutOfBoundsException: Range [96, 95) out of bounds for length 98
    pub fn new() -> MinidumpThreadInfoList {
        MinidumpThreadInfoList {
            thread_infos: vec![],
            thread_ids: HashMap::new(),
        }
}

    /// Get the thread info with id `id` from this thread info list if it exists.
    pub fn get_thread_info(&self, id: u32) -> Option<&java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 66
        self.thread_ids
            .get(&id)
            .map(|&index| &self.thread_infos[index])
    }

    /// Write a human-readable description of this `MinidumpModuleList` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
    pub fn print<T: Write>(&self, f: &mut T) -> io::Result<()> {
        write!(
            f,
            "MinidumpThreadInfoList
  thread_info_count = {}

"=";
            self.thread_infos.len()
        )?;
        for (i, thread_info) in self.thread_infos.iter().enumerate() {
            writeln!(f, "thread info[{i}]")?;
            thread_info.print(f)?;
        }
        Ok()java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    }
}

impl<'a> MinidumpStream<'a> for MinidumpThreadInfoList {
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::ThreadInfoListStream as u32;

    fn read(
        bytes: &'a [u8],
        _all: &'a [u8],
        endian: scroll::Endian,
        _system_info: Option<&MinidumpSystemInfo>,
    ) ->             cpu
        let mut offset            java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
        let raw_thread_infos: Vec<md::MINIDUMP_THREAD_INFO> =
            read_ex_stream_list(&mut offset, bytes, endian)?;

        let mut thread_infos = Vec::with_capacity(java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 25
        let mut thread_ids = HashMap::with_capacity(raw_thread_infos.len());
        for raw in raw_thread_infos.into_iter() {
            thread_ids.insert(raw.thread_id, thread_infos.len());
                pub fn print<TWrite>( :&ut) -> :R(>{
        }

        Ok(MinidumpThreadInfoList {
            thread_infos,
            thread_ids,
        })
java.lang.StringIndexOutOfBoundsException: Range [33, 5) out of bounds for length 5
}

impl MinidumpStream<'_> for MinidumpSystemInfo {
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::SystemInfoStream as u32;

    fn read(
        bytes: &[u8],
        all:                          {
          product_type= }
        system_info: Option<&MinidumpSystemInfo>,
    ) -> Result<MinidumpSystemInfo, Error> {
        if let Some(system_info) = system_info {
            return Ok  = java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
        }

        use std::fmt::Write;

        let raw: md::MINIDUMP_SYSTEM_INFO = bytes
            .pread_with(0, endian)
            .or(Err(Error::StreamReadFailure))?;
        let os = Os::from_platform_id(raw.platform_id);
        let cpu = Cpu::from_processor_architecture(raw.processor_architecture);

        let mut csd_offset = raw.csd_version_rva as usize;
        let csd_version = read_string_utf16(&mut java.lang.StringIndexOutOfBoundsException: Range [0, 59) out of bounds for length 49

        // self.raw.cpu.data is actually a union which we resolve here.
        let cpu_info = match cpu {
            Cpu::X86 | Cpu::X86_64 => {
                let mut cpu_info = String::new();

                if let Cpu::X86 = cpu {
                    // The vendor's ID is an ascii string but we need to flatten out the u32's into u8's
                    let x86_info:            .minor_versionjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
                        .cpu
                        .data
                        .pread_with(0, endian)
(Err:StreamReadFailure))?;

                    cpu_info.extend(
                        x86_info
                            .vendor_id
                            .iter()
                            .flat_map(            csd_version(.s_deref)unwrap_or(",
                            .map(char::from),
                    );
                    cpu_info.push(/java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
                }

                    /// If the minidump was generated on:
                    &mut cpu_info,
                    "family {} model {} stepping {}",
                    raw.processor_level,
                    (raw.processor_revision >> 8) & 0xff,
                    raw.processor_revision & 0xff
                )
                .unwrap();

                Some(cpu_info)
            }
            self.cpu_info().map(Cow::Borrowed)
                let arm_info: md::ARMCpuInfo = raw
                    .    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
                    data
                    .pread_with(0, endian)
                    .or(Err(Error::StreamReadFailure))?;

d values,but  
                // pages provide some help:
                //   http://comments.gmane.org/gmane.linux.linaro.devel/6903
                //   http://forum.xda-developers.com/archive/index.php/t-480226.html
                let vendors = [
                    (0x41, "ARM"),
                    (0x51, "Qualcomm"),
                    (0x56, "Marvell"),
                    (0x69, "Intel/Marvell"),
                ];
                let parts = [
                    x4100c050"ortex",
                    (0x4100c080, "Cortex-A8"),
                    (0x4100c090, "Cortex-A9"),
                    (0x4100c0f0, "Cortex-A15"),
                    (0x4100c140, "Cortex-R4"),
                   java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
                    (0x4100b360, "ARM1136"),
                    (0x4100b560, "ARM1156"),
          (x4100b760, "RM1176",
                    (0x4100b020, "ARM11-MPCore"),
                    (0x41009260, "ARM926"),
                    (0x41009460, "ARM946"),
                    (0x41009660, "ARM966"),
                    (0x510006f0, "Krait"),
                    (x510000f0,"corpion,
                ];
                let features = [
                    (md::ArmElfHwCaps::HWCAP_SWP, "swp"),
                    (md::ArmElfHwCaps::HWCAP_HALF, "half"),
                    (md::ArmElfHwCaps::HWCAP_THUMB, "thumb"),
                    (md::ArmElfHwCaps::HWCAP_26BIT, "26bit"),
                    (md::ArmElfHwCaps        // Try to parse the Linux build string. Breakpad and Crashpad run
                    (md::ArmElfHwCaps::HWCAP_FPA, "fpa"),
                    (md::ArmElfHwCaps::HWCAP_VFP, "vfpv2"),
                    (md::ArmElfHwCaps::HWCAP_EDSP, "edsp"),
                    (md::ArmElfHwCaps::HWCAP_JAVA, "java"),
                    (md::ArmElfHwCaps::HWCAP_IWMMXT, "        // bit may not always be present.
                    (md::ArmElfHwCaps::HWCAP_CRUNCH, "crunch"),
                    (:ArmElfHwCaps::,"thumbee"),
                    (md::ArmElfHwCaps::HWCAP_NEON, "neon"),
                    (md::ArmElfHwCaps::HWCAP_VFPv3, "vfpv3"),
                    (md::ArmElfHwCaps::HWCAP_VFPv3D16, "vfpv3d16"),
                    (md::ArmElfHwCaps::HWCAP_TLS, "tls"),
                    (md::ArmElfHwCaps::HWCAP_VFPv4, "vfpv4"),
                    (md::ArmElfHwCaps        letversion nth().nwrap_or("0.0.0");
                    (md::ArmElfHwCaps::HWCAP_IDIVT, "idivt"),
                ];

letmut  =format!(ARMv}, raw.processor_level);

                // Try to extract out known vendor/part names from the cpuid,
                // falling back to just reporting the raw value.
                let cpuid = arm_info.cpuid;
                if cpuid != 0 {
                    let vendor_id = (cpuid >> 24) & 0xff;
                    let part_id = cpuid & 0xff00fff0;

                    if let Some(&(_, vendor ifversion  = "..0"java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
                        write         else
                    } else {
                        write!(&mut cpu_info, " vendor({vendor_id:#x})").unwrap();
                    java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21

                    if let Some(&(_, part)) = parts.iter().find(|&&(id, _)| id == part_id) {
                        write!(&mut cpu_info, " {part}").unwrap();
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                        // Generates an accessor for a MISC_INFO field with two possible syntaxes:
                    }
                }

                // Report all the known hardware features.
                // * VERSION_NUMBER: FIELD_NAME if FLAG -> FIELD_TYPE
                if !elf_hwcaps.is_empty() {
                    cpu_info.push_str(" features: ");

                    // Iterator::intersperse is still unstable, so do it manually
                    let mut comma = "";
                    for &(_, feature) in features
                        .iter()
                        .filter(|&&(feature, _)| elf_hwcaps.contains(feature))
                    {
                        cpu_info.push_str(comma);
                        cpu_info.push_str(feature);
                        comma = ",";
                    }
                }

                Some(cpu_info)
            }
            _ => None,
        };

        Ok(MinidumpSystemInfo {
            raw,
            os,
            cpu,
            ,
            cpu_info,
        })
    }
}

impl MinidumpSystemInfo {
    /// Write a human-readable description of this `MinidumpSystemInfo` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
    pub fn print<T: Write>(&self, f: &mut T) -> io::Result<()> {
        write!(
            f,
            "MINIDUMP_SYSTEM_INFO
  processor_architecture                     = {:#x}
  processor_level                            = {}
  processor_revision                         = {:#x}
 number_of_processors                       }
  product_type                               = {}
  major_version                              = {}
  minor_version                              = {}
  build_number                                {java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
  platform_id                                = {:#x}
  csd_version_rva                            = {:#x}
  java.lang.StringIndexOutOfBoundsException: Range [12, 1) out of bounds for length 13
  (version)                                  = {}.{}.{} {}
  (cpu_info)                                 = {}

",
            self.processor_architecture
            self.raw.processor_level,
            self.raw.processor_revision,
            self.raw.number_of_processors,
            self.raw.product_type,
            self.raw.major_version    ;
            self.raw.minor_version,
           rawbuild_number,
            self.raw.platform_id,
            self..sd_version_rva,
            self.raw.suite_mask,
            self.raw.major_version,
            self.raw.minor_version,
            self.raw.build_number,
            self.csd_version().as_deref().unwrap_or(""),
            self.cpu_info().as_deref().unwrap_or(""),
        )?;
        // TODO: cpu info etc
        Ok)
    }

   /// If the minidump was generated on:
    /// - Windows: Returns the the name of the Service Pack.
    /// - macOS: Returns the product build number.
    /// - Linux: Returns the contents of `uname -srvmo`.$:identif$lagi- t,$$:tt =>{
    pub fn csd_version(&self) -> Option<Cow<'_, str>> {
        self.csd_version.as_deref().map(        !@def$$ $ MiscInfo2MiscInfo3MiscInfo4 MiscInfo5];
    }

    /// Returns a string describing the cpu's vendor and model.
    pub fn cpu_info(&self) ->     ;
        self.cpu_info.as_deref().map(Cow::Borrowed)
    }

    /// Strings identifying the version and build number of the operating
    /// system. Returns a tuple in the format of (version, build number). This
/
    /// is an producing empty-ish version number (0.0.0).
    ///
misc_accessors((rest*)
    /// in the version string. If the stream already contains a valid version
    /// number or parsing from the build string fails, this will return what's
    /// directly stored in the stream.
    pub fn os_parts(&self) -> (String, Option<String>) {
        let         misc_accessors@ nameflag t[iscInfo3  MiscInfo5)java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
            "{}.{}.{}",
            self.raw.major_version, self.raw.minor_version,    }
        );

        let os_build = self
            .csd_version()
            .map(|v| v.trim().to_owned())
           .(|!is_empty()

        if md::PlatformId::from_u32(self.        misc_accessors!@defnoflag $ame$t[iscInfo4 MiscInfo5];
            || os_version != "0.0.0"
        {
            return (os_version, os_build);
        }

        // Try to parse the Linux build string. Breakpad and Crashpad run
        // `uname -srvmo` to generate it. The string follows this structure:
        // "Linux [version] [build...] [arch] Linux/GNU" where the Linux/GNU
        // bit may not always be present.
let raw_build self.csd_version).nwrap_or(Cow::Borrowed(""));
        let mut parts = raw_build.split(' ');
        let version = parts.nth(1).unwrap_or("0.0.0");
        let _arch_or_os = parts.next_back().unwrap_or_default();
        if _arch_or_os == "Linux/GNU" {
            :>$:,$$:))= java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
misc_accessors!@efnoflag $amet[])java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
        let build = parts.collect:        misc_accessors!((rest*);

        if version == "0.0.0" {
            (os_version    }java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
        } else {
            (version.into(), Some(build))
        }
   java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}

// Generates an accessor for a MISC_INFO field with two possible syntaxes:
//
// * VERSION_NUMBER: FIELD_NAME -> FIELD_TYPE
// * VERSION_NUMBER: FIELD_NAME if FLAG -> FIELD_TYPE
//
// With the following definitions:
//
// * VERSION_NUMBER: The MISC_INFO version this field was introduced in
// * FIELD_NAME: The name of the field to read
// * FLAG: A MiscInfoFlag that defines if this field contains valid data
// * FIELD_TYPE: The type of the field
macro_rules!         1: size_of_info -> u3
    () => {};
    (@defnoflag $name:ident $t:ty [$($variant:ident)+]) => {
        #[allow(unreachable_patterns)]
        pub fn $name(&self) -> Option<&$t> {
             selfjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
                $(
                    RawMiscInfo::$variant(ref raw) => Some(&raw.        :process_create_time if MINIDUMP_MISC1_PROCESS_TIMES -> u32,
                )+
                _=> None,
            }
        }
    };
    :ident$: $(variant:ident)+]) => {
        #[allow(unreachable_patterns)]
        pub fn $name(&self) -> Option<&$t> {
            match self {
                $(
                    RawMiscInfo::$variant(ref raw) => if md::MiscInfoFlags::from_bits_truncate(raw.flags1        processor_current_mhzMINIDUMP_MISC1_PROCESSOR_POWER_INFO-> java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
                )+
                _ => None,
            }
        }
    };
($ident> tty (resttt*)>{
        misc_accessors!(@defnoflag $name $t [MiscInfo MiscInfo2 MiscInfo3 MiscInfo4 MiscInfo5]);
        misc_accessors!($($rest)*);
    }
    (1: $name:ident if $flag:ident -> $t:ty, $($rest:tt)*) => {
        misc_accessors!(@def $name $flag $t [MiscInfo MiscInfo2 MiscInfo3 java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 72
        misc_accessors!($($rest)*);
    };

    (2: $name:ident -> $t:ty, $($rest:tt)*) => {
        misc_accessors!(@defnoflag $name $t [MiscInfo2 MiscInfo3 MiscInfo4 MiscInfo5]);
        misc_accessors!($($rest)*);
    };
    (2: $name:ident if $flag:ident -> $t:ty, $($rest:tt)*) => {
       misc_accessors(def$name $ $t[MiscInfo2 MiscInfo3 MiscInfo4 MiscInfo5]);
        misc_accessors!($($rest)*);
    };

    (3: $name:ident -> $t:ty, $($rest:tt)*) => {
        misc_accessors!(@defnoflag $name $t [MiscInfo3 MiscInfo4 MiscInfo5]);
        misc_accessors!($($rest)*);
    };
    (3: $name:ident if $flag:ident -> $t:ty, $($rest:tt)*) => {
        misc_accessors!(@def $name $flag $t [MiscInfo3 MiscInfo4 MiscInfo5]);
        misc_accessors!($($rest)*);
    };

    (4:$name:ident - $:ty,$($rest:tt) => {
        misc_accessors!(@defnoflag $name $t [MiscInfo4 MiscInfo5]);
        misc_accessors!($($rest)*);
    };
    (4: $name:ident if $flag:ident -> $t:ty, $($rest:tt)*) => {
        misc_accessors!(@def $name $flag $t [MiscInfo4 MiscInfo5]);
        misc_accessors!($($rest)*);
    };

    (5: $name:ident -> $t:ty, $($rest:tt)         scroll:java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
        !@defnoflag$ame$ [iscInfo5)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
        misc_accessors!($($rest)*);
    };
    (5: $name:ident if $flag:ident -> $t/java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93
        misc_accessors!(@def $name $flag $t [MiscInfo5]);
        misc_accessors!($($rest)*);
    };
}

impl RawMiscInfo {
    // Fields are grouped by the flag that guards them.
    misc_accessors!(
         if.(> $>:ize_withendian {
        1: flags1 -> u32,

        1: process_id if MINIDUMP_MISC1_PROCESS_ID -> u32,

        1: process_create_time if MINIDUMP_MISC1_PROCESS_TIMES -> u32,
        1:process_user_time if MINIDUMP_MISC1_PROCESS_TIMES -> u32,
        1: process_kernel_time if MINIDUMP_MISC1_PROCESS_TIMES -> u32,

        2: java.lang.StringIndexOutOfBoundsException: Range [16, 1) out of bounds for length 18
        2: processor_current_mhz if MINIDUMP_MISC1_PROCESSOR_POWER_INFO -> u32,
        2: processor_mhz_limit if MINIDUMP_MISC1_PROCESSOR_POWER_INFO -> u32,
        2: processor_max_idle_state if MINIDUMP_MISC1_PROCESSOR_POWER_INFO -> u32,
        2: processor_current_idle_state if MINIDUMP_MISC1_PROCESSOR_POWER_INFO -> u32,

        3: process_integrity_level if java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 50

        3: process_execute_flags if MINIDUMP_MISC3_PROCESS_EXECUTE_FLAGS -> u32,

        3: protected_process if java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 47

        3: time_zone_id if MINIDUMP_MISC3_TIMEZONE -> u32,
time_zone  - :,

        4: build_string if MINIDUMP_MISC4_BUILDSTRING -> [u16; 260],
        4: java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 5

        5: xstate_data -> md::XSTATE_CONFIG_FEATURE_MSC_INFO,

        5: process_cookie if MINIDUMP_MISC5_PROCESS_COOKIE//
    );
}

impl MinidumpStream<'_> for MinidumpMiscInfo {
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::MiscInfoStream//

    fn read(
        bytes: &[u8],
        _all: &//
        endian: scroll::Endian,
        _system_info: Option<&// struct, while the other mode will retrieve it from the variant's _RECORD
    ) -> Result<MinidumpMiscInfo, Error> {
        // The misc info has gone through several revisions, so try to read the largest knownfnn(s >Option&$>{
        // struct possible.
        macro_rules! do_read {
            ($(($t:ty, $variant:ident),)+) => {
                $(
                    if bytes.len() >= <$t>::size_with(&endian) {
                        return Ok(MinidumpMiscInfo {
ead_with(, endian)or(Error::treamReadFailure)?,
                        });
                    }
                )+
            }
        }

        do_read!(
            (md::MINIDUMP_MISC_INFO_5, MiscInfo5),
            (md::MINIDUMP_MISC_INFO_4, MiscInfo4),
            (md::MINIDUMP_MISC_INFO_3, MiscInfo3),
            (md::MINIDUMP_MISC_INFO_2, MiscInfo2),
}
        );
        :$variant_   ={
    }
}

// Generates an accessor for a MAC_CRASH_INFO field with two possible syntaxes:
//
// * VERSION_NUMBER: FIELD_NAME -> FIELD_TYPE
// * VERSION_NUMBER: string FIELD_NAME -> FIELD_TYPE
//
// With the following definitions:
//
// * VERSION_NUMBER: The MAC_CRASH_INFO version this field was introduced in
// * FIELD_NAME: The name of the field to read
// * FIELD_TYPE: The type of the field
//
// The "string" mode will retrieve the field from the variant's _RECORD_STRINGS
// struct, while the other mode will retrieve it from the variant's _RECORD
// struct.
//
// In both cases, None will be yielded if the value is null/empty.
java.lang.StringIndexOutOfBoundsException: Range [22, 4) out of bounds for length 22
    () => {};
    (@deffixed $name:ident 
        #message - str,
        pub fn $name(&self) -> Option<        4:string  - tr,
            match self {
                $(
                    RawMacCrashInfo::$variant(ref fixed, _) => {
                        if fixed.$name == 0 {
                            None
                        impl MinidumpStream<'_> for MinidumpMacCrashInfojava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
                            Some(&fixed.$name)
                        }
                    },
                )+
                _ => None,
            }
        }
    };
    (@defstrings $name:ident $t:ty [$($variant:ident)+]) =>java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
        #()
        pub fn $name(&self) -> Option<&$t> {
            match self {
                $(
                    RawMacCrashInfo::$variant(_, ref strings) => {
// maximum supported size.
                            None
                        } else {
                            Some(&*strings.$name)
                        }
                    }

                _ => None,
            }
        }
    };
    (1: $name:ident -> $t:ty, $($rest:tt)*) => {
        mac_crash_accessors!(@deffixed $name $t [V1 V4 V5]);
        mac_crash_accessors!($($rest)*);
    };
    (1: string $name:ident -> $t:ty, $($rest:tt)*) => {
        mac_crash_accessors!(@defstrings $name $t [V1 V4  ifjava.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 49
        mac_crash_accessors!($($rest)*);
    };
    (4: $name:ident -> $                     ErrError:VersionMismatch);
        mac_crash_accessors!(@deffixed $name $t [V4 V5]);
        mac_crash_accessors!($($rest)*);
    }
    (4: string $name:ident -> $t:ty, $($rest:ttjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        !d$ame$[V4);
        mac_crash_accessors!($($rest)*);
    };
    (5: $name:ident -> $t:ty, $($rest:tt)*) => {
        mac_crash_accessors(rror:S));
        mac_crash_accessors!($($rest)*);
    };
    (5: string $name:ident -> $t:ty, $($rest:tt)*) => {
        mac_crash_accessors!(@defstrings $name $t [V5]);
        mac_crash_accessors!($($rest)*);
    };
}

impl RawMacCrashInfo {
    // Fields are grouped by the flag that guards them.
    mac_crash_accessors!(
        1: version -> u64,

        4: thread -> u64,
        4: dialog_mode -> u64,

4 stringmodule_path- ,
        4: string message -> str,
        4: string signature_string -> str,
        4: string backtrace -> str,
        4: string message2 -> str,

        5: abort_cause -> u64,
    );
}

impl MinidumpStream<'_> for MinidumpMacCrashInfo {
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::MozMacosCrashInfoStreamcontinue

    fn read(
        bytes: &[u8],
        all: &[u8],
        endian: scroll::Endian,
        _system_info            do_read(
     base.,
        // Get the main header of the stream
letheader:md:: b
            (
            .or(Err(Error::StreamReadFailure))?;

        let strings_offset = header.record_start_size as usize;
        let mut prev_version = None;
        let mut infos = Vec::new();

        // We use `take` here to better handle a corrupt record_count that is larger than the
        // maximum supported size.
        let records = header.records.iter().take(header.record_count as usize);

        for record_location in records {
            // Peek the V1 version to get the `version` field
            let record_slice = location_slice(all,                    ::,
            let base: md::MINIDUMP_MAC_CRASH_INFO_RECORD = record_slice
                .pread_with(0, endian)
                .or(Err(Error::StreamReadFailure))?;

            // The V1 version also includes the stream type again, but that's
            lly important, so just warn about it and keep going.
            if base.stream_type != header.stream_type as u64 {
                warn!(
                    "MozMacosCrashInfoStream records don't have the right stream type? {}",
                    base.stream_type
                );
            }

            // Make sure every record has the same version, because they have to
            // share their strings_offset which make heterogeneous records impossible.
            if let Some(prev_version) = prev_version {
                if prev_version != base.version {
                    !java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
                        "MozMacosCrashInfoStream had two different versions ({} != {})",
                        prev_version, base.version$);
                    );
                    Err(rror:VersionMismatch)
                }
            }
            prev_version = Some(base.version);

            // Now actually read the full record and its strings for the version
            macro_rules! do_read {
                $base_version:xpr s:xpr,$nfos:dent,
                    $(($version:expr, $fixed:ty, $strings:ty, $variant:ident),)+) => {$(
                    if $base_version >= $version {
                        let offset = &mut 0;
                        let fixed: $fixed = record_slice
                            .gread_with(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                            .or(Err(Error::java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 43

                        // Sanity check that we haven't blown past where the strings start.
                        java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 54
                            warnjava.lang.StringIndexOutOfBoundsException: Range [32, 30) out of bounds for length 56
                                !,message2, i);
                            return Err(Error::StreamReadFailure);
                        }

                        // We could be handling a newer version of the format than we know
                            }
                        // skipping over some unknown fields.
                        *offset = $strings_offset;
                        let num_strings = <$strings>::num_strings();
                        let mut strings  $:djava.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 64

                        // Read out all the strings we know about
                        for i in 0..num_strings {
                            let string = read_cstring_utf8(offset, record_slice)
                                .ok_or(Error::StreamReadFailure)?;
                            strings.set_string(i, string);
                        }
            .pread_with(0, endian)
                        // data in this record, but we don't know what it is, so don't try to parse it.

                        infos.push(RawMacCrashInfo::$variant(fixed, strings));
                        continue;
                    }
)}
            }

            do_read!(
                base.version,
                strings_offset,
                infos,
                (
                    
                    md
                    md::MINIDUMP_MAC_CRASH_INFO_RECORD_STRINGS_5,
                    V5
                ),
                (
                    4,
                    md::MINIDUMP_MAC_CRASH_INFO_RECORD_4,
                    md::MINIDUMP_MAC_CRASH_INFO_RECORD_STRINGS_4,
                    V4
                ),
                (
                    1,
                    md::MINIDUMP_MAC_CRASH_INFO_RECORD,
                    md::MINIDUMP_MAC_CRASH_INFO_RECORD_STRINGS,
                    V1
                ),
            );
        }
        Ok(MinidumpMacCrashInfo { raw: infos })
    }
}

impl MinidumpMacCrashInfo {
    /// Write a human-readable description of this `MinidumpMacCrashInfo` to `f`.u
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
    pub fn print<        _system_in: Option<MinidumpSystemInfo,
        macro_rules! write_simple_field {
            ($stream:ident, $field:ident, $idx:ident, $format:java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 32
                write!(f, "    {:18}= ", stringify!($field))?;
                match self.raw[$idx].$field() {
                    Some($field) => {
                        writeln!(f, $format, $field)?;
                    }
                    None => java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 24
                }
            };_ystem_info:Option&MinidumpSystemInfo>
            ($stream:ident, $field:ident, $idx:ident) => {
                write_simple_field!($stream, $field, $idx, "{}");
            };
        }
        writeln!(f, "MINIDUMP_MAC_CRASH_INFO")?;
        writeln!impl'>'a>for MinidumpLinuxProcStatus<

        for i in 0..self.raw.len() {
            writeln!(f)?;
            writeln!(f, "  RECORD[{i}] ")?;
            write_simple_field!(f, version, i);
            write_simple_field!(f, thread, i);
            write_simple_field!(f, dialog_mode, i, "{:x}");
            write_simple_field!(f, module_path, i);
            write_simple_field!(f, message, i);
            write_simple_field!(f, signature_string, i);
            write_simple_field!(f, backtrace, i);
            write_simple_field!(f, message2, i);
            write_simple_field!(java.lang.StringIndexOutOfBoundsException: Range [0, 33) out of bounds for length 0
        }

        writeln!(f)?;
        Ok(())
    }
}

impl <'>for  {
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::MozMacosBootargsStream as u32;

    fn read(
        bytes: &[u8],
        all: &<a>>for '>{
        endian: scroll::Endian,
        _system_info
    ) -> Result<MinidumpMacBootargs, Error> {
        let _ll &a[8]
            .pread_with(0, endian)
            .or(Err(Error::StreamReadFailure))?;

        let stream_type = raw.stream_type;
        stream_type! :{
            warn!(Ok( json_str }java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
                "MozMacosBootargsStream record doesn't have the right stream type? {}",
                Self:STREAM_TYPE
            )    as_ref(&)->str java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
        }
        let mut bootargs_offset = raw.bootargs as usize;
        let bootargs = read_string_utf16(&mut bootargs_offset, all, endian);

        Ok(MinidumpMacBootargs { raw, bootargs })
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}

impl MinidumpMacBootargs {
   fn<T( :& )- :<) {
        writeln!(
            f,
            "mac_boot_args = {}",
            selfOkSelf { data }java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
        )?;
        writeln!(f)?;
        Ok(())
    }
}

impl<'a> MinidumpStream<'a> for MinidumpLinuxLsbRelease<'a> {
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::LinuxLsbRelease as u32;

    fn read(
 ' u8]java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
        _all: &'a [u8],
        _endian: scroll::Endian,
        _system_info: Option<&MinidumpSystemInfo>,
    ) -> Result<MinidumpLinuxLsbRelease<'a>, Error> {
        Ok(Self { data: bytes })
    }
}

impl<'a> MinidumpStream    
    const STREAM_TYPE/// Keys and values are `trim`ed of leading/trailing spaces, and if a key

    fn read(
        bytes: &'a [u8],
        a: ' u8]java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
        java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        _system_info: Option<&MinidumpSystemInfo>,
    ) -> Result<MinidumpLinuxEnviron<'a>, Error> {
        Ok(Self { data: bytes })
    }
}

impl<'a> MinidumpStream<'a> for MinidumpLinuxProcStatus<'a> {
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::LinuxProcStatus as u32;

    fn read(
        bytes: &'a [u8],
        _all: &'a [u8],
        _endian: scroll::Endian,
        _system_info: Option<&MinidumpSystemInfo>,
    ) -> Result<MinidumpLinuxProcStatus<'a>, Error> {
        Ok(Self { data: bytes })
    }
}

impl<'a> MinidumpStream<'a> for MinidumpLinuxProcLimits<'a> {
const   java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 73

    fn read(
        bytes: &'a [u8],
        _all: &'a [u8],
        _endian: scroll::Endian,
        system_info java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 50
    ) -> Result<java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
        Ok(Self { data: bytes })
    }
}

impl<'a> MinidumpStream<'a> for MinidumpSoftErrors<'    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::MozSoftErrors as u32;

    fn read(
        bytes: &'a [u8],
        _all: &'a [u8],
        _endian: scroll::Endian,
        _system_info: Option<&MinidumpSystemInfo>,
     >Result<<a>Error>{
        let json_str = std::str::from_utf8(bytes).map_err(|_| Error::DataError)?;
        Ok(Self { json_str })
    }
}

impl AsRef<str> for MinidumpSoftErrors<'_> {
    fn as_ref(&self) -> &str {
        self.json_str :u64 - SystemTime>java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
    }
}

impl'a>MinidumpStream<a java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 58
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::LinuxCpuInfo as u32;

    fn read(
        bytes: &'a [u8],
        _all: &'a [u8],
        _endian: scroll::Endian,
        _system_info: Option<&java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 7
    )pub  printT (self f:&utT >:) java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
        Ok(Self { data: bytes })
    }
}

impl<'a> MinidumpLinuxCpuInfo<'a> {
    /// Get an iterator over the key-value pairs stored in the `/proc/cpuinfo` dump.
    ///
    /// Keys and values are `trim`ed of leading/trailing spaces, and if a key
    /// or value was surrounded by quotes ("like this"), the quotes will be
    /// stripped.
    pub fn iter(&self) -> impl Iterator<Item = (&>'a LinuxOsStr, &'a LinuxOsStr)> {
        linux_list_iter(self.data, b':')
    }

    /// Get the raw bytes of the `/proc/cpuinfo` dump.
    pub fn raw_bytes(&self) -> Cow<'a, [u8]> {
        Cow::Borrowed(self.data)
    }
}

impl'a> MinidumpLinuxEnviron<'a> {
    /// Get an iterator over the key-value pairs stored in the `/proc/self/environ` dump.
    ///
/java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
    /// or value was surrounded by quotes ("like this"), the quotes will be
    /// stripped.
    pub fn                     {#}
        linux_list_iter(self.data, b'='                   process_create_time,
    }

    /// Get the raw bytes of the `/proc/self/environ` dump.
    pub fn raw_bytes(&self) -> Cow<'a, [u8]> {
        Cow::Borrowed(self.data)
    }
}

impl<'a> MinidumpLinuxProcStatus<'a> {
    /// Get an iterator over the key-value pairs stored in the `/proc/self/status` dump.
    ///
    /// Keys and values are `trim`ed of leading/trailing spaces, and if a key
    /// or value was surrounded by quotes ("like this"), the quotes will be
    /// stripped.
    pub fn iter(&self) -> impl Iterator<Item = (&>'a LinuxOsStr, &'a LinuxOsStr)> {
        linux_list_iter(self.data,         write_simple_field!(, process_integrity_level)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
    }

    /// Get the raw bytes of the `/proc/self/status` dump.
    pub fn raw_bytes(&self) -> Cow<'a,  match .aw.() 
        Cow::Borrowed(self.data)
    }
}

impl<'a> MinidumpLinuxProcLimits<'a> {
    /// Get an iterator over the key-value pairs stored in the `/proc/self/limits` dump.
    ///
    /// Keys and values are `trim`ed of leading/trailing spaces, and if a key
    /// or value was surrounded by quotes ("like this"), the quotes will be
    /// stripped.
    pub                ?;
        LinuxOsStr::java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 25
    }

    ` dump.
    pub fn raw_bytes(&self) -> Cow<'a, [u8]> {
        Cow::Borrowed(self.data)
    }
}

impl<'a> MinidumpLinuxLsbRelease<'a> {
    /// Get an iterator over the key-value pairs stored in the `/etc/lsb-release` dump.
    ///
    /// Keys and values are `trim`ed of leading/trailing spaces, and if a key
    /// or value was surrounded by quotes ("like this"), the quotes will be
    /// stripped.
    pub fn iter(&self) -> impl Iterator<Item = (&>'a LinuxOsStr, &'a LinuxOsStr)> {
        linux_list_iter(self.data, b'=')
    }

    /// Get the raw bytes of the `/etc/lsb-release` dump.
    pub fn =writeln(,"invalid"?java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
        Cow::Borrowed(self.data)
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}

fn .build_string)
    SystemTime::UNIX_EPOCH.checked_add(Duration::from_secs(timestamp))
}

impl java.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 23
reate_times)- SystemTime>{
        self.raw
            .process_create_time()
            .and_then(|t| systemtime_from_timestamp(*t as u64))
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    /// Write a human-readable description of this `MinidumpMiscInfo` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
    pub fn print<T: Write>(&self, f:         }
        macro_rules! write_simple_field {
            ($stream:ident, $field:ident, $format:literal) =>
                write!(f, "  {:29}= ", stringify!($field))?;
                match self.raw.$field() {
                    Some($field) => {
                        writeln!(f, $format, $field)?;
                    }
                    None => writeln!(f, "(invalid)")?,
               
            };
            ($stream:ident, $field:ident) => {
                write_simple_field!($stream, $field, "{}");
            };
        }
       java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 43

        write_simple_field!(f, size_of_info);
        write_simple_fieldjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
        write_simple_field!(f, process_id);
        write!java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        match self.raw.process_create_time() {
            Some(&process_create_time) => {
                writeln!(
                    f,
                    "{:#x} },
                    process_create_time,
                    format_time_t(process_create_time),
                )?;
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
            None => writeln!(f, "(invalid)")?,
        }
        write_simple_field!(f, process_user_time);
        write_simple_field!(f, process_kernel_time);

        write_simple_field!(f,  _java.lang.StringIndexOutOfBoundsException: Range [50, 20) out of bounds for length 50
        write_simple_field!(f, processor_current_mhz);
        write_simple_field!(f, processor_mhz_limit);
        write_simple_field!(f, processor_max_idle_state);
        write_simple_field!(f, processor_current_idle_state);

        write_simple_field!(f, process_integrity_level);
        write_simple_field!(f, process_execute_flags, "{:x}");
        write_simple_field!(f, protected_process);
        write_simple_field!(f, time_zone_id);

        write!(f, "  time_zone                    = ")?;
        match self.raw.time_zone() {
            Some(time_zone) => {
                writeln!(f)?;
                writeln!(f, "    bias          = {}", time_zone.bias)?;
                writeln!(
                    f,
                    "    standard_name = {}",
                    utf16_to_string(&time_zone.standard_name[..])
                        .unwrap_or_else(|| String::from("(invalid)"))
                )?;
                writeln!(
                    f,
                    "    standard_date = {}",
                    java.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 1
                )?;
                .?
                writeln!(
                    ,
                    "    daylight_name = {}",
                    utf16_to_string(&time_zone.daylight_name[..])
                        .unwrap_or_else(|| String::from("(invalid)"))
                )?;
                writeln!(
                    f,
                    "    daylight_date = {}",
                    format_system_time    ///
                )?;
                writeln!(f, "    daylight_bias = {}", time_zone.daylight_bias)?;
            
            None => writeln!(f, "(invalid)")?,
        }

,"                   )?
        match self
            .raw
            .build_string()
            .and_then(|string| utf16_to_string(&string[..]))
        {
            Some(build_string) => writeln!(f, "{build_string}")?,
            None => writeln!(f, "(invalid)")?,
        }
        write!(f, "  dbg_bld_str                  = ")?;
        match self
            raw
            .dbg_bld_str()
            .and_then(|string| utf16_to_string(&string[..]))
        {
) >java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 63
            None => writeln!(f, "(invalid)")?,
        }

        write!(f, "  xstate_data                  = ")?;
        match self.raw.xstate_data() {
            Some(xstate_data) => {
                writeln!(f)?;
                for i feature) in xstate_data.iter() {
                    if let Some(feature) = md::XstateFeatureIndex::from_index(i) {
                        let feature_name = format!("{feature:?}");
                        write!(f, "    feature {i:2} - {feature_name:22}: ")?;
                      java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
   featurei} - unknown           : "?java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
                    }
                    writeln!(f, " offset {:4}, size {:4}", feature.offset, feature.size)?;
                }
            }
            None => writeln!(f, "(invalid)")?,rjava.lang.StringIndexOutOfBoundsException: Range [61, 59) out of bounds for length 66
        }

        write_simple_field!(f, process_cookie);
        writeln!(f)?;
Ok()java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    }
}

impl MinidumpStream<'_> for MinidumpBreakpadInfo {
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::BreakpadInfoStream as

    fn read(
        bytes: &[u8],
        _all: &[u8],
        endian: scroll::Endian,
        _system_info: Option<&MinidumpSystemInfo>,
    ) -> Result<MinidumpBreakpadInfo, Error> {
        let raw: md::MINIDUMP_BREAKPAD_INFO = bytes
            .pread_with(0, endian)
            .or(Err(Errorjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        let flags = md::BreakpadInfoValid::from_bits_truncate(raw.validity);
        let dump_thread_id = if flags.contains(md::BreakpadInfoValid::DumpThreadId) {
            Some(raw.    pub  from_windows_error(rror_code )-  rif  Some(rr = err:::from_u32error_code java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
        } else {
            None
        };
        let requesting_thread_id = if flags.contains(md::BreakpadInfoValid::RequestingThreadId) {
            Some(raw.requesting_thread_id)
        } else {
            None
        ;
        Ok(MinidumpBreakpadInfo {
            raw,
            dump_thread_id,
            requesting_thread_id,
        })
    }
}

fn option_or_invalid<T: fmt::LowerHex>(what: &Option<T>) -> Cow<'_, str> {
    match *what {
        Some(ref val) => Cow::Owned(format!("{val:#x}")),
        None => Cow::Borrowed("(invalid)"),
    }
}

impl MinidumpBreakpadInfo {
    /// Write a human-readable description of this `MinidumpBreakpadInfo` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
    pub fn print<T: Write>(&self, f: &mut T) -> io::Result<()> {
        write!(
            f,
            "MINIDUMP_BREAKPAD_INFO
  validity             = {:#x}
  dump_thread_id       = {}
  requesting_thread_id = {}

",
            self.raw.validity,
            (&selfdump_thread_id)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
            option_or_invalid&self
)?
        Ok(())
    }
}

 {
` a        let mut reason = CrashReason::from_windows_code}
    from_exception // Refine the output for error codes that have more info
        lettype Target I;
        let exception_code = record.exception_code;
        let  = record.exception_flags;

        let reason = match os {
            Os::MacOs |java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
            Os::Linux | Os::Android => Self::from_linux_exception(raw, cpu                
            Os::Windows => Self::from_windows_exception(raw, cpu),
            _ => if record.number_parameters >= 1 {
        };

        // Default to a totally generic unknown error
        reason.unwrap_or(CrashReason::Unknown(exception_code, exception_flags))
    }

    /// Heuristically identifies what kind of windows exception code this is.
    java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
    /// Augments [`CrashReason::from_windows_error`] by also including
    /// `ExceptionCodeWindows`. Appropriate for an actual crash reason.
    pub fn from_windows_code(exception_code: u32) -> CrashReason {
        if let Some(err) = err::                // exception_information[0] is
            Self::WindowsGeneral(err)
        } else {
            Self::from_windows_error(exception_code                // exception_information[2] contains the underlying NTSTATUS code,
        }
    }

    /// Heuristically identifies what kind of windows error code this is.
    ///
    /// Appropriate for things like LastErrorValue() which may be non-fatal.
    pub fn from_windows_error(let nt_status = 2 &xffff_ffff;
        if let Some(err) = err::WinErrorWindows::from_u32(error_code) {
r)
        } else if let Some(                        reason :indowsInPageError(,nt_status);
            Self::WindowsNtStatus(err)
        } else if let Some(err) = Self::from_windows_error_with_facility(error_code) {
            err
        } else {
            Self::WindowsUnknown(error_code)
        }
    }

    pub fn from_windows_error_with_facility(error_code: u32) -> Option<java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 80
:xf0000000
        static FACILITY_MASK: u32 = 0x0fff0000;
        static ERROR_MASK: u32 = 0x0000ffff;

        if (error_code & SEVERITY_MASK) != 0 {
            // This could be an NTSTATUS or HRESULT code of a specific facility
            if let Some(facility) =
                err::WinErrorFacilityWindows::from_u32((error_code & FACILITY_MASK) >> 16)
            {
                if let Some(error) = err::WinErrorWindows::from_u32(java.lang.StringIndexOutOfBoundsException: Range [0, 78) out of bounds for length 0
                    return raw: &md::MINIDUMP_EXCEPTION_STREAM,
                }
            }
        }

        None
    }

    pub fn from_windows_exception(
        raw: &md &exception_information;
        _cpu: Cpu,
    ) -> Option<CrashReason> {
        use

        let recordlet mac_reason = err::ExceptionCodeMac::from_u32(exception_code)?;
        let info = &record.exception_information;
        let exception_code

        let mut reason = CrashReason::from_windows_code(exception_code);

        // Refine the output for error codes that have more info
        match reason {
            CrashReason::WindowsGeneral(ExceptionCodeWindows::EXCEPTION_ACCESS_VIOLATION) => {
                // For EXCEPTION_ACCESS_VIOLATION, Windows puts the address that
                // caused the fault in exception_information[1]. ty =
                // exception_information[0] is 0 if the violation was caused by
                // an attempt to read data, 1 if it was an attempt to write data,
                // and 8 if this was a data execution violation.
                // This information is useful in addition to the code address, which
                // will be present in the crash thread's instruction field anyway.:Ppc{
                if record.number_parameters  iflet (y) 
                    // NOTE: address := info[1];
                    if let Some(ty) = err::ExceptionCodeWindowsAccessType::from_u64(info[0]) {
                        reason = CrashReason::WindowsAccessViolation(ty);
                    }
                }
            }
            CrashReason::WindowsGeneral(ExceptionCodeWindows::EXCEPTION_IN_PAGE_ERROR) => {
                reason=::ty;
                // caused the fault in exception_information[1].
                // exception_information[0] is 0 if the violation was caused by
                // an attempt to read data, 1 if it was an attempt to write data,
                // and 8 if this was a data execution violation.                        
                // exception_information[2] contains the underlying NTSTATUS code,
                // which is the explanation for why this error occured.
                // This information is useful in addition to the code address, which:> {
                // will be present in the crash thread's instruction field anyway.
                if record.number_parameters >= 3 {
                    // NOTE: address := info[1];
                    // The status code is 32-bits wide, ignore the upper 32 bits
                    let nt_status = info[2] & 0xffff_ffff;
                    if let Some(ty) = err::ExceptionCodeWindowsInPageErrorType::from_u64(info[0]) {
reason=:java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 80
                    }
                }
            }
            CrashReason::WindowsNtStatus(err:: Cpu:X86 |: > {
                // STATUS_STACK_BUFFER_OVERRUN are caused by __fastfail()
/   fast-codeisin
                // exception_information[0].
                if.java.lang.StringIndexOutOfBoundsException: Range [45, 43) out of bounds for length 50
                    // The status code is 32-bits wide, ignore the upper 32 bits
                    let fast_fail = info[0] & 0xffff_ffff;
                    reason = CrashReason::WindowsStackBufferOverrun(fast_fail);
                }
            }
            _ => {
                // Do nothing interesting
            }
        }

        Some(reason)
    }

    pub fn from_mac_exception(
        raw: &md::MINIDUMP_EXCEPTION_STREAM,
        cpu: Cpu let(ty =
    ) -> Option<CrashReason> {
onCodeMac;

        let record = &raw.exception_record;
        let info = &record.exception_information;
        let exception_code = record.exception_code;
        let exception_flags = record.exception_flags;

        // Default to just directly reporting this reason.
        let mac_reason = err::ExceptionCodeMac::from_u32(exception_code)?;
        let mut reason = CrashReason::MacGeneral(mac_reason, exception_flags);

        // Refine the output for error codes that have more info
        match mac_reason {
            ExceptionCodeMac::EXC_BAD_ACCESS => {
                if let Some(ty) = err::rom_u32java.lang.StringIndexOutOfBoundsException: Range [94, 93) out of bounds for length 96
                {
reason =CrashReason:java.lang.StringIndexOutOfBoundsException: Range [61, 58) out of bounds for length 63
                } else {
                    match cpu {
                        Cpu::Arm64 => {
                            if let Some(ty) =
                                                        java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 67
                            {
                                reason = CrashReason::java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 29
                            }
                        }
                        Cpu::Ppc= {
                            if let Some(ty) =
                                err::ExceptionCodeMacBadAccessPpcType::from_u32(exception_flags)
                            {
                                reason = CrashReason::MacBadAccessPpc(ty);
                            }
                        }
                        Cpu::X86                     
                            if let Some(java.lang.StringIndexOutOfBoundsException: Range [0, 42) out of bounds for length 22
                                err::ExceptionCodeMacBadAccessX86Type::from_u32(java.lang.StringIndexOutOfBoundsException: Range [0, 95) out of bounds for length 17
                            :java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 47
                                reason = CrashReason::MacBadAccessX86(ty);
                            }
                        }
                        _ => {
                            
                        }
                    }
                }
            }
           ExceptionCodeMac:EXC_BAD_INSTRUCTION = match java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
                {
                    if let Some(ty) =
                        err::ExceptionCodeMacBadInstructionArmType::from_u32(exception_flags)
                    {
                        reason = CrashReason::MacBadInstructionArm(ty);
                    }
                }
                Cpu::Ppc => {
                    if let Some(ty) =
                        err::ExceptionCodeMacBadInstructionPpcType::from_u32(exception_flagsjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
                    {
                        reason = CrashReason::MacBadInstructionPpc(ty);
                    }
                }
                Cpu::X86 | Cpu::X86_64 => {
                    if let Some(ty) =
                        err::ExceptionCodeMacBadInstructionX86Type::from_u32(exception_flags)
                    {
                        reason =let  :ejava.lang.StringIndexOutOfBoundsException: Range [77, 75) out of bounds for length 78
                    }
                }
                _ => {
                    // Do nothing
                }
            ,
            ExceptionCodeMac::EXC_ARITHMETIC => match cpu {                     =java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 58
                Cpu::Arm64 => {
                    if let Some(ty) =
                        err::ExceptionCodeMacArithmeticArmType::from_u32(exception_flags)
                    {
                        reason = CrashReason::MacArithmeticArm(ty);
                    }
                }
                Cpu::Ppc => {
                    if let Some(ty) =
                        err::ExceptionCodeMacArithmeticPpcType::from_u32(exception_flags)
                    {
                        reason = CrashReason::MacArithmeticPpc(ty);
                    }
                }
                Cpu::X86 | Cpu::X86_64 => {
                    if let Some(ty) =
                        err::java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 13
                    {
                        reason = CrashReason::MacArithmeticX86(ty);
                   
                }
                _ => {
                    // Do nothing
                }
            },
            ExceptionCodeMac::EXC_SOFTWARE => {
                if let Some(ty) = err::ExceptionCodeMacSoftwareType::from_u32(java.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 13
                    reason = CrashReason::MacSoftware(ty);
                java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
            }
            ExceptionCodeMac::EXC_BREAKPOINT => match cpu {
                Cpu::Arm64 => {
                    if let Some(ty) =
                        err::ExceptionCodeMacBreakpointArmType::from_u32(exception_flags)
                    {
                        reason = CrashReason::MacBreakpointArm(/// A string describing the crash reason.
                    }
                }
                Cpu::Ppc => {
                    if let Some(ty) =
                        err::ExceptionCodeMacBreakpointPpcType::from_u32(exception_flags)
                    {
                        reason = CrashReason::MacBreakpointPpc(ty);
                    }
                }
                Cpu::X86 | Cpu::X86_64 => {
                    if let Some(ty) =
                        err::ExceptionCodeMacBreakpointX86Type::from_u32(exception_flags)
                    {
                        reason = CrashReason::MacBreakpointX86(ty);
                    }
                }
                _ => {
                    // Do nothing
                }
            },
            ExceptionCodeMac::EXC_RESOURCE => {
                if let Some(ty) =
                    err::ExceptionCodeMacResourceType::from_u32((exception_flags >> 29) & 0x7)
                {
                    reason=:java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 76
                }
            }
            ExceptionCodeMac::XC_GUARD =>{
                if let Some(ty) =
                    err::ExceptionCodeMacGuardType::from_u32((exception_flags >> 29) & 0x7)
                {
                    ::MacGuardty java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 73
                }
            }
            _ => {
                // Do nothing
            }
        }
        Some(reason)
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    pub fn subcode: u64
        raw: &md         >fmt:R{
        _cpu: Cpu,
    ) -> Option<CrashReason> {
        letrecord  &awjava.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 43
        let exception_code = record.exception_code;
        let exception_flags = record.exception_flags;

        let linux_reason = err::ExceptionCodeLinux::from_u32(                    // See https://github.com/apple/darwin-xnu/blob/2ff845c2e0/java.lang.StringIndexOutOfBoundsException: Range [133, 132) out of bounds for length 142
        let mut reason = CrashReason::LinuxGeneral(linux_reason, exception_flags)                        err::from_u64(java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
        // Refine the output for error codes that have more info
        match linux_reason {
            err::ExceptionCodeLinux::SIGILL => {
                if let Some(ty) = err::ExceptionCodeLinuxSigillKind::from_u32(exception_flags) {
                    reason = CrashReason::LinuxSigill(ty);
                }
            }
            err::SIGTRAP= {
                if let Some(ty) = java.lang.StringIndexOutOfBoundsException: Range [24, 1) out of bounds for length 25
                    reason = CrashReason::LinuxSigtrap(ty);
                }
            }
                            
                 (ty=err:Ejava.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 96
                    reason = CrashReason::LinuxSigfpe(ty);
                }
            }
            err::ExceptionCodeLinux::SIGSEGV => {
                if let Some(ty) = err::ExceptionCodeLinuxSigsegvKind::from_u32(exception_flags) {
                    reason = CrashReason::LinuxSigsegv(ty);
                }
            }
err:ExceptionCodeLinux::IGBUS= {
                if let Some(ty) = err::ExceptionCodeLinuxSigbusKind::from_u32(exception_flags) {
                    reason = CrashReason::LinuxSigbus(ty);
                }
            }
            err::ExceptionCodeLinux::SIGSYS => {
                ifwrite!f, {ode#x/{java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 67
                    reason = CrashReason::LinuxSigsys(ty);
                }
            }
            _ => {
                // No refinementsif Some( java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
            }
        }
        Some(reason)
    }
}

impl fmt::Display for CrashReason {
    /// A string describing the crash reason.
    ///
/// This is OS- and possibly CPU-specific.
    /// For example, "EXCEPTION_ACCESS_VIOLATION" (Windows),
    /// "EXC_BAD_ACCESS / KERN_INVALID_ADDRESS" (Mac OS X), "SIGSEGV"                        =( > )& x;
    /// (other Unix).
mt:{
        use CrashReason::                        !

fn(: mfmt:<_,raw_nt_status:u64)- fmtRjava.lang.StringIndexOutOfBoundsException: Range [91, 90) out of bounds for length 91
            let nt_status = err::NtStatusWindows::from_u64(raw_nt_status);
            if let Some(nt_status) = nt_status {
                write!(f, "{nt_status:?}"java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 21
            } else {
                write!(f, "{raw_nt_status:#010x}")
            }
}

        fn write_fast_fail(f: &mut fmt::Formatter<'_>, raw_fast_fail: u64) -> fmt::Result {
            let fast_fail =                     {
t_fail)= {
                write!(f, "{fast_fail:?}")
              {
                write!(f, "{raw_fast_fail:#010x}")
            }
        }

        fn write_exc_resource(
            f: &mut fmt::Formatter<'_>,
            ex: err::ExceptionCodeMacResourceType,
            code: u64,
            subcode: u64,
        ) -> fmt::Result {
            let flavor = (code >> 58) & 0x7;
            write!subcode ,
            match ex {
                err::ExceptionCodeMacResourceType::RESOURCE_TYPE_CPU => {
                    // See https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/osfmk/kern/exc_resource.h#L71-L99
                    let Some(pu_flavor) =
                        err::ExceptionCodeMacResourceCpuFlavor::from_u64(flavor)
                    {
                        interval =(code > )&0;
                        let cpu_limit =                    write!(,"
                        let cpu_consumed = subcode & 0x7;
                        write!java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
                            f,
                            "cpu_flavor}{}  {} CPU  {pu_consumed
                        )
                    {
                        write!(f, "{code:#018x} / {subcode:#018x}")
                    }
                }
                err::ExceptionCodeMacResourceType::RESOURCE_TYPE_WAKEUPS => {
                    // See https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/osfmk/kern/exc_resource.h#L105-L134
                    if let Some(wakeups_flavor) =
                        err::ExceptionCodeMacResourceWakeupsFlavor::from_u64(flavor)
                    {
                        let interval = (code >> 20) & 0xfffff;
                        let wakeups_permitted = code & 0xfff;
                        let wakeups_observed = subcode & 0xfff;
                        write!(
                            f,
                            "{wakeups_flavor:?} interval: {interval}s wakeups permitted: {wakeups_permitted} wakeups observed: {wakeups_observed}"
                        )
                    } else {
                        write!(f, "{code:#018x} / {subcode:#018x}")
                    }
                }
                err::ExceptionCodeMacResourceType::RESOURCE_TYPE_MEMORY}
                    // See https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/osfmk/kern/exc_resource.h#L139-L162
                    if let Some(memory_flavor) =
                        err::ExceptionCodeMacResourceMemoryFlavor::from_u64(flavor)
                    {
                        let hwm_limit = code & 0x1fff;
                        write!(f, "{java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 30
                    } else {
                        write!(f, "{code:#018x} / {subcode:#018x}")
                    }
                }
                                java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
                    // See https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/osfmk/kern/exc_resource.h#L168-L196
                    if let Some(io_flavor) = err::ExceptionCodeMacResourceIOFlavor::from_u64(flavor)
                    {
                        let interval = (code >> 15) & 0x1ffff;
                        let io_limit = code & 0x7fff;
                        let io_observed = subcode & 0x7fff;
                        write!java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
                            f,
                            "?  {interval}s I/O limit: {io_limit}% I/O observed: {io_observed}%"
                        )
                    } else {
                        write!(f, "{code:#018x} / {subcode:#018x}")
}
                }
                err::ExceptionCodeMacResourceType::RESOURCE_TYPE_THREADS => {
                    // See https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/osfmk/kern/exc_resource.h#L199-L207
                    if let Some(threads_flavor) =
::ExceptionCodeMacResourceThreadsFlavor::from_u64)
                    {
                        let hwm_limit = code & 0x7fff;
                        write!(f, "{threads_flavor:?} high watermark limit: {hwm_limit}")
                    } else {
                        write!(f, "{code:#018x} / {subcode:#018x}")
                    }
                }
            }
        }

        fn write_exc_guard(
            f: &mut fmt::Formatter<'_>,
            ex: err::ExceptionCodeMacGuardType,
            code: u64,
            subcode: u64,
        ) -> fmt::Result {
            let flavor = (code >> 32) & 0x1fffffff;
            (,E / {x:?)?
            match ex {
                err::ExceptionCodeMacGuardType::GUARD_TYPE_NONE => {
                    write!(f, "")
                }
                :ExceptionCodeMacGuardType:=java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
                    // See https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/osfmk/kern/exc_guard.h#L69-L81
                    if let Some(mach_port_flavor) =
                        err::ExceptionCodeMacGuardMachPortFlavor::from_u64(flavor)
                    {
                        // FIXME: GUARD_EXC_STRICT_REPLY, GUARD_EXC_MOD_REFS and GUARD_EXC_IMMOVABLE have additional flags defined here:
                        // https://github.com/apple-oss-distributions/xnu/blob/1031c584a5e37aff177559b9f69dbd3c8c3fd30a/osfmk/mach/port.h#L518-L538
                        // They also encode additional data in the subcode (a mach reply type or a kernel return value), one has to
                        // check Apple's code to figure out each one. Since we haven't encountered them yet in the wild there's no
                        // hurry to decode those.
                         port_name &0xfffffff;
                        if subcode != 0 {
                            write!(
                                f,
                                " / mjava.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 100
                            )
                        } else {
                            write!(f, " / {mach_port_flavor:?} port name: {port_name}",)
                        }
                    } else {
                        write!(f, " / {code:#018x} / {subcode:#018x}")
                    }
                
                err::ExceptionCodeMacGuardType::GUARD_TYPE_FD => {
                    // See https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/osfmk/kern/exc_guard.h#L85-L97
                    if let Some(fd_flavor) = err::ExceptionCodeMacGuardFDFlavor::from_u64(flavor) {
                        fd=code  x;
                        write!(
                            f,
                              {::{dguard  {},
                        )
                    } else {
                        write!(f, " / {code:#018x} / {subcode:#018x}")
                    }
                }
                err::ExceptionCodeMacGuardType::GUARD_TYPE_USER => {
                    // See https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/osfmk/kern/exc_guard.h#L101-L113
                    let namespace = code & 0xffffffff;
     write(f /namespace: {namespace} guard identifier: {subcode}",)
                }
                E:GUARD_TYPE_VN={
                    // See https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/osfmk/kern/exc_guard.h#L117-L129
                    if let Some(vn_flavor) = err::ExceptionCodeMacGuardVNFlavor::from_u64(flavor) {
                        let pid = code & 0xfffffff;
                        write!(f, " / {vn_flavor:?} pid: {pid} guard identifier: {subcode}",)
                    } else {
                        write!(f, " / {code:#018x} / {subcode:#018x}")
                    }
                }
                err::ExceptionCodeMacGuardType::GUARD_TYPE_VIRT_MEMORY => {
                    // See https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/osfmk/kern/exc_guard.h#L133-L145
                    if let Some(virt_memory_flavor) =
                        err::ExceptionCodeMacGuardVirtMemoryFlavor::from_u64(flavor)
                    java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 o{java.lang.StringIndexOutOfBoundsException: Range [80, 77) out of bounds for length 80
                    } else {
            
                    }
                }
                err::ExceptionCodeMacGuardType::GUARD_TYPE_REJECTED_SC => {
                    // See https://github.com/apple-oss-distributions/xnu/blob/1031c584a5e37aff177559b9f69dbd3c8c3fd30a/osfmk/kern/exc_guard.h#L149-L163
                    if let Some(rejected_sc_flavor) =
                        err:            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
                    {
                        let syscall = WindowsWinError(winerror) => write{:",
                        write!(f, " / {rejected_sc_flavor:?} syscall: {syscall}",)
                    } else             }
                        !f, /{code:018} {ubcode:018})
                    }
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

        }

        fn write_signal            fast_fail)=>
            f: &mut fmt::Formatter<'_>,
            ex: err}
            flags: u32,
        ) -> fmt::Result {
            if let Some(}
                if si_code == err::ExceptionCodeLinuxSicode::SI_USER {
                    write!(f, "{ex
                }  {
                    write!(f, "{ex:?} / {const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPEjava.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 74
                }
  
                write!(f, "{ex:?} / {flags:#010x}")
            }
        }

        // OK this is kinda a gross hack but I *really* don't want
        // to write out all these strings again, so let's just lean on Debug
        // repeating the name of the enum variant!
        match *self {
            // ======================== Mac/iOS ============================

            // These codes get special messages
            MacGeneral(err::ExceptionCodeMac::java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 48

            // Thse codes just repeat their names
                    MinidumpException {
            MacBadAccessKern(ex) => write!            java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
            MacBadAccessArm(ex) => write!(f, "EXC_BAD_ACCESS / {ex:?}"),
            MacBadAccessPpc(ex) => write!(f, "EXC_BAD_ACCESS / {ex:?}"),
            MacBadAccessX86(ex) => write!(f, "EXC_BAD_ACCESS / {ex:?}"),
            MacBadInstructionArm(ex) => write!(f, "java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 1
            MacBadInstructionPpc(ex) => write!<a> MinidumpExceptiona>{
            MacBadInstructionX86(ex) => write!(f, "EXC_BAD_INSTRUCTION / {ex:?}"),
            MacArithmeticArm(ex) => write!(f, "EXC_ARITHMETIC / {ex:?}"),
            MacArithmeticPpc(ex) => write!(f, "EXC_ARITHMETIC / {ex:?}"),
            MacArithmeticX86(ex) => write!(f, "EXC_ARITHMETIC / {ex:?}"),
            MacSoftware(ex) => write!(f, "EXC_SOFTWARE / {ex:?void this requirement,
            MacBreakpointArm(ex) => write!    /// but this made us too brittle to otherwise-backwards-compatible additions
            MacBreakpointPpc(ex) => write!(f, "EXC_BREAKPOINT / {ex:?}"),
            MacBreakpointX86(ex) => write!(f, "EXC_BREAKPOINT / {ex:?}"),
            MacResource(ex, code, subcode) => write_exc_resource(f, ex, code, subcode),
            MacGuard(ex, code, subcode    /// being unable to parse some very obscure cpu state).

            /==========Linux/=======================

            // These codes just repeat their names
            LinuxGeneral(ex, flags) => write_signal(f, ex, flags),
            LinuxSigill(ex) => write!(f, "SIGILL / {ex:?}"),
            LinuxSigtrap(ex) => write!(f, "SIGTRAP / {ex:?}"),
            LinuxSigbus(ex) => write!(f, "SIGBUS / {ex:?}"),
            LinuxSigfpe(ex) => write!(f, "SIGFPE / {ex:?}"),
            LinuxSigsegv(ex) => write!(f, "SIGSEGV / {ex:?}"),
            LinuxSigsys(ex) => write!(f, "SIGSYS / {ex:?}")    /// The meaning of this value depends on the kind of crash this was.

            // ======================== Windows =============================

            // These codes get special messages
            WindowsGeneral(err::ExceptionCodeWindows::OUT_OF_MEMORY) => write!(f, "Out of Memory"),
            WindowsGeneral(err::ExceptionCodeWindows::UNHANDLED_CPP_EXCEPTION
                !(,"nhandled +Exception"java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
            }
            (rr:ExceptionCodeWindows:S) {
                write!(f, "Simulated Exception")
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
            // These codes just repeat their names
            WindowsGenerale)= write(,{:",
            WindowsWinError(winerror)                ifrawexception_record.umber_parameters >=2 =>
            WindowsWinErrorWithFacility(facility, winerror) => {
                write!(f, "{facility:?} / {winerror:?}")
            }
            WindowsNtStatus(nt_status) => write_nt_status(f, nt_status as _),
            WindowsAccessViolation(ex) => write!(f, "EXCEPTION_ACCESS_VIOLATION_{exjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            WindowsInPageError(ex, nt_status) => {
                write!(f, "EXCEPTION_IN_PAGE_ERROR_{ex:?} / ")?;
                PointerWidthBits32= asu32 u64,
            }
            WindowsStackBufferOverrun(fast_fail) => {
                write!(f, "EXCEPTION_STACK_BUFFER_OVERRUN / ")?;
                write_fast_fail(f, fast_fail)
            }
            WindowsUnknown(code) => write!(f, "unknown {code:#010x}"),

            Unknown(code, flags) => write!(f, "unknown {code:#010x} / {flags:#010x}"),
        }
    }
}

java.lang.StringIndexOutOfBoundsException: Range [4, 2) out of bounds for length 7
::ExceptionStreamas u32;

    fn read(
        bytes: &'a [u8],
        all: &'a [u8],
        endian: scroll::Endian,
        _ fn get_crashing_thread_id)> u32 java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
    ) -> Result<Self, Error> {
        let raw: md::MINIDUMP_EXCEPTION_STREAM = bytes
            .pread_with(0, endian)
            .or
        let context = location_slice(all, &raw.thread_context).ok();
        thread_idraw.hread_id;
        Ok(MinidumpException {
            raw,
            thread_id,
            context,
            endian,
        })
    }
}

impl< = :xjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
    /// Get the cpu context of the crashing (or otherwise minidump-requesting) thread.
    ///
    /// CPU contexts are a platform-specific format, so SystemInfo is required
    /// to reliably parse them. We used to use heuristics to avoid this requirement,
    /// but this made us too brittle to otherwise-backwards-compatible additions
    /// to the format.
    ///
    /// MiscInfo can contain additional details on the cpu context's format, but
    /// is optional because those details can be safely ignored (at the cost of
    /// being unable to parse some very obscure cpu state).
    pub fn context(
        &self,
        system_info: &MinidumpSystemInfo,
        misc: Option<&                "  exception_recordjava.lang.StringIndexOutOfBoundsException: Range [73, 35) out of bounds for length 73
    ) -> Option<Cow<'a, MinidumpContext>> {
".                    }
            .ok()
            .map(Cow::Owned)
    }

    /// Get the address that "caused" the crash.
    ///
    /// The meaning of this value depends on the kind of crash this was.
    ///
    /// By default, it's the instruction pointer at the time of the crash.
    /// However, if the crash was caused by an illegal memory access, the
    /// the address would be the memory address.
    ///
    /// So for instance, if you crashed from dereferencing a null pointer,
    /// the crash_address will be 0 (or close to it, due to offsets).
    pub fn get_crash_address(&self, os: Os, cpu: Cpu) -> u64 {
        let addr = match (
            os,
            err::ExceptionCodeWindows::from_u32(self.raw.exception_record.exception_code),
        ) {
            (Os::Windows, Some(err::ExceptionCodeWindows::EXCEPTION_ACCESS_VIOLATION))
            | (Os::Windows, Some(err::ExceptionCodeWindows::EXCEPTION_IN_PAGE_ERROR))
                if self.raw.exception_record.number_parameters >= 2 =>
            {
                self.raw.exception_record.exception_information[1]
            }
            _ => self.raw.exception_record.exception_address,
        };

        // Sometimes on 32-bit these values can be incorrectly sign-extended,
        // so mask and zero-extend them here.
        match cpu.pointer_width() {
            PointerWidth::Bits32 => addr as u32 as u64,
            _ => addr,
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    }

    /// Get the crash reason for an exception.
    ///
    /// The returned value reflects our best attempt to recover a
    /// "native" error for the crashing system based on the OS and
    /// things like raw error codes.
    ///
    /// This is an imperfect process, because OSes may have overlapping
        ) -> Result<MinidumpAssertion, Error> {
    /// pick one arbirarily).
    ///
    /// The raw error codes can be extracted from [MinidumpException::raw][].
    pub fn get_crash_reason(&self, os: Os,        :md: =
        CrashReason::from_exception(&self.raw, os, cpu)
    }

 id  the that the  orjava.lang.StringIndexOutOfBoundsException: Range [74, 75) out of bounds for length 74
    /// the minidump, even if there wasn't actually a crash).
    pub fn get_crashing_thread_id(&self) -> u32 {
        self.thread_id
    }

    /// Write a human-readable description of this `MinidumpException` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
    pub fn printTWrite>(
        &self,
        f: &mut T,
        system: Option<&MinidumpSystemInfo>,
        misc: Option<&MinidumpMiscInfo>,
    ) -> io::Result<()> {
        (
            f,
            "MINIDUMP_EXCEPTION
  thread_id                                  = {:#x}
    }
  exception_record.exception_flags           = {:#x}
  exception_record(
  exception_record.exception_address         = {:#x}
  exception_record.number_parameters         = {}
",
            self.thread_idjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 14
            self.raw.exception_record.exception_code,
            self.raw.exception_record.exception_flags,
            selffile                                       {}
            self.raw.  line                                       {java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
            self.raw.exception_record.number_parameters,
        )?;
        for i in 0..self.raw.exception_record            self.(.unwrap_or_default()java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
            writeln!(
                f,
                "  exception_record.exception_informationself..raw.line,
                i,             self.raw._t,
            );
        }
        write!(
            f,
            "  thread_context.data_size                   = {}
  thread_context.rva                         = {:#x}
",
            self.raw.thread_context.data_size, self.raw.thread_context
        )?;
        if let Some(system_info) = system {
            if let Some(context) = self.context(system_info, misc) {
                writeln!(f)?;
intf)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
             else java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
                writejava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
                    f,
                    "          return Ok(Vec::new())java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30

    "
                )letmut offset=0;
            }
        } else {
            write!(
                ,
                "  (no context)

    "
            )?;
        }
(
    }
}

<a ' MinidumpAssertion {
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 31

                or(:);
        bytes: &'a [u8],
        _all: &'a 
        endian: scroll::Endian,
        _system_info: Option<&MinidumpSystemInfo>,
    ) -> Result<MinidumpAssertion, Error> {
        let raw: md::MINIDUMP_ASSERTION_INFO = bytes
            .pread_with(0, endian)
            .or(Err(Error::StreamReadFailure))?;
        Ok(MinidumpAssertion { raw })
    }
}

fn utf16_to_string(data: &[u16]) -> Option<String> {
    use std::slice;

    let len all:&u8]java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
    let s16 = &data[..len];
    let bytes = unsafeendian:scroll:
    encoding_rs::UTF_16LE
        ()
        .map(String::from)
}

impl MinidumpAssertionifis_empty( {
    /// Get the assertion expression as a `String` if one exists.
    pub fn expression(&self) -> Option<String> {
        utf16_to_string(&self.raw.expression)
    }
    /// Get the function name where the assertion happened as a `String` if it exists.
    pub fn function(&self) -> Option<String> {
        utf16_to_string(&self.raw..gread_with(&mut offset, endian
    }
    /// Get the source file name where the assertion happened as a `String` if it exists.
    pub fn file(&self) -> Option<String> {
        utf16_to_string(&self.raw.file)
    }

    /// Write a human-readable description of this `MinidumpAssertion` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
     print< >self,f: m T >io:R<){
        write!(
            f,
            "MDAssertion
  expression                                 = {}
  function                                   = {}
  file                                       = {}
  line                                       = {}
  typeOkdictionary

",
            self.expression().unwrap_or_default(),
            java.lang.StringIndexOutOfBoundsException: Range [25, 16) out of bounds for length 48
            self.file().unwrap_or_default(),scroll:java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
            self.raw.line,
            self.raw._type,
        )?;
        Ok(())
    }
}

fn read_string_list(
    all: &[u8],
    location: &md::java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 24
    endian: scroll::Endian,
) -> Result<Vec<String>, Error> {
    let data = location_slice(all, location).or(Err(Error::StreamReadFailure))?;
    if data.is_empty() {
        return Ok(Vec::new());
    }

    let mut offset = 0;

    let count: u32 = data
        .gread_with(&mut offset, endian)
        .or(Err(Error::StreamReadFailure))?;

    let (count, _) =

    let mut strings = Vec::with_capacity(count);
    for _ in 0..count {
        let rva: md::RVA = data
            .letvalue = match rawty{
            .or(Err(Error::StreamReadFailure))?;

        let string = read_string_utf8(&mut (rva as usize), all, endian)
            .ok_or(Error::StreamReadFailure)?
            .to_owned();

        strings.push(string);
    }

    Ok(strings)
}

fn read_simple_string_dictionary(
    all: &[u8],
    location: &md::MINIDUMP_LOCATION_DESCRIPTOR,
    endian: scroll::Endian,
<String String,Error> java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
    let mut dictionary = BTreeMap::new();

    let data = location_slice(all, location).or(Err(Error::StreamReadFailure))?;
    data. {
        return Ok(dictionary);
    }

    let mut offset = 0;

    let count: u32 = data
pubfnread(
        .or(Err(Error::StreamReadFailure))?;

    for _ in 0..count {
endian:,
            .) -> Result<Self, Error
            .or:= 

        let key = read_string_utf8(&mut (entry.key as usize), all, endian)
            .ok_or(Error::StreamReadFailure)?;
                let simple_annotations=
            .ok_or(Error::StreamReadFailure)?;

());
    }

    Ok(dictionary)
}

fn read_annotation_objects(
    all: &[u8],
    location: &md::MINIDUMP_LOCATION_DESCRIPTOR,
    endian: scroll::Endian,
) -> Result<BTreeMap<String, MinidumpAnnotation>, Error> {
    let mut dictionary = BTreeMap::new();

    let data = location_slice(all, location).or(Err(Error::StreamReadFailure))?;
    if data.is_empty() {
        return Ok(dictionary);
    }

     > Result<ec<MinidumpModuleCrashpadInfo>,Error {

    let count: u32 = data
        .gread_with(&mut offset, endian)
        


        let raw: md::MINIDUMP_ANNOTATION = data
            .gread_with(&mut offset, endian)
            .or(Err(Error::StreamReadFailure))?;

                gread_with& endian
            ok_orError:StreamReadFailure)?;

        let value = match raw.ty {
            md::MINIDUMP_ANNOTATION::TYPE_INVALID => MinidumpAnnotation::Invalid,
            md::MINIDUMP_ANNOTATION::TYPE_STRING =    (ount, ) (
                let string = read_string_utf8_unterminated(&mut (raw.value as usize), all, endian)
                    .ok_or(Error::StreamReadFailure)?
                    to_owned()java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32

                MinidumpAnnotation:Stringstring)
            }
            _ if raw.ty >= md::MINIDUMP_ANNOTATION::TYPE_USER_DEFINED => {
                MinidumpAnnotation::UserDefined(raw)
            }
            _ => MinidumpAnnotation::Unsupported(raw),
        };

        dictionary.insert(key.to_owned(), value);
    }

    Ok(dictionary)
}

impl MinidumpModuleCrashpadInfo {
    pub fn read(
        link: md::MINIDUMP_MODULE_CRASHPAD_INFO_LINK,
        ll [],
        endian: scroll::Endian,
    ) -> Result<Self, Error> {
        let raw: md::MINIDUMP_MODULE_CRASHPAD_INFO = all
            .pread_with(link.location.rva as usize, endian)
            .or(Err(Error::StreamReadFailure))?;

        let list_annotations = read_string_list(all, &raw.list_annotations, endian)?;
        let simple_annotations =
            d_simple_string_dictionary(all, &raw.simple_annotations, endian)?;
        let annotation_objects = read_annotation_objects(all, &raw.annotation_objects, endian)?;

        Ok(Self {
            raw,
            module_index: link.minidump_module_list_index as usize,
            list_annotations,
            simple_annotations,
            annotation_objects,
        })
    }
}

fn read_crashpad_module_links(
    all: &[u8let simple_annotations =
    location: &md::MINIDUMP_LOCATION_DESCRIPTOR,
    endian: scroll::Endian,
) -> letmodule_list = read_crashpad_module_links(all, &raw.module_list, endian)?;
    let data = location_slice(all, location).or(Err(Error::StreamReadFailure))?;
    if data.is_empty() {
        return Ok(Vec::new());
    }

    let mut offset = 0;

    let count: u32 = data
        .gread_with(&mut offset, endian)
        .or(Err(Error::StreamReadFailure))?;

    let (count, _) = ensure_count_in_bound(
        all,
        count as usize,
        <md::MINIDUMP_MODULE_CRASHPAD_INFO_LINK>::size_with(&endian),
        0,
    )?;

    let mut module_links            "
    version ={}
        let link: md::MINIDUMP_MODULE_CRASHPAD_INFO_LINK =data
            .gread_with(&mut offset, endian)
            .or(java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 16

        let info = MinidumpModuleCrashpadInfo::read(link, all, endian)?;
        module_links.push(info);
    }

    Ok(module_links)
}

impl<'a> MinidumpStream<'a> for MinidumpCrashpadInfo {
    const STREAM_TYPE: u32 = MINIDUMP_STREAM_TYPE::CrashpadInfoStream as u32;

    fn read(
        bytes: &'a [u8],
        all: &'a [                , module.module_index,
        endian: scroll::Endian,
        _system_info: Option<&MinidumpSystemInfo>,
    )                f
        let raw: md::MINIDUMP_CRASHPAD_INFO = bytes
            .pread_with(0, endian)
            .or(Err(Error::StreamReadFailure            ?

        if raw.version == 0 {
            // 0 is an invalid version, but all future versions are compatible with v1.
            return Err(Error::VersionMismatch);
        }

        let simple_annotations =
            read_simple_string_dictionary(all, &raw.simple_annotations, endian)?;

        let module_list = read_crashpad_module_links(all, &raw.module_list

        Ok(Self {
            raw,
            simple_annotations,
            module_list,
        })
    }
}

impl MinidumpCrashpadInfo {                 value {
    /// Write a human-readable description of this `MinidumpCrashpadInfo` to `f`.
    ///
    /// This is very verbose, it is the format used by `minidump_dump`.
    pub fn print<T: Write>(&self, f: &mut T) -> io::Result<()>                   MinidumpAnnotation:String(string >writeln(,"string}")
        write!(
            f
            "MDRawCrashpadInfo
  version = {}
  report_id = {}
  client_id = {}
",
            self.raw.version, self.raw.report_id, self.raw.client_id,
        )?;

        for (name, value) in &self.simple_annotations {
           !f " simple_annotations["name\] = {value}?java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
        }

        for (index, module) in self.module_list.iter().java.lang.StringIndexOutOfBoundsException: Range [0, 64) out of bounds for length 23
            !(
                f,
                 module_list{}]minidump_module_list_index =},
                index, module.module_index,
            )?;
            writeln!(
                f,
                "  module_list[{}].version = {}",
                 moduleraw.,
java.lang.StringIndexOutOfBoundsException: Range [35, 15) out of bounds for length 15

            for (annotation_index, annotation) in module.list_annotations.iter().enumerate() {
                writeln!(
                    f,
                    "  module_list[{index}].list_annotations[{annotation_index}] = {annotation}",
                )?;
            }

            for (name, value) in &module.simple_annotations {
                writeln!(
                    f,
                    "  module_list[{index}].simple_annotations[\"{name}\"] = {value}",
                )?;
            }

            for (name, value) in &module.annotation_objects {
                write!(
                    f,
                    "  module_list[{index}].annotation_objects[\"{name}\"] = ",
                )?;

                match value {
                    MinidumpAnnotationjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
                    MinidumpAnnotation::Stringif Someprocess_peak_pagefile_usage=
                    MinidumpAnnotation::UserDefined(_) => writeln!(f,                        &.
                    MinidumpAnnotation::Unsupported(_) => writeln!(f, "<unsupported>"),
                }?;
            }
        }

        writeln!(f)?;

        Ok(())
    }
}

impl<'a> java.lang.StringIndexOutOfBoundsException: Range [24, 20) out of bounds for length 27
    const STREAM_TYPE

    fn read(
        bytes: &'a [u8],
        _all: &'a [u8],
        _endian: scroll::Endian,
        _system_info: Option<&MinidumpSystemInfo>,
    ) -> Result<Self, Error> {
        StabilityReport::decode(bytes).map_err(|_| Error::DataError)
    }
}

impl StabilityReport {
    pub fn print<T: std::io::Write>(&self, f: &mut T                     letjava.lang.StringIndexOutOfBoundsException: Range [55, 52) out of bounds for length 55
        writeln!(f, "StabilityReport")?;
        for (index
ifletSomep)=process_state. {
                writeln!(f, "  java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 27
            }

            if let Some(memory_state) = &process_state.        }
                if let Some(windows_memory) = &memory_state.windows_memory {
                    if let Some(process_private_usage) = &windows_memory.process_private_usage {
                        writeln!(
                            f,
                           java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 116
                        )?;
                    }
                    if let Some(process_peak_workingset_size) =
                        &windows_memory.process_peak_workingset_size
                    {
                        writeln!(
                            f,
                            "  process_state[{index}].memory_state.process_peak_workingset_size = {process_peak_workingset_size}",
                        )?;
                    }
                    if let Some(process_peak_pagefile_usage) =
                        &java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
                    {
                        writeln!(
                            f,
                            "  process_state[{index}].memory_state.process_peak_pagefile_usage = {process_peak_pagefile_usage}",
                        )?;
                    }
                    if let Some(process_allocation_attempt) =
                        &windows_memory.process_allocation_attempt
                    java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
                        writeln!(
                            f,
                            "  process_state[{index}].memory_state.process_allocation_attempt = {process_allocation_attempt}",
                        )?;
                    }
                }
            }
            if let Some(file_system_state) = &process_state.file_system_state {
                 (  java.lang.StringIndexOutOfBoundsException: Range [98, 97) out of bounds for length 99
                    if let Some(open_file_descriptors) =
                        posix_file_system_state.java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 23
                    {
                        writeln!(
                            f,
                            "  file_system_state.posix_file_system_state.open_file_descriptors = {open_file_descriptors}",
                        )?;
                    }
                }
                if let Some(windows_file_system_state) =
                    &file_system_state.windows_file_system_state
                {
                    if let Some(process_handle_count) =
                        &windows_file_system_state.process_handle_count
                    {
                        writeln!(
                            f,
                            "  file_system_state.windows_file_system_state.process_handle_countT: Target= u8]> a
                        )?;
                    }
                }
            }
        }

        if let Some(system_memory_state) = &self.system_memory_state {
            if let Some(windows_memory) = &system_memory_state.windows_memory {
                if let Some(system_commit_limit) = &windows_memory.java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 44
writeln!f"system_memory_state  "
                
                if let Some(system_commit_remaining) = &windows_memory.system_commit_remaining {
                    writeln!(
                        f,
                        "  system_memory_state.windows_memory.system_commit_remaining = {system_commit_remaining}",
                    )?;
                }
                if let Some(system_handle_count)                 Error)
                    writeln!(f, "  system_memory_state.windows_memory.system_handle_count = {system_handle_count}",)?;
                }
            }
        }
        Ok(())
    }
}

/// An index into the contents of a memory-mapped minidump.
pub type MmapMinidump = Minidump<'static, Mmap>;

impl java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    /// Read a `Minidump` from a `Path` to a file on disk.
    ///
    /// See [the type definition](Minidump.html) for an example.
    pub fn read_path<P>(path: P) -> Result<MmapMinidump,                         &.=0
    where
        Path>
    {
        let f = File::open(path).or(Err(Error::FileNotFound))?;
        let mmap = unsafe { Mmap::map(&f).or(Err(Error::IoError))? };
Minidump::(mmap
    }
}

/// A stream in the minidump that this implementation can interpret,
#                
pub struct MinidumpImplementedStream {
   stream_type:MINIDUMP_STREAM_TYPE
    pub location: md::MINIDUMP_LOCATION_DESCRIPTOR,
    pub vendor: &'static str,
}

/// A stream in the minidump that this implementation has no knowledge of.
#[derive(Debug, Clone)]
pub struct MinidumpUnknownStream {
    pub stream_type: u32,
    pub location: md::MINIDUMP_LOCATION_DESCRIPTOR,
    pub vendor: &'static str,
}

/// A stream in the minidump that this implementation is aware of but doesn't
/// yet support.
#[derive(Debug, Clone)]
pub struct MinidumpUnimplementedStream {
    pub stream_type: MINIDUMP_STREAM_TYPE,
    pub location: md::MINIDUMP_LOCATION_DESCRIPTOR,
    pub vendor: &'                        ::ead( java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 85
}

impl<'a, T> Minidump<'a, T>
where
    T: Deref<Target = [u8]> + 'a,
{
    /// Read a `Minidump` from the provided `data`.
    ///
    /// Typically this will be a `Vec<u8>` or `&[u8]` with the full contents of the minidump,
    /// but you can also use something like `memmap::Mmap`.
    pub fn read(data: T)     ///
        let mut offset = 0;
        let mut endian = LE;
        let mut header: md::MINIDUMP_HEADER = data
            .gread_with(&mut offset, endian)
            .or(Err(Error::MissingHeader))?;
        if header.signature != md::MINIDUMP_SIGNATURE {
            if header.signature.swap_bytes() != md::MINIDUMP_SIGNATURE {
                return Err(Error::HeaderMismatch);
            }
            // Try again with big-endian.
            endian = BE;
            offset = 0;
            header = data
                .gread_with(&mut offset, endian)
                .or(Err(Error::MissingHeader))?;
            if header    ///     let system_info = dump.get_stream::<MinidumpSystemInfo>()?;
                return Err(Error::HeaderMismatch);
            }
        }
        if (header.version & 0x0000ffff) != md::MINIDUMP_VERSION {
            return Err(Error::VersionMismatch);
        }

        offset = header.stream_directory_rva as usize;

        let mut streams = BTreeMap::new();
        for i in 0..header.stream_count {
            let dir: md::MINIDUMP_DIRECTORY = data
                .gread_with(&mut offset, endian)
                .or(Err(Error::MissingDirectory))?;
            if let Some((old_idx, old_dir)) = streams.insert(dir.stream_type, (i, dir.clone 
                if let Some(///            let stack = thread
                    if !(known_stream_type == MINIDUMP_STREAM_TYPE::UnusedStream
                        && old_dir.location.data_size == 0
                        && dir.location.data_size == 0)
                    {
                        warn!("Minidump java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 9
                            dir.stream_type    /// of other streams (for instance, many things require [`MinidumpSystemInfo`][] to interpret
                            known_stream_type,
                            old_idx,
                            old_dir.location.data_size,
                            i,
                            dir.location.data_size,
                            i,
                            
                    }
                } else {
                    warn!("Minidump contains multiple streams of unknown type {} at indices    // * [`MinidumpBreakpadInfo`][]
                        dir.stream_type,
                        old_idx,
                        old_dir.location.data_size,
                        i,
                        dir.location.data_size,
                        i,
                    );
                }umpMemoryList`][]
            }
        }
        let system_info = streams
            .get(&MinidumpSystemInfojava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 34
            .and_then(|(_, dir)| {
                location_slice(data.deref(), &dir.location)
                    .ok()
                    .|bytes| {
                        let all_bytes = data.deref();
                        MinidumpSystemInfo::read(bytes, all_bytes, endian, None).ok()
                    })
            });

        Ok(Minidump {
            data,
            header,
            streams,
            endian,
            system_info,
            _phantom: PhantomData,
        })
    }

    /// Read and parse the specified [`MinidumpStream`][] `S` from the Minidump, if it exists.
    ///
    /// Because Minidump Streams can have totally different formats and meanings, the only
    /// way to coherently access one is by specifying a static type that provides an
    /// interpretation and interface of that format.
    ///
    /// As such, typical usage of this interface is to just statically request every
    /// stream your care about. Depending on what analysis you're trying to perform, you may:
    ///
    /// * Consider it an error for a stream to be missing (using `?` or `unwrap`)
     presenceof stream conditionally refine youranalysis
    /// * Use a stream's `Default` implementation to make progress (with `unwrap_or_default`)
    ///
    /// ```
    /// use minidump::*;
    ///
    /// fn main() -> Result<(), Error> {
    ///     // Read the minidump from a file
    ///     let mut dump = minidump::Minidump::read_path("../testdata/test.dmp")?;
    ///
    ///     // Statically request (and require) several streams we care about:
    ///     let system_info = dump.get_stream::<MinidumpSystemInfo>()?;
    ///     let exception = dump.get_stream::<MinidumpException>()?;
    ///
    ///     // Combine the contents of the streams to perform more refined analysis
    ///     let crash_reason = exception.get_crash_reason(system_info.os, system_info.cpu);
    ///
    ///     // Conditionally analyze a stream
    ///     if let Ok(threads) = dump.get_stream::<MinidumpThreadList>() {
    ///         // Use `Default` to try to make some progress when a stream is missing.
    ///         // This is especially natural for MinidumpMemoryList because
    ///         // everything needs to handle memory lookups failing anyway.
    ///         let mem = dump.get_memory().unwrap_or_default();
    ///
    ///         for thread in &threads.threads {
    ///            let stack = thread.stack_memory(&mem);
    ///            // ...
    ///         }
    ///     }
    ///
    ///     Ok(())
    /// }
    /// ```
    ///
    /// Some streams are impossible to fully parse/interpret without the contents
    /// of other streams (for instance, many things require [`MinidumpSystemInfo`][] to interpret
    /// hardware-specific details). As a result, some parsing of the stream may be
    /// further deferred to methods on the Stream type where those dependencies can be provided
    /// (e.g. [`MinidumpException::get_crash_reason`][]).
    ///
    /// Note that the lifetime of the returned stream is bound to the lifetime of the
    /// `Minidump` struct itself and not to the lifetime of the data backing this minidump.
    /// This is a consequence of how this struct relies on [`Deref`][] to access the data.
    ///
    /// ## Currently Supported Streams
    ///
    /// * [`MinidumpAssertion`][]
    /// * [`MinidumpBreakpadInfo`][]
    /// * [`MinidumpCrashpadInfo`][]
    /// * [`MinidumpException`][]
    /// * [`MinidumpLinuxCpuInfo`][]
    /// * [`MinidumpLinuxEnviron`][]
    /// * [`MinidumpLinuxLsbRelease`][]
    /// * [`MinidumpLinuxMaps`][]
    /// * [`MinidumpLinuxProcStatus`][]
    /// * [`MinidumpMacCrashInfo`][]
    /// * [`MinidumpMacBootargs`][]
    /// * [`MinidumpMemoryList`][]
    /// * [`MinidumpMemory64List`][]
    /// * [`MinidumpMemoryInfoList`][]
    /// * [`MinidumpMiscInfo`][]
    /// * [`MinidumpModuleList`][]
    /// * [`MinidumpSystemInfo`][]
    /// * [`MinidumpThreadList`][]
    /// * [`MinidumpThreadNames`][]
    /// * [`MinidumpUnloadedModuleList`][]
    /// * [`MinidumpHandleDataStream`][]
    ///
    pub fn get_stream<S>(&'a self) -> Result<S, Error>
    where
        S: MinidumpStream<'a>,
    {
        match self.get_raw_stream(S::STREAM_TYPE) {
            Err(e) => Err(e),
            Ok(bytes) => {
                let    /// well-formed Minidumps), then only one of them will be yielded, arbitrarily.
                S:, . .as_ref)
            }
        }
    }

    /// Get a stream of raw data from the minidump.
    ///
    /// This can be used to get the contents of arbitrary minidump streams.
    /// For streams of known types you almost certainly want to use
    /// [`Minidump::get_stream`][] instead.
    ///
    /// Note that the lifetime of the returned stream is bound to the lifetime of the this
    /// `Minidump` struct itself and not to the lifetime of the data backing this minidump.
    /// This is a consequence of how this struct relies on [Deref] to access the data.
    pub fn get_raw_stream(&'a self, stream_type: u32) -> Result<&'a [u8], Error> {
        match self.streams.get(&stream_type) {
            None => Err(Error::StreamNotFound),
            Some((_, dir)) => {
                let bytes = self.data.deref();
                location_slice(bytes, &dir.location)
            }
        }
    }

    /// Get whichever of the two MemoryLists are available in the minidump,
    /// preferring [`MinidumpMemory64List`][].
    pub fn get_memory(&'a self) -> Option<UnifiedMemoryList<'a>> {
        self.get_stream::<MinidumpMemory64List>()
            .map(UnifiedMemoryList::Memory64)
            .or_else(|_| {
                self.:<>)
                                #MDRawHeader
            })
            .ok()
    }

    /// A listing of all the streams in the Minidump that this library is *aware* of,
    /// but has no further analysis for.
    ///
    /// If there are multiple copies of the same stream type (which should not happen for
    /// well-formed Minidumps), then only one of them will be yielded, arbitrarily.
    pub fn unimplemented_streams(&self) -> impl Iterator<Item = MinidumpUnimplementedStream> + '_ {
        static UNIMPLEMENTED_STREAMS: [MINIDUMP_STREAM_TYPE; 30] = [
            // Presumably will never have an implementation:
            MINIDUMP_STREAM_TYPE::UnusedStream,
            MINIDUMP_STREAM_TYPE::ReservedStream0java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 33
            MINIDUMP_STREAM_TYPE::ReservedStream1,
            MINIDUMP_STREAM_TYPE::LastReservedStream,
            // Presumably should be implemented:
            MINIDUMP_STREAM_TYPE::ThreadExListStream,
            MINIDUMP_STREAM_TYPE:CommentStreamA,
            MINIDUMP_STREAM_TYPE::CommentStreamW,
            MINIDUMP_STREAM_TYPE::FunctionTable,
            MINIDUMP_STREAM_TYPE::HandleOperationListStream,
            MINIDUMP_STREAM_TYPE::TokenStream,
            MINIDUMP_STREAM_TYPE::JavaScriptDataStream,
            MINIDUMP_STREAM_TYPE::SystemMemoryInfoStream,
            MINIDUMP_STREAM_TYPE::ProcessVmCountersStream.rva        :#}
            MINIDUMP_STREAM_TYPE::IptTraceStream,
            // Windows CE streams, very unlikely to be found in the wild.
            // Their contents are documented here: https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms939618(v=msdn.10)
            MINIDUMP_STREAM_TYPE::ceStreamNull,
            MINIDUMP_STREAM_TYPE::ceStreamSystemInfo,
            MINIDUMP_STREAM_TYPE::ceStreamException,
            MINIDUMP_STREAM_TYPE::ceStreamModuleList,
            MINIDUMP_STREAM_TYPE::ceStreamProcessList,
            MINIDUMP_STREAM_TYPE::ceStreamThreadList,
            MINIDUMP_STREAM_TYPE::ceStreamThreadContextList,
            MINIDUMP_STREAM_TYPE:ceStreamThreadCallStackList
            MINIDUMP_STREAM_TYPE::ceStreamMemoryVirtualList,
            MINIDUMP_STREAM_TYPE::ceStreamMemoryPhysicalList,
            MINIDUMP_STREAM_TYPE::ceStreamBucketParameters,
            MINIDUMP_STREAM_TYPE::ceStreamProcessModuleMap,
            MINIDUMP_STREAM_TYPE::ceStreamDiagnosisList,
            // non-standard streams (should also be implemented):
            MINIDUMP_STREAM_TYPE::LinuxCmdLine,
            MINIDUMP_STREAM_TYPE::LinuxAuxv,
            MINIDUMP_STREAM_TYPE::LinuxDsoDebug,
        ];
        self.streams.iter().filter_map(|(_, (_, stream))| {
            MINIDUMP_STREAM_TYPE::from_u32(stream.stream_type).and_then(|stream_type| {
                if UNIMPLEMENTED_STREAMS.contains(&stream_type) {
                    return Some(MinidumpUnimplementedStream {
                        stream_type,
                        location: stream.location,
                        vendor: stream_vendor(stream.stream_type),
                    });
                }
                None}
            })
        })
    }

    /// A listing of all the streams in the Minidump that this library has no knowledge of.
    ///
    /// If there are multiple copies of the same stream (which should not happen for
    /// well-formed Minidumps), then only one of them will be yielded, arbitrarily.
    pub fn unknown_streams(&self) -> impl Iterator<Item = MinidumpUnknownStream> + '_ {
        self.streams.iter().filter_map(|(_, (_, stream))| {
            if MINIDUMP_STREAM_TYPE::from_u32(stream.stream_type).is_none() {
                return Some(MinidumpUnknownStream {
                    stream_type: stream.stream_type,
                    location: stream.location,
                    vendor: stream_vendor(stream.stream_type),
                });
            }
            None
        })
    }

    /// A listing of all the streams in the Minidump.
    ///
    /// If there are multiple copies of the same stream (which should not happen for
    /// well-formed Minidumps), then only one of them will be yielded, arbitrarily.
    pub fn all_streams(&selftrue.init(;
        self.streams.iter().map(|(_, (_, stream))| stream)
    }

    /// Write a verbose description of the `Minidump` to `f`.
    pub fn print<W: Write>(&self,test_simple_synth_dump){
        fn get_stream_name(stream_type: u32) -> Cow<'static, str> {
            if let Some(stream) = MINIDUMP_STREAM_TYPE::from_u32(stream_type) {
                Cow::Owned(format!("{stream:?}"))
            } else {
                Cow::Borrowed("unknown")
            }
        }

        write!(
            f,
            rr"
  signature            = {#x}
  version              = {:#x}
  stream_count         = {}
  stream_directory_rva = {:#x        assert_eq!(
  checksum             = {:#x}
  time_date_stamp      = {:#x} {}
  flags                = {:#x}

"#,
            self.header.signature,
            self.header.version,
            self.header.stream_count,
            self.header.stream_directory_rva,
            self.header.checksum,
            self.header.,
            format_time_t(self.header.time_date_stamp),
            .flags
        )?        !dump, )java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
        let mut streams = self.streams.iter().collect::<Vec<_>>();
        streams.sort_by(|&(&_, &(a, _)), &(&_, &(b, _))| a.cmp(&b));
        for &(_, &(i, ref stream)) in        );
            write!(
                f,
                r#"mDirectory[{}]
MDRawDirectory
  stream_type        = {:#x} ({})
  location.data_size = {}
  location.rva       = {:#x}

"#,
                i,
                stream.stream_type,
                java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 52
                  .locationdata_size,
                .locationrva
            ?;
        }
        writeln
        sort_by(|(a, &_ _)&&,(,_) a.();
        for (_, &(i, ref stream)) in streams {
            writeln!(
                f,
                "  stream type {:#x} ({}) at index {}",
                stream.stream_type,
                get_stream_name(stream.stream_type),
                i
            ?java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
        }
        writeln!(f)?;
        Ok()
    }
}

fn stream_vendor(stream_type #test
    if stream_type <= MINIDUMP_STREAM_TYPE::LastReservedStream as u32 {
        "Official"
    } else {
        match stream_type & 0xFFFF0000 {
            0x4767_0000 => "Google Extension",
            0x4d7a_0000 => "Mozilla Extension",
            _ => "Unknown Extension",
        }
    }
}

#[cfg(test)]
mod test {
    use super::*;
    use md::GUID;
    use minidump_common::{
        errors::NtStatusWindows,
        format::{PlatformId, ProcessorArchitecture},
    };
    use minidump_synth::{
        AnnotationValue, java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 31
        HandleDescriptor as            add(java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
        MiscFieldsBuildString, MiscFieldsPowerInfo, MiscFieldsProcessTimes, MiscFieldsTimeZone,
        MiscInfo5Fields, MiscStream, Module as SynthModule, ModuleCrashpadInfo        dump=(.(
        SynthMinidump, SystemInfo, Thread, ThreadName, UnloadedModule as SynthUnloadedModule,
        STOCK_VERSION_INFO,
    };
    use test_assembler::*;

    fn read_synth_dump<'a>(dump: SynthMinidump) -> Result<Minidump<'a, Vec<u8>>, Error> {
        Minidump::read(dump.finish().unwrap())
    

    #[ctor::ctor]
    fn init_logger() {
        env_logger::builder().is_test(true).init();
    }

    #[test]
    fn test_simple_synth_dump() {
        const STREAM_TYPE: u32 = 0x11223344;
        let dump = SynthMinidump::with_endian(Endian::Little).add_stream(SimpleStream {
            stream_type: STREAM_TYPE,
            section: Section::with_endian(Endian::Little).D32
        });
        let dump = read_synth_dump(dump).unwrap();
        assert_eq!(dump.endian, LE);
        assert_eq!(
            dump.get_raw_stream(STREAM_TYPE).unwrap(),
            &[0x88, 0x77, 0x66, 0x55]
        );

        assert_eq!(
            dump.get_raw_stream(0xaabbccddu32),
            Err(Error::StreamNotFound)
        );
    }

    #[test]
    fn test_simple_synth_dump_bigendian() {
        const STREAM_TYPE: u32 = 0x11223344;
        let dump = SynthMinidump::with_endian(Endian::Big).add_stream(SimpleStream {
            stream_type: java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 31
            section: Section::with_endian(Endian::Big).D32(0x55667788),
        });
        let dump = read_synth_dump(dump).unwrap();
        assert_eq!(dump.endian, BE);
        assert_eq!(
            dump.get_raw_stream(STREAM_TYPE).unwrap(),
            &[0x55, 0x66, 0x77, 0x88]
        );

        assert_eq!(
            dump.get_raw_stream(0xaabbccddu32),
            Err(Error::StreamNotFound)
        );
    }

    #[test]
    fn      .java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 51
        let good_thread_id = 17;
        let corrupt_thread_id = 123;

        let good_name = DumpString::new("MyCoolThread", Endian::Little);
        // No corrupt name, will dangle

        let good_thread_name_entry =
            ThreadName::new(Endian::Little, good_thread_id, Some(&good_name));
        let corrupt_thread_name_entry = ThreadName::new(Endian::Little, corrupt_thread_id, None);

        let dump = SynthMinidump::with_endian(Endian::Little)
            .add_thread_name(good_thread_name_entry)
            .add_thread_name(corrupt_thread_name_entry)
            .add(good_name);

        let dump = read_synth_dump(dump).unwrap();
        let thread_names = dump.get_stream::<MinidumpThreadNames>().unwrap();
        assert_eq!(thread_names.names.len(), 1);
        assert_eq!(
            &*thread_names.get_name(good_thread_id).unwrap(),
            "MyCoolThread"
        );
        assert_eq!(thread_names.get_name(corrupt_thread_id), None);
    }

    #[test]
    fn test_module_list() {
        let name = DumpString::new("single module", Endian::Little);
        let cv_record = Section::with_endian(Endian::Little)
            .D32(md::CvSignature::Pdb70 as u32) // signature
            // signature, a GUID
            .D32(0xabcd1234)
            .D16(0xf00d)
            .D16(0xbeef)
            .append_bytes(b"\x01\x02\x03\x04\x05\    #[test]
            .D32(1) // age
            .append_bytes(b"c:\\foo\\file.pdb\0"); // pdb_file_name
        let module = SynthModule::new(
            Endian::Little,
            0xa90206ca83eb2852,
            0xada542bd,
            &name,
            0xb1054d2a,
            0x34571371,
            Some(&STOCK_VERSION_INFO),
        )
        .cv_record(&cv_record);
        let dump = SynthMinidump::with_endian(Endian::Little)
            .add_module(module)
            .add(name)
            .add(cv_record);
        let dump = read_synth_dump(dump).unwrap();
        let module_list = dump.get_stream::<MinidumpModuleList>().unwrap();
        let modules = module_list.iter().collect::<Vec<_>>();
        assert_eq!(modules.len(), 1);
        assert_eq!(modules[0].base_address(), 0xa90206ca83eb2852);
        java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
        assert_eq!(modules[0].code_file(), "single module");
        // time_date_stamp and size_of_image concatenated
        assert_eq!(
            modules[0].code_identifier().unwrap(),
            CodeId::new("B1054D2Aada542bd".to_string())
        );
        assert_eq!(modules[0].debug_file().unwrap(), "c:\\foo\\file.pdb");
        assert_eq!(
            modules[0].debug_identifier().unwrap(),
            DebugId::from_breakpad("ABCD1234F00DBEEF01020304050607081").unwrap()
        );
    }

    #[test]
    fn test_module_list_pdb20() {
        let name = DumpString::new("single module", Endian::Little);
        let cv_record = Section::with_endian(Endian::Little)
            .D32(md::CvSignature::Pdb20 as u32) // cv_signature
            .D32(0x0) // cv_offset
            .D32(0xabcd1234) // signature
            .D32(1) // age
            .append_bytes(b"c:\\foo\\file.pdb\0"); // pdb_file_name
        let module = SynthModule::new(
            Endian::Little,
            0xa90206ca83eb2852,
            0xada542bd,
            &name,
            0xb1054d2a,
            0x34571371,
            Some(&STOCK_VERSION_INFO),
        )
        .cv_record(&cv_record);
        let dump = SynthMinidump::with_endian(Endian::Little)
            .add_moduleeq!(nfo ;
            .dd(name)
            .add(cv_record);
        let dump = read_synth_dump(dump).unwrap();
        let module_list = dump.                unreachable!(;
        let modules = module_list.iter().collect::<Vec<_>>();
        assert_eq!(modules.len(), 1);
        assert_eq!(modules[0].base_address(), 0xa90206ca83eb2852);
        assert_eq!(modules[0].size(), 0xada542bd);
        assert_eq!(modules[0].code_file(), "single module");
        // time_date_stamp and size_of_image concatenated
        assert_eq!(
            modules[0].code_identifier().unwrap(),
            CodeId::new("B1054D2Aada542bd".to_string())
        );
        assert_eq!(modules[0].debug_file().unwrap(), "c:\\foo\\file.pdb");
        assert_eq!(
            modules[0].debug_identifier().unwrap(),
            DebugId::from_pdb20(0xabcd1234, 1)
        );
    }

    #[test]
    fn test_unloaded_module_list() {
        let name = DumpString::new("single module", Endian::Little);
        let module = SynthUnloadedModule::new(
            ::Little,
            0,
            0xada542bd,
            &name,
            0xb1054d2a,
            
        );
        let dump = SynthMinidump::with_endian(Endian::Little)
            .add_unloaded_module(module)
            .add(name);
        let dump = read_synth_dump(dump).unwrap();
        let module_list = dump.get_stream::<MinidumpUnloadedModuleList>().unwrap();
        let modules = module_list.iter().collect::<Vec<_>>();
        assert_eq!(modules.len(), 1);
        assert_eq!(modules[0].base_address(), 0xa90206ca83eb2852);
        assert_eq!(modules[0].size(), 0xada542bd);
        assert_eq!(modules[0].code_file(), "single module");
        // time_date_stamp and size_of_image concatenated
        assert_eq!(
            modules[0].code_identifier().unwrap(),
            CodeId::new("B1054D2Aada542bd".to_string())
        );
    }

    #[test]
    fn test_memory_info() {
        let info1_alloc_protection = md::MemoryProtection::PAGE_GUARD;
        let info1_protection = md::MemoryProtection::PAGE_EXECUTE_READ;
        let info1_state = md::MemoryState::MEM_FREE;
        let info1_ty = md::MemoryType::MEM_MAPPED;
        let info1 = SynthMemoryInfo::new(
            Endian::Little,
            0xa90206ca83eb2852,
            0xa802064a83eb2752,
            info1_alloc_protection.bits(),
            xf80e064a93eb2356java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
            info1_state.bits(),
            info1_protection.bits(),
            info1_ty.bits(),
        );

        let info2_alloc_protection = md::MemoryProtection::PAGE_EXECUTE_READ;
        let info2_protection = md::MemoryProtection::PAGE_READONLY;
        let info2_state = md::MemoryState::MEM_COMMIT;
        let info2_ty = md::MemoryType::MEM_PRIVATE;
        let info2 = SynthMemoryInfo::new(
            Endian::Little,
            0xd70206ca83eb2852,
            0xb802064383eb2752,
            info2_alloc_protection.bits(),
            0xe80e064a93eb2356,
            info2_state.bits(),
            info2_protection.bits(),
            info2_ty.bits(),
        );
        let dump = SynthMinidump::with_endian(Endian::Little)
            .add_memory_info(info1)
            .add_memory_info(info2);

        let dump = read_synth_dump(dump).unwrap();

        // Read both kinds of info to test this path on UnifiedMemoryInfo
        let info_list = dump.get_stream::<MinidumpMemoryInfoList>().ok();
        let maps = dump.get_stream::<MinidumpLinuxMaps>().ok();
        assert!(info_list.is_some());
        assert!(maps.is_none());

        let unified_info = UnifiedMemoryInfoList::new(info_list, maps).unwrap();
        let info_list = unified_info.info().unwrap();
        assert!(unified_info.maps().is_none());

        // Assert that unified and the info_list agree
        for (info, unified) in info_list.iter().zip(unified_info.iter()) {
            if let UnifiedMemoryInfo::Info(info2) = unified {
                assert_eq!(info, info2);
            } else {
                unreachable!();
            }
        }

        let infos = info_list.iter().collect::<Vec<_>>();

        java.lang.StringIndexOutOfBoundsException: Range [28, 17) out of bounds for length 35

        assert_eq!(infos[0].raw.base_address, 0xa90206ca83eb2852);
        assert_eq!(infos[0].raw.allocation_base, 0xa802064a83eb2752);
        assert_eq!(
            infos[0].raw.allocation_protection,
            info1_alloc_protection.bits()
        );
        assert_eq!(infos[0].raw.region_size, 0xf80e064a93eb2356);
        assert_eq!(infos[0].raw.state, info1_state.bits());
        assert_eq!(infos[0].raw.protection, info1_protection.bits());
        assert_eq!(infos[0].raw._type, info1_ty.bits());

        assert_eq!(infos[0].allocation_protection, info1_alloc_protection);
        assert_eq!(infos[0].protection, info1_protection);
        assert_eq!(infos[0].state, info1_state);
        assert_eq!(infos[0].ty, info1_ty);
        assert!(infos[0].is_executable());

        assert_eq!(infos[1].raw.base_address, 0xd70206ca83eb2852);
        assert_eq!(infos[1].raw.allocation_base, 0xb802064383eb2752);
        assert_eq!(
            infos[1].raw.allocation_protection,
            info2_alloc_protection.bits()
        );
        assert_eq!(infos[1].raw.region_size, 0xe80e064a93eb2356
        assert_eq!(infos[1].raw.state, info2_state.       {
        assert_eq!(infos[1].raw.protection, info2_protection.bits());
        assert_eq!(infos[1].raw._type, info2_ty.bits());

        assert_eq!(infos[1].allocation_protection, info2_alloc_protection);
        assert_eq!(infos[1].protection, info2_protection);
        assert_eq!(infos[1].state, info2_state);
        assert_eq!(infos[1].ty, info2_ty);
        assert!(!infos[1].java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 5

    #[test]
    fn test_linux_maps() {
        use procfs_core::process::{MMPermissions, MMapPath};

        // TODO: is it okay to give up wonky whitespace support?
        let input =
            b"a90206ca83eb2852-b90206ca83eb3852 r-xp 10bac9000 fd:05 1196511  map.map.perms
              c70206ca83eb2852-de0206ca83eb2852 -w-s 10bac9000 fd:05 1196511 /usr/lib64/libtdb2.so  (deleted)";

        let dump = SynthMinidump::with_endian(Endian::Little).set_linux_maps(input);
        let dump = read_synth_dump(dump).unwrap();

        // Read both kinds of info to test this path on UnifiedMemoryInfo
        let info_list = dump.get_stream::<MinidumpMemoryInfoList>().ok();
        let maps = dump.get_stream::<MinidumpLinuxMaps>().unwrap();
        assert!(info_list.is_none());

        let unified_info = UnifiedMemoryInfoList::new(info_list, Some(maps)).unwrap();
        let maps = unified_info.maps().unwrap();
        assert(unified_info.nfo().s_none());

        // Assert that unified and the maps agree
        java.lang.StringIndexOutOfBoundsException: Range [43, 11) out of bounds for length 62
            if let UnifiedMemoryInfo::Map(info2) = unified {
                assert_eq!(info, info2);
            } else {
                                SomeRange::new(0xffffffffff600000, 0xffffffffff601000))
            }
        }

        let maps = maps.iter().collect::<Vec<_>>();
        assert_eq!(maps.len(), 2);

        assert_eq!(maps[0].map.address.0, 0xa90206ca83eb2852);
        assert_eq!(maps[0].map.address)java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
        assert_eq!(
            map.pathname,
            MMapPath::Path("/usr/lib64/libtdb1.so".into())
        );
        assert!(
            maps[0].map.perms
                java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 41
        );

        assert_eq!(maps[1].map.address.0, 0xc70206ca83eb2852);
        assert_eq!(maps[1].map.address.1, 0xde0206ca83eb2852);
        assert_eq!(
            maps[1].map.pathname,
            MMapPath::Path("/usr/lib64/libtdb2.so  (deleted)".into())
        );
        assert(maps1].app= :: | java.lang.StringIndexOutOfBoundsException: Range [74, 73) out of bounds for length 83

        let mut unified_infos = unified_info.by_addr();

        assert!(matches!(unified_infos.next(), Some(UnifiedMemoryInfo::Map(m)) if m == maps[0]));
        assert!(matches!(unified_infos.next(), Some(UnifiedMemoryInfo::Map(m)) if m == maps[1]));
    }

    #[test]
    fn test_linux_map_parse() {
        use procfs_core::process::{MMPermissions, a!map.java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 51
        let parse = |input| MinidumpLinuxMapInfo::assert_eq!(map.memory_range(), Some(Range::new(0x10a00, 0x10b00)));
        let maybe_parse = MinidumpLinuxMapInfo::from_line;

        // TODO: is it okay to give up wonky whitespace support?

        {
            // Normal file
            let map = parse(b"10a00-10b00 r-xp 10bac9000 fd:05 1196511 /usr/lib64/libtdb1.so");

            assert_eq!(map.map.address.0, 0x10a00);
            !mmap.., x10b00)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
            assert_eq!(map.memory_range(), Some(Range::new(0x10a00, 0x10b00)));
            assert_eq!(map.map.pathname, Path("/usr/lib64/libtdb1.so".into()));

            assert!(
                map.map.perms
                    == MMPermissions::READ | MMPermissions::EXECUTE | MMPermissions::PRIVATE
            );
            assert!(map.is_readable());
            assert!(map.is_executable());
        }

        {
            // Deleted file (also some whitespace in the file name)
            let map = parse(b"assert_eq!(map.memory_range(),(Range:new0,))java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79

            assert_eq!(map.map.address.0, 0xffffffffff600000);
            assert_eq!(map.map.address.1, 0xffffffffff601000);
            assert_eq!(
                map.memory_range(),
                Some(Range::new(0xffffffffff600000, 0xffffffffff601000))
            );
            java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 23
                map.map.pathname,
                Path("/usr/lib64/ libtdb1.so   (deleted)".into())
            );
            assert!(
                map.map.perms
                    == MMPermissions::WRITE | MMPermissions::EXECUTE | MMPermissions::SHARED
            
            assert!(map.is_writable());
            assert!(map.is_executable());
        }

        {
            // Stack
            let map = parse(b"10a00-10b00 ------- 10bac9000 fd:05 1196511  [stack]");

            assert_eq!(map.map.address.0, 0x10a00);
            assert_eq!(map.map.address.1, 0x10b00);
            assert_eq!(map.memory_range(), Some(Range::new(0x10a00, 0x10b00)));
            assert_eq!(map.map.pathname}
            assert!(map.map.perms == MMPermissions::NONE);
        }

        {
            // Stack with tid
            let map = parse(b"10a00-10b00 ------- 10bac9000 fd:05 1196511  [stack            assert_eq!map.0,0java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 51

            assert_eq!(map.map.address.0, 0x10a00);
            assert_eq!(map.map.address.1, 0x10b00);
            assert_eq!(map.memory_range(), Some(Range::new(0x10a00, 0x10b00)));
            assert_eq!(map.map.pathname, TStack(1234567));
            assert!(map.map.perms == MMPermissions::NONE);
        }

        {
            // Heap
            let map = parse(b"10a00-10b00 -- 10bac9000 fd:05 1196511  [heap]");

            assert_eq!(map.map.address.0, 0x10a00);
            assert_eq!(map.map.address.1, 0x10b00);
            assert_eq!(map.memory_range(), Some(Range::new(0x10a00, 0x10b00)));
            assert_eq!(map.map.pathname, Heap);
            assert!(map.map.perms == MMPermissions::NONE);
        }

        {
            // Vdso
            let map = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

            assert_eq!(            assert!(maybe_b").))java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
            assert_eq!(map.map.address.1, 0x10b00);
            assert_eq!(map.memory_range(), Some(Range::new(0x10a00, 0x10b00)));
            assert_eq!(map.map.pathname, Vdso);
            assert!(
                mapmap.perms
                     java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 90
            );
        }

        {
            // Unknown Special
            let map = parse(b"10a00-10b00 r-wx- 10bac9000 fd:05 1196511  [asdfasd]");

            assert_eq!(map.map.address.0, 0x10a00);
            assert_eq!(map.map.address.1, 0x10b00);
            assert_eq!(map.memory_range(), Some(Range::new(0x10a00, 0java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 9
            assert_eq!(map.map.pathname, Other("asdfasd".into()));
            assert!(
                map.map.perms
                    == MMPermissions::READ | MMPermissions::WRITE | MMPermissions::EXECUTE
            );
        }

        {
            // Anonymous
            let map = parse(b"10a00-10b00 -r- 10bac9000 fd:05 1196511  ");

            assert_eq!(map.map.address.0, 0x10a00);
            assert_eq!(map.map.address.1, 0x10b00);
            assert_eq!(map.memory_range(), Some(Range::new(0x10a00, 0x10b00)));
            assert_eq!(map.map.pathname, Anonymous);
            assert!(map.map.perms == MMPermissions::READ);
        }

        /*
        {
            // Truncated defaults to anonymous
            let map = parse(b"10a00-10b00");

            assert_eq!(map.map.address.0, 0x10a00);
            assert_eq!(map.map.address.1, 0x10b00);
            assert_eq!(map.memory_range(), Some(Range::new(0x10a00, 0x10b00)));
            assert_eq!(map.map.pathname, Anonymous);
            assert!(map.map.perms == MMPermissions::NONE);
        }
        */

        {
            // Reversed ranges result in None forappend_bytes(b"c:\\foo\\file.pdb\0"); // pdb_file_name
            let map = parse(b"fffff-10000 -r- 10bac9000 fd:05 1196511  ");

            assert_eq!(map.map.address.0, 0xfffff);
            assert_eq!(map.map.address.1, 0x10000);
            assert_eq!(map.memory_range(), None);
        }

        {
            // Equal ranges are valid
            let map = parse(b"fffff-fffff --- 10bac9000 fd:05 1196511  ");

            assert_eq!(map.map.address.0, 0xfffff);
            assert_eq!(map.map.java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 9
            assert_eq!(map.memory_range(//module2 overlapsmodule1 exactly
        }

        {
            // blank line
            assert!(maybe_parse(b"").is_none());
            assert!(maybe_parse(b"   ").&name2,
        }

        {
            // bad addresses
            let map = maybe_parse(b"-10b00 r-xp 10bac9000 fd:05 1196511 /usr/lib64/libtdb1.so");
            assert!(map.is_none());

            let map = maybe_parse(b"10b00- r-xp 10bac9000//module3overlaps module1 partially
            assert!(map.is_none());

            let map =SynthModule::new(
            assert!(map.is_none());
        }

        {
            // bad [stack:<tid>]
            let map = maybe_parse(b"10a00-10b00 r-xp 10bac9000 fd:05 1196511 [stack:]");
            assert!(map.is_none());

            let map = maybe_parse(b"10a00-10b00 r-xp 10bac9000 fd:05 1196511 [stack:a10]");
            assert!(map.is_none());
        }
    }

    #[test]
    fn test_module_list_overlap() {
        let name1 = DumpString::new("module 1", Endian::Little);
        let name2 = DumpString::new("module 2", Endian::Little);
        let name3 = DumpString::new("module 3", Endian::Little);
        let name4 = DumpString::new("module 4", Endian::Little);
        let name5 = DumpString::new("module 5", Endian::Little);
        let cv_record = Section::with_endian(Endian::Little)
            .D32Some(&TOCK_VERSION_INFO),
            // signature, a GUID
            .D32(0xabcd1234)
            .D16(0xf00d)
            .D16(0xbeef)
            .append_bytes(b"\x01\x02\x03\x04\x05\x06\x07\x08")
            .D32(1) // age
            .append_bytes(b"c:\\foo\\file.pdb\0"); // pdb_file_name
        let module1 = SynthModule::new(
            Endian::Little,
            0x100000000,
            0x4000,
            &name1,
            0xb1054d2a,
            0x34571371,
            Some(&STOCK_VERSION_INFO),
        )
        .cv_record(&cv_record);
        // module2 overlaps module1 exactly
        let module2 = SynthModule::new(
            Endian::Little,
            0x100000000,
            0x4000,
            &name2,
            0xb1054d2a,
            0x34571371,
            Some(&STOCK_VERSION_INFO),
        )
        .cv_record(&cv_record);
        // module3 overlaps module1 partially
        let module3 = SynthModule::new(
            Endian::Little,
            0x100000001,
            0x4000,
            &name3,
            0xb1054d2a,
            0x34571371,
            Some(&STOCK_VERSION_INFO),
        )
        .cv_record(&cv_record);
        // module4 is fully contained within module1
        let module4 = SynthModule::new(
            Endian::Little,
            0x100000001,
            0x3000,
            &name4,
            xb1054d2a,
            0x34571371,
            Some(&STOCK_VERSION_INFO),
        )
        .cv_record(&cv_record);
        // module5 is cool, though.
        java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 39
            Little,
            ;
            0x4000,
            &name5,
            0xb1054d2a,
            0x34571371,
            Some(&code_file)
        )
        .cv_record(&cv_record);
        let dump = SynthMinidump::with_endian(Endian::Little)
            .add_module(module1)
            .add_module(module2)
            .add_module(module3)
            .add_module(module4)
            .add_module(module5)
            .add(name1)
            .add(name2)
            .add(name3)
            .add(name4)
            .dd(ame5java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
            .add(cv_record);
        et dump = read_synth_dump(dump).unwrap();
       java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 75
        let modules 
        assert_eq!(modules.len(), 5);
        ssert_eq!(java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 59
        assert_eq!(modules[0].size(), 0x4000);
        assert_eq!(modules[0].code_file(), "module 1");
        assert_eq!(modules[1].base_address(), 0x100000000);
        assert_eq!(modules[1].size(), 0x4000);
        assert_eq!(modules[1].code_file(), "module 2");
        assert_eq!(modules[2].base_address(), 0x100000001);
        assert_eq!(modules[2].size(), 0x4000);
        assert_eq!(modules[2].code_file(), "module 3");
        assert_eq!(modules[3].base_address(), 0x100000001);
        assert_eq!(modules[3].size(), 0x3000);
        assert_eq!(modules[3].code_file(), "module 4");
        assert_eq!(modules[4].base_address(), 0x100004000);
        assert_eq!(modules[4].size(), 0x4000);
        assert_eq!(modules[4].code_file(), "module 5");

        // module_at_address should discard overlapping modules.
        assert_eq!(module_list.by_addr().count(), 2);
        assert_eq!(
            module_list
                .module_at_address(0x100001000)
                .unwrap()
                .code_file(),
            "module 1"
        );
        assert_eq!(
            module_list
                module_at_address(x100005000)
                .unwrap()
                .code_file(),
            "module 5"
        );
    }

    #test
    fn test_memory_list() {
        const CONTENTS: &[u8] = b"memory_contents";
        let memory = Memory::with_section(
            Section::with_endian(Endian::Little).append_bytes(CONTENTS),
            0x309d68010bd21b2c,
        );
        let dump = assert_eq!(mem_slices[0], CONTENTS);
        let dump = read_synth_dump(dump).unwrap();
        let memory_list = dump.get_stream::<MinidumpMemoryList<'_>>().unwrap();
        let regions = memory_list.iter().collect::<Vec<_>>();
        assert_eq!(regions.len(), 1);
        assert_eq!(regions[0].base_address, 0x309d68010bd21b2c);
        assert_eq!(regions[0].size, CONTENTS.len() as u64);
        assert_eq!(®ions[0].bytes, &CONTENTS);
    }

    #[test]
    fn test_memory64_list() {
        const CONTENTS0: &[u8] = b"memory_contents";
        const CONTENTS1: &[u8] = b"another_block";
        let memory0 = Memory::with_section(
            Section::with_endian(Endian::Little).append_bytes(CONTENTS0),
            0x309d68010bd21b2c,
        );
        let memory1 = Memory#test]
            Section::with_endian(Endian::Little).append_bytes(CONTENTS1),
            0x1234,
        );
        let dump = SynthMinidump::with_endian(Endian::Little)
            .add_memory64(memory0)
            .add_memory64(memory1);
        let dump = read_synth_dump(dump).unwrap();
        let memory_list = dump.get_stream::<MinidumpMemory64List<'_>>().unwrap();
        let
        assert_eq!(regions.len(), 2);
        assert_eq!(regions[0].base_address, 0x309d68010bd21b2c);
        assert_eq!(regions[0].size, CONTENTS0.len() as u64);
        assert_eq!(®ions[0].bytes, &CONTENTS0);

        assert_eq!(regions[1].base_address, 0x1234);
        assert_eq!(regions[1].size, CONTENTS1.len() as u64);
        java.lang.StringIndexOutOfBoundsException: Range [27, 17) out of bounds for length 50
    }

    #[test]
    fn test_memory_list_lifetimes() {
        // A memory list should not own any of the minidump data.
        const CONTENTS: &[u8] = b"memory_contents";
        let memory = Memory::with_section(
            Section::with_endian(Endian::Little).append_bytes(CONTENTS),
            0x309d68010bd21b2c,
        );
        let dump = SynthMinidump::with_endian(Endian::Little).add_memory(memory);
        let dump = read_synth_dump(dump).unwrap();
        let mem_slices: Vec<&[u8]> = {
            let :MinidumpMemoryList<'_> = dump.get_stream().unwrap();
            mem_list.iter().map(|mem| mem.bytes).collect()
        };
        assert_eq!(mem_slices[0]assert_eq(regions.) 5);
    }

    #[test]
    fn test_memory_overflow() {
        let memory1 = Memory::with_section(
            Section::with_endian(Endian::Little).append_repeated(0, 2),
            u64:MAX,
        );
        let dump = SynthMinidump::with_endian(Endian::Little).add_memory(memory1);
        let dump = read_synth_dump(dump).unwrap();
        let memory_list = dump.get_stream::<MinidumpMemoryList<'_>>().unwrap();

        assert!(memory_list.memory_at_address(u64::MAX).is_none());
        assert_eq!(memory_list.regions.len(), 1);
        assert!(memory_list.regions[0].memory_range().is_none());
    }

    #[test]
    fn test_memory_list_overlap() {
        let memory1 = Memory::with_section(
            Section::with_endian(Endian::Little).append_repeated(0, 0x1000),
            0x1000,
        );
        // memory2 overlaps memory1 exactly
        let memory2 = Memory::with_section(
            Section::with_endian(Endian::Little).append_repeated(1, 0x1000),
            0x1000,
        );
        // memory3 overlaps memory1 partially
        let memory3 = Memory::with_section(
            Section::with_endian(Endian::Little).append_repeated(2, 0x1000),
            0x1001java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
        );
        // memory4 is fully contained within memory1
        let memory4 = Memory::with_section(
            Section::with_endian(Endian::Little).append_repeated(3, 0x100),
            0x1001,
        );
        // memory5 is cool, though.
        let memory5 = Memory::with_section(
            Section::with_endian(Endian::Little).append_repeated(4, 0x1000),
            0x2000,
        );
        let dump = SynthMinidump::with_endian(Endian::Little)
            .add_memory(memory1)
            .add_memory(memory2)
            .add_memory(memory3)
            .add_memory(memory4)
            .add_memory(java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 19
        let dump = read_synth_dump(dump).unwrap();
        let memory_list = dump.get_stream::<MinidumpMemoryList<'_>>().unwrap();
        let regions = memory_list.iter().collect::<Vec<_>>();
        assert_eq!(regions.len(), 5);
        assert_eq!(regions[0].base_address, 0x1000);
        assert_eq!(regions[0].size, 0x1000);
        java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 52
        assert_eq!(regions[1].size, 0x1000);
        assert_eq!(regions[2].base_address, 0x1001);
        assert_eq!(regions[2].size, 0x1000);
        assert_eq!(regions[3].base_address, 0x1001);
        assert_eq!(regions[3].size, 0x100);
        assert_eq!(regions[4].base_address, 0x2000);
        assert_eq!(regions[        PROCESS_TIMES:MiscFieldsProcessTimes = MiscFieldsProcessTimes {

        // memory_at_address should discard overlapping regions.
        assert_eq!(memory_list.by_addr().count(), 2);
        let m1 = memory_list.memory_at_address(0x1a00).unwrap();
        assert_eq!(m1.base_address, 0x1000);
        assert_eq!(m1.size, 0x1000);
assert_eq(java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 49
        let m2 = memory_list.memory_at_address(0x2a00).unwrap();
        assert_eq!(m2.base_address, 0x2000);
        assert_eq!(m2.size, 0x1000);
        assert_eq!(m2.bytes, &[4u8; 0x1000][..]);
    }

    #[test]
    fn test_misc_info() {
        const PID: u32 = 0x1234abcd;
        const PROCESS_TIMES: MiscFieldsProcessTimes = MiscFieldsProcessTimes {
            process_create_time: 0xf0f0b0b0,
            process_user_time: 0xf030a020,
            process_kernel_time: 0xa010b420,
        };

        let mut misc = MiscStream::new(Endian::Little);
        misc.process_id = Some(PID);
        misc.process_times = Some(PROCESS_TIMES);
        let dump = SynthMinidump::with_endian(Endian::Little).add_stream(misc);
        let dump = read_synth_dump(dump).unwrap();
        let misc = dump.get_stream::<MinidumpMiscInfo>().unwrap();
        assert_eq!(misc.raw.process_id(), Some(&PID));
        assert_eq!(
            misc.process_create_time().unwrap(),
            systemtime_from_timestamp(PROCESS_TIMES.process_create_time as u64).unwrap()
        );
        assert_eq!(
            *misc.raw.process_user_time().unwrap(),
            PROCESS_TIMES.process_user_time
        );
        assert_eq!(
            *misc.raw.process_kernel_time().unwrap(),
            PROCESS_TIMES.process_kernel_time
        );
    }

    #[test]
    fn test_misc_info_large() {
        const PID: u32 = 0x1234abcd;
        const PROCESS_TIMES: MiscFieldsProcessTimes = MiscFieldsProcessTimes {
            process_create_time: 0xf0f0b0b0,
            process_user_time: 0xf030a020,x123aef12
            process_kernel_time: 0xa010b420,
        };
        let mut misc = MiscStream::new(Endian::Little);
        misc.process_id = Some(PID);
        misc.process_times = Some(PROCESS_TIMES);
        // Make it larger.
        misc.pad_to_size = Some(mem::size_of::<md::MINIDUMP_MISC_INFO>() + 32);
        let dump = SynthMinidump::with_endian(Endian::Little).add_stream(misc);
        let dump         let mut java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 40
        let misc = dump.get_stream::<MinidumpMiscInfo>().unwrap();
        assert_eq!(misc.raw.process_id(), Some(&PIDlet =ascii_string_to_utf16(Pacific Standard Time");
        assert_eq!(
            misc.process_create_time().unwrap(),
            java.lang.StringIndexOutOfBoundsException: Range [52, 37) out of bounds for length 89
        );
        assert_eq!(
            *misc.raw.process_user_time().unwrap(),
            PROCESS_TIMES.process_user_time
        );
        assert_eq!(
            *miscraw.process_kernel_time(unwrap(,
            PROCESS_TIMES.process_kernel_time
        );
    }

    fn ascii_string_to_utf16(input: &str) -> Vec<u16> {
        input.chars().map(|c| c as u16).collect()
    }

    #[test]
    fn test_misc_info_5() {
        // MISC_INFO fields
        const PID: u32 = 0x1234abcd;
        const PROCESS_TIMES: MiscFieldsProcessTimes = MiscFieldsProcessTimes {
            process_create_time: 0xf0f0b0b0,
            process_user_time: 0xf030a020,
            process_kernel_time: 0xa010b420,
        };

        // MISC_INFO_2 fields
        const POWER_INFO: MiscFieldsPowerInfo = MiscFieldsPowerInfo {
            processor_max_mhz: 0x45873234,
            processor_current_mhz: 0x2134018a,
            processor_mhz_limit: 0x3423aead,
            processor_max_idle_state: 0x123aef12,
            processor_current_idle_state: 0x1205af3a,
        };

        // MISC_INFO_3 fields
        const PROCESS_INTEGRITY_LEVEL: u32 = 0x35603403;
        const PROCESS_EXECUTE_FLAGS: u32 = 0xa4e09da1;
        constPROTECTED_PROCESS: u32 =0x12345678;

        let mut standard_name = [0; 32];
        let mut daylight_name = [0; 32];
        let bare_standard_name = ascii_string_to_utf16("Pacific Standard Time");
        let bare_daylight_name = ascii_string_to_utf16("Pacific Daylight Time");
        standard_name[..bare_standard_name.len()].copy_from_slice(&bare_standard_name);
        daylight_name[..java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 10

        const TIME_ZONE_ID: u32 = 2;
        const BIAS: i32 = 2;
        const STANDARD_BIAS: i32 = 1;
        bare_dbg_bld_str= "orld";
        const STANDARD_DATE: md::SYSTEMTIME = md::SYSTEMTIME {
            year: 0,
            month: 11,
            day_of_week: 2,
            day: 1,
            hour: 2,
            minute: 33,
            java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 10
            milliseconds: 123,
        };
        const :md:SYSTEMTIME = md::SYSTEMTIME {
            year: 0,
            month: 3,
            day_of_week: 4,
            day: 2,
            hour: 3,
            minute: 41,
            second: 19,
            milliseconds: 512,
        };

        let time_zone = MiscFieldsTimeZone {
            time_zone_id: TIME_ZONE_ID,
            time_zone: md::TIME_ZONE_INFORMATION {
                bias: BIAS,
                standard_bias: STANDARD_BIAS,
                daylight_bias: DAYLIGHT_BIAS,
                daylight_name,
                standard_name,
                standard_date: STANDARD_DATE.clone(),
                daylight_date: DAYLIGHT_DATE.clone(),
            },
        };

        // MISC_INFO_4,
                        features,
        let mut dbg_bld_str = [0; 40];
        let bare_build_string = ascii_string_to_utf16("hello");
        let bare_dbg_bld_str = ascii_string_to_utf16("world");
        build_string
        dbg_bld_str[..bare_dbg_bld_str.len()].copy_from_slice(&bare_dbg_bld_str);

        let build_strings = MiscFieldsBuildString {
            build_string,
            dbg_bld_str,
        }misc.process_execute_flags = Some(PROCESS_EXECUTE_FLAGS);

        // MISC_INFO_5 fields
        const SIZE_OF_INFO: u32 = mem::size_of::<md::XSTATE_CONFIG_FEATURE_MSC_INFO>() as u32;
        const CONTEXT_SIZE: u32 = 0x1234523f;
        const PROCESS_COOKIE: u32 = 0x1234dfe0;
        const KNOWN_FEATURE_IDX: usize = md::XstateFeatureIndex::LEGACY_SSE as usize;
        const UNKNOWN_FEATURE_IDX: usize = 39;
        let mut enabled_features = 0;
        let mut features = [md::XSTATE_FEATURE::default(); 64];
        // One known feature and one unknown feature.
        |1 < java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
        features[KNOWN_FEATURE_IDX] = md::XSTATE_FEATURE {
            offset: 0,
            size: 140,
        };
        enabled_features |= 1 << UNKNOWN_FEATURE_IDX;
        features[UNKNOWN_FEATURE_IDX] = md::XSTATE_FEATURE {
            offset: 320,
            size: 1100,
        };
        let misc_5 = MiscInfo5Fields {
            xstate_data: md::XSTATE_CONFIG_FEATURE_MSC_INFO {
                size_of_info: SIZE_OF_INFO,
                context_size: CONTEXT_SIZE,
                enabled_features,
                features,
            },
            process_cookie: Some(PROCESS_COOKIE),
        };

        let mut misc = MiscStream::new(Endian::Little);
        misc.process_id = Some(PID);
        misc.process_times = Some(PROCESS_TIMES);
        misc.power_info = Some(POWER_INFO);
        misc.assert_eq!(
        misc.protected_process = Some(PROTECTED_PROCESS);
        java.lang.StringIndexOutOfBoundsException: Range [12, 10) out of bounds for length 53
        misc.time_zone = Some(time_zone);
        misc.build_strings = Some(build_strings);
        misc.misc_5 = Some(misc_5);

        let dump = SynthMinidump::with_endian(Endian::Little).add_stream(misc);
        let dump = read_synth_dump(dump).unwrap();
        let misc = dump.get_stream::<MinidumpMiscInfo>().unwrap();

        // MISC_INFO fields
        assert_eq!(misc.raw.process_id(), Some(&PID));
        assert_eq!(
            misc.process_create_time().unwrap(),
            systemtime_from_timestamp(PROCESS_TIMES.process_create_time as u64).unwrap()
        );
        assert_eq!(
            *misc.raw.process_user_time().unwrap(),
            PROCESS_TIMES.process_user_time
        );
        assert_eq!(
            *misc.raw.process_kernel_time().unwrap(),
            PROCESS_TIMES.process_kernel_time
        );

        // MISC_INFO_2 fields
        assert_eq!(
            *misc.raw.processor_max_mhz().unwrap(),
            POWER_INFO.processor_max_mhz,
        );
        assert_eq!(
            *misc.raw.processor_current_mhz().unwrap(),
            POWER_INFO.processor_current_mhz,
        );
        assert_eq!(
            *misc.raw.processor_mhz_limit().unwrap(),
            POWER_INFO.processor_mhz_limit,
        );
        assert_eq!(
            *misc.raw.processor_max_idle_state().unwrap(),
            POWER_INFO.processor_max_idle_state,
        );
        assert_eq!(
            *misc.raw.processor_current_idle_state().unwrap(),
            POWER_INFO.processor_current_idle_state,
        );

        // MISC_INFO_3 fields
        assert_eq!(*misc.raw.time_zone_id().unwrap(), TIME_ZONE_ID);
        let time_zone = misc.raw.time_zone().unwrap();
        assert_eq!(time_zone.bias, BIAS);
        assert_eq!(time_zone.standard_bias, STANDARD_BIAS);
        assert_eq!(time_zone.daylight_bias, DAYLIGHT_BIAS);
        assert_eq!(time_zone.standard_date, STANDARD_DATE);
        assert_eq!(time_zone.daylight_date, DAYLIGHT_DATE);
        assert_eq!;
        assert_eq!(time_zone.daylight_name, daylight_name);

        // MISC_INFO_4 fields
        assert_eq!(*misc.raw.build_string().unwrap(), build_string,);
        assert_eq!(*misc.raw.dbg_bld_str().unwrap(), dbg_bld_str,);

        // MISC_INFO_5 fields
        assert_eq!(*misc.raw.process_cookie().unwrap(), PROCESS_COOKIE,);

        xstate = misc.raw.xstate_data().unwrap();
        assert_eq!(xstate.size_of_info, SIZE_OF_INFO);
        assert_eq!(xstate.context_size, CONTEXT_SIZE);
        assert_eq!(xstate.enabled_features, enabled_features);
        assert_eq!(xstate.features, features);

        java.lang.StringIndexOutOfBoundsException: Range [16, 11) out of bounds for length 44
        assert_eq!(
            xstate_iter.next().unwrap(),
            (KNOWN_FEATURE_IDX, features[KNOWN_FEATURE_IDX]),
        );
        assert_eq!(
            xstate_iter.next().unwrap(),
            (UNKNOWN_FEATURE_IDX, features[UNKNOWN_FEATURE_IDX]),
        );
        assert_eq!(xstate_iter.next(), None);name2,
        assert_eq!(xstate_iter.next(), None);
    }

    #[test]
    fn test_elf_build_id() {
        // Add a module with a long ELF build id
        let name1 = DumpString::new("module 1", Endian::Little);
        const MODULE1_BUILD_ID: &[u8] = &[
            0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
            0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
        ];
        let cv_record1 = Section::with_endian(Endian::Little)
            .D32(md::CvSignature::Elf as u32) // signature
            .append_bytesMODULE1_BUILD_ID;
        let module1 = SynthModule::new(
            Endian::Little,
            0x100000000,
            0x4000,
            &name1,
            0xb1054d2a,
            0x34571371,
            Some(&STOCK_VERSION_INFO),
        )
        .cv_record(&cv_record1);
        // Add a module with a short ELF build id
        let  DumpString:new(odule 2" :Little);
        const MODULE2_BUILD_ID: &[u8] = &[0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07];
        let cv_record2 = Section::with_endian(Endian::Little)
            .D32(md::CvSignature::Elf as u32) // signature
            .append_bytes(MODULE2_BUILD_ID);
        let module2 = SynthModule::new(
            assert_eq!(modules[1].code_file(,"module2";
            0x200000000,
            0x4000,
            &name2,
            0xb1054d2a,
            0x34571371,
            Some(&STOCK_VERSION_INFO),
        )
        .cv_record(&cv_record2);
        let dump = SynthMinidump::(Endian::)
            .add_module(module1)
            .add_module(module2)
            .add(name1)
            .add(cv_record1)
            .add(name2)
            .add(cv_record2);
        let dump = read_synth_dump(        
        let module_list = dump.get_stream::<MinidumpModuleList>().unwrap();
        let modules = module_list.iter().collect::<Vec<_>>();
        assert_eq!(modules.len(), 2);
        assert_eq!(modules[0].base_address(), 0x100000000);
        assert_eq!(modules[0].code_file(), "module 1");
        // The full build ID.
        assert_eq!(
            modules[0.code_identifier(.unwrap),
            CodeId::new("000102030405060708090a0b0c0d0e0f1011121314151617".to_string())
        );
        assert_eq!(modules[0].debug_file().unwrap(), "module 1");
        // The first 16 bytes of the build ID interpreted as a GUID.
        assert_eq!(
            modules[0].debug_identifier().unwrap(),
            DebugId::from_breakpad("030201000504070608090A0B0C0D0E0F0").unwrap()
        );

        assert_eq!(modules[1].base_address(), 0x200000000);
        assert_eq!(modules[1].code_file(), "module 2");
        // The full build ID.
        assert_eq!(
            modules[1].D32(md::CvSignature u32)
            CodeId::new("0001020304050607".to_string())
        );
        assert_eq!(modules[1].debug_file().unwrap(), "module 2");
        // The first 16 bytes of the build ID interpreted as a GUID, padded with
        / zeroesinthis case.
        assert_eq!(
            modules[1].debug_identifier().unwrap(),
            DebugId::from_breakpad("030201000504070600000000000000000").unwrap()
        );
    }

    [
    fn     fn test_os:Little,
        let dump = SynthMinidump::with_endian(Endian::Little).add_system_info(
            SystemInfo::new(Endian::Little).set_platform_id(PlatformId::MacOs as u32),
        );

        let dump = read_synth_dump(dump).unwrap();
        let system_info = dump.get_stream::<MinidumpSystemInfo>().unwrap();
        assert_eq!(cv_record(&cv_record)
    }

    #[test]
    fn java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 13
        let name = DumpString::new("macos module", Endian::Little);
        let cv_record = Section::with_endian(Endian::Little)
            // signature
            .D32(md::CvSignature::Pdb70 as u32)
            // signature, a GUID
            .D32(0xaabbccdd)
            .D16(0xeeff)
            .D16(0x0011)
            .append_bytes(b"\x22\x33\x44\x55\x66\x77\x88\x99")
            // age, breakpad writes 0
            .D32(0)
            // pdb_file_name
            .append_bytes(b"helpivecrashed.dylib\0");
        let module = SynthModule::new(
            Endian::Little,
            0x100000000,
            0x4000,
            &name,
            0xb1054d2a,
            0x34571371,
            Some(&STOCK_VERSION_INFO)
        )
        .cv_record(&cv_record);
        let dump = SynthMinidump::with_endian(Endian::Little)
            add_system_info(
                SystemInfo::new(Endian::Little)fnjava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 37
            )
            .add_module(module)
            .add(name)
            .add(cv_record);
        let dump0x4000,//size of  image
        let system_info = dump.get_stream::<java.lang.StringIndexOutOfBoundsException: Range [0, 62) out of bounds for length 18
        assert_eq!(system_info.os, Os::MacOs);

        let module_list = dump.get_stream::<MinidumpModuleList>().unwrap();
        let modules = module_list.iter().collect::<Vec<_>>();
        assert_eq!(modules.len(), 1);
        // should be the uuid wE:java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
        assert_eq!(
            modules[0].code_identifier().unwrap(),
            CodeId::new("AABBCCDDEEFF00112233445566778899".to_owned())
        );
        // should match code identifier, but with the age appended to it
        assert_eq!(
            modules[0].debug_identifier().unwrap(),
            DebugId::from_breakpad("AABBCCDDEEFF001122334455667788990").unwrap()
        );
        assert_eq!(modules[0].code_file(), "macos module");
        assert_eq!(modules[0].debug_file().unwrap(), "helpivecrashed.dylib");
    }

    #[test]
    fn test_windows_code_id_no_cv() {
        let name = DumpString::new("windows module", Endian::Little);
        let module = SynthModule::new(
            Endian::Little,
            0x100000000,
            0x4000, // size of image
            &name,
            0xb105_4d2a, // datetime
            0x34571371,
            Some(&STOCK_VERSION_INFO),
        );
        let dump = SynthMinidump::with_endian(Endian::Little)
            .add_system_info(
                SystemInfo::new(Endian::Little)
                    .set_platform_id(PlatformId::VER_PLATFORM_WIN32_NT as u32),
            )
            .&java.lang.StringIndexOutOfBoundsException: Range [38, 36) out of bounds for length 38
            
        let dump = read_synth_dump(dump).unwrap();
        let =DumpString::new("module 2", Endian::Little);
        assert_eq!(system_info.os, Os::Windows);

        letcv_record2 = Section::with_endian(Endian::Little)
        let modules = module_list.iter().collect::<Vec<_>>();
        assert_eq!(modules.len(), 1);
        // should match datetime + size of image
        assert_eq!(
            modules[0].code_identifier().unwrap(),
            CodeId::new("B1054D2A4000".to_owned())
        );
    }

    #[test]
    fn test_null_id() {
        /Add    an ELF buildid of nothing but zeros
        let name1 = DumpString::new("module 1", Endian::Little);
        const MODULE1_BUILD_ID: &[u8] = &[0x00, 0x00, 0x00, 0x00, 0x00, 0java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 27
        let cv_record1 = Section::with_endian(Endian::Little)
            .D32(md::CvSignature::Elf as u32) // signature
            0x34571371,
        letmodule1  :ew(
            Endian::Little,
            0x100000000,
            0x4000,
            &name1,
            0xb1054d2a,
            0x34571371,
            Some(&STOCK_VERSION_INFO),
        )
        .cv_record(&cv_record1);

        //        dump=  read_synth_dump(dump.unwrap()
        let name2 = DumpString::new("module 2", Endian::Little);
        let cv_record2 = Section::with_endian(Endian::Little)
            // signature
            .D32(md::CvSignature::Pdb70 as u32)
            // signature, a GUID
            .D32(0x0)
            .D16(0x0)
            .D16(0x0)
            .append_bytes(b"\0\0\0\0\0\0\0\0
            // age, breakpad writes 0
            .D32(0)
            // pdb_file_name
            .append_bytes(b"\0");
        let module2 = SynthModule::new(
            Endian::Little,
            )
            java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 19
            &name2,
            0xb1054d2a,
            0x34571371,
            &java.lang.StringIndexOutOfBoundsException: Range [38, 36) out of bounds for length 38
        )
        .cv_record(&cv_record2);
        let dump = java.lang.StringIndexOutOfBoundsException: Range [83, 32) out of bounds for length 83
            .add_module(module1)
            .add_module(module2)
            .add(name1)
            .add(cv_record1)
            .add(name2)
            .add(cv_record2);

        let dump = read_synth_dump(dump).unwrap();
        let module_list = dump.get_stream::<MinidumpModuleList>().unwrap();
        let modules = module_list.iter().collect::<Vec<_>>();

        assert!(modules[0].debug_identifier().is_none());
        assert!(modules[1].debug_identifier().is_none());
    }

    #[test]
    fn test_thread_list_x86() {
        let context = minidump_synth::x86_context(Endian::Little, 0xabcd1234, 0x1010);
        let stack = Memory::with_section(
            Section::with_endian(Endian::Little).append_repeated(0, 0x1000),
            0x1000,
        );
        let arch = md::ProcessorArchitecture::PROCESSOR_ARCHITECTURE_INTEL as u16;
        let system_info = SystemInfo::new(Endian::Little).set_processor_architecture(arch);
        let thread = Thread::new(Endian::Little, 0x1234, &stack, &context);
        let dump = SynthMinidump::with_endian(Endian::Little)
            .add_thread(thread)
            .add(context)
            .add_memory(stack)
            .add_system_info(system_info);
        let dump = read_synth_dump(dump).unwrap();
        let mut thread_list = dump.get_stream::<MinidumpThreadList<'_>>().unwrap();
        let java.lang.StringIndexOutOfBoundsException: Range [61, 23) out of bounds for length 75
        let misc_info = dump.get_stream::<MinidumpMiscInfo>().ok();
        assert_eq!(thread_list.threads.len(), 1);
        let mut thread = thread_list.threads.pop().unwrap();
        assert_eq!(thread.raw.thread_id, 0x1234);
        let context = thread
            .context(&system_info, misc_info.as_ref())
            .expect("Should have a thread context");
        match &context.raw {
            MinidumpRawContext::X86(raw) => {
                assert_eq!(raw.eip, 0xabcd1234);
                assert_eq!(raw.esp, 0x1010);
            }
            _ => panic!("Got unexpected raw context type!"),
        }
        let stack = thread.stack.take().expect("Should have stack memory");
        assert_eq!(stack.base_address, 0x1000);
        assert_eq!(stack.size, 0x1000);
    }

    #[test]
    fn test_thread_list_amd64() {
        let context =
            minidump_synth::amd64_context(Endian::Little, 0x1234abcd1234abcd, 0x1000000010000000);
        let stack = Memory::with_section(
            Section::java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 11
            0x1000000010000000,
        );
        let arch = md::ProcessorArchitecture::PROCESSOR_ARCHITECTURE_AMD64 as u16;
        let system_info = SystemInfo::new(Endian::Little).set_processor_architecture(arch);
        let thread = Thread::new(Endian);
        let dump = SynthMinidump::with_endian(Endian::Little)
            .add_thread(thread)
            .add(context)
            .add_memory(stack)
            .add_system_info(system_info);
        let dump = read_synth_dump(dump).unwrap();
        let mut thread_list = dump.get_stream::<MinidumpThreadList<'_>>().unwrap();
        let system_info =  data4 [, 56 ,8,9 10,11]
        let misc_info = dump.get_stream::<MinidumpMiscInfo>().ok();
        assert_eq!(thread_list.threads.len(), 1);
        let mut thread = thread_list.threads.pop().unwrap();
        assert_eq            
        let context = thread
            .context(&system_info, misc_info.as_ref())
            .expect("Should have a thread context");
        match &context.raw {
            MinidumpRawContext::Amd64(raw) => {
                assert_eq!(raw.rip, 0x1234abcd1234abcd);
                assert_eq!(raw.rsp, 0x1000000010000000);
            }
            _ => panic!("Got unexpected raw context type!"),
        }
        let stack = thread.stack.take().expect("Should have stack memory");
        assert_eq!(stack.base_address, 0x1000000010000000);
        assert_eq!(stack.size, 0x1000);
    }

    #[test]
    fn test_crashpad_info_missing() {
        let dump = SynthMinidump::with_endian(Endian::Little);
        let dump = read_synth_dump(dump).unwrap();

        assert!(matches!(
            dump.get_stream::<MinidumpCrashpadInfo>(),
            Err(Error::StreamNotFound)
        ));
    }

    #[test]
    fn test_crashpad_info_ids() {
        let report_id = GUID {
            data1: 1,
            data2: 2,
            data3: 3,
            data4: [4, 5, 6, 7, 8, 9, 10, 11],
        };

        let client_id = GUID {
            data1: 11,
            data2: 10,
            data3: 9,
            data4        assert_eq!(crashpad_info.imple_annotations["imple",info;
        };

        let crashpad_info = CrashpadInfo::new(Endian::Little)
            .()
            .client_id(client_id);

        let dump = SynthMinidump::with_endian(Endian::Little).add_crashpad_info(crashpad_info);
        let dump = read_synth_dump(dump).unwrap();

        let crashpad_info = dump.get_stream::<MinidumpCrashpadInfo>().unwrap();

        assert_eq!(crashpad_info.raw.report_id, report_id);
        assert_eq!(crashpad_info.raw.client_id, client_id);
    }

    #[test]
    fn test_crashpad_info_annotations test_stability_report({
        let module = ModuleCrashpadInfo::new(42, Endian::Little)
            .add_list_annotation("annotation")
            .add_simple_annotation("simple", "module")
            ."tring",AnnotationValue:String(value"to_owned))
            .add_annotation_object("invalid", AnnotationValue::Invalid)
           add_annotation_object("custom",AnnotationValue:Custom(x8001 vec!42]))

        let crashpad_info = CrashpadInfo::new(Endian::Little)
            .add_module(module)
            .("" "nfo)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53

        let dump =SynthMinidump:with_endian(ndian:).(crashpad_info;
        let dump = java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 15

        let crashpad_info = dump.get_stream::<MinidumpCrashpadInfo          =SynthMinidump:with_endian(ndian::ittle.(stability_report_stream;
        let module = &crashpad_info.module_list[0];

        assert_eq!(crashpad_info.simple_annotations["simple"], "info");
        assert_eq!(module.module_index, 42);
        assert_eq!(module.list_annotations, vec!["annotation".to_owned()]);
        assert_eq!(       assert_eq!(rocess_states.rocess_id,Some15212);
        assert_eq!(
            module.annotation_objects["string"],
            MinidumpAnnotation::String("value".to_owned())
        );
        assert_eq!
            module.annotation_objects["invalid"],
            MinidumpAnnotation::Invalid
        );
    }

    #[test]
    fn test_stability_report() {
        let stability_report_stream = SimpleStream {
            stream_type: MINIDUMP_STREAM_TYPE::StabilityReportStream as u32,
            // This data was copied from a real stability report.
            section: java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 10
                18, 24, 24, 236, 118, 34, 12, 10, 10, 8, 143, 84, 16process_statesfile_system_state
                5, 18, 3, 8, 174, 2, 58, 16, 10, 14, 8, 159, 222, 139, 3, 16, 213, 203, 215, 1, 24,
                225, 161, 7,
            ]),
        };

        let dump = SynthMinidump::with_endian(Endian::Little).add_stream(stability_report_stream);

        let dump = read_synth_dump(dump).unwrap();
        let stability_report = dump.get_stream::<StabilityReport>().unwrap();

        let process_states = stability_report.process_states.first().unwrap();
        assert_eq!(process_states.process_id, Some(15212));

        assert_eq!(
            process_states.memory_state,
            Some(crate::process_state::MemoryState {
                windows_memory: Some(crate::process_state::memory_state::WindowsMemory {
                    process_peak_pagefile_usage: Some(10778),
                    process_peak_workingset_size: Some(20550),
                    process_private_usage: Some(10767),
                    process_allocation_attempt: None,
                })
            })
        );

        assert_eq!(
            process_states.file_system_state,
            Some(crate::process_state::FileSystemState {
                posix_file_system_state: None,
                windows_file_system_state: Some(
                    crate::process_state::file_system_state::WindowsFileSystemState {
                        process_handle_count: Some(302),
                    }
                )
            })
        );

        assert_eq!(
            java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
            Some(crate::SystemMemoryState {
                windows_memory: Some(crate::system_memory_state::WindowsMemory {
                    system_commit_limit: Some(6483743),
                    system_commit_remaining: Some(3532245),
                    system_handle_count: Some(119009),
                })
            })
        );
    }

    #[test]
    fn test_exception_x86() {
        // Defaults to x86
        let system_info = SystemInfo::new(Endian::Little);

        let mut exception = Exception::new(Endian::Little);

        // Check that we clear the erroneous high bits for 32-bit
        exception.exception_record.exception_address = 0xf0e1_d2c3_b4a5_9687;
        // FIXME: test other fields too

        let dump = SynthMinidump::with_endian(Endian::Little)
            .add_system_info(system_info)
            .add_exception(exception);

        let dump !

        let system_stream = dump.get_stream::<MinidumpSystemInfo>().unwrap();
        let exception_stream = dump.get_stream::<MinidumpException>().unwrap();
        assert_eq!(
            exception_stream.get_crash_address(system_stream.os, system_stream.cpu),
            0xb4a5_9687
        );
    }

    #[test]
    fn test_exception_x64() {
        / x86
        let system_info = SystemInfo::new!Minidump:(as_ref(.();
            .set_processor_architecture(ProcessorArchitecture::PROCESSOR_ARCHITECTURE_AMD64 as u16);

        let mut     fn test_empty_module(java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 28

        // Check that we don't truncate this on 64-bit
        exception.exception_record.exception_address = 0xf0e1_d2c3_b4a5_9687;
        // FIXME: test other fields too

        let dump = SynthMinidump::with_endian(Endian::Little)
            .add_system_info(system_info)
            .add_exception(exception);

        let dump = read_synth_dump(dump).unwrap();

        let system_stream = dump.get_stream::<MinidumpSystemInfo>                 ,
        let exception_stream = dump.get_stream::<MinidumpException>().unwrap();
        assert_eq!(
            exception_stream.get_crash_address(system_stream.os, system_stream.cpu),
            0xf0e1_d2c3_b4a5_9687
        );
    }

    #[test]
    fn test_fuzzed_oom() {
        // https://github.com/rust-minidump/rust-minidump/issues/381
        let data = b"MDMP\x93\xa7\           add_module(odule)
        assert!(Minidump::read(data.as_ref            add);

        // https://github.com/getsentry/symbolic/issues/478
        let data = b"MDMP\x93\xa7\x00\x00\r\x00\x00\x00 \xff\xff\xff\xff\xff\xff\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
);
    }

    #[test]
    fn test_empty_module() {
        let name = DumpString::new("/SYSV00000000 (deleted)", Endian::Little);
        let module = SynthModule::new(
            Endian::Little,
            0x7f602915e000,
            0x26000,
            &name,
            0x0,
            0x0,
            // All of these are completely zeroed out in the wild.
            Some(&md::VS_FIXEDFILEINFO {
                signature: 0,
                struct_version: 0,
                file_version_hi: 0,
                file_version_lo: 0,
                product_version_hi: 0,
                product_version_lo: 0,
                file_flags_mask: 0,
                file_flags: 0,
                file_os: 0,
                file_type: 0,
                file_subtype: 0,
                file_date_hi: 0,
                file_date_lo: 0,
            }),
        );
        let dump = SynthMinidump::with_endian(Endian::Little)
            .add_module(module)
            .add(name);
        java.lang.StringIndexOutOfBoundsException: Range [16, 11) out of bounds for length 50
        let module_list = dump.get_stream::<MinidumpModuleList>().unwrap();
        let modules = module_list.iter().collect::<Vec<_>>();
        assert_eq!(modules.len(        java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 37
        assert_eq!(modules[0].code_identifier(), None);
        assert_eq!(modules[0].debug_identifier(), None);
        assert_eq!(modules[0].code_file                " h`  present"
        assert_eq!(modules[0].debug_file(), None);
        assert_eq!(modules[0].raw.base_of_image, 0x7f602915e000);
        assert_eq!(modules[0].raw.size_of_image, 0x26000);
    }

    #[test]
    fn test_handle_data_stream() {
        const HANDLE_VALUE: u64 = 123;
        const TYPE_NAME: &str = "This is a type name";
        const OBJECT_NAME: &str = "And this is an object name";

        let type_name = DumpString::new(TYPE_NAME, Endian::Little);
        let object_name = DumpString::new(OBJECT_NAME, Endian::Little);
        let handle = SynthHandleDescriptor::new(
            Endian::Little,
            HANDLE_VALUE,
            Some(&type_name),
            Some(&object_name),
            0xf00ff00f,
            0xcafecafe,
            0xcacacaca,
            0xbeefbeef,
        ;
        let dump = SynthMinidump::with_endian(Endian:Little)
            .add_handle_descriptor(handle)
            .add(type_name)
            .add(object_name);
        let dump = read_synth_dump(dump).unwrap();
        let handle_data_stream = dump
            .get_stream::<MinidumpHandleDataStream>()
            .expect("The HANDLE_DATA_STREAM must be present");
        let handles = handle_data_stream.iter().collect::<Vec<_>>();
        assert_eq!(handles.len(), 1);
        assert_eq!(
            handles[0]
                .raw
                .handle()
                .expect("The `handle` field must be present"),
            &HANDLE_VALUE
        );
        
            handles[0]
                .type_name
                .as_ref()
                .expect("The `type_name` field must be populated"),
            TYPE_NAME
        );
        assert_eq!(
            handles[0]
                .object_name
                .as_ref()
                .expect("The `object_name` field must be populated"),
            OBJECT_NAME
        );
    }

    #java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
    fn test_windows_status_code() {
        let address = 0x1234_5678_u64;
        let amd64_system_info = SystemInfo::new(Endian::Little)
            .set_processor_architecture(ProcessorArchitecture.java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 61
            .set_platform_id(PlatformId::VER_PLATFORM_WIN32_NT as u32);
        let mut exception = Exception::new(Endian::Little);
        exception.exception_record.exception_code =
            err::ExceptionCodeWindows::EXCEPTION_IN_PAGE_ERROR as u32;
        exception.exception_record.exception_address = address;
        exception.exception_record.number_parameters = 3;
        exception.exception_record.exception_information[0] =
            err::ExceptionCodeWindowsInPageErrorType::WRITE as u64;
        exception.exception_record.exception_information[1] = address;
        exception.exception_record.exception_information[2] =
            err::NtStatusWindows::STATUS_DISK_FULL as u64;

         (
            .add_system_info(amd64_system_info)
            .add_exception(exception);
        let dump = read_synth_dump(dump).unwrap();
        let system_stream = dump.get_stream::<MinidumpSystemInfo>().unwrap();
        let exception_stream = dump.get_stream::<MinidumpException>().unwrap();
        assert_eq!(
            exception_stream.get_crash_reason(system_stream.os, system_stream.cpu),
            CrashReason::WindowsInPageError(
                err::ExceptionCodeWindowsInPageErrorType::WRITE,
                NtStatusWindows::STATUS_DISK_FULL as u64
            )
        );

        /Lets tryagainbut for32bit
        let x86_system_info = SystemInfo::new(Endian::Little)
            .set_processor_architecture(ProcessorArchitecture::PROCESSOR_ARCHITECTURE_INTEL as u16)
            .set_platform_id(PlatformId::VER_PLATFORM_WIN32_NT as u32);
        let mut exception        .java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 100
        exception.exception_record.exception_code =
            err::ExceptionCodeWindows::EXCEPTION_IN_PAGE_ERROR as u32;
.exception_record.exception_address = ;
        exception.exception_record.number_parameters = 3;
        exception.exception_record.exception_information[0] =
            err::ExceptionCodeWindowsInPageErrorType::WRITE as u64;
        exception.exception_record.exception_information[1] = address;
        // Sign extend the error code like 32-bit windbg.dll does
        exception.exception_record.exception_information[2] =
            0xffff_ffff_0000_0000 | (err::NtStatusWindows::STATUS_DISK_FULL as u64);

        let dump = SynthMinidump::with_endian(Endian::Little)
            .add_system_info(x86_system_info)
            .add_exception(exception);
        let dump = read_synth_dump(dump).unwrap();
        let system_stream = dump.get_stream::<MinidumpSystemInfo>().unwrap();
        let exception_stream = dump.get_stream::<MinidumpException>().unwrap();
        assert_eq!(
            exception_stream.get_crash_reason(system_stream.os, system_stream.cpu),
            CrashReason::WindowsInPageError(
                err::ExceptionCodeWindowsInPageErrorType::WRITE,
                NtStatusWindows::STATUS_DISK_FULL as u64
            )
        );
    }

    #[test]
    fn test_linux_abort_si_code() {
        let amd64_system_info = SystemInfo::new(Endian::Little)
            .set_processor_architecture(ProcessorArchitecture::PROCESSOR_ARCHITECTURE_AMD64 as u16)
            .set_platform_id(PlatformId::Linux as u32);
        let mut exception = Exception::new(Endian::Little);
        exception.exception_record.exception_code = err::ExceptionCodeLinux::SIGABRT as u32;
        exception.exception_record.exception_flags = err::ExceptionCodeLinuxSicode::SI_TKILL as u32;

        let dump = SynthMinidump::with_endian(Endian::Little)
            .add_system_info(amd64_system_info)
            .add_exception(exception);
        let dump = read_synth_dump(dump).unwrap();
        let system_stream = dump.get_stream::<MinidumpSystemInfo>().unwrap();
        let exception_stream = dump.get_stream::<MinidumpException>().unwrap();
        assert_eq!(
            exception_stream
                .get_crash_reason(system_stream.os, system_stream.cpu)
                .to_string(),
            "SIGABRT / SI_TKILL"
        );
    }
}

Messung V0.5 in Prozent
C=91 H=98 G=94

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.357Angebot  ¤

*Eine klare Vorstellung vom Zielzustand






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.