亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

directory search
archive archive/tar archive/zip bufio bufio(緩存) builtin builtin(內(nèi)置包) bytes bytes(包字節(jié)) compress compress/bzip2(壓縮/bzip2) compress/flate(壓縮/flate) compress/gzip(壓縮/gzip) compress/lzw(壓縮/lzw) compress/zlib(壓縮/zlib) container container/heap(容器數(shù)據(jù)結(jié)構(gòu)heap) container/list(容器數(shù)據(jù)結(jié)構(gòu)list) container/ring(容器數(shù)據(jù)結(jié)構(gòu)ring) context context(上下文) crypto crypto(加密) crypto/aes(加密/aes) crypto/cipher(加密/cipher) crypto/des(加密/des) crypto/dsa(加密/dsa) crypto/ecdsa(加密/ecdsa) crypto/elliptic(加密/elliptic) crypto/hmac(加密/hmac) crypto/md5(加密/md5) crypto/rand(加密/rand) crypto/rc4(加密/rc4) crypto/rsa(加密/rsa) crypto/sha1(加密/sha1) crypto/sha256(加密/sha256) crypto/sha512(加密/sha512) crypto/subtle(加密/subtle) crypto/tls(加密/tls) crypto/x509(加密/x509) crypto/x509/pkix(加密/x509/pkix) database database/sql(數(shù)據(jù)庫(kù)/sql) database/sql/driver(數(shù)據(jù)庫(kù)/sql/driver) debug debug/dwarf(調(diào)試/dwarf) debug/elf(調(diào)試/elf) debug/gosym(調(diào)試/gosym) debug/macho(調(diào)試/macho) debug/pe(調(diào)試/pe) debug/plan9obj(調(diào)試/plan9obj) encoding encoding(編碼) encoding/ascii85(編碼/ascii85) encoding/asn1(編碼/asn1) encoding/base32(編碼/base32) encoding/base64(編碼/base64) encoding/binary(編碼/binary) encoding/csv(編碼/csv) encoding/gob(編碼/gob) encoding/hex(編碼/hex) encoding/json(編碼/json) encoding/pem(編碼/pem) encoding/xml(編碼/xml) errors errors(錯(cuò)誤) expvar expvar flag flag(命令行參數(shù)解析flag包) fmt fmt go go/ast(抽象語(yǔ)法樹(shù)) go/build go/constant(常量) go/doc(文檔) go/format(格式) go/importer go/parser go/printer go/scanner(掃描儀) go/token(令牌) go/types(類型) hash hash(散列) hash/adler32 hash/crc32 hash/crc64 hash/fnv html html html/template(模板) image image(圖像) image/color(顏色) image/color/palette(調(diào)色板) image/draw(繪圖) image/gif image/jpeg image/png index index/suffixarray io io io/ioutil log log log/syslog(日志系統(tǒng)) math math math/big math/big math/bits math/bits math/cmplx math/cmplx math/rand math/rand mime mime mime/multipart(多部分) mime/quotedprintable net net net/http net/http net/http/cgi net/http/cookiejar net/http/fcgi net/http/httptest net/http/httptrace net/http/httputil net/http/internal net/http/pprof net/mail net/mail net/rpc net/rpc net/rpc/jsonrpc net/smtp net/smtp net/textproto net/textproto net/url net/url os os os/exec os/signal os/user path path path/filepath(文件路徑) plugin plugin(插件) reflect reflect(反射) regexp regexp(正則表達(dá)式) regexp/syntax runtime runtime(運(yùn)行時(shí)) runtime/debug(調(diào)試) runtime/internal/sys runtime/pprof runtime/race(競(jìng)爭(zhēng)) runtime/trace(執(zhí)行追蹤器) sort sort(排序算法) strconv strconv(轉(zhuǎn)換) strings strings(字符串) sync sync(同步) sync/atomic(原子操作) syscall syscall(系統(tǒng)調(diào)用) testing testing(測(cè)試) testing/iotest testing/quick text text/scanner(掃描文本) text/tabwriter text/template(定義模板) text/template/parse time time(時(shí)間戳) unicode unicode unicode/utf16 unicode/utf8 unsafe unsafe
characters

  • import "debug/dwarf"

  • 概述

  • 參數(shù)

概述

Package dwarf 提供對(duì)從可執(zhí)行文件加載的 DWARF調(diào)試信息的訪問(wèn),這些信息在 DWARF 2.0 標(biāo)準(zhǔn)中定義,http://dwarfstd.org/doc/dwarf-2.0.0.pdf

