3 typedef struct Dwarf Dwarf
;
4 typedef struct DwarfAttrs DwarfAttrs
;
5 typedef struct DwarfBlock DwarfBlock
;
6 typedef struct DwarfBuf DwarfBuf
;
7 typedef struct DwarfExpr DwarfExpr
;
8 typedef struct DwarfSym DwarfSym
;
9 typedef union DwarfVal DwarfVal
;
16 TagEnumerationType
= 0x04,
17 TagFormalParameter
= 0x05,
18 TagImportedDeclaration
= 0x08,
20 TagLexDwarfBlock
= 0x0B,
22 TagPointerType
= 0x0F,
23 TagReferenceType
= 0x10,
24 TagCompileUnit
= 0x11,
27 TagSubroutineType
= 0x15,
30 TagUnspecifiedParameters
= 0x18,
32 TagCommonDwarfBlock
= 0x1A,
33 TagCommonInclusion
= 0x1B,
34 TagInheritance
= 0x1C,
35 TagInlinedSubroutine
= 0x1D,
37 TagPtrToMemberType
= 0x1F,
39 TagSubrangeType
= 0x21,
41 TagAccessDeclaration
= 0x23,
43 TagCatchDwarfBlock
= 0x25,
50 TagNamelistItem
= 0x2C,
53 TagTemplateTypeParameter
= 0x2F,
54 TagTemplateValueParameter
= 0x30,
56 TagTryDwarfBlock
= 0x32,
57 TagVariantPart
= 0x33,
59 TagVolatileType
= 0x35,
60 TagDwarfProcedure
= 0x36,
61 TagRestrictType
= 0x37,
62 TagInterfaceType
= 0x38,
64 TagImportedModule
= 0x3A,
65 TagUnspecifiedType
= 0x3B,
66 TagPartialUnit
= 0x3C,
67 TagImportedUnit
= 0x3D,
68 TagMutableType
= 0x3E,
72 TypeComplexFloat
= 0x03,
75 TypeSignedChar
= 0x06,
77 TypeUnsignedChar
= 0x08,
78 TypeImaginaryFloat
= 0x09,
81 AccessProtected
= 0x02,
90 VirtPureVirtual
= 0x02,
95 LangCplusplus
= 0x0004,
98 LangFortran77
= 0x0007,
99 LangFortran90
= 0x0008,
100 LangPascal83
= 0x0009,
101 LangModula2
= 0x000A,
105 LangFortran95
= 0x000E,
107 /* 0x8000-0xFFFF reserved */
109 IdCaseSensitive
= 0x00,
112 IdCaseInsensitive
= 0x03,
114 CallingNormal
= 0x01,
115 CallingProgram
= 0x02,
116 CallingNocall
= 0x03,
117 /* 0x40-0xFF reserved */
121 InDeclaredNotInlined
= 0x02,
122 InDeclaredInlined
= 0x03,
124 OrderRowMajor
= 0x00,
125 OrderColumnMajor
= 0x01,
137 OpAddr
= 0x03, /* 1 op, const addr */
139 OpConst1u
= 0x08, /* 1 op, 1 byte const */
140 OpConst1s
= 0x09, /* " signed */
141 OpConst2u
= 0x0A, /* 1 op, 2 byte const */
142 OpConst2s
= 0x0B, /* " signed */
143 OpConst4u
= 0x0C, /* 1 op, 4 byte const */
144 OpConst4s
= 0x0D, /* " signed */
145 OpConst8u
= 0x0E, /* 1 op, 8 byte const */
146 OpConst8s
= 0x0F, /* " signed */
147 OpConstu
= 0x10, /* 1 op, LEB128 const */
148 OpConsts
= 0x11, /* " signed */
152 OpPick
= 0x15, /* 1 op, 1 byte stack index */
166 OpPlusUconst
= 0x23, /* 1 op, ULEB128 addend */
171 OpSkip
= 0x2F, /* 1 op, signed 2-byte constant */
172 OpBra
= 0x28, /* 1 op, signed 2-byte constant */
180 /* OpLitN = OpLit0 + N for N = 0..31 */
182 /* OpRegN = OpReg0 + N for N = 0..31 */
183 OpBreg0
= 0x70, /* 1 op, signed LEB128 constant */
184 /* OpBregN = OpBreg0 + N for N = 0..31 */
185 OpRegx
= 0x90, /* 1 op, ULEB128 register */
186 OpFbreg
= 0x91, /* 1 op, SLEB128 offset */
187 OpBregx
= 0x92, /* 2 op, ULEB128 reg, SLEB128 off */
188 OpPiece
= 0x93, /* 1 op, ULEB128 size of piece */
189 OpDerefSize
= 0x94, /* 1-byte size of data retrieved */
190 OpXderefSize
= 0x95, /* 1-byte size of data retrieved */
192 /* next four new in Dwarf v3 */
193 OpPushObjAddr
= 0x97,
194 OpCall2
= 0x98, /* 2-byte offset of DIE */
195 OpCall4
= 0x99, /* 4-byte offset of DIE */
196 OpCallRef
= 0x9A /* 4- or 8- byte offset of DIE */
197 /* 0xE0-0xFF reserved for user-specific */
206 /* not for consumer use */
228 /* whether we have it, along with type */
230 uchar abstractorigin
;
241 uchar containingtype
;
256 uchar identifiercase
;
293 ulong abstractorigin
;
304 ulong containingtype
;
306 DwarfVal datamemberloc
;
312 DwarfBlock discrlist
;
319 ulong identifiercase
;
334 DwarfBlock namelistitem
;
347 DwarfVal stringlength
;
350 DwarfVal uselocation
;
353 DwarfVal vtableelemloc
;
377 /* not for consumer use... */
389 Dwarf
*dwarfopen(struct _Pe
*elf
);
390 void dwarfclose(Dwarf
*);
391 int dwarfaddrtounit(Dwarf
*, ulong
, ulong
*);
392 int dwarflookupfn(Dwarf
*, ulong
, ulong
, DwarfSym
*);
393 int dwarflookupname(Dwarf
*, char*, DwarfSym
*);
394 int dwarflookupnameinunit(Dwarf
*, ulong
, char*, DwarfSym
*);
395 int dwarflookupsubname(Dwarf
*, DwarfSym
*, char*, DwarfSym
*);
396 int dwarflookuptag(Dwarf
*, ulong
, ulong
, DwarfSym
*);
397 int dwarfenumunit(Dwarf
*, ulong
, DwarfSym
*);
398 int dwarfseeksym(Dwarf
*, ulong
, ulong
, DwarfSym
*);
399 int dwarfenum(Dwarf
*, DwarfSym
*);
400 int dwarfnextsym(Dwarf
*, DwarfSym
*);
401 int dwarfnextsymat(Dwarf
*, DwarfSym
*, int);
402 int dwarfpctoline(Dwarf
*, ulong
, char**, char**, char**, char **, ulong
*, ulong
*, ulong
*);
403 int dwarfunwind(Dwarf
*, ulong
, DwarfExpr
*, DwarfExpr
*, DwarfExpr
*, int);
404 ulong
dwarfget1(DwarfBuf
*);
405 ulong
dwarfget2(DwarfBuf
*);
406 ulong
dwarfget4(DwarfBuf
*);
407 uvlong
dwarfget8(DwarfBuf
*);
408 ulong
dwarfget128(DwarfBuf
*);
409 long dwarfget128s(DwarfBuf
*);
410 ulong
dwarfgetaddr(DwarfBuf
*);
411 int dwarfgetn(DwarfBuf
*, uchar
*, int);
412 uchar
*dwarfgetnref(DwarfBuf
*, ulong
);
413 char *dwarfgetstring(DwarfBuf
*);
416 typedef struct DwarfAbbrev DwarfAbbrev
;
417 typedef struct DwarfAttr DwarfAttr
;
461 DwarfAbbrev
*dwarfgetabbrev(Dwarf
*, ulong
, ulong
);
463 int dwarfgetinfounit(Dwarf
*, ulong
, DwarfBlock
*);
465 extern int dwarf386nregs
;
466 extern char *dwarf386regs
[];
467 extern char *dwarf386fp
;
469 #define SYMBOL_SIZE 18
470 #define MAXIMUM_DWARF_NAME_SIZE 64
471 #define MAXIMUM_COFF_SYMBOL_LENGTH 256