Documentation
¶
Overview ¶
Package developer offers additional functionality to the developer of ROMs that use a coprocessor. It uses available DWARF data for a binary in order to provide the developer performance profiling and variable information.
The functionality of this package will be greatly expanded in the future.
Index ¶
- Constants
- Variables
- type AllSourceLines
- type CallStack
- type CartCoProcDeveloper
- type Developer
- func (dev *Developer) AttachCartridge(cart CartCoProcDeveloper, romFile string, elfFile string)
- func (dev *Developer) BorrowIllegalAccess(f func(*IllegalAccess))
- func (dev *Developer) BorrowSource(f func(*Source))
- func (dev *Developer) BorrowYieldState(f func(*YieldState))
- func (dev *Developer) CheckBreakpoint(addr uint32) bool
- func (dev *Developer) DisableExpensive(disable bool)
- func (dev *Developer) HasSource() bool
- func (dev *Developer) HighAddress() uint32
- func (dev *Developer) IllegalAccess(event string, pc uint32, addr uint32) string
- func (dev *Developer) NewFrame(frameInfo television.FrameInfo) error
- func (dev *Developer) NullAccess(event string, pc uint32, addr uint32) string
- func (dev *Developer) OnYield(instructionPC uint32, currentPC uint32, reason mapper.YieldReason)
- func (dev *Developer) ProcessProfiling()
- func (dev *Developer) Profiling() *mapper.CartCoProcProfiler
- func (dev *Developer) ResetStatistics()
- func (dev *Developer) StackCollision(pc uint32, addr uint32) string
- func (dev *Developer) StartProfiling()
- type DisasmRange
- type FunctionFilter
- type IllegalAccess
- type IllegalAccessEntry
- type KernelVCS
- type Load
- type SortedFunctions
- func (e SortedFunctions) Len() int
- func (e SortedFunctions) Less(i int, j int) bool
- func (e *SortedFunctions) SetCumulative(set bool)
- func (e *SortedFunctions) SetKernel(kernel KernelVCS)
- func (e SortedFunctions) Sort()
- func (e *SortedFunctions) SortByAverageCycles(descending bool)
- func (e *SortedFunctions) SortByFile(descending bool)
- func (e *SortedFunctions) SortByFrameCycles(descending bool)
- func (e *SortedFunctions) SortByFunction(descending bool)
- func (e *SortedFunctions) SortByMaxCycles(descending bool)
- func (e SortedFunctions) Swap(i int, j int)
- func (e *SortedFunctions) UseRawCyclesCounts(use bool)
- type SortedLines
- func (e SortedLines) Len() int
- func (e SortedLines) Less(i int, j int) bool
- func (e *SortedLines) SetKernel(kernel KernelVCS)
- func (e SortedLines) Sort()
- func (e *SortedLines) SortByAverageLoadOverFunction(descending bool)
- func (e *SortedLines) SortByAverageLoadOverSource(descending bool)
- func (e *SortedLines) SortByFile(descending bool)
- func (e *SortedLines) SortByFrameLoadOverFunction(descending bool)
- func (e *SortedLines) SortByFrameLoadOverSource(descending bool)
- func (e *SortedLines) SortByFunction(descending bool)
- func (e *SortedLines) SortByLineAndFunction(descending bool)
- func (e *SortedLines) SortByLineNumber(descending bool)
- func (e *SortedLines) SortByMaxLoadOverFunction(descending bool)
- func (e *SortedLines) SortByMaxLoadOverSource(descending bool)
- func (e SortedLines) Swap(i int, j int)
- func (e *SortedLines) UseRawCyclesCounts(use bool)
- type SortedVariableMethod
- type SortedVariables
- type SortedVariablesLocal
- type Source
- func (src *Source) AddFunctionFilter(functionName string)
- func (src *Source) CanBreakpoint(ln *SourceLine) bool
- func (src *Source) CheckBreakpoint(ln *SourceLine) bool
- func (src *Source) DropFunctionFilter(functionName string)
- func (src *Source) FindSourceLine(addr uint32) *SourceLine
- func (src *Source) FramebaseCurrent() (uint64, error)
- func (src *Source) ResetStatistics()
- func (src *Source) ToggleBreakpoint(ln *SourceLine)
- func (src *Source) UpdateGlobalVariables()
- type SourceDisasm
- type SourceFile
- type SourceFileContent
- type SourceFunction
- type SourceLine
- type SourceLineFragment
- type SourceLineFragmentType
- type SourceRange
- type SourceType
- type SourceVariable
- func (varb *SourceVariable) Address() (uint64, bool)
- func (varb *SourceVariable) Child(i int) *SourceVariable
- func (varb *SourceVariable) Derivation() []loclistDerivation
- func (varb *SourceVariable) NumChildren() int
- func (varb *SourceVariable) String() string
- func (varb *SourceVariable) Update()
- func (varb *SourceVariable) Value() uint32
- type SourceVariableLocal
- type Stats
- type StatsGroup
- type TV
- type YieldState
Constants ¶
const DriverFunctionName = "<driver>"
DriverFunctionName is the name given to a function that represents all the instructions that fall outside of the ROM and are in fact in the "driver".
Variables ¶
var AvailableInKernelOptions = []string{"Any", "VBLANK", "Screen", "Overscan", "ROM Setup"}
List of KernelVCS values as strings
Functions ¶
This section is empty.
Types ¶
type AllSourceLines ¶ added in v0.20.0
type AllSourceLines struct {
// contains filtered or unexported fields
}
func (AllSourceLines) Get ¶ added in v0.20.0
func (a AllSourceLines) Get(i int) *SourceLine
func (AllSourceLines) Len ¶ added in v0.20.0
func (a AllSourceLines) Len() int
func (AllSourceLines) String ¶ added in v0.20.0
func (a AllSourceLines) String(i int) string
type CallStack ¶ added in v0.19.3
type CallStack struct {
// contains filtered or unexported fields
}
CallStack maintains information about function calls and the order in which they happen.
type CartCoProcDeveloper ¶ added in v0.20.0
type CartCoProcDeveloper interface { GetCoProc() mapper.CartCoProc PushFunction(func()) }
CartCoProcDeveloper defines the interface to the cartridge required by the developer pacakge
type Developer ¶
type Developer struct {
// contains filtered or unexported fields
}
Developer implements the CartCoProcDeveloper interface.
func NewDeveloper ¶
NewDeveloper is the preferred method of initialisation for the Developer type.
func (*Developer) AttachCartridge ¶ added in v0.20.0
func (dev *Developer) AttachCartridge(cart CartCoProcDeveloper, romFile string, elfFile string)
func (*Developer) BorrowIllegalAccess ¶
func (dev *Developer) BorrowIllegalAccess(f func(*IllegalAccess))
BorrowIllegalAccess will lock the illegal access log for the duration of the supplied fucntion, which will be executed with the illegal access log as an argument.
func (*Developer) BorrowSource ¶
BorrowSource will lock the source code structure for the durction of the supplied function, which will be executed with the source code structure as an argument.
May return nil.
func (*Developer) BorrowYieldState ¶ added in v0.20.0
func (dev *Developer) BorrowYieldState(f func(*YieldState))
BorrowYieldState will lock the illegal access log for the duration of the supplied fucntion, which will be executed with the illegal access log as an argument.
func (*Developer) CheckBreakpoint ¶ added in v0.19.3
CheckBreakpoint implements the mapper.CartCoProcDeveloper interface.
func (*Developer) DisableExpensive ¶ added in v0.20.0
DisableExpensive prevents the computationaly expensive developer functions from running.
func (*Developer) HighAddress ¶ added in v0.20.0
HighAddress implements the CartCoProcDeveloper interface.
func (*Developer) IllegalAccess ¶
IllegalAccess implements the CartCoProcDeveloper interface.
func (*Developer) NewFrame ¶
func (dev *Developer) NewFrame(frameInfo television.FrameInfo) error
NewFrame implements the television.FrameTrigger interface.
func (*Developer) NullAccess ¶ added in v0.18.0
IllegalAccess implements the CartCoProcDeveloper interface.
func (*Developer) OnYield ¶ added in v0.20.0
func (dev *Developer) OnYield(instructionPC uint32, currentPC uint32, reason mapper.YieldReason)
OnYield implements the mapper.CartCoProcDeveloper interface.
func (*Developer) ProcessProfiling ¶ added in v0.19.3
func (dev *Developer) ProcessProfiling()
ProcessProfiling implements the mapper.CartCoProcDeveloper interface.
func (*Developer) Profiling ¶ added in v0.19.3
func (dev *Developer) Profiling() *mapper.CartCoProcProfiler
Profiling implements the mapper.CartCoProcDeveloper interface.
func (*Developer) ResetStatistics ¶ added in v0.19.3
func (dev *Developer) ResetStatistics()
ResetStatistics resets all performance statistics. This differs from the function in the Source type in that it acquires and releases the source critical section.
func (*Developer) StackCollision ¶ added in v0.18.0
IllegalAccess implements the CartCoProcDeveloper interface.
func (*Developer) StartProfiling ¶ added in v0.19.3
func (dev *Developer) StartProfiling()
StartProfiling implements the mapper.CartCoProcDeveloper interface.
type DisasmRange ¶ added in v0.17.0
type DisasmRange struct {
Disasm []*SourceDisasm
}
DisasmRange is used to dynamically create a list of SourceDisasm entries.
func (*DisasmRange) Add ¶ added in v0.17.0
func (rng *DisasmRange) Add(line *SourceLine)
Add the disassembly entries for a SourceLine to the range.
func (*DisasmRange) Clear ¶ added in v0.17.0
func (rng *DisasmRange) Clear()
Clear all disassembly entires from the range.
func (*DisasmRange) IsEmpty ¶ added in v0.17.0
func (rng *DisasmRange) IsEmpty() bool
IsEmpty returns true if there are now SourceDisasm entries in the range.
func (*DisasmRange) Len ¶ added in v0.17.0
func (rng *DisasmRange) Len() int
Len implements the sort.Sort interface.
func (*DisasmRange) Less ¶ added in v0.17.0
func (rng *DisasmRange) Less(i int, j int) bool
Less implements the sort.Sort interface.
func (*DisasmRange) Swap ¶ added in v0.17.0
func (rng *DisasmRange) Swap(i int, j int)
Swap implements the sort.Sort interface.
type FunctionFilter ¶ added in v0.17.0
type FunctionFilter struct { FunctionName string Function *SourceFunction Lines SortedLines }
type IllegalAccess ¶
type IllegalAccess 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 []*IllegalAccessEntry // 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 }
IllegalAccess records memory accesses by the coprocesser that are "illegal".
type IllegalAccessEntry ¶
type IllegalAccessEntry struct { Event string PC uint32 AccessAddr uint32 // number of times this specific illegal access has been seen Count int // the source line of the PC address. field can be nil SrcLine *SourceLine // whether access address was reported as being a "null access". when this // is true the illegal access is very likely because of a null pointer // dereference IsNullAccess bool }
IllegalAccessEntry is a single entry in the illegal access log.
type KernelVCS ¶ added in v0.19.3
type KernelVCS int
KernelVCS indicates the 2600 kernel that is associated with a source function or source line.
type Load ¶ added in v0.17.0
type Load struct { // cycle count FrameCount float32 AverageCount float32 MaxCount float32 // cycle count expressed as a percentage Frame float32 Average float32 Max float32 // whether the corresponding values are valid FrameValid bool AverageValid bool MaxValid bool }
Load records the frame (or current) load as well as the average and maximum load.
type SortedFunctions ¶ added in v0.17.0
type SortedFunctions struct { Functions []*SourceFunction // contains filtered or unexported fields }
func (SortedFunctions) Len ¶ added in v0.17.0
func (e SortedFunctions) Len() int
func (*SortedFunctions) SetCumulative ¶ added in v0.19.3
func (e *SortedFunctions) SetCumulative(set bool)
func (*SortedFunctions) SetKernel ¶ added in v0.18.0
func (e *SortedFunctions) SetKernel(kernel KernelVCS)
func (SortedFunctions) Sort ¶ added in v0.17.0
func (e SortedFunctions) Sort()
func (*SortedFunctions) SortByAverageCycles ¶ added in v0.17.0
func (e *SortedFunctions) SortByAverageCycles(descending bool)
func (*SortedFunctions) SortByFile ¶ added in v0.17.0
func (e *SortedFunctions) SortByFile(descending bool)
func (*SortedFunctions) SortByFrameCycles ¶ added in v0.17.0
func (e *SortedFunctions) SortByFrameCycles(descending bool)
func (*SortedFunctions) SortByFunction ¶ added in v0.17.0
func (e *SortedFunctions) SortByFunction(descending bool)
func (*SortedFunctions) SortByMaxCycles ¶ added in v0.17.0
func (e *SortedFunctions) SortByMaxCycles(descending bool)
func (SortedFunctions) Swap ¶ added in v0.17.0
func (e SortedFunctions) Swap(i int, j int)
func (*SortedFunctions) UseRawCyclesCounts ¶ added in v0.19.3
func (e *SortedFunctions) UseRawCyclesCounts(use bool)
type SortedLines ¶ added in v0.17.0
type SortedLines struct { Lines []*SourceLine // contains filtered or unexported fields }
func (SortedLines) Len ¶ added in v0.17.0
func (e SortedLines) Len() int
func (*SortedLines) SetKernel ¶ added in v0.18.0
func (e *SortedLines) SetKernel(kernel KernelVCS)
func (SortedLines) Sort ¶ added in v0.17.0
func (e SortedLines) Sort()
func (*SortedLines) SortByAverageLoadOverFunction ¶ added in v0.17.0
func (e *SortedLines) SortByAverageLoadOverFunction(descending bool)
func (*SortedLines) SortByAverageLoadOverSource ¶ added in v0.17.0
func (e *SortedLines) SortByAverageLoadOverSource(descending bool)
func (*SortedLines) SortByFile ¶ added in v0.17.0
func (e *SortedLines) SortByFile(descending bool)
func (*SortedLines) SortByFrameLoadOverFunction ¶ added in v0.17.0
func (e *SortedLines) SortByFrameLoadOverFunction(descending bool)
func (*SortedLines) SortByFrameLoadOverSource ¶ added in v0.17.0
func (e *SortedLines) SortByFrameLoadOverSource(descending bool)
func (*SortedLines) SortByFunction ¶ added in v0.17.0
func (e *SortedLines) SortByFunction(descending bool)
func (*SortedLines) SortByLineAndFunction ¶ added in v0.17.0
func (e *SortedLines) SortByLineAndFunction(descending bool)
func (*SortedLines) SortByLineNumber ¶ added in v0.17.0
func (e *SortedLines) SortByLineNumber(descending bool)
func (*SortedLines) SortByMaxLoadOverFunction ¶ added in v0.17.0
func (e *SortedLines) SortByMaxLoadOverFunction(descending bool)
func (*SortedLines) SortByMaxLoadOverSource ¶ added in v0.17.0
func (e *SortedLines) SortByMaxLoadOverSource(descending bool)
func (SortedLines) Swap ¶ added in v0.17.0
func (e SortedLines) Swap(i int, j int)
func (*SortedLines) UseRawCyclesCounts ¶ added in v0.19.3
func (e *SortedLines) UseRawCyclesCounts(use bool)
type SortedVariableMethod ¶ added in v0.18.0
type SortedVariableMethod int
const ( SortVariableByName SortedVariableMethod = iota SortVariableByAddress )
type SortedVariables ¶ added in v0.18.0
type SortedVariables struct { Variables []*SourceVariable Method SortedVariableMethod Descending bool }
func (SortedVariables) Len ¶ added in v0.18.0
func (v SortedVariables) Len() int
func (*SortedVariables) SortByAddress ¶ added in v0.18.0
func (e *SortedVariables) SortByAddress(descending bool)
func (*SortedVariables) SortByName ¶ added in v0.18.0
func (e *SortedVariables) SortByName(descending bool)
func (SortedVariables) Swap ¶ added in v0.18.0
func (v SortedVariables) Swap(i int, j int)
type SortedVariablesLocal ¶ added in v0.20.0
type SortedVariablesLocal struct { Locals []*SourceVariableLocal Method SortedVariableMethod Descending bool }
SortedVariabelsLocal is exactly the same as the SortedVariables type except for the type of the Variables field. this is a good candidate for replacing with a Go1.19 generic solution
func (SortedVariablesLocal) Len ¶ added in v0.20.0
func (v SortedVariablesLocal) Len() int
func (SortedVariablesLocal) Less ¶ added in v0.20.0
func (v SortedVariablesLocal) Less(i int, j int) bool
func (*SortedVariablesLocal) SortByAddress ¶ added in v0.20.0
func (e *SortedVariablesLocal) SortByAddress(descending bool)
func (*SortedVariablesLocal) SortByName ¶ added in v0.20.0
func (e *SortedVariablesLocal) SortByName(descending bool)
func (SortedVariablesLocal) Swap ¶ added in v0.20.0
func (v SortedVariablesLocal) Swap(i int, j int)
type Source ¶
type Source struct { // source is compiled with optimisation Optimised bool // disassembled binary Disassembly map[uint64]*SourceDisasm // all the files in all the compile units Files map[string]*SourceFile Filenames []string // as above but indexed by the file's short filename, which is sometimes // more useful than the full name // // short filenames also only include files that are in the same path as the // ROM file FilesByShortname map[string]*SourceFile ShortFilenames []string // functions found in the compile units Functions map[string]*SourceFunction FunctionNames []string // best guess at what the "main" function is in the program. very often // this function will be called "main" and will be easy to discern but // sometimes it is named something else and we must figure out as best we // can which function it is // // if no function can be found at all, MainFunction will be a stub entry MainFunction *SourceFunction // sorted list of every function in all compile unit SortedFunctions SortedFunctions GlobalsByAddress map[uint64]*SourceVariable SortedGlobals SortedVariables SortedLocals SortedVariablesLocal // the highest address of any variable (not just global variables, any // variable) HighAddress uint64 // lines of source code found in the compile units. this is a sparse // coverage of the total address space LinesByAddress map[uint64]*SourceLine // sorted list of every source line in all compile units SortedLines SortedLines // every non-blank line of source code in all compile units AllLines AllSourceLines // sorted lines filtered by function name FunctionFilters []*FunctionFilter // statistics for the entire program Stats StatsGroup // flag to indicate whether the execution profile has changed since it was cleared // // cheap and easy way to prevent sorting too often - rather than sort after // every call to execute(), we can use this flag to sort only when we need // to in the GUI. // // probably not scalable but sufficient for our needs of a single GUI // running and using the statistics for only one reason ExecutionProfileChanged bool // list of breakpoints on ARM program Breakpoints map[uint32]bool // call stack of running program CallStack CallStack // contains filtered or unexported fields }
Source is created from available DWARF data that has been found in relation to and ELF file that looks to be related to the specified ROM.
It is possible for the arrays/map fields to be empty
func NewSource ¶ added in v0.17.0
func NewSource(romFile string, cart CartCoProcDeveloper, elfFile string) (*Source, error)
NewSource is the preferred method of initialisation for the Source type.
If no ELF file or valid DWARF data can be found in relation to the ROM file the function will return nil with an error.
Once the ELF and DWARF file has been identified then Source will always be non-nil but with the understanding that the fields may be empty.
func (*Source) AddFunctionFilter ¶ added in v0.17.0
func (*Source) CanBreakpoint ¶ added in v0.20.0
func (src *Source) CanBreakpoint(ln *SourceLine) bool
func (*Source) CheckBreakpoint ¶ added in v0.19.3
func (src *Source) CheckBreakpoint(ln *SourceLine) bool
CheckBreakpoint returns true if there is a breakpoint on the specified line.
func (*Source) DropFunctionFilter ¶ added in v0.17.0
DropFunctionFilter drops the existing filter.
func (*Source) FindSourceLine ¶ added in v0.19.3
func (src *Source) FindSourceLine(addr uint32) *SourceLine
FindSourceLine returns line entry for the address. Returns nil if the address has no source line.
func (*Source) FramebaseCurrent ¶ added in v0.21.0
FramebaseCurrent returns the current framebase value
func (*Source) ResetStatistics ¶ added in v0.18.0
func (src *Source) ResetStatistics()
ResetStatistics resets all performance statistics.
func (*Source) ToggleBreakpoint ¶ added in v0.19.3
func (src *Source) ToggleBreakpoint(ln *SourceLine)
ToggleBreakpoint adds or removes a breakpoint depending on whether the breakpoint already exists.
func (*Source) UpdateGlobalVariables ¶ added in v0.20.0
func (src *Source) UpdateGlobalVariables()
UpdateGlobalVariables using the current state of the emulated coprocessor. Local variables are updated when coprocessor yields (see OnYield() function)
type SourceDisasm ¶ added in v0.17.0
type SourceDisasm struct { Addr uint32 Instruction string Line *SourceLine // contains filtered or unexported fields }
SourceDisasm is a single disassembled intruction from the ELF binary. Not to be confused with the coprocessor.disassembly package. SourceDisasm instances are intended to be used by static disasemblers.
func (*SourceDisasm) Opcode ¶ added in v0.17.0
func (d *SourceDisasm) Opcode() string
Opcode returns a string formatted opcode appropriate for the bit length.
func (*SourceDisasm) String ¶ added in v0.17.0
func (d *SourceDisasm) String() string
type SourceFile ¶ added in v0.17.0
type SourceFile struct { Filename string ShortFilename string Content SourceFileContent // the source file has at least one global variable if HasGlobals is true HasGlobals bool }
SourceFile is a single source file indentified by the DWARF data.
func (*SourceFile) IsStub ¶ added in v0.20.0
func (f *SourceFile) IsStub() bool
IsStub returns true if the SourceFile is just a stub.
type SourceFileContent ¶ added in v0.20.0
type SourceFileContent struct { Lines []*SourceLine MaxLineWidth int }
SourceFileContent lists the lines in a source file
func (SourceFileContent) Len ¶ added in v0.20.0
func (s SourceFileContent) Len() int
Len implements the fuzzy.Source interface
func (SourceFileContent) String ¶ added in v0.20.0
func (s SourceFileContent) String(i int) string
String implements the fuzzy.Source interface
type SourceFunction ¶ added in v0.17.0
type SourceFunction struct { // name of function Name string // range of addresses in which function resides Range []SourceRange // first source line for each instance of the function. note that the first // line of a function may not have any code directly associated with it. // the Disassembly and Stats fields therefore should not be relied upon. DeclLine *SourceLine // stats for the function FlatStats StatsGroup CumulativeStats StatsGroup // which 2600 kernel has this function executed in Kernel KernelVCS // whether the call stack involving this function is likely inaccurate OptimisedCallStack bool // contains filtered or unexported fields }
SourceFunction is a single function identified by the DWARF data or by the ELF symbol table in the case of no DWARF information being available for the function.
func (*SourceFunction) IsInlined ¶ added in v0.20.0
func (fn *SourceFunction) IsInlined() bool
IsInlined returns true if the function has at least one inlined instance
func (*SourceFunction) IsStub ¶ added in v0.19.3
func (fn *SourceFunction) IsStub() bool
IsStub returns true if the SourceFunction is just a stub
func (*SourceFunction) String ¶ added in v0.20.0
func (fn *SourceFunction) String() string
type SourceLine ¶ added in v0.17.0
type SourceLine struct { // the actual file/line of the SourceLine. line numbers are counted from one File *SourceFile LineNumber int // the function the line of source can be found within Function *SourceFunction // whether this line is to be found inlined elsewhere in the program Inlined bool // plain string of line PlainContent string // line divided into parts Fragments []SourceLineFragment // the generated assembly for this line. will be empty if line is a comment // or otherwise unsused. // // note that only disassembly for non-linined ranges will be collated Disassembly []*SourceDisasm // whether this source line has been responsible for a likely bug (eg. illegal access of memory) Bug bool // statistics for the line Stats StatsGroup // which 2600 kernel has this line executed in Kernel KernelVCS // contains filtered or unexported fields }
SourceLine is a single line of source in a source file, identified by the DWARF data and loaded from the actual source file.
func (*SourceLine) IsStub ¶ added in v0.19.3
func (ln *SourceLine) IsStub() bool
IsStub returns true if the SourceLine is just a stub.
func (*SourceLine) String ¶ added in v0.17.0
func (ln *SourceLine) String() string
type SourceLineFragment ¶ added in v0.17.0
type SourceLineFragment struct { Type SourceLineFragmentType Content string }
SourceLineFragment represents an single part of the entire source line.
type SourceLineFragmentType ¶ added in v0.17.0
type SourceLineFragmentType int
SourceLineFragmentType defines how a single SourceLineFragment should be interpretted.
const ( FragmentCode SourceLineFragmentType = iota FragmentComment FragmentStringLiteral )
A list of the valid SourceLineFragmentTypes.
type SourceRange ¶ added in v0.20.0
SourceRange is used to specify the effective start and end addresses of a function or a variable.
func (SourceRange) InRange ¶ added in v0.20.0
func (r SourceRange) InRange(addr uint64) bool
InRange returns true if address is in range of start and end addresses
func (SourceRange) Size ¶ added in v0.20.0
func (r SourceRange) Size() uint64
Size returns the size of the range
func (SourceRange) String ¶ added in v0.20.0
func (r SourceRange) String() string
String returns the start/end addresses of the range. If the range is inlined then the addresses are printed with square brackets.
type SourceType ¶ added in v0.18.0
type SourceType struct { Name string // is a constant type Constant bool // the base type of pointer types. will be nil if type is not a pointer type PointerType *SourceType // size of values of this type (in bytes) Size int // empty if type is not a composite type. see SourceVariable.IsComposite() // function Members []*SourceVariable // number of elements in the type. if count is more than zero then this // type is an array. see SourceVariable.IsArry() function ElementCount int // the base type of all the elements in the type ElementType *SourceType }
SourceType is a single type identified by the DWARF data. Composite types are differentiated by the existance of member fields
func (*SourceType) Bin ¶ added in v0.18.0
func (typ *SourceType) Bin() string
Bin returns a format string to represent a value as a correctly padded binary number.
func (*SourceType) Hex ¶ added in v0.18.0
func (typ *SourceType) Hex() string
Hex returns a format string to represent a value as a correctly padded hexadecinal number.
func (*SourceType) IsArray ¶ added in v0.18.0
func (typ *SourceType) IsArray() bool
IsArray returns true if SourceType is an array type.
func (*SourceType) IsComposite ¶ added in v0.18.0
func (typ *SourceType) IsComposite() bool
IsComposite returns true if SourceType is a composite type.
func (*SourceType) IsPointer ¶ added in v0.18.0
func (typ *SourceType) IsPointer() bool
IsPointer returns true if SourceType is a pointer type.
func (*SourceType) Mask ¶ added in v0.18.0
func (typ *SourceType) Mask() uint32
Mask returns the mask value of the correct size for the type.
func (*SourceType) String ¶ added in v0.20.0
func (typ *SourceType) String() string
type SourceVariable ¶ added in v0.18.0
type SourceVariable struct { // name of variable Name string // variable type (int, char, etc.) Type *SourceType // first source line for each instance of the function DeclLine *SourceLine // if ErrorOnResolve is not nil then an error was enountered during a // resolve() sequence. the error will be logged when the field is first set // to true ErrorOnResolve error // contains filtered or unexported fields }
SourceVariable is a single variable identified by the DWARF data.
func (*SourceVariable) Address ¶ added in v0.18.0
func (varb *SourceVariable) Address() (uint64, bool)
Address returns the location in memory of the variable referred to by SourceVariable
func (*SourceVariable) Child ¶ added in v0.20.0
func (varb *SourceVariable) Child(i int) *SourceVariable
Child returns the i'th child of the variable. A child can be an array element, composite member or dereferenced variable, as appropriate for the variables SourceType
Count from zero. Returns nil if no such child exists
func (*SourceVariable) Derivation ¶ added in v0.20.0
func (varb *SourceVariable) Derivation() []loclistDerivation
Derivation returns the sequence of results that led to the most recent value.
func (*SourceVariable) NumChildren ¶ added in v0.20.0
func (varb *SourceVariable) NumChildren() int
NumChildren returns the number of children for this variable
func (*SourceVariable) String ¶ added in v0.18.0
func (varb *SourceVariable) String() string
func (*SourceVariable) Update ¶ added in v0.20.0
func (varb *SourceVariable) Update()
Update variable. It should be called periodically before using the return value from Address() or Value()
Be careful to only call this from the emulation goroutine.
func (*SourceVariable) Value ¶ added in v0.20.0
func (varb *SourceVariable) Value() uint32
Value returns the current value of a SourceVariable
type SourceVariableLocal ¶ added in v0.20.0
type SourceVariableLocal struct { *SourceVariable // the address range for which the variable is valid Range SourceRange }
SourceVariableLocal represents a single local variable identified by the DWARF data.
type Stats ¶ added in v0.17.0
Stats records the cycle count over time and can be used to the frame (or current) load as well as average and maximum load.
The actual percentage values are accessed through the OverSource and OverFunction fields. These fields provide the necessary scale by which the load is measured.
The validity of the OverSource and OverFunction fields depends on context. For instance, for the SourceFunction type, the corresponding OverFunction field is invalid. For the Source type meanwhile, neither field is valid.
For the SourceLine type however, both OverSource and OverFunction can be used to provide a different scaling to the load values.
func (*Stats) HasExecuted ¶ added in v0.20.0
HasExecuted returns true if the statistics have ever been updated. ie. the source associated with this statistic has ever executed.
Not to be confused with the FrameValid, AverageValid and MaxValid fields of the Load type.
type StatsGroup ¶ added in v0.19.3
type StatsGroup struct { // cycle statistics for the entire program Overall Stats // kernel specific cycle statistics for the program. accumulated only once TV is stable VBLANK Stats Screen Stats Overscan Stats ROMSetup Stats }
StatsGroup collates the Stats instance for all kernel views of the program.
type TV ¶ added in v0.18.0
type TV interface { GetFrameInfo() television.FrameInfo GetCoords() coords.TelevisionCoords }
TV is the interface from the developer type to the television implementation.
type YieldState ¶ added in v0.20.0
type YieldState struct { InstructionPC uint32 Reason mapper.YieldReason LocalVariables []*SourceVariableLocal }
YieldState records the most recent yield.
func (*YieldState) Cmp ¶ added in v0.20.0
func (y *YieldState) Cmp(w *YieldState) bool
Cmp returns true if two YieldStates are equal.
Source Files
¶
- breakpoints.go
- developer.go
- disasm_range.go
- doc.go
- function_filter.go
- illegal_access.go
- mapfile.go
- profiling.go
- profiling_stats.go
- source.go
- source_dwarf_builder.go
- source_dwarf_frame.go
- source_dwarf_frame_instructions.go
- source_dwarf_loclist.go
- source_dwarf_loclist_operations.go
- source_fragments.go
- source_sorting.go
- source_types.go
- source_types_variables.go
- yield.go