參數(shù)

  • Variables (變量)

  • type AddrType

  • type ArrayType

  • func (t *ArrayType) Size() int64

  • func (t *ArrayType) String() string

  • type Attr

  • func (a Attr) GoString() string

  • func (a Attr) String() string

  • type BasicType

  • func (b *BasicType) Basic() *BasicType

  • func (t *BasicType) String() string

  • type BoolType

  • type CharType

  • type Class

  • func (i Class) GoString() string

  • func (i Class) String() string

  • type CommonType

  • func (c *CommonType) Common() *CommonType

  • func (c *CommonType) Size() int64

  • type ComplexType

  • type Data

  • func New(abbrev, aranges, frame, info, line, pubnames, ranges, str []byte) (*Data, error)

  • func (d *Data) AddTypes(name string, types []byte) error

  • func (d *Data) LineReader(cu *Entry) (*LineReader, error)

  • func (d *Data) Ranges(e *Entry) ([][2]uint64, error)

  • func (d *Data) Reader() *Reader

  • func (d *Data) Type(off Offset) (Type, error)

  • type DecodeError

  • func (e DecodeError) Error() string

  • type DotDotDotType

  • func (t *DotDotDotType) String() string

  • type Entry

  • func (e *Entry) AttrField(a Attr) *Field

  • func (e *Entry) Val(a Attr) interface{}

  • type EnumType

  • func (t *EnumType) String() string

  • type EnumValue

  • type Field

  • type FloatType

  • type FuncType

  • func (t *FuncType) String() string

  • type IntType

  • type LineEntry

  • type LineFile

  • type LineReader

  • func (r *LineReader) Next(entry *LineEntry) error

  • func (r *LineReader) Reset()

  • func (r *LineReader) Seek(pos LineReaderPos)

  • func (r *LineReader) SeekPC(pc uint64, entry *LineEntry) error

  • func (r *LineReader) Tell() LineReaderPos

  • type LineReaderPos

  • type Offset

  • type PtrType

  • func (t *PtrType) String() string

  • type QualType

  • func (t *QualType) Size() int64

  • func (t *QualType) String() string

  • type Reader

  • func (r *Reader) AddressSize() int

  • func (r *Reader) Next() (*Entry, error)

  • func (r *Reader) Seek(off Offset)

  • func (r *Reader) SeekPC(pc uint64) (*Entry, error)

  • func (r *Reader) SkipChildren()

  • type StructField

  • type StructType

  • func (t *StructType) Defn() string

  • func (t *StructType) String() string

  • type Tag

  • func (t Tag) GoString() string

  • func (t Tag) String() string

  • type Type

  • type TypedefType

  • func (t *TypedefType) Size() int64

  • func (t *TypedefType) String() string

  • type UcharType

  • type UintType

  • type UnspecifiedType

  • type VoidType

  • func (t *VoidType) String() string

打包文件

buf.go class_string.go const.go entry.go line.go open.go type.go typeunit.go unit.go

變量

ErrUnknownPC 是 LineReader.ScanPC 在查找 PC未被行表中的任何條目覆蓋時(shí)返回的錯(cuò)誤。

var ErrUnknownPC = errors.New("ErrUnknownPC")

type AddrType

AddrType 代表機(jī)器地址類型。

type AddrType struct {
        BasicType}

type ArrayType

ArrayType表示固定大小的數(shù)組類型。

