issue 822: Dr. Syscall DR Extension, part 0: disable

Temporarily disable drsyscall build for incremental commits

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1118 5b54908e-ead4-fc18-b48a-0285e6dbc711
issue 822: Dr. Syscall DR Extension, part 1: API

The header files defining the API and the documentation

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1119 5b54908e-ead4-fc18-b48a-0285e6dbc711
issue 822: Dr. Syscall DR Extension, part 7: wingdi

Changes to drsyscall/drsyscall_wingdi.c for operation within the
iterator-based framework:

+ Changed sysarg handlers to take in sysarg_iter_info_t* for easier
  state passing, as the iteration is stateful.
+ Changed check_sysmem() calls to report_memarg*(), which can abort
  the iteration and so return values must be checked and the
  handler exited if necessary.
+ Added types, when known, to report_memarg*() calls.
+ Moved definedness-checking-specific code out of the framework.
+ Moved control monitoring and other non-shadow code out of the framework.
+ Removed bool return value from pre-syscall handling as it is not used.
+ Updated the list of stored system call numbers to include only
  those used in the framework and not those used for gdicheck and
  handle leak checking.
+ Shifted system call name and number tables to process init rather
  than module load time, so the client can iterate in dr_init().
+ Added success codes for initialization.

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1120 5b54908e-ead4-fc18-b48a-0285e6dbc711
issue 822: Dr. Syscall DR Extension, part 8: windows

Changes to drsyscall/drsyscall_windows.* for operation within the
iterator-based framework:

+ Changed sysarg handlers to take in sysarg_iter_info_t* for easier
  state passing, as the iteration is stateful.
+ Changed check_sysmem() calls to report_memarg*(), which can abort
  the iteration and so return values must be checked and the
  handler exited if necessary.
+ Added types, when known, to report_memarg*() calls.
+ Moved definedness-checking-specific code out of the framework.
+ Moved control monitoring and other non-shadow code out of the framework.
+ Removed bool return value from pre-syscall handling as it is not used.
+ Updated the list of stored system call numbers to include only
  those used in the framework and not those used for gdicheck and
  handle leak checking.
+ Shifted system call name and number tables to process init rather
  than module load time, so the client can iterate in dr_init().
+ Added success codes for initialization.
+ Added drsys_handle_is_current_process() as easiest way to share
  is_current_process().
  This required shifting the NtQueryInformationProcess call into here.
+ Had to move check_out_buf() out of drsyscall ioctl checking b/c it
  relied on malloc lookup.
+ Added own windows version struct and replaced running_on_* calls.
+ Added caching of xdx for sysparam addr access in post-syscall.

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1121 5b54908e-ead4-fc18-b48a-0285e6dbc711
issue 822: Dr. Syscall DR Extension, part 9: linux

Changes to drsyscall/drsyscall_linux.c for operation within the
iterator-based framework

+ Changed sysarg handlers to take in sysarg_iter_info_t* for easier
  state passing, as the iteration is stateful.
+ Changed check_sysmem() calls to report_memarg*(), which can abort
  the iteration and so return values must be checked and the
  handler exited if necessary.
+ Added types, when known, to report_memarg*() calls.
+ Moved definedness-checking-specific code out of the framework.
+ Moved control monitoring and other non-shadow code out of the framework.
+ Removed bool return value from pre-syscall handling as it is not used.
+ Updated the list of stored system call numbers to include only
  those used in the framework and not those used for gdicheck and
  handle leak checking.
+ Shifted system call name and number tables to process init rather
  than module load time, so the client can iterate in dr_init().
+ Added a name to number table, which did not exist before for Linux.

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1122 5b54908e-ead4-fc18-b48a-0285e6dbc711
issue 822: Dr. Syscall DR Extension, part 10: top-level

Changes to drsyscall/drsyscall* cross-platform top-level code for operation
within the iterator-based framework and to implement the new queries in the
API:

