]> granicus.if.org Git - strace/commitdiff
Enhance personality syscall decoding
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 24 Dec 2015 16:53:07 +0000 (16:53 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 25 Dec 2015 00:46:07 +0000 (00:46 +0000)
* personality.c (SYS_FUNC(personality)): On entering syscall,
print first argument not as a hex value but as a set of flags.
On exiting syscall, print return code as a set of flags.
* NEWS: Mention this enhancement.

NEWS
personality.c

diff --git a/NEWS b/NEWS
index 09263eb22d3cac15316e23f4a8ab6bea24bd916e..f66d3212c778c51e3c1865ddec02d7251baf498b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,9 @@
 Noteworthy changes in release ?.?? (????-??-??)
 ===============================================
 
+* Improvements
+  * Enhanced decoding of personality syscall.
+
 * Bug fixes
   * Fixed build on arc, metag, nios2, or1k, and tile architectures.
 
index 5c425c61b740a86ceab333da70d25f4eff049a27..2030374e769eda7adc6265054c35002d2d6869a9 100644 (file)
@@ -6,7 +6,11 @@
 
 SYS_FUNC(personality)
 {
-       printxval(personality_options, tcp->u_arg[0], "PER_???");
+       if (entering(tcp)) {
+               printflags(personality_options, tcp->u_arg[0], "PER_???");
+               return 0;
+       }
 
-       return RVAL_DECODED;
+       tcp->auxstr = sprintflags("", personality_options, tcp->u_rval);
+       return RVAL_HEX | RVAL_STR;
 }