type ArrayType struct {
        CommonType
        Type          Type
        StrideBitSize int64 // 如果> 0,則保持每個(gè)元素的位數(shù)
        Count         int64 // 如果== -1,一個(gè)不完整的數(shù)組,如char x []。}

func (*ArrayType) Size

func (t *ArrayType) Size() int64

func (*ArrayType) String

func (t *ArrayType) String() string

type Attr

Attr 在 DWARF 條目字段中標(biāo)識(shí)屬性類型。

type Attr uint32
const (
        AttrSibling        Attr = 0x01
        AttrLocation       Attr = 0x02
        AttrName           Attr = 0x03
        AttrOrdering       Attr = 0x09
        AttrByteSize       Attr = 0x0B
        AttrBitOffset      Attr = 0x0C
        AttrBitSize        Attr = 0x0D
        AttrStmtList       Attr = 0x10
        AttrLowpc          Attr = 0x11
        AttrHighpc         Attr = 0x12
        AttrLanguage       Attr = 0x13
        AttrDiscr          Attr = 0x15
        AttrDiscrValue     Attr = 0x16
        AttrVisibility     Attr = 0x17
        AttrImport         Attr = 0x18
        AttrStringLength   Attr = 0x19
        AttrCommonRef      Attr = 0x1A
        AttrCompDir        Attr = 0x1B
        AttrConstValue     Attr = 0x1C
        AttrContainingType Attr = 0x1D
        AttrDefaultValue   Attr = 0x1E
        AttrInline         Attr = 0x20
        AttrIsOptional     Attr = 0x21
        AttrLowerBound     Attr = 0x22
        AttrProducer       Attr = 0x25
        AttrPrototyped     Attr = 0x27
        AttrReturnAddr     Attr = 0x2A
        AttrStartScope     Attr = 0x2C
        AttrStrideSize     Attr = 0x2E
        AttrUpperBound     Attr = 0x2F
        AttrAbstractOrigin Attr = 0x31
        AttrAccessibility  Attr = 0x32
        AttrAddrClass      Attr = 0x33
        AttrArtificial     Attr = 0x34
        AttrBaseTypes      Attr = 0x35
        AttrCalling        Attr = 0x36
        AttrCount          Attr = 0x37
        AttrDataMemberLoc  Attr = 0x38
        AttrDeclColumn     Attr = 0x39
        AttrDeclFile       Attr = 0x3A
        AttrDeclLine       Attr = 0x3B
        AttrDeclaration    Attr = 0x3C
        AttrDiscrList      Attr = 0x3D
        AttrEncoding       Attr = 0x3E
        AttrExternal       Attr = 0x3F
        AttrFrameBase      Attr = 0x40
        AttrFriend         Attr = 0x41
        AttrIdentifierCase Attr = 0x42
        AttrMacroInfo      Attr = 0x43
        AttrNamelistItem   Attr = 0x44
        AttrPriority       Attr = 0x45
        AttrSegment        Attr = 0x46
        AttrSpecification  Attr = 0x47
        AttrStaticLink     Attr = 0x48
        AttrType           Attr = 0x49
        AttrUseLocation    Attr = 0x4A
        AttrVarParam       Attr = 0x4B
        AttrVirtuality     Attr = 0x4C
        AttrVtableElemLoc  Attr = 0x4D
        AttrAllocated      Attr = 0x4E
        AttrAssociated     Attr = 0x4F
        AttrDataLocation   Attr = 0x50
        AttrStride         Attr = 0x51
        AttrEntrypc        Attr = 0x52
        AttrUseUTF8        Attr = 0x53
        AttrExtension      Attr = 0x54
        AttrRanges         Attr = 0x55
        AttrTrampoline     Attr = 0x56
        AttrCallColumn     Attr = 0x57
        AttrCallFile       Attr = 0x58
        AttrCallLine       Attr = 0x59
        AttrDescription    Attr = 0x5A)

func (Attr) GoString

func (a Attr) GoString() string

func (Attr) String

func (a Attr) String() string

type BasicType

BasicType 保存所有基本類型通用的字段。

type BasicType struct {
        CommonType
        BitSize   int64
        BitOffset int64}

func (*BasicType) Basic

func (b *BasicType) Basic() *BasicType

func (*BasicType) String

func (t *BasicType) String() string

type BoolType

BoolType表示 Bool類型。

type BoolType struct {
        BasicType}

type CharType

CharType 表示有符號(hào)的字符類型。

type CharType struct {
        BasicType}

type Class

Class 是屬性值的DWARF 4類。

通常,給定屬性的值可能采用 DWARF 定義的幾個(gè)可能的類之一,每個(gè)類都會(huì)導(dǎo)致對(duì)該屬性的稍微不同的解釋。

DWARF 第4版比以前版本的 DWARF 更精細(xì)地區(qū)分屬性值類。讀者可以將早期版本的 DWAR F中較粗糙的類混淆到適當(dāng)?shù)腄 WARF 4類中。例如, DWARF 2對(duì)常量以及所有類型的部分偏移使用“constant”,但讀者將規(guī)范DWARF 2文件中的屬性,這些屬性指向某個(gè)類 *Ptr 類的部分偏移,盡管這些類只是在 DWARF 3 中定義。

