PERFORCE change 132809 for review

John Birrell jb at FreeBSD.org
Tue Jan 8 12:46:20 PST 2008


http://perforce.freebsd.org/chv.cgi?CH=132809

Change 132809 by jb at 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;
 }


More information about the p4-projects mailing list