diff options
author | Steve Fink <sphink@gmail.com> | 2006-08-07 06:10:08 +0200 |
---|---|---|
committer | Ian Wienand <ianw@debian.org> | 2006-08-07 06:10:08 +0200 |
commit | e4b3263fb2b32eb5ee0f693fc223ed8c363fbd69 (patch) | |
tree | cc708044654624fd22fdfe7d0b9b09f1bef0c9e7 /etc | |
parent | 1150bc4b812f0150e832607b8724b023d6d7d575 (diff) | |
download | ltrace-e4b3263fb2b32eb5ee0f693fc223ed8c363fbd69.tar.gz |
Add pointers to structs
* Allow parameters to be pointers to structs, which themselves
can contain (nearly) any other type, including other structs
or pointers to structs.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/ltrace.conf | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/etc/ltrace.conf b/etc/ltrace.conf index fa901fc..1fe808e 100644 --- a/etc/ltrace.conf +++ b/etc/ltrace.conf @@ -21,6 +21,7 @@ ; format == ((const char *), ...) [printf() like] [TODO] ; string == (char *) ; string[argN] == (char *) [N>0] [show only up to (arg N) bytes] +; string[eltN] == (char *) [N>0] [show only up to (elt N) bytes] ; string[retval] == (char *) [show only up to (return val) bytes] ; string[arg0] == (char *) [same as string[retval]] ; string[N] == (char *) [N>0] [show only up to N bytes] @@ -29,12 +30,18 @@ ; enum (key=value,key=value,...) [enumeration, see below] ; array(type,argN) ; == (type[SIZE]) [array of (arg N) elements] +; array(type,eltN) +; == (type[SIZE]) [array of (struct element N) elements] ; array(type,N) == (type[N]) [array of N elements] - +; struct(type,type,...) +; == (struct {...}) [struct of several types] +; ; Backwards-compatibility: ; string0 == (char *) [same as string[retval]] ; stringN == (char *) [N>0] [same as string[argN]] + + ; Typedefs ; ; To make it easier to specify argument lists, you can use 'typedef' @@ -56,6 +63,37 @@ ; NOTE: Uses of array(...) alone are very rare. You almost always ; want array(...)*. The exceptions are when you have a fixed-size ; array. +; +; Structs +; +; NOTE: Uses of struct(...) alone are very rare. You almost always +; want struct(...)* (a pointer to a struct) anyway. Most compilers +; pass structs as pointers anyway, and those that don't are not yet +; supported. The one time when you want to use a non-pointer +; struct(...) type are when you have an array of structs, or a struct +; containing another struct. +; +; For example, if you have +; struct s1 { +; int y_size; +; int * y; +; int z[3]; +; struct { char c; } a; +; struct { char c; } * b; +; } +; and a function +; void f(struct s1*) +; then the corresponding ltrace spec is +; void f(struct(int,array(int,elt0),array(int,3),struct(char),struct(char)*)*) +; which, formatted similarly to the C declaration, looks like +; void f(struct( +; int, +; array(int,elt0), +; array(int,3), +; struct(char), +; struct(char)* +; )* +; ) ; arpa/inet.h |