Skip to content

Commit

Permalink
linux-user: Add strace support for printing arguments of llseek
Browse files Browse the repository at this point in the history
Some target are using llseek instead of _llseek like riscv,
nios2, hexagon, and openrisc.

Signed-off-by: Kito Cheng <kito.cheng@sifive.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210512101358.122781-1-kito.cheng@sifive.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
  • Loading branch information
kito-cheng authored and vivier committed May 15, 2021
1 parent 74081ae commit 9f771ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion linux-user/strace.c
Expand Up @@ -2341,7 +2341,7 @@ print_linkat(void *cpu_env, const struct syscallname *name,
}
#endif

#ifdef TARGET_NR__llseek
#if defined(TARGET_NR__llseek) || defined(TARGET_NR_llseek)
static void
print__llseek(void *cpu_env, const struct syscallname *name,
abi_long arg0, abi_long arg1, abi_long arg2,
Expand All @@ -2361,6 +2361,7 @@ print__llseek(void *cpu_env, const struct syscallname *name,
qemu_log("%s", whence);
print_syscall_epilogue(name);
}
#define print_llseek print__llseek
#endif

#ifdef TARGET_NR_lseek
Expand Down
3 changes: 3 additions & 0 deletions linux-user/strace.list
Expand Up @@ -511,6 +511,9 @@
#ifdef TARGET_NR__llseek
{ TARGET_NR__llseek, "_llseek" , NULL, print__llseek, NULL },
#endif
#ifdef TARGET_NR_llseek
{ TARGET_NR_llseek, "llseek" , NULL, print_llseek, NULL },
#endif
#ifdef TARGET_NR_lock
{ TARGET_NR_lock, "lock" , NULL, NULL, NULL },
#endif
Expand Down

0 comments on commit 9f771ad

Please sign in to comment.