parser

package
v0.0.0-...-c4863fd Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2014 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GIPParseFunc

type GIPParseFunc func(parser *GeneratorParser, input string) error

GIPParseFunc is called by the GeneratorParser, which should parse the input, calling EmitStackFrame for each frame.

type GIPStackFrame

type GIPStackFrame struct {
	RawAddress  uint64                   // The address as it appears in the input.
	Address     uint64                   // The address inside the module.
	Module      breakpad.SupplierRequest // Information about the module, used to fetch symbols.
	Placeholder string                   // A string value to use in case the frame cannot be symbolized.
}

GIPStackFrame contains all the information needed to symbolize a thread's stack frame.

type GeneratorParser

type GeneratorParser struct {
	// contains filtered or unexported fields
}

GeneratorParser is an Parser whose function is to extract thread lists from the input string. The output is then generated in a standard format that is different from the input format.

func NewGeneratorParser

func NewGeneratorParser(parseFunc GIPParseFunc) *GeneratorParser

NewGeneratorParser creates a new GeneratorParser that will process input using the specified parseFunc.

func (*GeneratorParser) EmitStackFrame

func (gip *GeneratorParser) EmitStackFrame(thread int, frame GIPStackFrame)

EmitStackFrame is called by the GIPParseFunc to append a frame to the stack for a given thread. The first time this is called for a given thread, the frame will be frame 0.

Threads may be emitted in any order, however stack frames for a given thread must be emitted in order.

func (*GeneratorParser) FilterModules

func (gip *GeneratorParser) FilterModules() bool

func (*GeneratorParser) ParseInput

func (gip *GeneratorParser) ParseInput(data string) error

func (*GeneratorParser) RequiredModules

func (gip *GeneratorParser) RequiredModules() []breakpad.SupplierRequest

func (*GeneratorParser) Symbolize

func (gip *GeneratorParser) Symbolize(tables []breakpad.SymbolTable) string

type Parser

type Parser interface {
	// ParseInput is the first step that accepts raw user input and internalizes
	// it. If successful, returns nil, or an error if unsuccessful and
	// processing should stop.
	ParseInput(data string) error

	// Called after ParseInput to report any modules for which symbol
	// information is needed.
	RequiredModules() []breakpad.SupplierRequest

	// Whether this parser should have its RequiredModules() filtered by the
	// breakpad.Supplier. Needed for if RequiredModules returns additional
	// modules that aren't necessairly needed for symbolization.
	FilterModules() bool

	// Takes the data internalized in ParseInput and symbolizes it using a
	// symbol table and its base address. Returns output acceptable for display
	// to a user.
	//
	// The output of invalid or impossible symbolization is the input, possibly
	// transformed for display of valid output.
	Symbolize(tables []breakpad.SymbolTable) string
}

Parser is the interface that describes the input processing pipeline for symbolization requests.

func NewAndroidParser

func NewAndroidParser(ctx context.Context, service breakpad.ModuleInfoService, version string) Parser

NewAndroidInputParse creates an Parser that symbolizes the log of the android chrome stack trace. Only works when version number of the build is included in the log (i.e. only for Official Release builds).

func NewAppleParser

func NewAppleParser() Parser

NewAppleParser creates a Parser for Apple-style crash and hang reports. The original input format will remain untouched, but the function names will be replaced where symbol data is available.

func NewCrashKeyParser

func NewCrashKeyParser(ctx context.Context, service breakpad.AnnotatedFrameService, reportID, key string) Parser

NewCrashKeyParser returns an Parser that connects to a AnnotatedFrameService backend. It retrieves the crash report with the given ID, and it extracts a stack trace (a string of whitespace-separated addresses) from the report. This stack trace is then symbolized using the module list provided by the crash report, via the FrameService.

func NewFragmentParser

func NewFragmentParser(moduleName, identifier string, baseAddress uint64) Parser

NewFragmentParser returns an Parser that can parse a whitespace- separated string of addresses and will symbolize them, returning each frame on a new line.

Because the parser cannot derive code module information from the input, all the necessary parameters for symbolization must be supplied here.

func NewModuleInfoParser

func NewModuleInfoParser(ctx context.Context, service breakpad.ModuleInfoService, product, version string) Parser

NewModuleInfoParser creates an input parser that takes a product name and version, along with a backend service, and will look up all the modules for that tuple.

func NewStackwalkParser

func NewStackwalkParser() Parser

NewStackwalkParser creates an Parser that symbolizes the machine format output of `minidump_stackwalk` in breakpad/src/processor/.

Jump to

Keyboard shortcuts

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