[ubsan] support print_module_map flag in standalone mode
authorEmily Shi <code@emi.sh>
Tue, 2 Mar 2021 00:33:20 +0000 (16:33 -0800)
committerEmily Shi <code@emi.sh>
Fri, 5 Mar 2021 21:59:56 +0000 (13:59 -0800)
commit9059903f2d33098e2c0e7074604da6845e31c436
tree897a3be08540d149b152bcb6bc7b56e5f498e431
parent1540646dbd18b7d7637a9f8ba64b53e0417ff5e4
[ubsan] support print_module_map flag in standalone mode

Currently, `print_module_map` is only respected for ubsan if it is ran in tandem with asan. This patch adds support for this flag in standalone mode. I copied the pattern used to implement this for asan.

Also added a common `print_module_map` lit test for Darwin only. Since the print messages are different per platform, we need to write a regex test to cover them. This test is coming in a separate patch

rdar://56135732

Reviewed By: vitalybuka, vsk, delcypher

Differential Revision: https://reviews.llvm.org/D97746
compiler-rt/lib/ubsan/ubsan_diag.cpp
compiler-rt/lib/ubsan/ubsan_init.cpp
compiler-rt/test/sanitizer_common/TestCases/Darwin/print-module-map.cpp [new file with mode: 0644]