Struct libcasr::report::CrashReport

source ·
pub struct CrashReport {
Show 32 fields pub pid: i32, pub date: String, pub uname: String, pub os: String, pub os_release: String, pub architecture: String, pub executable_path: String, pub proc_environ: Vec<String>, pub proc_cmdline: String, pub stdin: String, pub proc_status: Vec<String>, pub proc_maps: Vec<String>, pub proc_fd: Vec<String>, pub network_connections: Vec<String>, pub execution_class: ExecutionClass, pub stacktrace: Vec<String>, pub registers: Registers, pub disassembly: Vec<String>, pub package: String, pub package_version: String, pub package_architecture: String, pub package_description: String, pub asan_report: Vec<String>, pub ubsan_report: Vec<String>, pub python_report: Vec<String>, pub go_report: Vec<String>, pub java_report: Vec<String>, pub rust_report: Vec<String>, pub js_report: Vec<String>, pub csharp_report: Vec<String>, pub crashline: String, pub source: Vec<String>,
}
Expand description

Represents the information about program termination.

Fields§

§pid: i32

Pid of crashed process.

§date: String

Date and time of the problem report in ISO format. (see asctime(3)).

§uname: String

Output of uname -a.

§os: String

Name of the operating system. On LSB compliant systems, this can be determined with lsb_release -si.

§os_release: String

Release version of the operating system. On LSB compliant systems, this can be determined with lsb_release -sr.

§architecture: String

OS specific notation of processor/system architecture (e. g. i386).

§executable_path: String

Contents of /proc/pid/exe for ELF files; if the process is an interpreted script, this is the script path instead.

§proc_environ: Vec<String>

Subset of the process’ environment, from /proc/pid/env; this should only show some standard variables that.

§proc_cmdline: String

Contents of /proc/pid/cmdline.

§stdin: String

Path to stdin for target

§proc_status: Vec<String>

Contents of /proc/pid/status.

§proc_maps: Vec<String>

Contents of /proc/pid/maps.

§proc_fd: Vec<String>

Opend files at crash : ls -lah /proc/<pid>/fd.

§network_connections: Vec<String>

Opened network connections.

§execution_class: ExecutionClass

Crash classification.

§stacktrace: Vec<String>

Stack trace for crashed thread.

§registers: Registers

Registers state for crashed thread.

§disassembly: Vec<String>

Disassembly for crashed state (16 instructions).

§package: String

Package name.

§package_version: String

Package version.

§package_architecture: String

Package architecture.

§package_description: String

Package description.

§asan_report: Vec<String>

Asan report.

§ubsan_report: Vec<String>

Ubsan report.

§python_report: Vec<String>

Python report.

§go_report: Vec<String>

Go report.

§java_report: Vec<String>

Java report.

§rust_report: Vec<String>

Rust report.

§js_report: Vec<String>

JS report.

§csharp_report: Vec<String>

C# report.

§crashline: String

Crash line from stack trace: source:line or binary+offset.

§source: Vec<String>

Source code fragment.

Implementations§

source§

impl CrashReport

source

pub fn new() -> Self

Create new CrashReport

source

pub fn add_network_connections(&mut self) -> Result<()>

Add information about opened network connections

source

pub fn add_os_info(&mut self) -> Result<()>

Add information about operation system

source

pub fn add_proc_info(&mut self) -> Result<()>

Add information about running process

source

pub fn add_proc_environ(&mut self) -> Result<()>

Add current process environment variables

source

pub fn add_package_info(&mut self) -> Result<()>

Add package information.

source

pub fn sources(debug: &DebugInfo) -> Option<Vec<String>>

Get source code fragment for crash line

§Arguments
  • ‘debug’ - debug information
source

pub fn set_disassembly(&mut self, gdb_asm: &str)

Add disassembly as strings

§Arguments
  • gdb_asm - disassembly from gdb
source

pub fn filtered_stacktrace(&self) -> Result<Stacktrace>

Filter frames from the stack trace that are not related to analyzed code containing crash and return it as Stacktrace struct

Trait Implementations§

source§

impl Clone for CrashReport

source§

fn clone(&self) -> CrashReport

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CrashReport

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for CrashReport

source§

fn default() -> CrashReport

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for CrashReport

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for CrashReport

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Serialize for CrashReport

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,