Consolidate find_dynamo_library() into tools.c for Linux tests

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1761 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#1008: Remove aggressive restorer_valid[i] == -1 assert

If we've ever received a signal without an SA_RESTORER flag and with a
non-NULL sa_restorer value, then this assert will trigger when creating
a child thread.  Removing it doesn't appear to break any invariants.

I re-ordered the memset with the installation of our signal info field
to avoid a possible race on fully_initialized, which was for i#26.

Fixes issue 1008.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1762 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Handle erroneous double calls to exit.
Use unique names for easier debugging when combining static ext libs.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1763 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
fixed issue 1011
- split NT_SYSCALL to NT_RAW_SYSCALL to avoid static link
- put most nt_raw_syscall into DynamoRIO CORE

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1764 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Fix missing support for VS generator in .drpath files

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1765 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Add a -hashtable_study option to allow disabling hashtable studies

Large apps tend to trigger hashtable curiosities and generate large
blocks of hashtable entry logging that obscure interesting assertions
and logs.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1766 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#1012: Don't uninstall DR's signal handlers while cleaning up other threads

Fixes issue 1012.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1767 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#128: Use si_addr if it's a plausible faulting address

If si_addr is NULL or not equal to any of the memory operand addresses,
we fall back to the protection check.

Also adds a call to get protection info for the faulting PC.  The
existing code was using the protections for the last memory operand
address, or an uninitialized value if there were no memory operands.

Fixes issue 128.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1768 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Fixed issue 996
- add private_peb_initialized
- move dynamo_thread_exit_pre_client early to call callbacks before
  dynamo_thread_not_under_dynamo, which swaps tls to app,
  and set_thread_private_dcontext
- only swap TLS for clone syscall creating thread
- add peb swap in around thread init event callbacks

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

Adds ordering of signal and exception events to drmgr via
drmgr_register_{signal,exception}_event_ex(), with
drmgr_register_{signal,exception}_event() using a default 0 priority.

Also fixed "drmmgr" typo.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1770 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#1019 part 2:

Adds ordering of restore state events to drmgr via
drmgr_register_restore_state_ex_event_ex(), with
drmgr_register_restore_state{,_ex}_event() using a default 0 priority.

Used lazy registration to keep dr_xl8_hook_exists() useful.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1771 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Add dr_raw_mem_alloc, dr_raw_mem_free
- add dr_raw_mem_alloc, dr_raw_mem_free
- add raw_alloc_test in alloc test

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1772 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
fixed typo

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1773 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#975: Initial support for STATIC_LIBRARY

Adds the STATIC_LIBRARY cmake option and configure macro.  Linux support
is mostly functional.  Everything builds on Windows, but most tests
fail.

On Linux, we takeover from a static initializer in os.c if
DYNAMORIO_TAKEOVER_IN_INIT=1 is in the environment.  Clients are
supported by passing the exe path as the client library path.
load_shared_library() checks if it's trying to load the exe, and calls
dlopen(NULL) to get the right handle if so.  The private loader lookup
routines fall back to dlsym() and friends, so everything just works.

For Windows, takeover from a static library is not yet implemented.
We can use a C++-style static initializer in .CRT$XCU, which is similar
to the Linux takeover approach.

I added two nightly debug build types to test this configuration.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1774 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Add missing client.modules.appdll test file from r1774

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1775 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Fix the exclusion of tools that we don't want to install

This removes run_in_bg and the drrun_exe.debug files from the installed
package.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1776 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#1022: Fix standalone apps on Linux to initialize our_environ

For now, we're using _init() for non-STATIC_LIBRARY builds and
__attribute__((constructor)) for STATIC_LIBRARY builds.

Tested with gcc 4.4.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1777 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Update docs on -stderr_mask to state that DR output does not show up in cmd

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1778 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Fix should_swap_peb_pointer() usage outside CI ifdefs

Introduced in the STATIC_LIBRARY commit.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1779 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Fix usage message for drrun

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