Android-specific prctl

enh enh at google.com
Wed Jul 29 16:20:56 UTC 2015


oops. fixed patch with C comments:

diff --git a/prctl.c b/prctl.c
index 4c12bac..7dea54e 100644
--- a/prctl.c
+++ b/prctl.c
@@ -168,6 +168,27 @@ SYS_FUNC(prctl)
 		printstr(tcp, tcp->u_arg[1], TASK_COMM_LEN);
 		return RVAL_DECODED;

+#ifdef __ANDROID__
+# ifndef PR_SET_VMA
+#  define PR_SET_VMA   0x53564d41
+# endif
+# ifndef PR_SET_VMA_ANON_NAME
+#  define PR_SET_VMA_ANON_NAME    0
+# endif
+	case PR_SET_VMA:
+		if (tcp->u_arg[1] == PR_SET_VMA_ANON_NAME) {
+			tprintf(", %lu", tcp->u_arg[1]);
+			tprintf(", %#lx", tcp->u_arg[2]);
+			tprintf(", %lu, ", tcp->u_arg[3]);
+			printstr(tcp, tcp->u_arg[4], -1);
+		} else {
+			/* There are no other sub-options now, but there
+			 * might be in future... */
+			print_prctl_args(tcp, 1);
+		}
+		break;
+#endif
+
 	case PR_SET_MM:
 		tprints(", ");
 		printxval(pr_set_mm, tcp->u_arg[1], "PR_SET_MM_???");



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.




More information about the Strace-devel mailing list