Add support for Win64 stack unwind data as STACK CFI

This is a copy of https://breakpad.appspot.com/1264002/ where code review took place.

See https://bugzilla.mozilla.org/show_bug.cgi?id=548035 and https://code.google.com/p/chromium/issues/detail?id=115922

Credit to Mikhail I. Izmestev <izmmishao5@gmail.com> for original patch in https://breakpad.appspot.com/345002/

BUG=572
TEST=Run dump_syms_unittest after compiling dump_syms_regtest.cc with x64 toolchain
R=mark@chromium.org

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

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk/src@1290 4c0a9323-5329-0410-9bdc-e9ce6186880e
Check in new Windows binaries.

These binaries include recent changes to pdb_source_line_writer for emitting
STACK CFI lines for 64bit PDBs. They were built using the GYP build files,
MSVS 2013 and DIA SDK 12.0.

R=mark@chromium.org, siggi@chromium.org

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

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk/src@1291 4c0a9323-5329-0410-9bdc-e9ce6186880e
Ignore warning 4702 to avoid unreachable code error on
VS2013 stl when compiling with _HAS_EXCEPTIONS=0

See also https://crbug.com/346399 for background.

BUG=540
R=mark@chromium.org, thestig@chromium.org
TEST=update gyp to HEAD, generate MSVS2013 build files, verify breakpad compiles in Release.

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

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk/src@1292 4c0a9323-5329-0410-9bdc-e9ce6186880e
Make ARM64 detection consistent in chromium.

This is to uniform ARM64 detection code in chromium.
Use only __aarch64__ and don't look for __arm64__ at all.

Patch by Primiano Tucci <primiano@chromium.org>

BUG=chromium:354405, chromium:358092

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


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk/src@1293 4c0a9323-5329-0410-9bdc-e9ce6186880e
GoogleCrashdumpUploader would leak instances of LibcurlWrapper (Coverity)

The GoogleCrashdumpUploader would create, but never destroy it's instance of LibcurlWrapper.

BUG=574
A=cmumford@chromium.org
Original code review: https://breakpad.appspot.com/1314002/

R=cmumford@chromium.org

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

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk/src@1294 4c0a9323-5329-0410-9bdc-e9ce6186880e
Terminating FileID path when at maximum length. (Coverity)

If FileID was constructed with a path that was >= PATH_MAX then path_ was not terminated resulting in a possible buffer overrun when reading.

BUG=573
A=cmumford@chromium.org
Original code review: https://breakpad.appspot.com/1324002/

R=cmumford@chromium.org

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

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk/src@1295 4c0a9323-5329-0410-9bdc-e9ce6186880e
Update GYP dependency to r1886.

This updates both svn:external and DEPS. This version of GYP is able to produce VS2013 project files.

R=mark@chromium.org

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

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk/src@1298 4c0a9323-5329-0410-9bdc-e9ce6186880e
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/src@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/src@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/src@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/src@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/src@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/src@1304 4c0a9323-5329-0410-9bdc-e9ce6186880e
Add Arm64 support to breakpad unittests.

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

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

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk/src@1305 4c0a9323-5329-0410-9bdc-e9ce6186880e
Fix aarch64 ucontext layout on Android

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

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

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk/src@1306 4c0a9323-5329-0410-9bdc-e9ce6186880e
Increase Breakpad's signal handler stack size.

Some unittests fail on Android (both on Arm and Arm64) without this stack
size increase.

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

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

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk/src@1307 4c0a9323-5329-0410-9bdc-e9ce6186880e
Moving directory 'build' one level up as it collides with a file named 'BUILD' which happens to be in that same location in the Google source depot.

R=chrisha@chromium.org, mark@chromium.org

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

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk/src@1308 4c0a9323-5329-0410-9bdc-e9ce6186880e
Adding support for 64-bit Windows modules to ms_symbol_server_converter.

As part of that:
 - Updated MSSymbolServerConverter to also download the executable files from the symbol server and pass them to the PDBSourceLineWriter as it is required for successful conversion of symbols for 64-bit modules.
 - Added a .gyp file and target for the ms_symbol_server_converter library.
 - Updated PDBSourceLineWriter to allow executable files to be in locations different from the locations of the PDB files.
 - Minor style issue:
    * #define guards.
    * No space before ')' and after '('.

R=mark@chromium.org, wfh@chromium.org

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

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk/src@1309 4c0a9323-5329-0410-9bdc-e9ce6186880e
Fill in CPU info in mini-dump for Arm64.

Adds Arm64 varients of CPUFillThreadInfo and CPUFillFromUContext and
WriteCPUInformation for the Linux/Android client.

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

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

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk/src@1310 4c0a9323-5329-0410-9bdc-e9ce6186880e
Add x64 version of getcontext.

Assembly code is derived in part from code in libunwind.
Code tested on desktop linux (Android testing pending emulation
support).

BUG=346626
R=dannyb@google.com, thestig@chromium.org

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

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