DynamoRIO / DynamoRIO/drmemory
drstrace: add named enum and bitfield constants and field info for all structs
- Dominant language
- C
- Stars
- 2.7k
- Forks
- 290
- PR merge metrics
- No merged PRs in 30d
Description
_From [bruen...@google.com](https://code.google.com/u/109494838902877177630/) on May 06, 2014 11:44:16_
It turns out I had a bunch of old notes on this so I'm putting them into an issue:
For adding named enum and bitfield constants to drstrace, which is better:
A) drstrace client has to hardcode which of multiple int params are enums or
sizes or bitmasks.
So drsyscall says: type int
And drstrace says: name matches "NtQueryInformationFile", could be either
size or class: hardcode that final param is class.
so it's an enum, value is 5, print "FileStandardInformation".
or:
B) We add types "enum" and "bitmask" and "size" to drsyscall.
So drsyscall says: type enum
And drstrace says: name matches "NtQueryInformationFile", must be info class
enum, value is 5, print "FileStandardInformation"
For NtCreateFile, client still has to hardcode distinctions between the
many sets of flags:
IN ACCESS_MASK DesiredAccess,
IN ULONG FileAttributes,
IN ULONG ShareAccess,
IN ULONG CreateDisposition,
IN ULONG CreateOptions,
But for most syscalls, there's maybe an ACCESS_MASK, an enum, and a size,
so these types might be enough.
or
C) We add every single type to drsyscall.
So drsyscall says: type FILE_INFORMATION_CLASS
And drstrace says: value is 5, print "FileStandardInformation".
This doesn't solve NtCreateFile multiple ULONG params of course but not
much would solve that one so perhaps it's a poor example.
Client still needs a list of enum names, but looks them up based on type
rather than syscall name.
or
D) We give type name, and client uses drsyms type iterator to break it down.
drsyscall needs to give out string names (so does need to enum on info
class to get struct name). When install drstrace it can download MS
pdbs for ensured drsyms querying.
D looks the most promising.
_Original issue: http://code.google.com/p/drmemory/issues/detail?id=1540_
Contributor guide
Assessment
This issue has not been assessed yet.