Build addr2line-pdb from tcmalloc for use in memory-infra symbolization

The memory-infra tools were first written on linux where the
symbolization was done using addr2line. Turns out tcmalloc has some old
code (with a few small bugs) that wraps the windows dbghelp.dll
symbolization APIs in an addr2line-like interface called addr2line-pdb.

This CL
  * fixes the small format string bugs
  * makes the windows library configuration #defines more friendly
    for chromium build
  * modifies addr2line to expect addresses relative to DllBase to better
    simulate how addr2line works with modules in linux.

The last point is important. Windows DLL have a concept of "default load
address" which hints to the OS where to load the binary image after
relocation. The dbghelp.dll symbolization library will load the module
at this location in the virtual address space meaning the caller of
these functions would need to be aware of the base address. This makes
things unnecessarily complex in the face of ASLR and also diverges from
the behavior of addr2line when used with linux-style DSOs. This CL
simply adds the module base address to the incoming addresses thereby
making the input relative addresses for the module which both is easier
to use and lines up better with linux's addr2line behavior.

BUG=694792

Review-Url: https://codereview.chromium.org/2730473002
Cr-Original-Commit-Position: refs/heads/master@{#457271}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: bf193279edce86f900ae5b222dc93ea427ae1ff0
1 file changed
tree: d68fae10f67ddf3f8c6a2b22cda968feec003ac6
  1. src/