ReactOS 0.4.15-dev-8119-g4fb2fdb
dwarfinfo.c
Go to the documentation of this file.
1/*
2 * Dwarf info parse and search.
3 */
4
5#include <ntifs.h>
6#include <ndk/ntndk.h>
7#include <reactos/rossym.h>
8#include "rossympriv.h"
9#include <ntimage.h>
10
11#define NDEBUG
12#include <debug.h>
13
14#include "dwarf.h"
15#include <windef.h>
16
17enum
18{
92
93 FormAddr = 0x01,
96 FormData2 = 0x05,
97 FormData4 = 0x06,
98 FormData8 = 0x07,
99 FormString = 0x08,
102 FormData1 = 0x0B,
103 FormFlag = 0x0C,
104 FormSdata = 0x0D,
105 FormStrp = 0x0E,
106 FormUdata = 0x0F,
108 FormRef1 = 0x11,
109 FormRef2 = 0x12,
110 FormRef4 = 0x13,
111 FormRef8 = 0x14,
113 FormIndirect = 0x16
115
117static int getulong(DwarfBuf*, int, ulong, ulong*, int*);
118static int getuchar(DwarfBuf*, int, uchar*);
119static int getstring(DwarfBuf*, int, char**);
120static int getblock(DwarfBuf*, int, DwarfBlock*);
121static int skipform(DwarfBuf*, int);
122static int constblock(Dwarf*, DwarfBlock*, ulong*);
123
124int
126{
127 if(dwarfenumunit(d, unit, s) < 0)
128 return -1;
129
130 dwarfnextsymat(d, s, 0); /* s is now the CompileUnit */
131 while(dwarfnextsymat(d, s, 1) == 1)
132 if(s->attrs.name && strcmp(s->attrs.name, name) == 0)
133 return 0;
134 werrstr("symbol '%s' not found", name);
135 return -1;
136}
137
138
139int
141{
142 *s = *parent;
143 while(dwarfnextsymat(d, s, parent->depth+1))
144 if(s->attrs.name && strcmp(s->attrs.name, name) == 0)
145 return 0;
146 werrstr("symbol '%s' not found", name);
147 return -1;
148}
149
150int
152{
153 if(dwarfenumunit(d, unit, s) < 0) {
154 return -1;
155 }
156
157 dwarfnextsymat(d, s, 0); /* s is now the CompileUnit */
158 if(s->attrs.tag == tag) {
159 return 0;
160 }
161 while(dwarfnextsymat(d, s, 1) == 1)
162 if(s->attrs.tag == tag) {
163 return 0;
164 }
165 werrstr("symbol with tag 0x%lux not found", tag);
166 return -1;
167}
168
169int
171{
172 if(dwarfenumunit(d, unit, s) < 0)
173 return -1;
174 s->b.p = d->info.data + unit + off;
175 if(dwarfnextsymat(d, s, 0) != 1)
176 return -1;
177 return 0;
178}
179
180int
182{
183 if(dwarfenumunit(d, unit, s) < 0)
184 return -1;
185
186 if(dwarfnextsymat(d, s, 0) != 1)
187 return -1;
188 /* s is now the CompileUnit */
189
190 while(dwarfnextsymat(d, s, 1) == 1){
191 if(s->attrs.tag != TagSubprogram)
192 continue;
193 if(s->attrs.lowpc <= pc && pc < s->attrs.highpc)
194 return 0;
195 }
196 werrstr("fn containing pc 0x%lux not found", pc);
197 return -1;
198}
199
200int
202{
203 int i;
204 ulong aoff, len;
205
206 if(unit >= d->info.len){
207 werrstr("dwarf unit address 0x%x >= 0x%x out of range", unit, d->info.len);
208 return -1;
209 }
210 memset(s, 0, sizeof *s);
211 memset(&s->b, 0, sizeof s->b);
212
213 s->b.d = d;
214 s->b.p = d->info.data + unit;
215 s->b.ep = d->info.data + d->info.len;
216 len = dwarfget4(&s->b);
217 s->nextunit = unit + 4 + len;
218
219 if(s->b.ep - s->b.p < len){
220 badheader:
221 werrstr("bad dwarf unit header at unit 0x%lux", unit);
222 return -1;
223 }
224 s->b.ep = s->b.p+len;
225 if((i=dwarfget2(&s->b)) != 2)
226 goto badheader;
227 aoff = dwarfget4(&s->b);
228 s->b.addrsize = dwarfget1(&s->b);
229 if(d->addrsize == 0)
230 d->addrsize = s->b.addrsize;
231 if(s->b.p == nil)
232 goto badheader;
233
234 s->aoff = aoff;
235 s->unit = unit;
236 s->depth = 0;
237 return 0;
238}
239
240int
242{
243 if(dwarfenumunit(d, 0, s) < 0)
244 return -1;
245 s->allunits = 1;
246 return 0;
247}
248
249int
251{
252 ulong num;
253 DwarfAbbrev *a;
254
255 if(s->attrs.haskids)
256 s->depth++;
257top:
258 if(s->b.p >= s->b.ep){
259 if(s->allunits && s->nextunit < d->info.len){
260 if(dwarfenumunit(d, s->nextunit, s) < 0) {
261 return -1;
262 }
263 s->allunits = 1;
264 goto top;
265 }
266 return 0;
267 }
268
269 s->uoff = s->b.p - (d->info.data+s->unit);
270 num = dwarfget128(&s->b);
271 if(num == 0){
272 if(s->depth == 0) {
273 return 0;
274 }
275 if(s->depth > 0)
276 s->depth--;
277 goto top;
278 }
279
280 a = dwarfgetabbrev(d, s->aoff, num);
281 if(a == nil){
282 werrstr("getabbrev %ud %ud for %ud,%ud: %r\n", s->aoff, num, s->unit, s->uoff);
283 return -1;
284 }
285 if(parseattrs(&s->b, s->unit, a, &s->attrs) < 0) {
286 return -1;
287 }
288 return 1;
289}
290
291int
293{
294 int r;
295 DwarfSym t;
296 uint sib;
297
298 if(s->depth == depth && s->attrs.have.sibling){
299 sib = s->attrs.sibling;
300 if(sib < d->info.len && d->info.data+sib >= s->b.p)
301 s->b.p = d->info.data+sib;
302 s->attrs.haskids = 0;
303 }
304
305 /*
306 * The funny game with t and s make sure that
307 * if we get to the end of a run of a particular
308 * depth, we leave s so that a call to nextsymat with depth-1
309 * will actually produce the desired guy. We could change
310 * the interface to dwarfnextsym instead, but I'm scared
311 * to touch it.
312 */
313 t = *s;
314 for(;;){
315 if((r = dwarfnextsym(d, &t)) != 1) {
316 return r;
317 }
318 if(t.depth < depth){
319 /* went too far - nothing to see */
320 return 0;
321 }
322 *s = t;
323 if(t.depth == depth) {
324 return 1;
325 }
326 }
327}
328
329typedef struct Parse Parse;
330struct Parse {
331 int name;
332 int off;
334 int type;
335};
336
337#define OFFSET(x) offsetof(DwarfAttrs, x), offsetof(DwarfAttrs, have.x)
338
339static Parse plist[] = { /* Font Tab 4 */
340 { DwarfAttrAbstractOrigin, OFFSET(abstractorigin), TReference },
341 { DwarfAttrAccessibility, OFFSET(accessibility), TConstant },
342 { DwarfAttrAddrClass, OFFSET(addrclass), TConstant },
343 { DwarfAttrArtificial, OFFSET(isartificial), TFlag },
344 { DwarfAttrBaseTypes, OFFSET(basetypes), TReference },
345 { DwarfAttrBitOffset, OFFSET(bitoffset), TConstant },
346 { DwarfAttrBitSize, OFFSET(bitsize), TConstant },
348 { DwarfAttrCalling, OFFSET(calling), TConstant },
349 { DwarfAttrCommonRef, OFFSET(commonref), TReference },
350 { DwarfAttrCompDir, OFFSET(compdir), TString },
352 { DwarfAttrContainingType, OFFSET(containingtype), TReference },
355 { DwarfAttrDeclColumn, OFFSET(declcolumn), TConstant },
356 { DwarfAttrDeclFile, OFFSET(declfile), TConstant },
357 { DwarfAttrDeclLine, OFFSET(declline), TConstant },
358 { DwarfAttrDeclaration, OFFSET(isdeclaration), TFlag },
359 { DwarfAttrDefaultValue, OFFSET(defaultvalue), TReference },
360 { DwarfAttrDiscr, OFFSET(discr), TReference },
361 { DwarfAttrDiscrList, OFFSET(discrlist), TBlock },
362 { DwarfAttrDiscrValue, OFFSET(discrvalue), TConstant },
364 { DwarfAttrExternal, OFFSET(isexternal), TFlag },
365 { DwarfAttrFrameBase, OFFSET(framebase), TBlock|TConstant },
366 { DwarfAttrFriend, OFFSET(friend), TReference },
367 { DwarfAttrHighpc, OFFSET(highpc), TAddress },
368 { DwarfAttrEntrypc, OFFSET(entrypc), TAddress },
369 { DwarfAttrIdentifierCase, OFFSET(identifiercase), TConstant },
370 { DwarfAttrImport, OFFSET(import), TReference },
371 { DwarfAttrInline, OFFSET(inlined), TConstant },
372 { DwarfAttrIsOptional, OFFSET(isoptional), TFlag },
373 { DwarfAttrLanguage, OFFSET(language), TConstant },
376 { DwarfAttrLowpc, OFFSET(lowpc), TAddress },
377 { DwarfAttrMacroInfo, OFFSET(macroinfo), TConstant },
379 { DwarfAttrNamelistItem, OFFSET(namelistitem), TBlock },
382 { DwarfAttrProducer, OFFSET(producer), TString },
383 { DwarfAttrPrototyped, OFFSET(isprototyped), TFlag },
384 { DwarfAttrRanges, OFFSET(ranges), TReference },
385 { DwarfAttrReturnAddr, OFFSET(returnaddr), TBlock|TConstant },
387 { DwarfAttrSibling, OFFSET(sibling), TReference },
388 { DwarfAttrSpecification, OFFSET(specification), TReference },
389 { DwarfAttrStartScope, OFFSET(startscope), TConstant },
390 { DwarfAttrStaticLink, OFFSET(staticlink), TBlock|TConstant },
391 { DwarfAttrStmtList, OFFSET(stmtlist), TConstant },
392 { DwarfAttrStrideSize, OFFSET(stridesize), TConstant },
393 { DwarfAttrStringLength, OFFSET(stringlength), TBlock|TConstant },
396 { DwarfAttrUseLocation, OFFSET(uselocation), TBlock|TConstant },
397 { DwarfAttrVarParam, OFFSET(isvarparam), TFlag },
398 { DwarfAttrVirtuality, OFFSET(virtuality), TConstant },
399 { DwarfAttrVisibility, OFFSET(visibility), TConstant },
400 { DwarfAttrVtableElemLoc, OFFSET(vtableelemloc), TBlock|TReference },
401 { }
402};
403
405
406static int
408{
409 int i, f, n, got;
410 static int nbad;
411 void *v;
412
413 /* initialize ptab first time through for quick access */
415 for(i=0; plist[i].name; i++)
416 ptab[plist[i].name] = plist[i];
417
418 memset(attrs, 0, sizeof *attrs);
419 attrs->tag = a->tag;
420 attrs->haskids = a->haskids;
421
422 for(i=0; i<a->nattr; i++){
423 n = a->attr[i].name;
424 f = a->attr[i].form;
425 if(n < 0 || n >= DwarfAttrMax || ptab[n].name==0){
426 if(++nbad == 1)
427 werrstr("dwarf parse attrs: unexpected attribute name 0x%x", n);
428 continue; //return -1;
429 }
430 v = (char*)attrs + ptab[n].off;
431 got = 0;
432 if(f == FormIndirect)
433 f = dwarfget128(b);
435 && getulong(b, f, unit, v, &got) >= 0)
436 ;
437 else if((ptab[n].type&TFlag) && getuchar(b, f, v) >= 0)
438 got = TFlag;
439 else if((ptab[n].type&TString) && getstring(b, f, v) >= 0)
440 got = TString;
441 else if((ptab[n].type&TBlock) && getblock(b, f, v) >= 0)
442 got = TBlock;
443 else{
444 if(skipform(b, f) < 0){
445 if(++nbad == 1)
446 werrstr("dwarf parse attrs: cannot skip form %d", f);
447 return -1;
448 }
449 }
450 if(got == TBlock && (ptab[n].type&TConstant))
451 got = constblock(b->d, v, v);
452 *((uchar*)attrs+ptab[n].haveoff) = got;
453 }
454 return 0;
455}
456
457static int
459{
460 static int nbad;
461 uvlong uv;
462
463 switch(form){
464 default:
465 return -1;
466
467 /* addresses */
468 case FormAddr:
469 *type = TAddress;
470 *u = dwarfgetaddr(b);
471 return 0;
472
473 /* references */
474 case FormRefAddr:
475 /* absolute ref in .debug_info */
476 *type = TReference;
477 *u = dwarfgetaddr(b);
478 return 0;
479 case FormRef1:
480 *u = dwarfget1(b);
481 goto relativeref;
482 case FormRef2:
483 *u = dwarfget2(b);
484 goto relativeref;
485 case FormRef4:
486 *u = dwarfget4(b);
487 goto relativeref;
488 case FormRef8:
489 *u = dwarfget8(b);
490 goto relativeref;
491 case FormRefUdata:
492 *u = dwarfget128(b);
493 relativeref:
494 *u += unit;
495 *type = TReference;
496 return 0;
497
498 /* constants */
499 case FormData1:
500 *u = dwarfget1(b);
501 goto constant;
502 case FormData2:
503 *u = dwarfget2(b);
504 goto constant;
505 case FormData4:
506 *u = dwarfget4(b);
507 goto constant;
508 case FormData8:
509 uv = dwarfget8(b);
510 *u = uv;
511 if(uv != *u && ++nbad == 1)
512 werrstr("dwarf: truncating 64-bit attribute constants");
513 goto constant;
514 case FormSdata:
515 *u = dwarfget128s(b);
516 goto constant;
517 case FormUdata:
518 *u = dwarfget128(b);
519 constant:
520 *type = TConstant;
521 return 0;
522 }
523}
524
525static int
527{
528 switch(form){
529 default:
530 return -1;
531
532 case FormFlag:
533 *u = dwarfget1(b);
534 return 0;
535 }
536}
537
538static int
539getstring(DwarfBuf *b, int form, char **s)
540{
541 static int nbad;
542 ulong u;
543
544 switch(form){
545 default:
546 return -1;
547
548 case FormString:
549 *s = dwarfgetstring(b);
550 return 0;
551
552 case FormStrp:
553 u = dwarfget4(b);
554 if(u >= b->d->str.len){
555 if(++nbad == 1)
556 werrstr("dwarf: bad string pointer 0x%lux in attribute", u);
557 /* don't return error - maybe can proceed */
558 *s = nil;
559 }else
560 *s = (char*)b->d->str.data + u;
561 return 0;
562
563 }
564}
565
566static int
568{
569 ulong n;
570
571 switch(form){
572 default:
573 return -1;
574 case FormDwarfBlock:
575 n = dwarfget128(b);
576 goto copyn;
577 case FormDwarfBlock1:
578 n = dwarfget1(b);
579 goto copyn;
580 case FormDwarfBlock2:
581 n = dwarfget2(b);
582 goto copyn;
583 case FormDwarfBlock4:
584 n = dwarfget4(b);
585 copyn:
586 bl->data = dwarfgetnref(b, n);
587 bl->len = n;
588 if(bl->data == nil)
589 return -1;
590 return 0;
591 }
592}
593
594static int
596{
597 DwarfBuf b;
598
599 memset(&b, 0, sizeof b);
600 b.p = bl->data;
601 b.ep = bl->data+bl->len;
602 b.d = d;
603
604 switch(dwarfget1(&b)){
605 case OpAddr:
606 *pval = dwarfgetaddr(&b);
607 return TConstant;
608 case OpConst1u:
609 *pval = dwarfget1(&b);
610 return TConstant;
611 case OpConst1s:
612 *pval = (schar)dwarfget1(&b);
613 return TConstant;
614 case OpConst2u:
615 *pval = dwarfget2(&b);
616 return TConstant;
617 case OpConst2s:
618 *pval = (s16int)dwarfget2(&b);
619 return TConstant;
620 case OpConst4u:
621 *pval = dwarfget4(&b);
622 return TConstant;
623 case OpConst4s:
624 *pval = (s32int)dwarfget4(&b);
625 return TConstant;
626 case OpConst8u:
627 *pval = (u64int)dwarfget8(&b);
628 return TConstant;
629 case OpConst8s:
630 *pval = (s64int)dwarfget8(&b);
631 return TConstant;
632 case OpConstu:
633 *pval = dwarfget128(&b);
634 return TConstant;
635 case OpConsts:
636 *pval = dwarfget128s(&b);
637 return TConstant;
638 case OpPlusUconst:
639 *pval = dwarfget128(&b);
640 return TConstant;
641 default:
642 return TBlock;
643 }
644}
645
646/* last resort */
647static int
649{
650 int type;
652
653 if(getulong(b, form, 0, &val.c, &type) < 0
654 && getuchar(b, form, (uchar*)&val) < 0
655 && getstring(b, form, &val.s) < 0
656 && getblock(b, form, &val.b) < 0)
657 return -1;
658 return 0;
659}
660
unsigned char uchar
Definition: Unfrag.h:59
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
UINT32 uint
Definition: types.h:83
r parent
Definition: btrfs.c:3010
unsigned long ulong
Definition: linux.h:275
int form
Definition: main.c:89
int bytesize
Definition: main.c:93
static enum @958 ordering
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
const GLdouble * v
Definition: gl.h:2040
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble GLdouble t
Definition: gl.h:2047
GLdouble n
Definition: glext.h:7729
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLfloat f
Definition: glext.h:7540
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLuint GLfloat * val
Definition: glext.h:7180
GLuint GLuint num
Definition: glext.h:9618
GLenum GLsizei len
Definition: glext.h:6722
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
#define d
Definition: ke_i.h:81
#define f
Definition: ke_i.h:83
#define a
Definition: ke_i.h:78
#define b
Definition: ke_i.h:79
static int priority
Definition: timer.c:163
png_const_structrp png_const_inforp int * unit
Definition: png.h:2159
static int getstring(DwarfBuf *, int, char **)
Definition: dwarfinfo.c:539
int dwarflookupsubname(Dwarf *d, DwarfSym *parent, char *name, DwarfSym *s)
Definition: dwarfinfo.c:140
static int getuchar(DwarfBuf *, int, uchar *)
Definition: dwarfinfo.c:526
static int constblock(Dwarf *, DwarfBlock *, ulong *)
Definition: dwarfinfo.c:595
static int getblock(DwarfBuf *, int, DwarfBlock *)
Definition: dwarfinfo.c:567
int dwarflookupfn(Dwarf *d, ulong unit, ulong pc, DwarfSym *s)
Definition: dwarfinfo.c:181
int dwarfnextsymat(Dwarf *d, DwarfSym *s, int depth)
Definition: dwarfinfo.c:292
@ DwarfAttrSibling
Definition: dwarfinfo.c:19
@ DwarfAttrIsOptional
Definition: dwarfinfo.c:41
@ DwarfAttrUpperBound
Definition: dwarfinfo.c:48
@ DwarfAttrVirtuality
Definition: dwarfinfo.c:76
@ DwarfAttrDefaultValue
Definition: dwarfinfo.c:39
@ DwarfAttrUseUTF8
Definition: dwarfinfo.c:83
@ DwarfAttrConstValue
Definition: dwarfinfo.c:37
@ DwarfAttrLanguage
Definition: dwarfinfo.c:29
@ DwarfAttrTrampoline
Definition: dwarfinfo.c:86
@ DwarfAttrIdentifierCase
Definition: dwarfinfo.c:66
@ DwarfAttrAddrClass
Definition: dwarfinfo.c:51
@ FormAddr
Definition: dwarfinfo.c:93
@ DwarfAttrAllocated
Definition: dwarfinfo.c:78
@ DwarfAttrCallColumn
Definition: dwarfinfo.c:87
@ DwarfAttrExternal
Definition: dwarfinfo.c:63
@ DwarfAttrName
Definition: dwarfinfo.c:21
@ DwarfAttrNamelistItem
Definition: dwarfinfo.c:68
@ DwarfAttrAssociated
Definition: dwarfinfo.c:79
@ FormUdata
Definition: dwarfinfo.c:106
@ FormRefAddr
Definition: dwarfinfo.c:107
@ FormRef2
Definition: dwarfinfo.c:109
@ DwarfAttrMacroInfo
Definition: dwarfinfo.c:67
@ DwarfAttrOrdering
Definition: dwarfinfo.c:22
@ FormIndirect
Definition: dwarfinfo.c:113
@ FormSdata
Definition: dwarfinfo.c:104
@ FormRef4
Definition: dwarfinfo.c:110
@ DwarfAttrByteSize
Definition: dwarfinfo.c:23
@ FormDwarfBlock4
Definition: dwarfinfo.c:95
@ DwarfAttrLocation
Definition: dwarfinfo.c:20
@ DwarfAttrExtension
Definition: dwarfinfo.c:84
@ DwarfAttrSegment
Definition: dwarfinfo.c:70
@ DwarfAttrDataLocation
Definition: dwarfinfo.c:80
@ DwarfAttrCalling
Definition: dwarfinfo.c:54
@ DwarfAttrAbstractOrigin
Definition: dwarfinfo.c:49
@ DwarfAttrVarParam
Definition: dwarfinfo.c:75
@ DwarfAttrDescription
Definition: dwarfinfo.c:90
@ DwarfAttrUseLocation
Definition: dwarfinfo.c:74
@ DwarfAttrStartScope
Definition: dwarfinfo.c:46
@ DwarfAttrStrideSize
Definition: dwarfinfo.c:47
@ DwarfAttrDiscrValue
Definition: dwarfinfo.c:31
@ DwarfAttrContainingType
Definition: dwarfinfo.c:38
@ DwarfAttrCommonRef
Definition: dwarfinfo.c:35
@ DwarfAttrType
Definition: dwarfinfo.c:73
@ DwarfAttrLowerBound
Definition: dwarfinfo.c:42
@ DwarfAttrCallFile
Definition: dwarfinfo.c:88
@ DwarfAttrEntrypc
Definition: dwarfinfo.c:82
@ FormData1
Definition: dwarfinfo.c:102
@ DwarfAttrDeclaration
Definition: dwarfinfo.c:60
@ DwarfAttrStride
Definition: dwarfinfo.c:81
@ DwarfAttrDeclColumn
Definition: dwarfinfo.c:57
@ DwarfAttrFriend
Definition: dwarfinfo.c:65
@ FormRef8
Definition: dwarfinfo.c:111
@ DwarfAttrBaseTypes
Definition: dwarfinfo.c:53
@ DwarfAttrStaticLink
Definition: dwarfinfo.c:72
@ FormData8
Definition: dwarfinfo.c:98
@ DwarfAttrStringLength
Definition: dwarfinfo.c:34
@ DwarfAttrCompDir
Definition: dwarfinfo.c:36
@ DwarfAttrPrototyped
Definition: dwarfinfo.c:44
@ DwarfAttrHighpc
Definition: dwarfinfo.c:28
@ FormDwarfBlock2
Definition: dwarfinfo.c:94
@ DwarfAttrAccessibility
Definition: dwarfinfo.c:50
@ DwarfAttrReturnAddr
Definition: dwarfinfo.c:45
@ DwarfAttrCount
Definition: dwarfinfo.c:55
@ DwarfAttrArtificial
Definition: dwarfinfo.c:52
@ DwarfAttrBitSize
Definition: dwarfinfo.c:25
@ DwarfAttrCallLine
Definition: dwarfinfo.c:89
@ DwarfAttrDataMemberLoc
Definition: dwarfinfo.c:56
@ FormDwarfBlock1
Definition: dwarfinfo.c:101
@ DwarfAttrImport
Definition: dwarfinfo.c:33
@ FormRef1
Definition: dwarfinfo.c:108
@ DwarfAttrStmtList
Definition: dwarfinfo.c:26
@ DwarfAttrSpecification
Definition: dwarfinfo.c:71
@ DwarfAttrLowpc
Definition: dwarfinfo.c:27
@ DwarfAttrRanges
Definition: dwarfinfo.c:85
@ FormRefUdata
Definition: dwarfinfo.c:112
@ DwarfAttrInline
Definition: dwarfinfo.c:40
@ FormData2
Definition: dwarfinfo.c:96
@ DwarfAttrVtableElemLoc
Definition: dwarfinfo.c:77
@ DwarfAttrMax
Definition: dwarfinfo.c:91
@ FormData4
Definition: dwarfinfo.c:97
@ FormFlag
Definition: dwarfinfo.c:103
@ DwarfAttrDeclFile
Definition: dwarfinfo.c:58
@ FormDwarfBlock
Definition: dwarfinfo.c:100
@ DwarfAttrProducer
Definition: dwarfinfo.c:43
@ DwarfAttrVisibility
Definition: dwarfinfo.c:32
@ DwarfAttrEncoding
Definition: dwarfinfo.c:62
@ DwarfAttrDiscr
Definition: dwarfinfo.c:30
@ DwarfAttrPriority
Definition: dwarfinfo.c:69
@ DwarfAttrDeclLine
Definition: dwarfinfo.c:59
@ DwarfAttrFrameBase
Definition: dwarfinfo.c:64
@ DwarfAttrDiscrList
Definition: dwarfinfo.c:61
@ FormStrp
Definition: dwarfinfo.c:105
@ DwarfAttrBitOffset
Definition: dwarfinfo.c:24
@ FormString
Definition: dwarfinfo.c:99
int dwarflookupnameinunit(Dwarf *d, ulong unit, char *name, DwarfSym *s)
Definition: dwarfinfo.c:125
static int getulong(DwarfBuf *, int, ulong, ulong *, int *)
Definition: dwarfinfo.c:458
int dwarfenumunit(Dwarf *d, ulong unit, DwarfSym *s)
Definition: dwarfinfo.c:201
int dwarflookuptag(Dwarf *d, ulong unit, ulong tag, DwarfSym *s)
Definition: dwarfinfo.c:151
static Parse ptab[DwarfAttrMax]
Definition: dwarfinfo.c:404
int dwarfnextsym(Dwarf *d, DwarfSym *s)
Definition: dwarfinfo.c:250
int dwarfseeksym(Dwarf *d, ulong unit, ulong off, DwarfSym *s)
Definition: dwarfinfo.c:170
static int skipform(DwarfBuf *, int)
Definition: dwarfinfo.c:648
#define OFFSET(x)
Definition: dwarfinfo.c:337
int dwarfenum(Dwarf *d, DwarfSym *s)
Definition: dwarfinfo.c:241
static Parse plist[]
Definition: dwarfinfo.c:339
static int parseattrs(DwarfBuf *, ulong, DwarfAbbrev *, DwarfAttrs *)
Definition: dwarfinfo.c:407
signed char schar
Definition: compat.h:5
long long s64int
Definition: compat.h:16
#define werrstr(str,...)
Definition: compat.h:34
unsigned long long uvlong
Definition: compat.h:9
int s32int
Definition: compat.h:14
#define nil
Definition: compat.h:23
unsigned long long u64int
Definition: compat.h:15
short s16int
Definition: compat.h:12
#define memset(x, y, z)
Definition: compat.h:39
@ OpConst4s
Definition: dwarf.h:144
@ OpConst4u
Definition: dwarf.h:143
@ OpConsts
Definition: dwarf.h:148
@ OpConst2u
Definition: dwarf.h:141
@ TAddress
Definition: dwarf.h:135
@ OpConst8u
Definition: dwarf.h:145
@ TString
Definition: dwarf.h:133
@ TReference
Definition: dwarf.h:130
@ TConstant
Definition: dwarf.h:132
@ OpPlusUconst
Definition: dwarf.h:166
@ OpAddr
Definition: dwarf.h:137
@ OpConst1s
Definition: dwarf.h:140
@ TagSubprogram
Definition: dwarf.h:52
@ OpConst2s
Definition: dwarf.h:142
@ OpConstu
Definition: dwarf.h:147
@ TBlock
Definition: dwarf.h:131
@ OpConst8s
Definition: dwarf.h:146
@ OpConst1u
Definition: dwarf.h:139
@ TFlag
Definition: dwarf.h:134
ulong dwarfget128(DwarfBuf *)
Definition: dwarfget.c:152
ulong dwarfget2(DwarfBuf *)
Definition: dwarfget.c:81
char * dwarfgetstring(DwarfBuf *)
Definition: dwarfget.c:54
ulong dwarfget1(DwarfBuf *)
Definition: dwarfget.c:17
long dwarfget128s(DwarfBuf *)
Definition: dwarfget.c:197
ulong dwarfgetaddr(DwarfBuf *)
Definition: dwarfget.c:123
uchar * dwarfgetnref(DwarfBuf *, ulong)
Definition: dwarfget.c:40
ulong dwarfget4(DwarfBuf *)
Definition: dwarfget.c:95
uvlong dwarfget8(DwarfBuf *)
Definition: dwarfget.c:109
DwarfAbbrev * dwarfgetabbrev(Dwarf *, ulong, ulong)
Definition: dwarfabbrev.c:128
uchar haskids
Definition: dwarf.h:226
ulong tag
Definition: dwarf.h:225
uchar * data
Definition: dwarf.h:202
ulong len
Definition: dwarf.h:203
Definition: dwarf.h:437
int type
Definition: dwarfinfo.c:334
int name
Definition: dwarfinfo.c:331
int off
Definition: dwarfinfo.c:332
int haveoff
Definition: dwarfinfo.c:333
Definition: name.c:39
Definition: ecma_167.h:138
static char * encoding
Definition: xmllint.c:155