i#565 part 1: win8 version update

Updated all places where we store Windows versions:
+ windows_version_init()
+ tools.c get_windows_version()
+ dr_get_os_version()

Except not updating this until win8 support is all done:
+ -max_supported_os_version option

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1603 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#565 part 2: win8 syscall #s

Added the syscall numbers for win8 x86 and x64, and for the first time made
a separate column for wow64 due to the high-order bits being used instead
of ecx.

Reversed the columns so that new numbers are appened rather than inserted
at the beginning.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1604 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#899: new win8 syscalls

Adds numbers for 3 new win8 syscalls the core may need to intercept.
Adds NYI asserts to catch execution so we can go figure them out.

NtUnmapViewOfSectionEx with new arg==0 is let through as it's the same as
NtUnmapViewOfSection.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1605 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#565 part 3: syscall wrapper updates

There are quite a few wrapper differences which end up tripping DR all over
the place due to its many interactions with such wrappers:

+ syscalls_init() up-front syscall type check
+ intercept_syscall_wrapper()
+ clean_syscall_wrapper()
+ syscall param base for app syscall processing
+ add dynamorio_syscall_wow64_noedx which shifts retaddr
  so params are in right spot for calls from DR
+ wow64 post-syscall esp adjust is on win7 but not win8,
  for skipping syscalls and for invoke-another feature
+ win8 wow64 cleanup_and_terminate can't just use edx so I have it storing
  args on wow64_syscall_stack which I claim is safe
+ set_mcontext_for_syscall needs to pass args to an app syscall.
  I have it writing args to the app stack.  I can't clean them up.
  but it's only used for NtRaiseException, where changes
  to regs or even the stack will be unrolled or else the app will exit.

The checks for these are sometimes version checks for win8, and also:
+ added two routines for more general checks than "is it win8?":
  + syscall_uses_wow64_index()
  + !syscall_uses_edx_param_base()

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1606 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#899: handle new win8 syscall NtWow64AllocateVirtualMemory64 which it
turns out is just like NtAllocateVirtualMemory except it has an extra
unused arg inserted in the middle.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1607 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#910: treat _FPE_MULTIPLE_TRAPS as _FPE_ZERODIVIDE to get win32.fpe test to pass

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1608 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
fixes issue 917
+ define sfPdb ourselves for VS2005

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1609 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Export doxygen-handling scripts for use by other tools:
http://code.google.com/p/drmemory/issues/detail?id=929

+ export CMake_rundoxygen.cmake as cmake/docs_rundoxygen.cmake
+ add new file CMake_doxyutils.cmake exported as
  cmake/docs_doxyutils.cmake which provides functions for:
  + doxygen version check
  + cygpath conversion
  + doxyfile conversion for header and for navbar
+ updated DR to use this script split

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1610 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
fix VS2008 and earlier build breakage: define _FPE_MULTIPLE_TRAPS

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1611 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
fix VPS build breakage

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1612 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
fixes issue 919

Set CMAKE_BUILD_TYPE to ensure the proper exported target files are
generated.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1613 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Fix bug in os_using_app_state() on linux where it returns the opposite of
what it should.
Fixes http://code.google.com/p/drmemory/issues/detail?id=1016

Also added an assert that we're not in app state when we raise the exit
event.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1614 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Clarify docs on dr_get_proc_address() and what we mean by an
"exported" function on Linux.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1615 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
clarify docs on app vs DR state

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1616 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
fixes issue 920

1) Fix bug in vfork: need to restore segment in parent, not child.
2) Do not call dynamo_thread_not_under_dynamo() for another thread
   as neither segment nor itimer syscalls can work that way.
   Windows no-asynch was already ignoring the dcontext arg.
3) Added asserts to enforce the executing-thread-only requirement.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1617 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Make suite/tests/tools.c into a library to avoid extra compiles

This has a minor impact on build time, but it reduces the number of
compiler invocations by a lot.

Metrics using the ninja generator for a clean build of DR with tests on
Windows:
            time        num commands
------------------------------------
Before:     62.62s      925
After:      56.93s      746

I moved the print() implementation into tools.c to avoid errors
and warnings about fflush and vfprintf.

Review URL: https://codereview.appspot.com/6533051

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1618 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#47: Manage LDT entries on ia32 during early injection

During early injection, the app doesn't have any segments set up.  We
request two segments, one for DR, and another for our private libraries
(LIB_SEG_TLS).  When the app (usually via ld.so) makes its initial call
to set_thread_area, we return the selector that we got for our private
libraries.

Previously we'd assert if the app didn't have TLS.

Fixes an issue with segment updates (i#107) where the basic block
was terminated after a segment update instead of before it.

Review URL: https://codereview.appspot.com/6490071

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1619 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Merge branch 'master' into drdeploy-port-4-drrun