aboutsummaryrefslogtreecommitdiffstats
path: root/docs/syscall_descriptions_syntax.md
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-02-10 14:45:20 +0100
committerDmitry Vyukov <dvyukov@google.com>2020-02-10 14:45:20 +0100
commit18847f55bb3fe9db41e46a2e9e49a9f7c28143af (patch)
treee181c33c75f5851a5042290ff59dd44cce353c66 /docs/syscall_descriptions_syntax.md
parentd0da558cb16f3fb7cf26f20d24ee89eeb49a6f30 (diff)
pkg/ast: introduce hex-encoded string literals
The stringnozescapes does not make sense with filename, also we may need similar escaping for string flags. Handle escaped strings on ast level instead. This avoids introducing new type and works seamleassly with flags. As alternative I've also tried using strconv.Quote/Unquote but it leads to ugly half-escaped strings: "\xb0\x80s\xe8\xd4N\x91\xe3ڒ,\"C\x82D\xbb\x88\\i\xe2i\xc8\xe9\xd85\xb1\x14):M\xdcn" Make hex-encoded strings a separate string format instead.
Diffstat (limited to 'docs/syscall_descriptions_syntax.md')
-rw-r--r--docs/syscall_descriptions_syntax.md6
1 files changed, 2 insertions, 4 deletions
diff --git a/docs/syscall_descriptions_syntax.md b/docs/syscall_descriptions_syntax.md
index 43374d4dd..7ae2a14ef 100644
--- a/docs/syscall_descriptions_syntax.md
+++ b/docs/syscall_descriptions_syntax.md
@@ -35,14 +35,12 @@ rest of the type-options are type-specific:
direction (in/out/inout); type of the object
ptr64 has size of 8 bytes regardless of target pointer size
"string": a zero-terminated memory buffer (no pointer indirection implied), type-options:
- either a string value in quotes for constant strings (e.g. "foo"),
+ either a string value in quotes for constant strings (e.g. "foo" or `deadbeef` for hex literal),
or a reference to string flags (special value `filename` produces file names),
optionally followed by a buffer size (string values will be padded with \x00 to that size)
"stringnoz": a non-zero-terminated memory buffer (no pointer indirection implied), type-options:
- either a string value in quotes for constant strings (e.g. "foo"),
+ either a string value in quotes for constant strings (e.g. "foo" or `deadbeef` for hex literal),
or a reference to string flags,
-"stringnozescapes": same as "stringnoz", except escape sequences are respected, in order to have
- binary strings such as "\x12\x34\x56".
"fmt": a string representation of an integer (not zero-terminated), type-options:
format (one of "dec", "hex", "oct") and the value (a resource, int, flags, const or proc)
the resulting data is always fixed-size (formatted as "%020llu", "0x%016llx" or "%023llo", respectively)