summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2015-12-24 16:53:07 +0000
committerDmitry V. Levin <ldv@altlinux.org>2015-12-25 00:46:07 +0000
commit97cbf69756ef371853280574962f3fec05c7461e (patch)
tree2bc8192cbd58939a2b8e27fb02806d1e69c62a57
parentffb6c55d7d52b22a526e58815770b09a2994d856 (diff)
downloadstrace-97cbf69756ef371853280574962f3fec05c7461e.tar.gz
Enhance personality syscall decoding
* 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.
-rw-r--r--NEWS3
-rw-r--r--personality.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 09263eb22..f66d3212c 100644
--- 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.
diff --git a/personality.c b/personality.c
index 5c425c61b..2030374e7 100644
--- a/personality.c
+++ b/personality.c
@@ -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;
}