pub enum UnwindOperation {
    PushNonVolatile(Register),
    Alloc(u32),
    SetFPRegister,
    SaveNonVolatile(RegisterStackFrameOffset),
    SaveXMM(RegisterStackFrameOffset),
    Epilog,
    SaveXMM128(RegisterStackFrameOffset),
    PushMachineFrame(bool),
    Noop,
}
Expand description

An unwind operation corresponding to code in the function prolog.

Unwind operations can be used to reverse the effects of the function prolog and restore register values of parent stack frames that have been saved to the stack.

Variants

PushNonVolatile(Register)

Push a nonvolatile integer register, decrementing RSP by 8.

Alloc(u32)

Allocate a fixed-size area on the stack.

SetFPRegister

Establish the frame pointer register by setting the register to some offset of the current RSP. The use of an offset permits establishing a frame pointer that points to the middle of the fixed stack allocation, helping code density by allowing more accesses to use short instruction forms.

SaveNonVolatile(RegisterStackFrameOffset)

Save a nonvolatile integer register on the stack using a MOV instead of a PUSH. This code is primarily used for shrink-wrapping, where a nonvolatile register is saved to the stack in a position that was previously allocated.

SaveXMM(RegisterStackFrameOffset)

Save the lower 64 bits of a nonvolatile XMM register on the stack.

Epilog

Describes the function epilog.

This operation has been introduced with unwind info version 2 and is not implemented yet.

SaveXMM128(RegisterStackFrameOffset)

Save all 128 bits of a nonvolatile XMM register on the stack.

PushMachineFrame(bool)

Push a machine frame. This is used to record the effect of a hardware interrupt or exception. Depending on the error flag, this frame has two different layouts.

This unwind code always appears in a dummy prolog, which is never actually executed but instead appears before the real entry point of an interrupt routine, and exists only to provide a place to simulate the push of a machine frame. This operation records that simulation, which indicates the machine has conceptually done this:

  1. Pop RIP return address from top of stack into temp
  2. $ss, Push old $rsp, $rflags, $cs, temp
  3. If error flag is true, push the error code

Without an error code, RSP was incremented by 40 and the following was frame pushed:

OffsetValue
RSP + 32$ss
RSP + 24old $rsp
RSP + 16$rflags
RSP + 8$cs
RSP + 0$rip

With an error code, RSP was incremented by 48 and the following was frame pushed:

OffsetValue
RSP + 40$ss
RSP + 32old $rsp
RSP + 24$rflags
RSP + 16$cs
RSP + 8$rip
RSP + 0error code

Noop

A reserved operation without effect.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more

Causes self to use its Binary implementation when Debug-formatted. Read more

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted. Read more

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Formats each item in a sequence. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Attempts to convert self into T using TryInto<T>. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.