[Midnightbsd-cvs] src [9022] trunk/sys/cddl/dev/fbt/fbt.c: fbt_getargdesc: correctly handle types for return problems.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Sep 29 21:57:09 EDT 2016


Revision: 9022
          http://svnweb.midnightbsd.org/src/?rev=9022
Author:   laffer1
Date:     2016-09-29 21:57:08 -0400 (Thu, 29 Sep 2016)
Log Message:
-----------
fbt_getargdesc: correctly handle types for return problems.

Modified Paths:
--------------
    trunk/sys/cddl/dev/fbt/fbt.c

Modified: trunk/sys/cddl/dev/fbt/fbt.c
===================================================================
--- trunk/sys/cddl/dev/fbt/fbt.c	2016-09-30 01:56:38 UTC (rev 9021)
+++ trunk/sys/cddl/dev/fbt/fbt.c	2016-09-30 01:57:08 UTC (rev 9022)
@@ -1261,6 +1261,11 @@
 	uint32_t offset;
 	ushort_t info, kind, n;
 
+	if (fbt->fbtp_roffset != 0 && desc->dtargd_ndx == 0) {
+		(void) strcpy(desc->dtargd_native, "int");
+		return;
+	}
+
 	desc->dtargd_ndx = DTRACE_ARGNONE;
 
 	/* Get a pointer to the CTF data and it's length. */
@@ -1311,12 +1316,19 @@
 		return;
 	}
 
-	/* Check if the requested argument doesn't exist. */
-	if (ndx >= n)
-		return;
+	if (fbt->fbtp_roffset != 0) {
+		/* Only return type is available for args[1] in return probe. */
+		if (ndx > 1)
+			return;
+		ASSERT(ndx == 1);
+	} else {
+		/* Check if the requested argument doesn't exist. */
+		if (ndx >= n)
+			return;
 
-	/* Skip the return type and arguments up to the one requested. */
-	dp += ndx + 1;
+		/* Skip the return type and arguments up to the one requested. */
+		dp += ndx + 1;
+	}
 
 	if (fbt_type_name(&lc, *dp, desc->dtargd_native, sizeof(desc->dtargd_native)) > 0)
 		desc->dtargd_ndx = ndx;



More information about the Midnightbsd-cvs mailing list