From 41799debdcc19d65fb6e0499cbbb74a489a822ea Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 13 Dec 2017 19:18:07 +0100 Subject: prog: introduce more readable format for data args Fixes #460 File names, crypto algorithm names, etc in programs are completely unreadable: bind$alg(r0, &(0x7f0000408000)={0x26, "6861736800000000000000000000", 0x0, 0x0, "6d6435000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000 00000000000"}, 0x58) Introduce another format for printable strings. New args are denoted by '' ("" for old args). New format is enabled for printable chars, \x00 and \t, \r, \n. Example: `serialize(&(0x7f0000408000)={"6861736800000000000000000000", "4849000000"})`, vs: `serialize(&(0x7f0000408000)={'hash\x00', 'HI\x00'})`, --- sys/test/test.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sys/test/test.txt') diff --git a/sys/test/test.txt b/sys/test/test.txt index 561de0db8..69f987a16 100644 --- a/sys/test/test.txt +++ b/sys/test/test.txt @@ -555,3 +555,14 @@ mutate5(filename ptr[in, filename], flags flags[open_flags]) fd mutate6(fd fd, data ptr[in, array[int8]], size bytesize[data]) open_flags = 0xabababababababab, 0xcdcdcdcdcdcdcdcd + +# Serialization tests. + +serialize(a ptr[in, serialize_struct]) + +serialize_struct { + a string[serialize_strings, 10] + b string[serialize_strings, 5] +} + +serialize_strings = "aaa", "bbb" -- cgit mrf-deployment