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 struct DwarfStack DwarfStack
;
10 typedef struct DwarfParam DwarfParam
;
11 typedef union DwarfVal DwarfVal
;
18 TagEnumerationType
= 0x04,
19 TagFormalParameter
= 0x05,
20 TagImportedDeclaration
= 0x08,
22 TagLexDwarfBlock
= 0x0B,
24 TagPointerType
= 0x0F,
25 TagReferenceType
= 0x10,
26 TagCompileUnit
= 0x11,
29 TagSubroutineType
= 0x15,
32 TagUnspecifiedParameters
= 0x18,
34 TagCommonDwarfBlock
= 0x1A,
35 TagCommonInclusion
= 0x1B,
36 TagInheritance
= 0x1C,
37 TagInlinedSubroutine
= 0x1D,
39 TagPtrToMemberType
= 0x1F,
41 TagSubrangeType
= 0x21,
43 TagAccessDeclaration
= 0x23,
45 TagCatchDwarfBlock
= 0x25,
52 TagNamelistItem
= 0x2C,
55 TagTemplateTypeParameter
= 0x2F,
56 TagTemplateValueParameter
= 0x30,
58 TagTryDwarfBlock
= 0x32,
59 TagVariantPart
= 0x33,
61 TagVolatileType
= 0x35,
62 TagDwarfProcedure
= 0x36,
63 TagRestrictType
= 0x37,
64 TagInterfaceType
= 0x38,
66 TagImportedModule
= 0x3A,
67 TagUnspecifiedType
= 0x3B,
68 TagPartialUnit
= 0x3C,
69 TagImportedUnit
= 0x3D,
70 TagMutableType
= 0x3E,
74 TypeComplexFloat
= 0x03,
77 TypeSignedChar
= 0x06,
79 TypeUnsignedChar
= 0x08,
80 TypeImaginaryFloat
= 0x09,
83 AccessProtected
= 0x02,
92 VirtPureVirtual
= 0x02,
97 LangCplusplus
= 0x0004,
100 LangFortran77
= 0x0007,
101 LangFortran90
= 0x0008,
102 LangPascal83
= 0x0009,
103 LangModula2
= 0x000A,
107 LangFortran95
= 0x000E,
109 /* 0x8000-0xFFFF reserved */
111 IdCaseSensitive
= 0x00,
114 IdCaseInsensitive
= 0x03,
116 CallingNormal
= 0x01,
117 CallingProgram
= 0x02,
118 CallingNocall
= 0x03,
119 /* 0x40-0xFF reserved */
123 InDeclaredNotInlined
= 0x02,
124 InDeclaredInlined
= 0x03,
126 OrderRowMajor
= 0x00,
127 OrderColumnMajor
= 0x01,
139 OpAddr
= 0x03, /* 1 op, const addr */
141 OpConst1u
= 0x08, /* 1 op, 1 byte const */
142 OpConst1s
= 0x09, /* " signed */
143 OpConst2u
= 0x0A, /* 1 op, 2 byte const */
144 OpConst2s
= 0x0B, /* " signed */
145 OpConst4u
= 0x0C, /* 1 op, 4 byte const */
146 OpConst4s
= 0x0D, /* " signed */
147 OpConst8u
= 0x0E, /* 1 op, 8 byte const */
148 OpConst8s
= 0x0F, /* " signed */
149 OpConstu
= 0x10, /* 1 op, LEB128 const */
150 OpConsts
= 0x11, /* " signed */
154 OpPick
= 0x15, /* 1 op, 1 byte stack index */
168 OpPlusUconst
= 0x23, /* 1 op, ULEB128 addend */
173 OpSkip
= 0x2F, /* 1 op, signed 2-byte constant */
174 OpBra
= 0x28, /* 1 op, signed 2-byte constant */
182 /* OpLitN = OpLit0 + N for N = 0..31 */
184 /* OpRegN = OpReg0 + N for N = 0..31 */
185 OpBreg0
= 0x70, /* 1 op, signed LEB128 constant */
186 /* OpBregN = OpBreg0 + N for N = 0..31 */
187 OpRegx
= 0x90, /* 1 op, ULEB128 register */
188 OpFbreg
= 0x91, /* 1 op, SLEB128 offset */
189 OpBregx
= 0x92, /* 2 op, ULEB128 reg, SLEB128 off */
190 OpPiece
= 0x93, /* 1 op, ULEB128 size of piece */
191 OpDerefSize
= 0x94, /* 1-byte size of data retrieved */
192 OpXderefSize
= 0x95, /* 1-byte size of data retrieved */
194 /* next four new in Dwarf v3 */
195 OpPushObjAddr
= 0x97,
196 OpCall2
= 0x98, /* 2-byte offset of DIE */
197 OpCall4
= 0x99, /* 4-byte offset of DIE */
198 OpCallRef
= 0x9A /* 4- or 8- byte offset of DIE */
199 /* 0xE0-0xFF reserved for user-specific */
218 /* not for consumer use */
240 /* whether we have it, along with type */
242 uchar abstractorigin
;
253 uchar containingtype
;
268 uchar identifiercase
;
305 ulong abstractorigin
;
316 ulong containingtype
;
318 DwarfVal datamemberloc
;
324 DwarfBlock discrlist
;
331 ulong identifiercase
;
346 DwarfBlock namelistitem
;
359 DwarfVal stringlength
;
362 DwarfVal uselocation
;
365 DwarfVal vtableelemloc
;
389 /* not for consumer use... */
393 ulong unit
, childoff
, nextunit
;
398 Dwarf
*dwarfopen(struct _Pe
*elf
);
399 void dwarfclose(Dwarf
*);
400 int dwarfaddrtounit(Dwarf
*, ulong
, ulong
*);
401 int dwarflookupfn(Dwarf
*, ulong
, ulong
, DwarfSym
*);
402 int dwarflookupname(Dwarf
*, char*, DwarfSym
*);
403 int dwarflookupnameinunit(Dwarf
*, ulong
, char*, DwarfSym
*);
404 int dwarflookupsubname(Dwarf
*, DwarfSym
*, char*, DwarfSym
*);
405 int dwarflookuptag(Dwarf
*, ulong
, ulong
, DwarfSym
*);
406 int dwarfenumunit(Dwarf
*, ulong
, DwarfSym
*);
407 int dwarfseeksym(Dwarf
*, ulong
, ulong
, DwarfSym
*);
408 int dwarfenum(Dwarf
*, DwarfSym
*);
409 int dwarfnextsym(Dwarf
*, DwarfSym
*);
410 int dwarfnextsymat(Dwarf
*, DwarfSym
*parent
, DwarfSym
*child
);
411 int dwarfpctoline(Dwarf
*, DwarfSym
*proc
, ulong
, char**, char**, ulong
*);
412 int dwarfgetarg(Dwarf
*d
, const char *name
, DwarfBuf
*locbuf
, ulong cfa
, PROSSYM_REGISTERS registers
, ulong
*value
);
413 int dwarfgettype(Dwarf
*d
, DwarfSym
*param
, DwarfSym
*type
);
415 ulong
dwarfget1(DwarfBuf
*);
416 ulong
dwarfget2(DwarfBuf
*);
417 ulong
dwarfget4(DwarfBuf
*);
418 uvlong
dwarfget8(DwarfBuf
*);
419 ulong
dwarfget128(DwarfBuf
*);
420 long dwarfget128s(DwarfBuf
*);
421 ulong
dwarfgetaddr(DwarfBuf
*);
422 int dwarfgetn(DwarfBuf
*, uchar
*, int);
423 uchar
*dwarfgetnref(DwarfBuf
*, ulong
);
424 char *dwarfgetstring(DwarfBuf
*);
425 int dwarfcomputecfa(Dwarf
*d
, DwarfExpr
*cfa
, PROSSYM_REGISTERS registers
, ulong
*cfaLocation
);
426 int dwarfregunwind(Dwarf
*d
, ulong pc
, ulong fde
, DwarfExpr
*cfa
, PROSSYM_REGISTERS registers
);
427 int dwarfargvalue(Dwarf
*d
, DwarfSym
*proc
, ulong pc
, ulong cfa
, PROSSYM_REGISTERS registers
, DwarfParam
*parameters
);
428 int dwarfgetparams(Dwarf
*d
, DwarfSym
*s
, ulong pc
, int pnum
, DwarfParam
*paramblocks
);
430 typedef struct DwarfAbbrev DwarfAbbrev
;
431 typedef struct DwarfAttr DwarfAttr
;
478 ulong storage
[16]; // own storage
483 DwarfAbbrev
*dwarfgetabbrev(Dwarf
*, ulong
, ulong
);
485 int dwarfgetinfounit(Dwarf
*, ulong
, DwarfBlock
*);
487 #define MAXIMUM_DWARF_NAME_SIZE 64