Skip to content
  • ajwong's avatar
    Build addr2line-pdb from tcmalloc for use in memory-infra symbolization · bf193279
    ajwong authored
    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-Commit-Position: refs/heads/master@{#457271}
    bf193279