type Class int
const (        // ClassUnknown表示未知的DWARF類的值。
        ClassUnknown Class = iota        // ClassAddress表示類型為uint64的值        // 目標(biāo)機(jī)器上的地址。        // ClassBlock表示其類型為[]bype的值        // 解釋取決于屬性。
        ClassBlock        // ClassConstant表示類型為int64的值        // 常量。 這個(gè)常數(shù)的解釋取決于        // 屬性。
        ClassConstant        // ClassExprLoc表示包含的[]字節(jié)的值        // 一個(gè)編碼的DWARF表達(dá)式或位置描述。
        ClassExprLoc        // ClassFlag表示bool類型的值。
        ClassFlag        // ClassLinePtr表示值為int64的偏移量        // 進(jìn)入“l(fā)ine”部分。
        ClassLinePtr        // ClassLocListPtr表示值為int64的偏移量        // 到“l(fā)oclist”部分。
        ClassLocListPtr        // ClassMacPtr表示int64偏移量的值        // “mac”部分。
        ClassMacPtr        // ClassMacPtr表示int64偏移量的值        // “rangelist”部分。
        ClassRangeListPtr        // ClassReference表示偏移量偏移量的值        // 信息部分中的條目(用于Reader.Seek)。        // DWARF規(guī)范結(jié)合了ClassReference和        // ClassReferenceSig入類“reference”。
        ClassReference        // ClassReferenceSig表示一個(gè)uint64類型的值        // 引用類型Entry的簽名。
        ClassReferenceSig        // ClassString表示值是字符串。 如果        // 編譯單元指定AttrUseUTF8標(biāo)志(強(qiáng)烈地        // 推薦),字符串值將以UTF-8編碼。        // 否則,未指定編碼。
        ClassString        // ClassReferenceAlt表示int64類型的值        // DWARF“info”部分中的偏移量        // 對(duì)象文件。
        ClassReferenceAlt        // ClassStringAlt表示類型為int64的值        // 偏移到備用對(duì)象的DWARF字符串部分        // 文件。
        ClassStringAlt)

func (Class) GoString

func (i Class) GoString() string

func (Class) String

func (i Class) String() string

type CommonType

CommonType 保存多種類型通用的字段。如果某個(gè)字段對(duì)于給定的類型不知道或不適用,則使用零值。

type CommonType struct {
        ByteSize int64  // 此類型的值的大小,以字節(jié)為單位
        Name     string // 可用于引用類型的名稱

func (*CommonType) Common

func (c *CommonType) Common() *CommonType

func (*CommonType) Size

func (c *CommonType) Size() int64

type ComplexType

ComplexType 表示復(fù)雜的浮點(diǎn)類型。

type ComplexType struct {
        BasicType}

type Data

數(shù)據(jù)表示從可執(zhí)行文件(例如,ELF 或 Mach-O 可執(zhí)行文件)加載的 DWARF 調(diào)試信息。

type Data struct {        // 包含過(guò)濾或未導(dǎo)出的字段}

func New

func New(abbrev, aranges, frame, info, line, pubnames, ranges, str []byte) (*Data, error)

New 返回從給定參數(shù)初始化的新 Data 對(duì)象??蛻舳瞬粦?yīng)該直接調(diào)用此函數(shù),而應(yīng)使用適當(dāng)?shù)陌? debug/elf,debug/macho 或 debug/pe 的 File 類型的 DWARF 方法。

[]byte 參數(shù)是來(lái)自對(duì)象文件中相應(yīng)調(diào)試部分的數(shù)據(jù); 例如,對(duì)于 ELF 對(duì)象,縮寫(xiě)是 “.debug_abbrev” 部分的內(nèi)容。

func (*Data) AddTypes

func (d *Data) AddTypes(name string, types []byte) error

AddTypes 將為 DWARF數(shù)據(jù)添加一個(gè) .debug_types 節(jié)。具有DWARF 版本4調(diào)試信息的典型對(duì)象將具有多個(gè) .debug_types 部分。名稱僅用于錯(cuò)誤報(bào)告,用于區(qū)分一個(gè) .debug_types 和另一個(gè)。

func (*Data) LineReader

func (d *Data) LineReader(cu *Entry) (*LineReader, error)

LineReader 為編譯單元 cu 的行表返回一個(gè)新的讀取器,該讀取器必須是具有標(biāo)記 TagCompileUnit 的條目。

如果此編譯單元沒(méi)有行表,則返回 nil,nil。

func (*Data) Ranges

func (d *Data) Ranges(e *Entry) ([][2]uint64, error)

范圍返回由e覆蓋的PC范圍,這是一對(duì)[低,高]對(duì)。只有一些條目類型(如 TagCompileUnit 或 TagSubprogram)具有PC范圍;對(duì)于其他人,這將返回零,沒(méi)有錯(cuò)誤。

