[Ltrace-devel]
[PATCH] arrays, structs, flexible return value sizes,
alt config files, et al
Steve Fink
sphink at gmail.com
Sun Jul 16 00:56:15 UTC 2006
Long ago, I submitted the initial piece of this patch and got no
reply, so I'm not going to go to the effort of chopping it up into
reasonable-sized pieces unless there's some interest in including it.
This patch contains my accumulated changes. It's a big pile of related
stuff that enables me to get readable output for things like OpenGL
call tracing. I just rediffed it against 0.4, and the pain of that
incented me to try submitting again (looks like the code has all gone
through 'indent -kr'; that, and some space/tab stuff made sure that
the synchronization was painful.)
I'm attaching two patches, largely because of the space/tab
mismatches: one that applies cleanly to the 0.4 sources, and another
whitespace-ignoring version that should be more human-readable.
The changes are:
Command line
- -A option for specifying max number of array elements to print
- -F option for loading in an alternate config file
Configuration
- ltrace will load ~/.ltrace.conf (if present) in addition to /etc/ltrace.conf
Argument handling
- 'short' and 'unsigned short' arguments
- 'float' and 'double' arguments
- pointers to various data types
- struct arguments (usually passed as pointers)
- fixed- and variable-length arrays (usually passed as pointers)
- any argument can be used for the size of a returned string
- rather than string3, you can now use string[3] (or any other
argument index)
- same for array lengths
- arguments can be ignored with the 'ignore' parameter type
- enumerated types (example output: glMatrixMode(GL_MODELVIEW))
- typedefs (necessary for sanity when writing configs using structs and enums)
- all of this is documented in /etc/ltrace.conf
Nuisance
- a number of formatting changes slipped in
when I incorporated version 0.4.
- I'm guessing that the new argument types will cause portability
problems. See align_struct for my simplistic attempt at dealing with
the one issue I thought of. We could always just disable fancy
arguments on all architectures until they pass tests... :-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ltrace-0.4-argtypes.diff
Type: application/octet-stream
Size: 89812 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/ltrace-devel/attachments/20060715/a1bfbfe8/ltrace-0.4-argtypes-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: human-readable-ltrace-0.4-argtypes.diff
Type: application/octet-stream
Size: 57822 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/ltrace-devel/attachments/20060715/a1bfbfe8/human-readable-ltrace-0.4-argtypes-0001.obj
More information about the Ltrace-devel
mailing list