+ Build with platform-specific files.
+ Shift SYSCALL_DRIVER option to drsys.
+ Link with ntdll, as I needed to shift the call to
  NtQueryInformationProcess into drsys for
  drsys_handle_is_current_process().
+ Added heap stat routine stubs to drmf_utils.c so drsyscall can be tracked
  by regular heap stats.
+ Added safe_read impl in drmf_utils.c.
+ Add parameter type names.
+ Implemented the various query routines for the API.
+ Updated unknown syscall handling to use passed-in functions for
  querying definedness and addressability.
+ Moved auxiliary library and other non-shadow code out of the framework.
+ Updated cstring handling to take in sysarg_iter_info_t* and to
  call report_memarg*().
+ Implemented the dynamic iterators.  They are stateful, relying on cached
  values in the pre-syscall event.  They use a sysarg_iter_info_t struct
  to pass information around.
+ Implemented syscall filters.
+ Added bb events to implement syscall gateway checking.
+ Added last-chance handling for the syscall driver to clean up
  after all iterations.  Changed the driver interface to work with
  this model.  However, I may not have resources to test this fully.
+ Updated the SYSARG_COMPLEX_TYPE types to use the same values
  as the expoted DRSYS_TYPE_ types, in most cases, for ease
  of providing types.
+ Ended up duplicating strcasestr in drmf_utils.c.

Not yet done: the static iterators.

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1123 5b54908e-ead4-fc18-b48a-0285e6dbc711
issue 822: Dr. Syscall DR Extension, part 11: table search-replace

Changes to the system call tables: replacing "0" with "{0,0}" as system
call numbers are now a struct rather than an int

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1124 5b54908e-ead4-fc18-b48a-0285e6dbc711
issue 822: Dr. Syscall DR Extension, part 12: post-table-munge changes

Fixed errors in the tables after the search-replace changes of part 11,
requiring these to be separated out from the earlier changes:

+ Fix this bug in the windows table: "NtCreateTok|SYSINFO_CREATE_HANDLEen", OK,
+ Eliminated duplicate entries in the windows table found by new assert.

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1125 5b54908e-ead4-fc18-b48a-0285e6dbc711
update to DR r1765 for VS .drpath support



git-svn-id: https://drmemory.googlecode.com/svn/trunk@1126 5b54908e-ead4-fc18-b48a-0285e6dbc711
fixes issue 1061

Use the two new controls over DR exports, along with requiring cmake 2.8.10
for multiset exported targets, to export a drsyscall that imports from DR's
exported targets without also exporting them as part of its package.

This allows enabling the drmf test.
It also allows re-enabling the drsyscall build.

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1127 5b54908e-ead4-fc18-b48a-0285e6dbc711
Add x64 syscall parameter info to Dr. Syscall

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1128 5b54908e-ead4-fc18-b48a-0285e6dbc711
issue 822: Dr. Syscall DR Extension, part 13: API test

Added a test of the full drsys API.

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1129 5b54908e-ead4-fc18-b48a-0285e6dbc711
issue 822: Dr. Syscall DR Extension, part 14: static iterator

Added the static iterator:

+ Iteration is in hash order: not worth trying to keep numeric order.
+ Changed interface to pass an opaque pointer for arg type iteration.
+ Switch to external recursive lock for the hashtable so queries
  can be done during iteration.
+ Iterator found extra entry in linux table due to missing sign extension.
+ Added a simple test to drsyscall_client.c.

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1130 5b54908e-ead4-fc18-b48a-0285e6dbc711
issue 822: Dr. Syscall DR Extension, part 15: return types
fixes issue 1090

Adds return value types to the syscall tables:

+ Added a syscall return type to syscall_info_t
+ Filled in the long and STATUS values in the linux and ntoskrnl tables
+ Filled in the varying values in the win32k.sys tables
+ Added SYSINFO_RET_MINUS1_FAIL
+ Added drsys_syscall_return_type() and drsys_cur_syscall_return_type()
+ Updated the drsyscall test for return type in iteration and to
  call the individual queries
