]> granicus.if.org Git - strace/commitdiff
Improve decoding of Android's PR_SET_VMA prctl
authorElliott Hughes <enh@google.com>
Wed, 6 Apr 2016 21:41:36 +0000 (14:41 -0700)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 6 Apr 2016 21:41:36 +0000 (21:41 +0000)
Before:

  prctl(0x53564d41 /* PR_??? */, 0, 0x7f8ab53000, 4096,
        "atexit handlers") = 0

After:

  prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, 0x7fa8cbd000, 4096,
        "atexit handlers") = 0

* prctl.c (SYS_FUNC(prctl)) [__ANDROID__]: Do not define PR_SET_VMA.
* Hard-code PR_SET_VMA_ANON_NAME, the only current sub-option.
* xlat/prctl_options.in: Add PR_SET_VMA.

prctl.c
xlat/prctl_options.in

diff --git a/prctl.c b/prctl.c
index 53ee56e3b730611fdf6d2dcd4794035b51b8e103..da7d265ba0a536a002a4667cff307e19465d8d2f 100644 (file)
--- a/prctl.c
+++ b/prctl.c
@@ -208,16 +208,12 @@ SYS_FUNC(prctl)
                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(", PR_SET_VMA_ANON_NAME, %#lx", tcp->u_arg[2]);
                        tprintf(", %lu, ", tcp->u_arg[3]);
                        printstr(tcp, tcp->u_arg[4], -1);
                } else {
index 2d0d287fd6089bea12cd874b7fa4103cd09bf8bc..8c09ee31ee7544f770ff0d8f720107225382d98a 100644 (file)
@@ -44,3 +44,4 @@ PR_MPX_DISABLE_MANAGEMENT 44
 PR_SET_FP_MODE 45
 PR_GET_FP_MODE 46
 PR_CAP_AMBIENT 47
+PR_SET_VMA 0x53564d41