func (*Data) Reader

func (d *Data) Reader() *Reader

Reader會(huì)返回一個(gè)新的數(shù)據(jù)讀取器。閱讀器位于DWARF“info”部分的字節(jié)偏移量0處。

func (*Data) Type

func (d *Data) Type(off Offset) (Type, error)

類型在 DWARF “info”部分關(guān)閉時(shí)讀取類型。

type DecodeError

type DecodeError struct {
        Name   string
        Offset Offset
        Err    string}

func (DecodeError) Error

func (e DecodeError) Error() string

type DotDotDotType

DotDotDotType 表示可變參數(shù)...函數(shù)參數(shù)。

type DotDotDotType struct {
        CommonType}

func (*DotDotDotType) String

func (t *DotDotDotType) String() string

type Entry

entry 是一系列屬性/值(attribute/value)對(duì)。

type Entry struct {
        Offset   Offset // DWARF信息中的條目偏移
        Tag      Tag    // 標(biāo)簽(Entry的種類)
        Children bool   // whether Entry is followed by children
        Field    []Field}

func (*Entry) AttrField

func (e *Entry) AttrField(a Attr) *Field

AttrField  返回 Entry中與屬性 Attr 關(guān)聯(lián)的字段,如果沒(méi)有此屬性,則返回 nil。

func (*Entry) Val

func (e *Entry) Val(a Attr) interface{}

Val 在 Entry 中返回與屬性 Attr 相關(guān)的值,如果沒(méi)有這個(gè)屬性,則返回 nil。

一個(gè)常見(jiàn)的習(xí)慣用法是將無(wú)返回檢查與檢查該值是否具有預(yù)期的動(dòng)態(tài)類型進(jìn)行合并,如下所示:

v, ok := e.Val(AttrSibling).(int64)

type EnumType

EnumType 表示枚舉類型。其本地整數(shù)類型的唯一指示是它的ByteSize (在 CommonType中)。

type EnumType struct {
        CommonType
        EnumName string
        Val      []*EnumValue}

func (*EnumType) String

func (t *EnumType) String() string

type EnumValue

EnumValue 表示一個(gè)枚舉值。

type EnumValue struct {
        Name string
        Val  int64}

type Field

字段是 Entry 中的單個(gè)屬性/值對(duì)。

值可以是由 DWARF 定義的幾個(gè)“屬性類(attribute classes)”之一。每個(gè)類對(duì)應(yīng)的 Go類型是:

DWARF class       Go type        Class-----------       -------        -----address           uint64         ClassAddress
block             []byte         ClassBlock
constant          int64          ClassConstant
flag              bool           ClassFlag
reference
  to info         dwarf.Offset   ClassReference
  to type unit    uint64         ClassReferenceSig
string            string         ClassString
exprloc           []byte         ClassExprLoc
lineptr           int64          ClassLinePtr
loclistptr        int64          ClassLocListPtr
macptr            int64          ClassMacPtr
rangelistptr      int64          ClassRangeListPtr

對(duì)于無(wú)法識(shí)別的或供應(yīng)商定義的屬性,Class 可能是ClassUnknown。

type Field struct {
        Attr  Attr
        Val   interface{}
        Class Class}

type FloatType

FloatType 表示浮點(diǎn)類型。

type FloatType struct {
        BasicType}

type FuncType

FuncType 表示一個(gè)函數(shù)類型。

type FuncType struct {
        CommonType
        ReturnType Type
        ParamType  []Type}

func (*FuncType) String

func (t *FuncType) String() string

type IntType

IntType 表示一個(gè)有符號(hào)的整數(shù)類型。

type IntType struct {
        BasicType}

type LineEntry

LineEntry 是 DWARF 行表中的一行。