+ Fixed incorrect NtGdiDdReleaseDC param marked as W instead of R
+ Added NtGdi custom success criteria for two syscalls
+ Added treatment of bool, handle, and pointer return values as implied
  SYSINFO_RET_ZERO_FAIL
+ Removed SYSINFO_RET_ZERO_FAIL for syscalls that return handles as that's
  now handled automatically
+ Added several new types for return types:
  DRSYS_TYPE_{VOID,UNSIGNED_INT,NTSTATUS,ATOM,POINTER}
+ Added several SYSARG_TYPE_ types to store both type and size
  in a single field for return values

Not yet done and spun off as separate issues:
+ i#1093: figure out the failure codes for all the int and uint return
  values for win32k.sys syscalls
+ i#1094: figure out actual return types for the NtUserCall* secondary
  syscalls

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1131 5b54908e-ead4-fc18-b48a-0285e6dbc711
issue 822: Dr. Syscall DR Extension, part 16: inlined types

+ Removed SYSARG_IS_HANDLE and SYSARG_INLINED_BOOLEAN
+ Added SYSARG_INLINED, which stores the type in the misc field
+ Marked boolean and the existing handle types as SYSARG_INLINED
+ Leaving all the other inlined args for i#1089
+ Removed SYSINFO_DELETE_HANDLE and SYSINFO_CREATE_HANDLE.
  This includes from NtUserCreateInputContext and
  NtUserCreateLocalMemHandle which I believe were incorrectly marked
  as SYSINFO_CREATE_HANDLE.

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1132 5b54908e-ead4-fc18-b48a-0285e6dbc711
Update ntuser.h from latest reactos.
Also updated a half-dozen syscalls with updated return value and argument
information.  Did not update some that I'm not 100% sure of.
This resolves one part of i#487.

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1133 5b54908e-ead4-fc18-b48a-0285e6dbc711
issue 822: Dr. Syscall DR Extension, part 17: handle leak client

+ Implemented handle leak checking using drsys
+ Added drsys_cur_syscall_type() to drsys
+ For non-special memarg, report stored as full type not containing
+ Updated nudge test output for new return types from i#822 part 15
+ Walk memargs for handle leak even if no shadowing

Re-enabled use of drsyscall library in drmem now that
all of the Dr. Memory uses are fully supported.
This commit removes drmemory/syscall* all of the
code that is now in drsyscall.
It also updates drmemory/, common/, and drheapstat/ to use the drsys_*
interfaces.
It includes these diffs sent for review:

issue 822: Dr. Syscall DR Extension, part 2: client wingdi
issue 822: Dr. Syscall DR Extension, part 3: client windows
issue 822: Dr. Syscall DR Extension, part 4: client linux
issue 822: Dr. Syscall DR Extension, part 5: client cross-platform
issue 822: Dr. Syscall DR Extension, part 6: client non-syscall

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1134 5b54908e-ead4-fc18-b48a-0285e6dbc711
i#1095: add blank entries for all the known syscall names with unknown
details.
This is required for switching i#822 to use a syscall table entry handle
instead of queries all taking a number.

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1135 5b54908e-ead4-fc18-b48a-0285e6dbc711
issue 822: Dr. Syscall DR Extension, part 18: opaque pointer

Change Dr. Syscall API to use an opaque pointer drsys_syscall_t type for
all queries.  This allows unifying the static and dynamic queries.
It does take an extra step for a few formerly single-call lookups.

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1136 5b54908e-ead4-fc18-b48a-0285e6dbc711
i#1089 syscall arg info, part 1: multi-line table entries

Split table entries onto multiple lines for better readability and diffs
once we add an entry per (non-memory) parameter.

No changes other than whitespace.

git-svn-id: https://drmemory.googlecode.com/svn/trunk@1137 5b54908e-ead4-fc18-b48a-0285e6dbc711