[Glibc-bsd-commits] r5998 - in trunk/ctfutils/debian: . patches

stevenc-guest at alioth.debian.org stevenc-guest at alioth.debian.org
Sun Apr 10 22:18:16 UTC 2016


Author: stevenc-guest
Date: 2016-04-10 22:18:16 +0000 (Sun, 10 Apr 2016)
New Revision: 5998

Modified:
   trunk/ctfutils/debian/changelog
   trunk/ctfutils/debian/patches/sou_too_many_values.diff
Log:
Turn a "sou %s has too many values" error into a warning;
encode only the first CTF_MAX_VLEN members.


Modified: trunk/ctfutils/debian/changelog
===================================================================
--- trunk/ctfutils/debian/changelog	2016-04-10 21:11:48 UTC (rev 5997)
+++ trunk/ctfutils/debian/changelog	2016-04-10 22:18:16 UTC (rev 5998)
@@ -7,7 +7,7 @@
     - ulong_t.diff
   * Now using Standards-Version 3.9.8 (no changes needed)
   * Turn a "sou %s has too many values" error into a warning;
-    skip encoding struct/unions too large.
+    encode only the first CTF_MAX_VLEN members.
 
  -- Steven Chamberlain <steven at pyro.eu.org>  Sun, 10 Apr 2016 20:58:12 +0100
 

Modified: trunk/ctfutils/debian/patches/sou_too_many_values.diff
===================================================================
--- trunk/ctfutils/debian/patches/sou_too_many_values.diff	2016-04-10 21:11:48 UTC (rev 5997)
+++ trunk/ctfutils/debian/patches/sou_too_many_values.diff	2016-04-10 22:18:16 UTC (rev 5998)
@@ -1,9 +1,9 @@
 Date: Sun, 10 Apr 2016 21:54:27 +0100
 From: Steven Chamberlain <steven at pyro.eu.org>
-Subject: skip encoding struct/union with >CTF_MAX_VLEN members
+Subject: encode first CTF_MAX_VLEN members of struct/union
 
 Turn a "sou %s has too many values" error into a warning;
-skip encoding struct/unions too large.
+encode only the first CTF_MAX_VLEN members.
 
 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c
 +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c
@@ -14,7 +14,36 @@
 -			terminate("sou %s has too many members: %d > %d\n",
 +			warning("sou %s has too many members: %d > %d\n",
  			    tdesc_name(tp), i, CTF_MAX_VLEN);
-+			break;
++			i = CTF_MAX_VLEN;
  		}
  
  		if (tp->t_type == STRUCT)
+@@ -395,7 +396,7 @@
+ 		write_sized_type_rec(b, &ctt, tp->t_size);
+ 
+ 		if (tp->t_size < CTF_LSTRUCT_THRESH) {
+-			for (mp = tp->t_members; mp != NULL; mp = mp->ml_next) {
++			for (mp = tp->t_members; mp != NULL && i > 0; mp = mp->ml_next) {
+ 				offset = strtab_insert(&b->ctb_strtab,
+ 				    mp->ml_name);
+ 
+@@ -409,9 +410,10 @@
+ 					SWAP_16(ctm.ctm_offset);
+ 				}
+ 				ctf_buf_write(b, &ctm, sizeof (ctm));
++				i--;
+ 			}
+ 		} else {
+-			for (mp = tp->t_members; mp != NULL; mp = mp->ml_next) {
++			for (mp = tp->t_members; mp != NULL && i > 0; mp = mp->ml_next) {
+ 				offset = strtab_insert(&b->ctb_strtab,
+ 				    mp->ml_name);
+ 
+@@ -431,6 +433,7 @@
+ 				}
+ 
+ 				ctf_buf_write(b, &ctlm, sizeof (ctlm));
++				i--;
+ 			}
+ 		}
+ 		break;




More information about the Glibc-bsd-commits mailing list