type LineEntry struct {        // 地址是機(jī)器的程序計(jì)數(shù)器值        // 由編譯器生成的指令。 LineEntry        // 適用于Address中的每條指令        // 下一個(gè)LineEntry的地址。
        Address uint64        // OpIndex是VLIW內(nèi)操作的索引        // 指令。 第一個(gè)操作的索引是0. 對(duì)于        // 非VLIW體系結(jié)構(gòu),它將始終為0。地址和        // OpIndex一起形成一個(gè)可以的操作指針        // 參考指令中的任何單獨(dú)操作        // 流(stream)。
        OpIndex int        // 文件是與這些相對(duì)應(yīng)的源文件        // 說(shuō)明。
        File *LineFile        // Line是與這些對(duì)應(yīng)的源代碼行號(hào)        // 說(shuō)明。 行從1開(kāi)始編號(hào)??赡苁?nbsp;       // 0如果這些說(shuō)明不能歸因于任何來(lái)源        // 行。
        Line int        // 列是這些源代碼行中的列號(hào)        // 說(shuō)明。 列從1開(kāi)始編號(hào)。它可以        // 為0表示該行的“左邊緣”。
        Column int        // IsStmt表示Address是推薦的斷點(diǎn)        // 位置,如行,語(yǔ)句或以下的開(kāi)頭        // 聲明的不同部分。
        IsStmt bool        // BasicBlock表示Address是以下的開(kāi)頭        // 基本塊。
        BasicBlock bool        // PrologueEnd表示地址是一個(gè)(可能是        // 許多)PCs,執(zhí)行應(yīng)該暫停一個(gè)        // 進(jìn)入包含函數(shù)的斷點(diǎn)。        //        // 在DWARF 3中添加。
        PrologueEnd bool        // EpilogueBegin指出Address是可能的        // 許多)PCs,執(zhí)行應(yīng)該暫停一個(gè)        // 退出此函數(shù)時(shí)的斷點(diǎn)。        //        // 在DWARF 3中添加。
        EpilogueBegin bool        // ISA是這些指令集架構(gòu)        //說(shuō)明。 可能的ISA值應(yīng)該由        // 適用的ABI規(guī)范。        //        // 在DWARF 3中添加。
        ISA int        // 鑒別器是指示塊的任意整數(shù)        // 這些說(shuō)明屬于哪些。 它服務(wù)于        // 區(qū)分可能與之相關(guān)的多個(gè)區(qū)塊        // 相同的源文件,行和列。 當(dāng)只有一個(gè)        // 塊對(duì)于給定的源位置存在,它應(yīng)該是0。        //        // 在DWARF 3中添加。
        Discriminator int        // EndSequence表示該地址是之后的第一個(gè)字節(jié)        // 一系列目標(biāo)機(jī)器指令的結(jié)束。 如果它        // 被設(shè)置,只有這個(gè)和地址字段是有意義的。 一個(gè)        // 行號(hào)表可能包含多個(gè)信息        // 可能不相交的指令序列。 最后一項(xiàng)        // 在行表中應(yīng)始終設(shè)置EndSequence。
        EndSequence bool}

type LineFile

LineFile 是由 DWARF 行表項(xiàng)引用的源文件。

