Move printargs* functions to util.c

* syscall.c (printargs, printargs_u, printargs_d): Move ...
* util.c: ... here.
This commit is contained in:
Elvira Khabirova 2016-06-12 16:39:02 +03:00 committed by Dmitry V. Levin
parent be06426625
commit 3c1105d49c
2 changed files with 34 additions and 34 deletions

View File

@ -630,40 +630,6 @@ decode_mips_subcall(struct tcb *tcp)
}
#endif
int
printargs(struct tcb *tcp)
{
if (entering(tcp)) {
int i;
int n = tcp->s_ent->nargs;
for (i = 0; i < n; i++)
tprintf("%s%#lx", i ? ", " : "", tcp->u_arg[i]);
}
return 0;
}
int
printargs_u(struct tcb *tcp)
{
const int n = tcp->s_ent->nargs;
int i;
for (i = 0; i < n; ++i)
tprintf("%s%u", i ? ", " : "",
(unsigned int) tcp->u_arg[i]);
return RVAL_DECODED;
}
int
printargs_d(struct tcb *tcp)
{
const int n = tcp->s_ent->nargs;
int i;
for (i = 0; i < n; ++i)
tprintf("%s%d", i ? ", " : "",
(int) tcp->u_arg[i]);
return RVAL_DECODED;
}
static void
dumpio(struct tcb *tcp)
{

34
util.c
View File

@ -1400,3 +1400,37 @@ print_array(struct tcb *tcp,
return cur >= end_addr;
}
int
printargs(struct tcb *tcp)
{
if (entering(tcp)) {
int i;
int n = tcp->s_ent->nargs;
for (i = 0; i < n; i++)
tprintf("%s%#lx", i ? ", " : "", tcp->u_arg[i]);
}
return 0;
}
int
printargs_u(struct tcb *tcp)
{
const int n = tcp->s_ent->nargs;
int i;
for (i = 0; i < n; ++i)
tprintf("%s%u", i ? ", " : "",
(unsigned int) tcp->u_arg[i]);
return RVAL_DECODED;
}
int
printargs_d(struct tcb *tcp)
{
const int n = tcp->s_ent->nargs;
int i;
for (i = 0; i < n; ++i)
tprintf("%s%d", i ? ", " : "",
(int) tcp->u_arg[i]);
return RVAL_DECODED;
}