Date: Tue, 8 Jan 2008 20:46:19 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 132809 for review Message-ID: <200801082046.m08KkJND013139@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=132809 Change 132809 by jb@jb_freebsd1 on 2008/01/08 20:45:58 Just get the specified attribute and let the caller decide what to do in the case where it isn't found. The previous code was just wrong. Affected files ... .. //depot/projects/dtrace/src/lib/libdwarf/dwarf_attrval.c#2 edit Differences ... ==== //depot/projects/dtrace/src/lib/libdwarf/dwarf_attrval.c#2 (text+ko) ==== @@ -35,35 +35,11 @@ dwarf_attrval_find(Dwarf_Die die, Dwarf_Half attr) { Dwarf_AttrValue av; - Dwarf_AttrValue av_sib; - Dwarf_CU cu; - Dwarf_Die die_sib; - do { - av_sib = NULL; - - STAILQ_FOREACH(av, &die->die_attrval, av_next) { - if (av->av_attrib == attr) - break; - if (av->av_attrib == DW_AT_sibling) - av_sib = av; - } - - if (av != NULL || av_sib == NULL) + STAILQ_FOREACH(av, &die->die_attrval, av_next) { + if (av->av_attrib == attr) break; - - cu = die->die_cu; - - die = NULL; - - STAILQ_FOREACH(die_sib, &cu->cu_die, die_next) { - if (die_sib->die_offset == av_sib->u[0].u64) { - die = die_sib; - break; - } - } - - } while (die != NULL); + } return av; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801082046.m08KkJND013139>