type LineFile struct {
        Name   string
        Mtime  uint64 // 實(shí)現(xiàn)定義了修改時(shí)間,如果未知?jiǎng)t為0
        Length int    // 文件長(zhǎng)度,如果未知,則為0}

type LineReader

LineReader 從 DWARF“l(fā)ine”部分為單個(gè)編譯單元讀取一系列LineEntry 結(jié)構(gòu)。LineEntries 按照增加PC的順序發(fā)生,并且每個(gè)LineEntry 都為從該 LineEntry 的PC到下一個(gè) LineEntry 的PC之前的指令提供元數(shù)據(jù)。最后一項(xiàng)將設(shè)置其 EndSequence 字段。

type LineReader struct {        // 包含過(guò)濾或未導(dǎo)出的字段}

func (*LineReader) Next

func (r *LineReader) Next(entry *LineEntry) error

接下來(lái)將*entry 設(shè)置到此行表中的下一行并移至下一行。如果沒(méi)有更多條目并且行表正確終止,它將返回 io.EOF。

行總是按照遞增條目的順序排列。地址,但 entry.Line 可以前進(jìn)或后退。

func (*LineReader) Reset

func (r *LineReader) Reset()

復(fù)位重新定位行表格 reader 在行表格的開(kāi)頭。

func (*LineReader) Seek

func (r *LineReader) Seek(pos LineReaderPos)

Seek 將行表讀取器恢復(fù)到 Tell 返回的位置。

參數(shù) pos 必須已經(jīng)通過(guò)在此行表上調(diào)用 Tell 來(lái)返回。

func (*LineReader) SeekPC

func (r *LineReader) SeekPC(pc uint64, entry *LineEntry) error

SeekPC 將*entry 設(shè)置為包含 pc 的 LineEntry,并將讀取器放置在行表中的下一個(gè)條目上。如有必要,這將尋求反向查找電腦。

如果pc未被此行表中的任何條目覆蓋,SeekPC 將返回ErrUnknownPC。在這種情況下,*entry 和最終的查找位置是未指定的。

請(qǐng)注意,DWARF 行表只允許順序掃描,正向掃描。因此,在最壞的情況下,線表的大小需要時(shí)間線性。如果調(diào)用者希望重復(fù)進(jìn)行快速的 PC 查找,則應(yīng)該為行表建立適當(dāng)?shù)乃饕?/p>

func (*LineReader) Tell

func (r *LineReader) Tell() LineReaderPos

Tell 返回行表中的當(dāng)前位置。

type LineReaderPos

LineReaderPos 表示行表中的位置。

type LineReaderPos struct {        // 包含過(guò)濾或未導(dǎo)出的字段}

type Offset

Offset 表示 DWARF 信息內(nèi)條目的位置。(見(jiàn) Reader.Seek。)

type Offset uint32

type PtrType

PtrType 表示一個(gè)指針類型。

type PtrType struct {
        CommonType
        Type Type}

func (*PtrType) String

func (t *PtrType) String() string

type QualType

QualType 表示具有 C/C++“const”,“restrict” 或 “volatile” 限定符的類型。

type QualType struct {
        CommonType
        Qual string
        Type Type}

func (*QualType) Size

func (t *QualType) Size() int64

func (*QualType) String

func (t *QualType) String() string

type Reader

閱讀器允許從 DWARF “info”部分讀取條目結(jié)構(gòu)。Entry 結(jié)構(gòu)排列在樹(shù)中。Reader 的 Next 函數(shù)從樹(shù)的預(yù)定義遍歷中返回連續(xù)的條目。如果一個(gè)條目有子類,它的子類字段將是真實(shí)的,并且子類跟隨,終止于具有標(biāo)簽 0 的條目。

type Reader struct {        // 包含過(guò)濾或未導(dǎo)出的字段}

func (*Reader) AddressSize

func (r *Reader) AddressSize() int

AddressSize 返回當(dāng)前編譯單元中地址的大?。ㄒ宰止?jié)為單位)。

func (*Reader) Next

func (r *Reader) Next() (*Entry, error)

接下來(lái)從編碼的入口流中讀取下一個(gè)條目。當(dāng)它到達(dá)該部分的末尾時(shí)返回 nil,nil。如果當(dāng)前偏移量無(wú)效或者偏移量中的數(shù)據(jù)無(wú)法解碼為有效條目,則返回錯(cuò)誤。

func (*Reader) Seek

func (r *Reader) Seek(off Offset)

在編碼的入口流中尋找偏移讀取器的位置。偏移量 0 可以用來(lái)表示第一個(gè)條目。

func (*Reader) SeekPC

func (r *Reader) SeekPC(pc uint64) (*Entry, error)

SeekPC 返回包含 pc 的編譯單元的 Entry,并讓閱讀器讀取該單元的子元素。如果 pc 沒(méi)有被任何單元覆蓋,SeekPC 返回ErrUnknownPC 并且讀取器的位置是未定義的。

因?yàn)榫幾g單元可以描述可執(zhí)行文件的多個(gè)區(qū)域,所以最糟糕的情況是 SeekPC 必須搜索所有編譯單元中的所有范圍。每次調(diào)用SeekPC 時(shí)都會(huì)在最后一次調(diào)用的編譯單元中開(kāi)始搜索,因此一般來(lái)說(shuō),查看一系列 PC 時(shí),如果它們被分類,速度會(huì)更快。如果調(diào)用者希望重復(fù)進(jìn)行快速 PC 查找,則應(yīng)使用 Ranges 方法構(gòu)建適當(dāng)?shù)乃饕?/p>

func (*Reader) SkipChildren

func (r *Reader) SkipChildren()

SkipChildren 跳過(guò)與 Next 返回的最后一個(gè)條目關(guān)聯(lián)的子條目。如果該條目沒(méi)有子類,或者 Next 未被調(diào)用,則 SkipChildren 是無(wú)操作的。

type StructField

StructField 表示結(jié)構(gòu)體,聯(lián)合體或 C ++ 類類型中的字段。

