i#823: handle x86 <-> x64 mode changes, part 1
+ add LINK_FAR by squishing LINK_IND_JMP_PLT
  into existing flags
+ not just set for x64 b/c we'll want it for
  general i#823 in the future

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1430 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#49: mixed-mode, part N:
+ fix encoding issues for far instr operands
  (beyond issue 819)

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1431 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#823: handle x86 <-> x64 mode changes, part 2:
+ only handling wow64 for now
+ add far_ibl and far_ibl_unlinked pre-ibl
  generated code sequences which check for
  cs changes on far ctis and on matching
  cs perform a mode change and then jmp to
  the appropriate ibl
+ selector is stored into bx after spilling xbx
  in fragment; xbx is restored in far_ibl.
  xbx chosen to not conflict with rip-rel
  mangling which uses xax.
+ use instrlist_meta_append() to avoid caching
  the length of far jmp in 1st of 2 encode passes
+ only mangling far indirect jmps in this diff
+ always generate and go through far_ibl even in
  x86 build or non-mixed-mode, for code simplicity
  and since we'll want that for future i#823 work

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1432 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#49: mixed-mode, part N + 1:
+ transform all mangling-inserted code to 32-bit
  for x86 mode (that wasn't already transformed
  in parts 1..N-1 years ago)

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1433 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#49: mixed-mode support, part N + 2:
+ label interpretation and fragment creation as well as entering
  and exiting to make it clear which are 32-bit when in mixed mode
+ add stats on # of 32-bit bbs and traces
+ dump x86 gencode as pure x86 (simplification but best effort)

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1434 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#823:  handle x86 <-> x64 mode changes, part 3:
+ handle far direct jumps by pretending they're indirect
  and using the far_ibl prefix from part 2
+ added instr_is_near_ubr()
+ limit client to 1 bb-ending far cti
+ treat far dir as indir for all modes, for simplicity,
  and for future full i#823 impl

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1435 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#49: mixed-mode, part N + 3:
+ jecxz size calculation fix to be x86-mode-aware

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1436 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#49: mixed-mode, part N + 4:
+ keep 32-bit flag when creating traces
+ make trace ib cmp x86-mode-aware

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1437 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#49: mixed-mode, part N + 5:
+ make nop instr creation routines x86-mode-aware
+ convert nop instr to x86 in nop_pad_ilist
+ documented recommended model for generated 32-bit code in 64-bit DR

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1438 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#823: handle x86 <-> x64 mode changes, part 4:
+ far ibl mangling for far ret
+ far ibl mangling for iret

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1439 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#49: mixed-mode, part N + 6:
+ page-align wow64-layer stack base (which seems to
  not be stored page-aligned) to avoid assert

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1440 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
debug print in NtOpenFile needs to truncate to Length b/c not
null-terminated

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1441 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#49: mixed-mode, part N + 7:
+ add mixed-mode test win32.mixedmode which is built in
  a 32-bit build dir and run in a 64-bit build dir using
  the tools/ create_process.exe and earliest injection
+ automatic support in build suite for telling 64-bit
  build where the 32-bit dir is
+ support for manually setting var in order to manually run
  test in a 64-bit build dir:
  cmake -DTEST_32BIT_PATH:FILEPATH=C:/src/dr/git/build_x86_dbg_tests/suite/tests/bin .
+ enable linux cross-arch w/ same manual technique

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1442 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
fixes issue 833
+ adjusted mangling to reflect now-known fact that
  iretd in x64 mode pops ss:rsp
+ added iret testing to mixedmode test for i#833 and
  i#49/i#823

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1443 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#823: handle x86 <-> x64 mode changes, part 5:
+ far indirect call handling
+ added tests of far indirect calls and far rets to mixedmode.c
+ fixed bugs in insert_push_cs() and insert_push_retaddr()

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1444 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#823: handle x86 <-> x64 mode changes, part 6:
+ far direct call handling by treating as indirect,
  in similar fashion to far direct jmp
+ added instr_is_near_direct_call()
+ added test of far direct call to mixedmode.c

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1445 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Fix memset sizeof bugs found by clang.

Clang has a warning for the following kind of bug:
  my_struct_t *ptr = ...
  memset(ptr, 0, sizeof(ptr));

Probably what was meant was:
  memset(ptr, 0, sizeof(*ptr));

This fired 5 times when I built DR with clang.  There are other change
necessary to build DR with clang and make the tests pass, but I figured
these fixes would be pretty uncontroversial.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1446 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#501: Use setpgid for runstats children and killpg to kill them.

This prevents stale children hanging around after you run the test
suite, and should unstick the buildbot if we get another one of these
timeouts in a child process.

Fixes issue 501.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1447 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#805: Add -null_instrument_list option and API.

For modules that flagged as being uninstrumented, we can avoid the full
decode and instrlist creation for the basic block event.  This improves
performance for our planned hybrid asan and msan tools, but breaks
clients and extensions that need to see every instruction.

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

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