aboutsummaryrefslogtreecommitdiff
path: root/bsd-user/strace.c
diff options
context:
space:
mode:
authorSean Bruno <sbruno@freebsd.org>2014-06-08 09:57:24 -0700
committerPeter Maydell <peter.maydell@linaro.org>2014-06-11 00:25:06 +0100
commit80b346040d23c7e409949bef578ef4ef2c679e49 (patch)
tree04f4609e2cc53aa04b4e786fba8f228773d94b09 /bsd-user/strace.c
parent88dae46d1898e8ed65633f1bd6d0753f303bc3a1 (diff)
bsd-user: Implement strace support for print_sysctl syscall
Signed-off-by: Sean Bruno <sbruno@freebsd.org> Message-id: 1402246651-71099-4-git-send-email-sbruno@freebsd.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'bsd-user/strace.c')
-rw-r--r--bsd-user/strace.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/bsd-user/strace.c b/bsd-user/strace.c
index 47e5e760f4..b2633d0cb4 100644
--- a/bsd-user/strace.c
+++ b/bsd-user/strace.c
@@ -33,6 +33,28 @@ int do_strace;
* Utility functions
*/
+static void print_sysctl(const struct syscallname *name, abi_long arg1,
+ abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5,
+ abi_long arg6)
+{
+ uint32_t i;
+ int32_t *namep;
+
+ gemu_log("%s({ ", name->name);
+ namep = lock_user(VERIFY_READ, arg1, sizeof(int32_t) * arg2, 1);
+ if (namep) {
+ int32_t *p = namep;
+
+ for (i = 0; i < (uint32_t)arg2; i++) {
+ gemu_log("%d ", tswap32(*p++));
+ }
+ unlock_user(namep, arg1, 0);
+ }
+ gemu_log("}, %u, 0x" TARGET_ABI_FMT_lx ", 0x" TARGET_ABI_FMT_lx ", 0x"
+ TARGET_ABI_FMT_lx ", 0x" TARGET_ABI_FMT_lx ")",
+ (uint32_t)arg2, arg3, arg4, arg5, arg6);
+}
+
static void print_execve(const struct syscallname *name, abi_long arg1,
abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5,
abi_long arg6)