On Thu, Jul 06, 2017 at 09:57:31AM +0800, JingPiao Chen wrote:
> commit v4.17-161-gdbd0605 adjust TEST_NLATTR_OBJECT and
> TEST_NLATTR_ARRAY for large objects, only change the pattern
> print length, still pass a big length for nla_data_len, do not
> change strace output, still output '"STR"...'.
> 
> * tests/test_nlattr.h (TEST_NLATTR_OBJECT, TEST_NLATTR_ARRAY):
> In case of len < sizeof(object), pass plen as nla_data_len and slen.
> ---
>  tests/test_nlattr.h | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/test_nlattr.h b/tests/test_nlattr.h
> index 9c15c33..4a2af02 100644
> --- a/tests/test_nlattr.h
> +++ b/tests/test_nlattr.h
> @@ -108,8 +108,7 @@ print_nlattr(const unsigned int nla_len, const char 
> *const nla_type)
>               TEST_NLATTR_((fd_), (nlh0_), (hdrlen_),                 \
>                       (init_msg_), (print_msg_),                      \
>                       (nla_type_), #nla_type_,                        \
> -                     sizeof(obj_) - 1,                               \
> -                     (pattern_), sizeof(obj_) - 1,                   \
> +                     plen, (pattern_), plen,                         \
>                       print_quoted_hex((pattern_), plen));            \
>               /* short read of sizeof(obj_) */                        \
>               TEST_NLATTR_((fd_), (nlh0_), (hdrlen_),                 \
> @@ -139,8 +138,7 @@ print_nlattr(const unsigned int nla_len, const char 
> *const nla_type)
>               TEST_NLATTR_((fd_), (nlh0_), (hdrlen_),                 \
>                       (init_msg_), (print_msg_),                      \
>                       (nla_type_), #nla_type_,                        \
> -                     sizeof((obj_)[0]) - 1,                          \
> -                     (pattern_), sizeof((obj_)[0]) - 1,              \
> +                     plen, (pattern_), plen,                         \
>                       print_quoted_hex((pattern_), plen));            \
>               /* sizeof((obj_)[0]) < len < sizeof(obj_) */            \
>               TEST_NLATTR_((fd_), (nlh0_), (hdrlen_),                 \

I don't see why this change is needed.  I thought it's fine to pass an
object larger than plen as long as it's smaller than expected by strace.


-- 
ldv

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to