[Ltrace-devel] Parameter pack flavors and backend callbacks

Petr Machata pmachata at redhat.com
Thu Sep 13 15:59:47 UTC 2012


Hi there,

some backends (Itanium in particular) change the parameter passing
convention depending on whether given parameter is part of varargs
parameter or not.  Therefore the backend needs to know a) that any give
argument is part of parameter pack, and b) if it is, whether it's a
varargs-type pack, or something else.  So far the fetch interface
assumed that the actual type is all that matters, and is consequently
not prepared to deal with this.

The first part ("a" above) is solved by having two new backend
callbacks, arch_fetch_param_pack_start and arch_fetch_param_pack_end.

But not each pack is a varargs pack.  Currently the only one parameter
pack that we support is printf-style varargs pack, but in general,
parameter packs could be used to change function prototype in cases like
ptrace or ioctl, where not all parameters are always relevant.  Those
are not vararg arguments.

So we introduce parameter pack flavors.  Currently there are two,
PARAM_PACK_ARGS and PARAM_PACK_VARARGS.  There might at some point be
another flavor, PARAM_PACK_VA_LIST, for expanding va_list's in functions
like vprintf.

The code is on pmachata/pack_flavor.  Unless there are objections, I
will merge this soon.

pmachata/ia64 was rebased on top of that, and uses flavors to fix the
remaining two failures in parameters.exp.  I intend to merge this soon
as well.

Thank you,
PM



More information about the Ltrace-devel mailing list