type StructField struct {
        Name       string
        Type       Type
        ByteOffset int64
        ByteSize   int64
        BitOffset  int64 // 在ByteOffset的ByteSize字節(jié)內(nèi)
        BitSize    int64 // 如果不是位域,則為零}

type StructType

StructType 表示結(jié)構(gòu)體,聯(lián)合體或 C ++ 類的類型。

type StructType struct {
        CommonType
        StructName string
        Kind       string // “struct”,“union”或“class”。
        Incomplete bool // 如果為true,則struct,union,class被聲明但未被定義}

func (*StructType) Defn

func (t *StructType) Defn() string

func (*StructType) String

func (t *StructType) String() string

type Tag

標(biāo)簽是條目的分類(類型)。

type Tag uint32
const (
        TagArrayType              Tag = 0x01
        TagClassType              Tag = 0x02
        TagEntryPoint             Tag = 0x03
        TagEnumerationType        Tag = 0x04
        TagFormalParameter        Tag = 0x05
        TagImportedDeclaration    Tag = 0x08
        TagLabel                  Tag = 0x0A
        TagLexDwarfBlock          Tag = 0x0B
        TagMember                 Tag = 0x0D
        TagPointerType            Tag = 0x0F
        TagReferenceType          Tag = 0x10
        TagCompileUnit            Tag = 0x11
        TagStringType             Tag = 0x12
        TagStructType             Tag = 0x13
        TagSubroutineType         Tag = 0x15
        TagTypedef                Tag = 0x16
        TagUnionType              Tag = 0x17
        TagUnspecifiedParameters  Tag = 0x18
        TagVariant                Tag = 0x19
        TagCommonDwarfBlock       Tag = 0x1A
        TagCommonInclusion        Tag = 0x1B
        TagInheritance            Tag = 0x1C
        TagInlinedSubroutine      Tag = 0x1D
        TagModule                 Tag = 0x1E
        TagPtrToMemberType        Tag = 0x1F
        TagSetType                Tag = 0x20
        TagSubrangeType           Tag = 0x21
        TagWithStmt               Tag = 0x22
        TagAccessDeclaration      Tag = 0x23
        TagBaseType               Tag = 0x24
        TagCatchDwarfBlock        Tag = 0x25
        TagConstType              Tag = 0x26
        TagConstant               Tag = 0x27
        TagEnumerator             Tag = 0x28
        TagFileType               Tag = 0x29
        TagFriend                 Tag = 0x2A
        TagNamelist               Tag = 0x2B
        TagNamelistItem           Tag = 0x2C
        TagPackedType             Tag = 0x2D
        TagSubprogram             Tag = 0x2E
        TagTemplateTypeParameter  Tag = 0x2F
        TagTemplateValueParameter Tag = 0x30
        TagThrownType             Tag = 0x31
        TagTryDwarfBlock          Tag = 0x32
        TagVariantPart            Tag = 0x33
        TagVariable               Tag = 0x34
        TagVolatileType           Tag = 0x35        // 以下是DWARF 3中的新增內(nèi)容。
        TagDwarfProcedure  Tag = 0x36
        TagRestrictType    Tag = 0x37
        TagInterfaceType   Tag = 0x38
        TagNamespace       Tag = 0x39
        TagImportedModule  Tag = 0x3A
        TagUnspecifiedType Tag = 0x3B
        TagPartialUnit     Tag = 0x3C
        TagImportedUnit    Tag = 0x3D
        TagMutableType     Tag = 0x3E // 后來(lái)從DWARF中刪除.
        TagCondition       Tag = 0x3F
        TagSharedType      Tag = 0x40        // 以下是DWARF 4中的新功能。
        TagTypeUnit            Tag = 0x41
        TagRvalueReferenceType Tag = 0x42
        TagTemplateAlias       Tag = 0x43)

func (Tag) GoString

func (t Tag) GoString() string

func (Tag) String

func (t Tag) String() string

type Type

類型通常表示指向任何特定類型結(jié)構(gòu)(CharType,StructType等)的指針。

type Type interface {        Common() *CommonType        String() string        Size() int64}

type TypedefType

TypedefType 表示一個(gè)命名的類型。

type TypedefType struct {
        CommonType
        Type Type}

func (*TypedefType) Size

func (t *TypedefType) Size() int64

func (*TypedefType) String

func (t *TypedefType) String() string

type UcharType

UcharType 表示一個(gè)無(wú)符號(hào)字符類型。

type UcharType struct {
        BasicType}

type UintType

UintType 表示無(wú)符號(hào)整數(shù)類型。

type UintType struct {
        BasicType}

type UnspecifiedType

UnspecifiedType 表示隱式,未知,模糊或不存在的類型。

type UnspecifiedType struct {
        BasicType}

type VoidType

VoidType 表示 C void 類型。

type VoidType struct {
        CommonType}

func (*VoidType) String

func (t *VoidType) String() string
Previous article: Next article: