nm

package
v0.8.9 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 5

Documentation

Index

Constants

View Source
const (
	Undefined = SymbolType('U') // Undefined
	Text      = SymbolType('T') // Text (code) section symbol
	Data      = SymbolType('D') // Data (global var) section symbol
	Rodata    = SymbolType('R') // Read-only data (rodata) section symbol
	BSS       = SymbolType('B') // BSS (uninitialized global var) section symbol

	LocalText = SymbolType('t') // Local text (code) section symbol
	LocalData = SymbolType('d') // Local data (local var) section symbol
	LocalBSS  = SymbolType('b') // Local BSS (uninitialized local var) section symbol
	LocalASym = SymbolType('s') // Local symbol in an assembler source file
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

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

Cmd represents a nm command.

func New

func New(app string) *Cmd

New creates a new nm command.

func (*Cmd) List

func (p *Cmd) List(arfile string) (items []*ObjectFile, err error)

List lists symbols in an archive file.

type IndexBuilder

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

func NewIndexBuilder

func NewIndexBuilder(nm *Cmd) *IndexBuilder

func (*IndexBuilder) Index

func (p *IndexBuilder) Index(fromDir []string, toDir string, progress func(path string)) error

func (*IndexBuilder) IndexDir

func (p *IndexBuilder) IndexDir(fromDir, toDir string, progress func(path string)) error

func (*IndexBuilder) IndexFile

func (p *IndexBuilder) IndexFile(arFile, outFile string) (err error)

type MatchedFile

type MatchedFile struct {
	ArFile string
	Items  []*MatchedItem
}

MatchedFile represents a matched file

func Query

func Query(dir string, query string) (files []*MatchedFile, err error)

Query queries symbol in index files (allow wildcard).

type MatchedItem

type MatchedItem struct {
	ObjFile string
	Symbol  string
	Type    SymbolType
}

MatchedItem represents a matched item

type ObjectFile

type ObjectFile struct {
	File    string    // file name
	Symbols []*Symbol // symbols
}

ObjectFile represents an object file.

type Symbol

type Symbol struct {
	Name  string     // symbol name
	Addr  uint64     // symbol address
	Type  SymbolType // symbol type
	FAddr bool       // address is valid
}

Symbol represents a symbol in an object file.

type SymbolType

type SymbolType uint8

SymbolType represents a symbol type.

Jump to

Keyboard shortcuts

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