fix races in CrashGenerator::CreateChildCrash

The current CreateChildCrash logic is racy when it comes to creating a
crash dump for two reasons:

The main thread that calls kill() on a different thread is guaranteed
the signal will be *queued* when it returns, but not *delivered*.  If
the kernel doesn't automatically schedule the receiving thread, but
instead lets the main thread run to the exit() call, then the signal
never triggers a coredump and the whole process simply exits.

The main thread is using kill() to try to deliver a signal to a
specific thread, but that function is for sending signals to a
process.  That means the kernel is free to deliver the signal to
any thread in the process and not just the one requested.  This
manifests itself as the pr_pid in the coredump not being the one
expected.  Instead, we must use tkill() with the tid (which we
already took care of gathering) to deliver to a specific thread.

These are a lot easier to see on a UMP system as contention is heavier.

BUG=chromium:207918
TEST=`dumper_unittest` still passes, and doesn't flake out in a UMP system
TEST=`linux_client_unittest` still passes
R=benchan@chromium.org

Review URL: https://breakpad.appspot.com/1304005

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1299 4c0a9323-5329-0410-9bdc-e9ce6186880e
Remove some unecessary Android system header definitions.

Newer NDKs include some additional headers needed by Breakpad, so we can remove these redefinitions.

BUG=358831,335641,354405
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1374002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1300 4c0a9323-5329-0410-9bdc-e9ce6186880e
First cut at adding arm64 Linux / Android support to Breakpad.

This is an initial attempt to add Arm64 (aarch64) support to Breakpad for
Linux / Android platforms.  This CL adds the Arm64 data structures, but does
not yet implement the Android getcontext support or CPUFillFromThreadInfo /
CPUFillFromUContext.

BUG=354405,335641
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1354002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1301 4c0a9323-5329-0410-9bdc-e9ce6186880e
Add Arm64 version of breakpad_getcontext for Android.

This CL adds breakpad_getcontext support for Arm64 to Android. The assembly
is based on getcontext.S in glibc.

BUG=354405,335641
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1384002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1302 4c0a9323-5329-0410-9bdc-e9ce6186880e
Fix ElfCoreDumpTest.ValidCoreFile unit test.

The ElfCoreDumpTest.ValidCoreFile unit test assumed that the number of
NT_FPREGSET / NT_PRXFPREG notes in the core dump file equals to the number of
threads of the crashed process. This assumption isn't always true as the kernel
skips filling the NT_FPREGSET / NT_PRXFPREG note of a thread if the FPU state
isn't available. The kernel indicates the availability of NT_FPREGSET /
NT_PRXFPREG via the pr_fpvalid field of the NT_PRSTATUS note. This CL modifies
the ElfCoreDumpTest.ValidCoreFile unit test to verify the number of NT_FPREGSET
and NT_PRXFPREG notes based on the pr_fpvalid field of the NT_PRSTATUS notes.

BUG=577
TEST=Run unit tests on x86 and x86_64 Linux platform.
R=vapier@chromium.org

Review URL: https://breakpad.appspot.com/1404002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1303 4c0a9323-5329-0410-9bdc-e9ce6186880e
Move build configuration to root of repository.

This is in preparation for creating GYP build files for each platform.

BUG=https://code.google.com/p/google-breakpad/issues/detail?id=575
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1414002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1304 4c0a9323-5329-0410-9bdc-e9ce6186880e