faults

package
v0.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package faults records memory faults generated by a coprocessor.

Usage of the word "faults" is a shorthand and should probably be referred to as "memory faults" in a user facing context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category string

Category classifies the approximate reason for a memory fault

const (
	NullDereference  Category = "null dereference"
	MisalignedAccess Category = "misaligned access"
	StackCollision   Category = "stack collision"
	IllegalAddress   Category = "illegal address"
	UndefinedSymbol  Category = "undefined symbol"
)

List of valid Category values

type Entry

type Entry struct {
	Category Category

	// description of the event that triggered the memory fault
	Event string

	// addresses related to the fault
	InstructionAddr uint32
	AccessAddr      uint32

	// number of times this specific illegal access has been seen
	Count int
}

Entry is a single entry in the fault log

func (Entry) String

func (e Entry) String() string

type Faults

type Faults struct {

	// all the accesses in order of the first time they appear. the Count field
	// in the IllegalAccessEntry can be used to see if that entry was seen more
	// than once *after* the first appearance
	Log []*Entry

	// is true once a stack collision has been detected. once a stack collision
	// has occured then subsequent illegal accesses cannot be trusted and will
	// likely not be logged
	HasStackCollision bool
	// contains filtered or unexported fields
}

Faults records memory accesses by the coprocesser that are "illegal".

func NewFaults

func NewFaults() Faults

func (*Faults) Clear added in v0.30.0

func (flt *Faults) Clear()

Clear all entries from faults log. Does not clear the HasStackCollision flag

func (*Faults) NewEntry

func (flt *Faults) NewEntry(category Category, event string, instructionAddr uint32, accessAddr uint32)

NewEntry adds a new entry to the list of faults

func (Faults) WriteLog

func (flt Faults) WriteLog(w io.Writer)

WriteLog writes the list of faults in the order they were added

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL