Package dwarf

import "debug/dwarf"
Overview
Index

Overview ▾

包dwarf提供对从可执行文件加载的DWARF调试信息的访问,如DWARF 2.0标准中所定义,该信息位于http://dwarfstd.org/doc/dwarf-2.0.0.pdf.

Index ▾

Variables
type AddrType
type ArrayType
    func (t *ArrayType) Size() int64
    func (t *ArrayType) String() string
type Attr
    func (a Attr) GoString() string
    func (i 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 (i Tag) String() string
type Type
type TypedefType
    func (t *TypedefType) Size() int64
    func (t *TypedefType) String() string
type UcharType
type UintType
type UnspecifiedType
type UnsupportedType
    func (t *UnsupportedType) String() string
type VoidType
    func (t *VoidType) String() string

Package files

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

Variables

ErrUnknownPC是LineReader.ScanPC返回的错误,当查找PC不在行表中的任何条目中时.

var ErrUnknownPC = errors.New("ErrUnknownPC")

type AddrType

AddrType表示机器地址类型.

type AddrType struct {
    BasicType
}

type ArrayType

ArrayType表示固定大小的数组类型.

type ArrayType struct {
    CommonType
    Type          Type
    StrideBitSize int64 // if > 0, number of bits to hold each element
    Count         int64 // if == -1, an incomplete array, like char x[].
}

func (*ArrayType) Size

func (t *ArrayType) Size() int64

func (*ArrayType) String

func (t *ArrayType) String() string

type Attr

Attr标识DWARF条目的字段中的属性类型.

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 (i 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表示布尔类型.

type BoolType struct {
    BasicType
}

type CharType

CharType表示签名字符类型.

type CharType struct {
    BasicType
}

type Class 1.5

类别是属性值的DWARF 4类别.

通常,给定属性的值可以采用DWARF定义的几种可能的类别之一,每种类别都会导致对该属性的解释稍有不同.

DWARF版本4与以前版本的DWARF相比,可以更好地区分属性值类. 读者将把较粗的类从早期版本的DWARF消除为适当的DWARF 4类. 例如,DWARF 2对常量以及所有类型的节偏移量都使用"常量",但是读者将规范化DWARF 2文件中的属性,这些属性引用了到Class * Ptr类之一的节偏移量,即使这些类仅仅是在DWARF 3中定义.

type Class int
const (
    // ClassUnknown represents values of unknown DWARF class.
    ClassUnknown Class = iota

    // ClassAddress represents values of type uint64 that are
    // addresses on the target machine.
    ClassAddress

    // ClassBlock represents values of type []byte whose
    // interpretation depends on the attribute.
    ClassBlock

    // ClassConstant represents values of type int64 that are
    // constants. The interpretation of this constant depends on
    // the attribute.
    ClassConstant

    // ClassExprLoc represents values of type []byte that contain
    // an encoded DWARF expression or location description.
    ClassExprLoc

    // ClassFlag represents values of type bool.
    ClassFlag

    // ClassLinePtr represents values that are an int64 offset
    // into the "line" section.
    ClassLinePtr

    // ClassLocListPtr represents values that are an int64 offset
    // into the "loclist" section.
    ClassLocListPtr

    // ClassMacPtr represents values that are an int64 offset into
    // the "mac" section.
    ClassMacPtr

    // ClassMacPtr represents values that are an int64 offset into
    // the "rangelist" section.
    ClassRangeListPtr

    // ClassReference represents values that are an Offset offset
    // of an Entry in the info section (for use with Reader.Seek).
    // The DWARF specification combines ClassReference and
    // ClassReferenceSig into class "reference".
    ClassReference

    // ClassReferenceSig represents values that are a uint64 type
    // signature referencing a type Entry.
    ClassReferenceSig

    // ClassString represents values that are strings. If the
    // compilation unit specifies the AttrUseUTF8 flag (strongly
    // recommended), the string value will be encoded in UTF-8.
    // Otherwise, the encoding is unspecified.
    ClassString

    // ClassReferenceAlt represents values of type int64 that are
    // an offset into the DWARF "info" section of an alternate
    // object file.
    ClassReferenceAlt

    // ClassStringAlt represents values of type int64 that are an
    // offset into the DWARF string section of an alternate object
    // file.
    ClassStringAlt
)

func (Class) GoString 1.5

func (i Class) GoString() string

func (Class) String 1.5

func (i Class) String() string

type CommonType

CommonType包含多种类型共有的字段. 如果字段未知或不适用于给定类型,则使用零值.

type CommonType struct {
    ByteSize int64  // size of value of this type, in bytes
    Name     string // name that can be used to refer to type
}

func (*CommonType) Common

func (c *CommonType) Common() *CommonType

func (*CommonType) Size

func (c *CommonType) Size() int64

type ComplexType

ComplexType表示复杂的浮点类型.

type ComplexType struct {
    BasicType
}

type Data

数据表示从可执行文件(例如,ELF或Mach-O可执行文件)加载的DWARF调试信息.

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

func New

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

New返回从给定参数初始化的新Data对象. 客户端通常应使用相应软件包debug / elf,debug / macho或debug / pe的File类型的DWARF方法,而不是直接调用此函数.

[] byte参数是来自目标文件中相应调试部分的数据; 例如,对于ELF对象,abbrev是" .debug_abbrev"部分的内容.

func (*Data) AddTypes 1.3

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

AddTypes将向DWARF数据添加一个.debug_types部分. 具有DWARF版本4调试信息的典型对象将具有多个.debug_types部分. 该名称仅用于错误报告,用于将一个.debug_types节与另一个节区分开.

func (*Data) LineReader 1.5

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

LineReader为编译单元cu的行表返回一个新的阅读器,该表必须是带有TagCompileUnit标签的Entry.

如果此编译单元没有线表,则返回nil,nil.

func (*Data) Ranges 1.7

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

范围返回由e(一组[低,高]对)覆盖的PC范围. 仅某些条目类型(例如TagCompileUnit或TagSubprogram)具有PC范围;只有某些条目类型才具有PC范围. 对于其他人,这将返回nil且没有错误.

func (*Data) Reader

func (d *Data) Reader() *Reader

Reader返回一个新的Data Reader. 阅读器位于DWARF"信息"部分的字节偏移量0处.

func (*Data) Type

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

在DWARF"信息"部分中,类型读取关闭时的类型.

type DecodeError

type DecodeError struct {
    Name   string
    Offset Offset
    Err    string
}

func (DecodeError) Error

func (e DecodeError) Error() string

type DotDotDotType

DotDotDotType表示可变参数...函数参数.

type DotDotDotType struct {
    CommonType
}

func (*DotDotDotType) String

func (t *DotDotDotType) String() string

type Entry

条目是一系列属性/值对.

type Entry struct {
    Offset   Offset // offset of Entry in DWARF info
    Tag      Tag    // tag (kind of Entry)
    Children bool   // whether Entry is followed by children
    Field    []Field
}

func (*Entry) AttrField 1.5

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

AttrField返回与Entry中的属性Attr关联的Field,如果没有这样的属性,则返回nil.

func (*Entry) Val

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

Val返回与Entry中的属性Attr关联的值,如果没有这样的属性,则返回nil.

一个常见的用法是将nil return的检查与该值具有预期的动态类型的检查合并,如:

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

type EnumType

一个EnumType代表一个枚举类型. 它的本机整数类型的唯一指示是其ByteSize(在CommonType内部).

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

func (*EnumType) String

func (t *EnumType) String() string

type EnumValue

一个EnumValue代表一个枚举值.

type EnumValue struct {
    Name string
    Val  int64
}

type Field

字段是条目中的单个属性/值对.

值可以是DWARF定义的几个"属性类"之一. 每个类对应的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

对于无法识别或供应商定义的属性,Class可以为ClassUnknown.

type Field struct {
    Attr  Attr
    Val   interface{}
    Class Class // Go 1.5
}

type FloatType

FloatType表示浮点类型.

type FloatType struct {
    BasicType
}

type FuncType

FuncType表示函数类型.

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

func (*FuncType) String

func (t *FuncType) String() string

type IntType

IntType表示有符号整数类型.

type IntType struct {
    BasicType
}

type LineEntry 1.5

LineEntry是DWARF线表中的一行.

type LineEntry struct {
    // Address is the program-counter value of a machine
    // instruction generated by the compiler. This LineEntry
    // applies to each instruction from Address to just before the
    // Address of the next LineEntry.
    Address uint64

    // OpIndex is the index of an operation within a VLIW
    // instruction. The index of the first operation is 0. For
    // non-VLIW architectures, it will always be 0. Address and
    // OpIndex together form an operation pointer that can
    // reference any individual operation within the instruction
    // stream.
    OpIndex int

    // File is the source file corresponding to these
    // instructions.
    File *LineFile

    // Line is the source code line number corresponding to these
    // instructions. Lines are numbered beginning at 1. It may be
    // 0 if these instructions cannot be attributed to any source
    // line.
    Line int

    // Column is the column number within the source line of these
    // instructions. Columns are numbered beginning at 1. It may
    // be 0 to indicate the "left edge" of the line.
    Column int

    // IsStmt indicates that Address is a recommended breakpoint
    // location, such as the beginning of a line, statement, or a
    // distinct subpart of a statement.
    IsStmt bool

    // BasicBlock indicates that Address is the beginning of a
    // basic block.
    BasicBlock bool

    // PrologueEnd indicates that Address is one (of possibly
    // many) PCs where execution should be suspended for a
    // breakpoint on entry to the containing function.
    //
    // Added in DWARF 3.
    PrologueEnd bool

    // EpilogueBegin indicates that Address is one (of possibly
    // many) PCs where execution should be suspended for a
    // breakpoint on exit from this function.
    //
    // Added in DWARF 3.
    EpilogueBegin bool

    // ISA is the instruction set architecture for these
    // instructions. Possible ISA values should be defined by the
    // applicable ABI specification.
    //
    // Added in DWARF 3.
    ISA int

    // Discriminator is an arbitrary integer indicating the block
    // to which these instructions belong. It serves to
    // distinguish among multiple blocks that may all have with
    // the same source file, line, and column. Where only one
    // block exists for a given source position, it should be 0.
    //
    // Added in DWARF 3.
    Discriminator int

    // EndSequence indicates that Address is the first byte after
    // the end of a sequence of target machine instructions. If it
    // is set, only this and the Address field are meaningful. A
    // line number table may contain information for multiple
    // potentially disjoint instruction sequences. The last entry
    // in a line table should always have EndSequence set.
    EndSequence bool
}

type LineFile 1.5

LineFile是DWARF线表条目引用的源文件.

type LineFile struct {
    Name   string
    Mtime  uint64 // Implementation defined modification time, or 0 if unknown
    Length int    // File length, or 0 if unknown
}

type LineReader 1.5

LineReader从DWARF"行"部分读取单个编译单元的LineEntry结构序列. LineEntries以PC递增的顺序出现,并且每个LineEntry都将来自该LineEntry PC的指令的元数据提供给下一个LineEntry PC之前的指令. 最后一个条目将设置其EndSequence字段.

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

func (*LineReader) Next 1.5

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

下一步将* entry设置到此行表中的下一行,然后移动到下一行. 如果没有更多条目,并且该行表已正确终止,则返回io.EOF.

行始终按增加entry.Address的顺序排列,但entry.Line可以前进或后退.

func (*LineReader) Reset 1.5

func (r *LineReader) Reset()

重置将线表读取器重新定位在线表的开头.

func (*LineReader) Seek 1.5

func (r *LineReader) Seek(pos LineReaderPos)

Seek将线表读取器恢复到Tell所返回的位置.

此行表上对Tell的调用必须已返回参数pos.

func (*LineReader) SeekPC 1.5

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

SeekPC将* entry设置为包含pc的LineEntry,并将阅读器放在行表中的下一个条目上. 如有必要,这将向后寻找pc.

如果该行表中的任何条目均未包含pc,则SeekPC返回ErrUnknownPC. 在这种情况下,未指定*进入和最终搜索位置.

请注意,DWARF线表仅允许顺序向前扫描. 因此,在最坏的情况下,这花费的时间是线性表大小的线性时间. 如果呼叫者希望重复进行快速的PC查找,则应建立适当的线表索引.

func (*LineReader) Tell 1.5

func (r *LineReader) Tell() LineReaderPos

Tell返回折线表中的当前位置.

type LineReaderPos 1.5

LineReaderPos表示线表中的位置.

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

type Offset

偏移量表示DWARF信息中条目的位置. (请参阅Reader.Seek.)

type Offset uint32

type PtrType

PtrType表示指针类型.

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"信息"部分读取条目结构. Entry结构排列在树中. Reader的Ne​​xt函数从树的预遍历中返回连续的条目. 如果条目具有子项,则其"子项"字段为true,并且子项跟随,以带有标签0的条目终止.

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

func (*Reader) AddressSize 1.5

func (r *Reader) AddressSize() int

AddressSize返回当前编译单元中地址的大小(以字节为单位).

func (*Reader) Next

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

Next从编码的条目流中读取下一个条目. 它返回nil,到达部分末尾时返回nil. 如果当前偏移量无效或该偏移量处的数据无法解码为有效条目,则它将返回错误.

func (*Reader) Seek

func (r *Reader) Seek(off Offset)

在编码的输入流中,Seek将Reader的位置偏移. 偏移量0可以用来表示第一个条目.

func (*Reader) SeekPC 1.7

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

SeekPC返回包含pc的编译单元的Entry,并定位阅读器以读取该单元的子代. 如果pc未被任何单元覆盖,则SeekPC返回ErrUnknownPC,并且读取器的位置未定义.

Because compilation units can describe multiple regions of the executable, in the worst case SeekPC must search through all the ranges in all the compilation units. Each call to SeekPC starts the search at the compilation unit of the last call, so in general looking up a series of PCs will be faster if they are sorted. If the caller wishes to do repeated fast PC lookups, it should build an appropriate index using the Ranges method.

func (*Reader) SkipChildren

func (r *Reader) SkipChildren()

SkipChildren跳过与Next返回的最后一个条目关联的子条目. 如果该条目没有子对象,或者未调用Next,则SkipChildren是禁止操作的对象.

type StructField

StructField表示结构,联合或C ++类类型的字段.

type StructField struct {
    Name       string
    Type       Type
    ByteOffset int64
    ByteSize   int64 // usually zero; use Type.Size() for normal fields
    BitOffset  int64 // within the ByteSize bytes at ByteOffset
    BitSize    int64 // zero if not a bit field
}

type StructType

StructType表示结构,联合或C ++类类型.

type StructType struct {
    CommonType
    StructName string
    Kind       string // "struct", "union", or "class".
    Field      []*StructField
    Incomplete bool // if true, struct, union, class is declared but not defined
}

func (*StructType) Defn

func (t *StructType) Defn() string

func (*StructType) String

func (t *StructType) String() string

type Tag

标签是条目的分类(类型).

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
    // The following are new in DWARF 3.
    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 // Later removed from DWARF.
    TagCondition       Tag = 0x3F
    TagSharedType      Tag = 0x40
    // The following are new in DWARF 4.
    TagTypeUnit            Tag = 0x41
    TagRvalueReferenceType Tag = 0x42
    TagTemplateAlias       Tag = 0x43
)

func (Tag) GoString

func (t Tag) GoString() string

func (Tag) String

func (i Tag) String() string

type Type

Type通常表示一个指向任何特定Type结构(CharType,StructType等)的指针.

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

type TypedefType

TypedefType表示命名类型.

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表示无符号字符类型.

type UcharType struct {
    BasicType
}

type UintType

UintType表示无符号整数类型.

type UintType struct {
    BasicType
}

type UnspecifiedType 1.4

UnspecifiedType表示隐式,未知,模棱两可或不存在的类型.

type UnspecifiedType struct {
    BasicType
}

type UnsupportedType 1.13

UnsupportedType是在我们遇到不支持的类型的情况下返回的占位符.

type UnsupportedType struct {
    CommonType
    Tag Tag
}

func (*UnsupportedType) String 1.13

func (t *UnsupportedType) String() string

type VoidType

VoidType表示C无效类型.

type VoidType struct {
    CommonType
}

func (*VoidType) String

func (t *VoidType) String() string

by  ICOPY.SITE