Table of Contents

Interface INativeContext

Namespace
Microsoft.Samples.Debugging.Native
Assembly
NativeDebugWrappers.dll

Interface to a context. This provides platform agnostic wrapper to a platform specific OS Context.

public interface INativeContext : IEquatable<INativeContext>, IDisposable

Properties

Flags

Get the flags associated with the context.

ImageFileMachine

Get the ImageFileMachine code. This is used for getting an interop callstack for a machine. Used by TraverseStack

InstructionPointer

Get or Set the instruction pointer

IsSingleStepFlagEnabled

Is the single step flag enabled?

Platform

Get a simple string description of the CPU the context is for. A implementation may also provide a ToString() override to give more detail (eg, which flags are active)

Size

Get Size in bytes. Size could change depending on the flags.

StackPointer

Get the stack pointer

Methods

ClearContext()

This will clear the context buffer.

Clone()

Create a new deep copy of this context. The copies are independent and can be modified without interfering with each other.

EnumerateRegisters()

Enumerate registers names (and their types) for late-bound access. Available registers depend on the flags.

FindRegisterByName(string)

Get a register by name

GetPSFlags(AgnosticContextFlags)

This will return the context specific flags for the given AgnosticContextFlags

the value (found in the enum) of the platform specific flags desired
OpenForDirectAccess()

Used to lock the buffer and get a raw pointer to it. This is the only way to change the entire context at once. This is useful for pinvoking to native functions.

SetRegisterByName(string, object)

Sets a register by name.

SetSingleStepFlag(bool)

Enable or disable the single-step flag in the context.