i#47: Install private library TLS segment even if the app has none

This allows clients that rely on the private loader to work with early
injection.  Currently stl_test crashes, and this fixes it.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1556 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Fix the base+disp overflow bug in addr32 optimization.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1557 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Relax NT path curiosities when used as a library

This allows the DrMemory frontend to blindly call dr_directory_exists()
on strings that are not paths without having to write any path parsing
logic.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1558 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#47: Use PR_SET_NAME to make killall work for apps under DR

Interestingly, this has very little effect on ps.  The strings it
displays are usually from /proc/pid/cmdline.  Only 'ps -C <name>' uses
prctl PR_GET_NAME.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1559 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Teach opnd_get_size about PC operands

Fixes issue 882.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1560 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
add -logdir runtime option which takes precedence over the config var
+ add option itself
+ document it for users and in release notes
+ add note about i#886 for adding default logdir control to deployment API

this is partly driven by Dr. Memory
(http://code.google.com/p/drmemory/issues/detail?id=874)
but is also a useful missing option in general

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1561 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
fixed issue #871: DR slow on SPEC2006 with thread private code cache
- set thread private code cache infinite by default

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1562 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Added drsym_module_has_symbols() which on Windows uses SymGetSymbolFile(),
which is faster than drsym_get_module_debug_kind()'s SymGetModuleInfo64().
Unfortunately we have to map the file ourselves to see whether PECOFF
first but it's still a win.

Xref http://code.google.com/p/drmemory/issues/detail?id=973

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1563 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Clarify docs on meta instructions

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1564 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
+ Add drmgr_get_parent_cls_field
+ Document priority of drmgr CLS tracking pass

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1565 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Fixes http://code.google.com/p/drmemory/issues/detail?id=999

Bump the checklevel by one for private library heap allocations and fill
checks on free.  We still have to memset on free (b/c re-used by
non-priv-lib allocs) but that cost seems to be small.

cs2bugMDd w/o symcache goes from 83s down to 9s after this change.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1566 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Fix registering after the non-existent CLS pass on Linux

DRMGR_PRIORITY_NAME_CLS is now NULL on Linux, so users can use it in
their priority structs.

When registration fails, we free the new callback entry instead of
trying to free the pointer we used for iterating the list, which is
usually NULL.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1567 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Fix drmgr build, don't use IF_WINDOWS_ELSE

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1568 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Use drrun in the test suite inside runstats

This adds two execve calls to each test, but it will allow us to test
early injection.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1569 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#47: Add tests for Linux early injection on x64

Adds a run of client.events with early injection to the precommit suite
and adds a new test mode to the nightly runs.

Early injection doesn't work on ia32 yet.

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

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

Set dr_api_exit in dr_exit_process for Linux too to avoid leak report

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

+ use a recursive lock for drsyms linux to allow queries from
  a symbol iteration callback
+ avoid freeing resources in such a recursive call via a
  state var, for both linux and windows

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1572 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#46: Emulate uint64 division and modulo on ia32

gcc emits calls to support routines in libgcc.  This works OK when
libgcc is present, but it fails during early injection.  Implementing
the relevant routines removes the imports and lets ia32 early injection
get further.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1573 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Store gdb private loader cmds for access in release build through something
like:

  x/3s gdb_priv_cmds

While we have this global buffer, replaced the current sort of messy way of
keeping text_addr around with a direct append to the buffer in
privload_map_and_relocate().

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1574 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
fixed i#889-c#1: clean call analysis bug
- bailout on indirect call in check_callee_instr

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