PERFORCE change 132828 for review

John Birrell jb at FreeBSD.org
Tue Jan 8 14:53:16 PST 2008


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

Change 132828 by jb at jb_freebsd1 on 2008/01/08 22:53:09

	Default some return variables so that they are a known quantity when
	the search attribute value isn't found.
	
	
	Enhance some debug statements with the DIE offset in hex (because that's
	how dwarfdump refers to DIEs).

Affected files ...

.. //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/dwarf.c#12 edit

Differences ...

==== //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/dwarf.c#12 (text) ====

@@ -354,6 +354,7 @@
 die_signed(dwarf_t *dw, Dwarf_Die die, Dwarf_Half name, Dwarf_Signed *valp,
     int req)
 {
+	*valp = 0;
 	if (dwarf_attrval_signed(die, name, valp, &dw->dw_err) != DWARF_E_NONE) {
 		if (req) 
 			terminate("die %llu: failed to get unsigned: %s\n",
@@ -367,6 +368,7 @@
 die_unsigned(dwarf_t *dw, Dwarf_Die die, Dwarf_Half name, Dwarf_Unsigned *valp,
     int req)
 {
+	*valp = 0;
 	if (dwarf_attrval_unsigned(die, name, valp, &dw->dw_err) != DWARF_E_NONE) {
 		if (req) 
 			terminate("die %llu: failed to get unsigned: %s\n",
@@ -379,6 +381,8 @@
 static int
 die_bool(dwarf_t *dw, Dwarf_Die die, Dwarf_Half name, Dwarf_Bool *valp, int req)
 {
+	*valp = 0;
+
 	if (dwarf_attrval_flag(die, name, valp, &dw->dw_err) != DWARF_E_NONE) {
 		if (req) 
 			terminate("die %llu: failed to get flag: %s\n",
@@ -1403,7 +1407,7 @@
 {
 	Dwarf_Attribute attr;
 
-	debug(3, "die %llu: creating %s\n", off, typename);
+	debug(3, "die %llu <%llx>: creating %s type %d\n", off, off, typename, type);
 
 	tdp->t_type = type;
 
@@ -1467,7 +1471,7 @@
 	iidesc_t *ii;
 	char *name;
 
-	debug(3, "die %llu: creating function definition '%s'\n", off);
+	debug(3, "die %llu <%llx>: creating function definition\n", off, off);
 
 	/*
 	 * We'll begin by processing any type definition nodes that may be
@@ -1654,7 +1658,7 @@
 	Dwarf_Half tag;
 	tdesc_t *tdp;
 
-	debug(3, "die %llu: create_one\n", off);
+	debug(3, "die %llu <%llx>: create_one\n", off, off);
 
 	if (off > dw->dw_maxoff) {
 		terminate("illegal die offset %llu (max %llu)\n", off,


More information about the p4-projects mailing list