strace: Fix and enable tracing of msghdr structures.
Useful for sendmsg/recvmsg. However at present it only works for recvmsg, as sendmsg's parameter is const, and this is not automatically matched.
This commit is contained in:
@@ -562,19 +562,6 @@ format_pointer(Context &context, socket_args *args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static string
|
|
||||||
get_iovec(Context &context, iovec *iov, int iovlen)
|
|
||||||
{
|
|
||||||
if (iov == NULL && iovlen == 0)
|
|
||||||
return "(empty)";
|
|
||||||
|
|
||||||
string r = "{";
|
|
||||||
r += context.FormatPointer(iov);
|
|
||||||
r += ", " + context.FormatSigned(iovlen);
|
|
||||||
return r + "}";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static string
|
static string
|
||||||
format_pointer(Context &context, message_args *msg)
|
format_pointer(Context &context, message_args *msg)
|
||||||
{
|
{
|
||||||
@@ -587,6 +574,20 @@ format_pointer(Context &context, message_args *msg)
|
|||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
static string
|
||||||
|
get_iovec(Context &context, iovec *iov, int iovlen)
|
||||||
|
{
|
||||||
|
if (iov == NULL && iovlen == 0)
|
||||||
|
return "(empty)";
|
||||||
|
|
||||||
|
string r = "{";
|
||||||
|
r += context.FormatPointer(iov);
|
||||||
|
r += ", " + context.FormatSigned(iovlen);
|
||||||
|
return r + "}";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static string
|
static string
|
||||||
@@ -605,7 +606,7 @@ format_pointer(Context &context, msghdr *h)
|
|||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static string
|
static string
|
||||||
format_pointer(Context &context, ifreq *ifr)
|
format_pointer(Context &context, ifreq *ifr)
|
||||||
@@ -710,9 +711,9 @@ POINTER_TYPE(ifconf_ptr, ifconf);
|
|||||||
POINTER_TYPE(ifreq_ptr, ifreq);
|
POINTER_TYPE(ifreq_ptr, ifreq);
|
||||||
DEFINE_TYPE(pollfd_ptr, pollfd *);
|
DEFINE_TYPE(pollfd_ptr, pollfd *);
|
||||||
POINTER_TYPE(siginfo_t_ptr, siginfo_t);
|
POINTER_TYPE(siginfo_t_ptr, siginfo_t);
|
||||||
|
POINTER_TYPE(msghdr_ptr, msghdr);
|
||||||
#if 0
|
#if 0
|
||||||
POINTER_TYPE(message_args_ptr, message_args);
|
POINTER_TYPE(message_args_ptr, message_args);
|
||||||
POINTER_TYPE(msghdr_ptr, msghdr);
|
|
||||||
POINTER_TYPE(sockaddr_args_ptr, sockaddr_args);
|
POINTER_TYPE(sockaddr_args_ptr, sockaddr_args);
|
||||||
POINTER_TYPE(sockopt_args_ptr, sockopt_args);
|
POINTER_TYPE(sockopt_args_ptr, sockopt_args);
|
||||||
POINTER_TYPE(socket_args_ptr, socket_args);
|
POINTER_TYPE(socket_args_ptr, socket_args);
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ struct fd_set;
|
|||||||
struct flock;
|
struct flock;
|
||||||
struct ifconf;
|
struct ifconf;
|
||||||
struct ifreq;
|
struct ifreq;
|
||||||
|
struct msghdr;
|
||||||
struct message_args;
|
struct message_args;
|
||||||
struct pollfd;
|
struct pollfd;
|
||||||
struct sockaddr_args;
|
struct sockaddr_args;
|
||||||
@@ -111,6 +112,7 @@ DEFINE_FACTORY(fdset_ptr, fd_set *);
|
|||||||
DEFINE_FACTORY(flock_ptr, flock *);
|
DEFINE_FACTORY(flock_ptr, flock *);
|
||||||
DEFINE_FACTORY(ifconf_ptr, ifconf *);
|
DEFINE_FACTORY(ifconf_ptr, ifconf *);
|
||||||
DEFINE_FACTORY(ifreq_ptr, ifreq *);
|
DEFINE_FACTORY(ifreq_ptr, ifreq *);
|
||||||
|
DEFINE_FACTORY(msghdr_ptr, msghdr *);
|
||||||
DEFINE_FACTORY(message_args_ptr, message_args *);
|
DEFINE_FACTORY(message_args_ptr, message_args *);
|
||||||
DEFINE_FACTORY(pollfd_ptr, pollfd *);
|
DEFINE_FACTORY(pollfd_ptr, pollfd *);
|
||||||
DEFINE_FACTORY(siginfo_t_ptr, siginfo_t *);
|
DEFINE_FACTORY(siginfo_t_ptr, siginfo_t *);
|
||||||
|
|||||||
Reference in New Issue
Block a user