URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [debug/] [dwarf/] [const.go] - Rev 848
Go to most recent revision | Compare with Previous | Blame | View Log
// Copyright 2009 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.// Constantspackage dwarfimport "strconv"// An Attr identifies the attribute type in a DWARF Entry's Field.type Attr uint32const (AttrSibling Attr = 0x01AttrLocation Attr = 0x02AttrName Attr = 0x03AttrOrdering Attr = 0x09AttrByteSize Attr = 0x0BAttrBitOffset Attr = 0x0CAttrBitSize Attr = 0x0DAttrStmtList Attr = 0x10AttrLowpc Attr = 0x11AttrHighpc Attr = 0x12AttrLanguage Attr = 0x13AttrDiscr Attr = 0x15AttrDiscrValue Attr = 0x16AttrVisibility Attr = 0x17AttrImport Attr = 0x18AttrStringLength Attr = 0x19AttrCommonRef Attr = 0x1AAttrCompDir Attr = 0x1BAttrConstValue Attr = 0x1CAttrContainingType Attr = 0x1DAttrDefaultValue Attr = 0x1EAttrInline Attr = 0x20AttrIsOptional Attr = 0x21AttrLowerBound Attr = 0x22AttrProducer Attr = 0x25AttrPrototyped Attr = 0x27AttrReturnAddr Attr = 0x2AAttrStartScope Attr = 0x2CAttrStrideSize Attr = 0x2EAttrUpperBound Attr = 0x2FAttrAbstractOrigin Attr = 0x31AttrAccessibility Attr = 0x32AttrAddrClass Attr = 0x33AttrArtificial Attr = 0x34AttrBaseTypes Attr = 0x35AttrCalling Attr = 0x36AttrCount Attr = 0x37AttrDataMemberLoc Attr = 0x38AttrDeclColumn Attr = 0x39AttrDeclFile Attr = 0x3AAttrDeclLine Attr = 0x3BAttrDeclaration Attr = 0x3CAttrDiscrList Attr = 0x3DAttrEncoding Attr = 0x3EAttrExternal Attr = 0x3FAttrFrameBase Attr = 0x40AttrFriend Attr = 0x41AttrIdentifierCase Attr = 0x42AttrMacroInfo Attr = 0x43AttrNamelistItem Attr = 0x44AttrPriority Attr = 0x45AttrSegment Attr = 0x46AttrSpecification Attr = 0x47AttrStaticLink Attr = 0x48AttrType Attr = 0x49AttrUseLocation Attr = 0x4AAttrVarParam Attr = 0x4BAttrVirtuality Attr = 0x4CAttrVtableElemLoc Attr = 0x4DAttrAllocated Attr = 0x4EAttrAssociated Attr = 0x4FAttrDataLocation Attr = 0x50AttrStride Attr = 0x51AttrEntrypc Attr = 0x52AttrUseUTF8 Attr = 0x53AttrExtension Attr = 0x54AttrRanges Attr = 0x55AttrTrampoline Attr = 0x56AttrCallColumn Attr = 0x57AttrCallFile Attr = 0x58AttrCallLine Attr = 0x59AttrDescription Attr = 0x5A)var attrNames = [...]string{AttrSibling: "Sibling",AttrLocation: "Location",AttrName: "Name",AttrOrdering: "Ordering",AttrByteSize: "ByteSize",AttrBitOffset: "BitOffset",AttrBitSize: "BitSize",AttrStmtList: "StmtList",AttrLowpc: "Lowpc",AttrHighpc: "Highpc",AttrLanguage: "Language",AttrDiscr: "Discr",AttrDiscrValue: "DiscrValue",AttrVisibility: "Visibility",AttrImport: "Import",AttrStringLength: "StringLength",AttrCommonRef: "CommonRef",AttrCompDir: "CompDir",AttrConstValue: "ConstValue",AttrContainingType: "ContainingType",AttrDefaultValue: "DefaultValue",AttrInline: "Inline",AttrIsOptional: "IsOptional",AttrLowerBound: "LowerBound",AttrProducer: "Producer",AttrPrototyped: "Prototyped",AttrReturnAddr: "ReturnAddr",AttrStartScope: "StartScope",AttrStrideSize: "StrideSize",AttrUpperBound: "UpperBound",AttrAbstractOrigin: "AbstractOrigin",AttrAccessibility: "Accessibility",AttrAddrClass: "AddrClass",AttrArtificial: "Artificial",AttrBaseTypes: "BaseTypes",AttrCalling: "Calling",AttrCount: "Count",AttrDataMemberLoc: "DataMemberLoc",AttrDeclColumn: "DeclColumn",AttrDeclFile: "DeclFile",AttrDeclLine: "DeclLine",AttrDeclaration: "Declaration",AttrDiscrList: "DiscrList",AttrEncoding: "Encoding",AttrExternal: "External",AttrFrameBase: "FrameBase",AttrFriend: "Friend",AttrIdentifierCase: "IdentifierCase",AttrMacroInfo: "MacroInfo",AttrNamelistItem: "NamelistItem",AttrPriority: "Priority",AttrSegment: "Segment",AttrSpecification: "Specification",AttrStaticLink: "StaticLink",AttrType: "Type",AttrUseLocation: "UseLocation",AttrVarParam: "VarParam",AttrVirtuality: "Virtuality",AttrVtableElemLoc: "VtableElemLoc",AttrAllocated: "Allocated",AttrAssociated: "Associated",AttrDataLocation: "DataLocation",AttrStride: "Stride",AttrEntrypc: "Entrypc",AttrUseUTF8: "UseUTF8",AttrExtension: "Extension",AttrRanges: "Ranges",AttrTrampoline: "Trampoline",AttrCallColumn: "CallColumn",AttrCallFile: "CallFile",AttrCallLine: "CallLine",AttrDescription: "Description",}func (a Attr) String() string {if int(a) < len(attrNames) {s := attrNames[a]if s != "" {return s}}return strconv.Itoa(int(a))}func (a Attr) GoString() string {if int(a) < len(attrNames) {s := attrNames[a]if s != "" {return "dwarf.Attr" + s}}return "dwarf.Attr(" + strconv.FormatInt(int64(a), 10) + ")"}// A format is a DWARF data encoding format.type format uint32const (// value formatsformAddr format = 0x01formDwarfBlock2 format = 0x03formDwarfBlock4 format = 0x04formData2 format = 0x05formData4 format = 0x06formData8 format = 0x07formString format = 0x08formDwarfBlock format = 0x09formDwarfBlock1 format = 0x0AformData1 format = 0x0BformFlag format = 0x0CformSdata format = 0x0DformStrp format = 0x0EformUdata format = 0x0FformRefAddr format = 0x10formRef1 format = 0x11formRef2 format = 0x12formRef4 format = 0x13formRef8 format = 0x14formRefUdata format = 0x15formIndirect format = 0x16)// A Tag is the classification (the type) of an Entry.type Tag uint32const (TagArrayType Tag = 0x01TagClassType Tag = 0x02TagEntryPoint Tag = 0x03TagEnumerationType Tag = 0x04TagFormalParameter Tag = 0x05TagImportedDeclaration Tag = 0x08TagLabel Tag = 0x0ATagLexDwarfBlock Tag = 0x0BTagMember Tag = 0x0DTagPointerType Tag = 0x0FTagReferenceType Tag = 0x10TagCompileUnit Tag = 0x11TagStringType Tag = 0x12TagStructType Tag = 0x13TagSubroutineType Tag = 0x15TagTypedef Tag = 0x16TagUnionType Tag = 0x17TagUnspecifiedParameters Tag = 0x18TagVariant Tag = 0x19TagCommonDwarfBlock Tag = 0x1ATagCommonInclusion Tag = 0x1BTagInheritance Tag = 0x1CTagInlinedSubroutine Tag = 0x1DTagModule Tag = 0x1ETagPtrToMemberType Tag = 0x1FTagSetType Tag = 0x20TagSubrangeType Tag = 0x21TagWithStmt Tag = 0x22TagAccessDeclaration Tag = 0x23TagBaseType Tag = 0x24TagCatchDwarfBlock Tag = 0x25TagConstType Tag = 0x26TagConstant Tag = 0x27TagEnumerator Tag = 0x28TagFileType Tag = 0x29TagFriend Tag = 0x2ATagNamelist Tag = 0x2BTagNamelistItem Tag = 0x2CTagPackedType Tag = 0x2DTagSubprogram Tag = 0x2ETagTemplateTypeParameter Tag = 0x2FTagTemplateValueParameter Tag = 0x30TagThrownType Tag = 0x31TagTryDwarfBlock Tag = 0x32TagVariantPart Tag = 0x33TagVariable Tag = 0x34TagVolatileType Tag = 0x35TagDwarfProcedure Tag = 0x36TagRestrictType Tag = 0x37TagInterfaceType Tag = 0x38TagNamespace Tag = 0x39TagImportedModule Tag = 0x3ATagUnspecifiedType Tag = 0x3BTagPartialUnit Tag = 0x3CTagImportedUnit Tag = 0x3DTagMutableType Tag = 0x3E)var tagNames = [...]string{TagArrayType: "ArrayType",TagClassType: "ClassType",TagEntryPoint: "EntryPoint",TagEnumerationType: "EnumerationType",TagFormalParameter: "FormalParameter",TagImportedDeclaration: "ImportedDeclaration",TagLabel: "Label",TagLexDwarfBlock: "LexDwarfBlock",TagMember: "Member",TagPointerType: "PointerType",TagReferenceType: "ReferenceType",TagCompileUnit: "CompileUnit",TagStringType: "StringType",TagStructType: "StructType",TagSubroutineType: "SubroutineType",TagTypedef: "Typedef",TagUnionType: "UnionType",TagUnspecifiedParameters: "UnspecifiedParameters",TagVariant: "Variant",TagCommonDwarfBlock: "CommonDwarfBlock",TagCommonInclusion: "CommonInclusion",TagInheritance: "Inheritance",TagInlinedSubroutine: "InlinedSubroutine",TagModule: "Module",TagPtrToMemberType: "PtrToMemberType",TagSetType: "SetType",TagSubrangeType: "SubrangeType",TagWithStmt: "WithStmt",TagAccessDeclaration: "AccessDeclaration",TagBaseType: "BaseType",TagCatchDwarfBlock: "CatchDwarfBlock",TagConstType: "ConstType",TagConstant: "Constant",TagEnumerator: "Enumerator",TagFileType: "FileType",TagFriend: "Friend",TagNamelist: "Namelist",TagNamelistItem: "NamelistItem",TagPackedType: "PackedType",TagSubprogram: "Subprogram",TagTemplateTypeParameter: "TemplateTypeParameter",TagTemplateValueParameter: "TemplateValueParameter",TagThrownType: "ThrownType",TagTryDwarfBlock: "TryDwarfBlock",TagVariantPart: "VariantPart",TagVariable: "Variable",TagVolatileType: "VolatileType",TagDwarfProcedure: "DwarfProcedure",TagRestrictType: "RestrictType",TagInterfaceType: "InterfaceType",TagNamespace: "Namespace",TagImportedModule: "ImportedModule",TagUnspecifiedType: "UnspecifiedType",TagPartialUnit: "PartialUnit",TagImportedUnit: "ImportedUnit",TagMutableType: "MutableType",}func (t Tag) String() string {if int(t) < len(tagNames) {s := tagNames[t]if s != "" {return s}}return strconv.Itoa(int(t))}func (t Tag) GoString() string {if int(t) < len(tagNames) {s := tagNames[t]if s != "" {return "dwarf.Tag" + s}}return "dwarf.Tag(" + strconv.FormatInt(int64(t), 10) + ")"}// Location expression operators.// The debug info encodes value locations like 8(R3)// as a sequence of these op codes.// This package does not implement full expressions;// the opPlusUconst operator is expected by the type parser.const (opAddr = 0x03 /* 1 op, const addr */opDeref = 0x06opConst1u = 0x08 /* 1 op, 1 byte const */opConst1s = 0x09 /* " signed */opConst2u = 0x0A /* 1 op, 2 byte const */opConst2s = 0x0B /* " signed */opConst4u = 0x0C /* 1 op, 4 byte const */opConst4s = 0x0D /* " signed */opConst8u = 0x0E /* 1 op, 8 byte const */opConst8s = 0x0F /* " signed */opConstu = 0x10 /* 1 op, LEB128 const */opConsts = 0x11 /* " signed */opDup = 0x12opDrop = 0x13opOver = 0x14opPick = 0x15 /* 1 op, 1 byte stack index */opSwap = 0x16opRot = 0x17opXderef = 0x18opAbs = 0x19opAnd = 0x1AopDiv = 0x1BopMinus = 0x1CopMod = 0x1DopMul = 0x1EopNeg = 0x1FopNot = 0x20opOr = 0x21opPlus = 0x22opPlusUconst = 0x23 /* 1 op, ULEB128 addend */opShl = 0x24opShr = 0x25opShra = 0x26opXor = 0x27opSkip = 0x2F /* 1 op, signed 2-byte constant */opBra = 0x28 /* 1 op, signed 2-byte constant */opEq = 0x29opGe = 0x2AopGt = 0x2BopLe = 0x2CopLt = 0x2DopNe = 0x2EopLit0 = 0x30/* OpLitN = OpLit0 + N for N = 0..31 */opReg0 = 0x50/* OpRegN = OpReg0 + N for N = 0..31 */opBreg0 = 0x70 /* 1 op, signed LEB128 constant *//* OpBregN = OpBreg0 + N for N = 0..31 */opRegx = 0x90 /* 1 op, ULEB128 register */opFbreg = 0x91 /* 1 op, SLEB128 offset */opBregx = 0x92 /* 2 op, ULEB128 reg; SLEB128 off */opPiece = 0x93 /* 1 op, ULEB128 size of piece */opDerefSize = 0x94 /* 1-byte size of data retrieved */opXderefSize = 0x95 /* 1-byte size of data retrieved */opNop = 0x96/* next four new in Dwarf v3 */opPushObjAddr = 0x97opCall2 = 0x98 /* 2-byte offset of DIE */opCall4 = 0x99 /* 4-byte offset of DIE */opCallRef = 0x9A /* 4- or 8- byte offset of DIE *//* 0xE0-0xFF reserved for user-specific */)// Basic type encodings -- the value for AttrEncoding in a TagBaseType Entry.const (encAddress = 0x01encBoolean = 0x02encComplexFloat = 0x03encFloat = 0x04encSigned = 0x05encSignedChar = 0x06encUnsigned = 0x07encUnsignedChar = 0x08encImaginaryFloat = 0x09)
Go to most recent revision | Compare with Previous | Blame | View Log
