1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

Revert "[llvm-symbolizer] Switch to using native symbolizer by default on Windows"

Breaks some asan tests on the buildbot.

This reverts commit c74b427cb2a90309ee0c29df21ad1ca26390263c.
This commit is contained in:
Amy Huang 2020-11-23 16:29:04 -08:00
parent f6737ef448
commit 2504c5bf49
7 changed files with 18 additions and 24 deletions

View File

@ -354,14 +354,6 @@ OPTIONS
Read command-line options from response file `<FILE>`.
WINDOWS/PDB SPECIFIC OPTIONS
-----------------------------
.. option:: --dia
Use the Windows DIA SDK for symbolization. If the DIA SDK is not found,
llvm-symbolizer will fall back to the native implementation.
MACH-O SPECIFIC OPTIONS
-----------------------

View File

@ -43,7 +43,7 @@ public:
bool Demangle = true;
bool RelativeAddresses = false;
bool UntagAddresses = false;
bool UseDIA = false;
bool UseNativePDBReader = false;
std::string DefaultArch;
std::vector<std::string> DsymHints;
std::string FallbackDebugPath;

View File

@ -557,8 +557,11 @@ LLVMSymbolizer::getOrCreateModuleInfo(const std::string &ModuleName) {
using namespace pdb;
std::unique_ptr<IPDBSession> Session;
PDB_ReaderType ReaderType =
Opts.UseDIA ? PDB_ReaderType::DIA : PDB_ReaderType::Native;
PDB_ReaderType ReaderType = PDB_ReaderType::Native;
#if LLVM_ENABLE_DIA_SDK
if (!Opts.UseNativePDBReader)
ReaderType = PDB_ReaderType::DIA;
#endif
if (auto Err = loadDataForEXE(ReaderType, Objects.first->getFileName(),
Session)) {
Modules.emplace(ModuleName, std::unique_ptr<SymbolizableModule>());

View File

@ -8,6 +8,8 @@ RUN: echo 0x140006C40 >> %t.input
RUN: echo 0x140006C70 >> %t.input
RUN: llvm-symbolizer -obj="%p/Inputs/test-columns.exe" < %t.input \
RUN: | FileCheck %s
RUN: llvm-symbolizer -obj="%p/Inputs/test-columns.exe" -use-native-pdb-reader < %t.input \
RUN: | FileCheck %s
This tests that the symbolizer outputs column info when it is present in the pdb.

View File

@ -6,18 +6,17 @@ RUN: echo 0x4013D0 >> %t.input
RUN: echo 0x4013E0 >> %t.input
RUN: echo 0x4013F0 >> %t.input
RUN: echo 0x401420 >> %t.input
RUN: llvm-symbolizer --obj="%p/Inputs/test.exe" < %t.input \
RUN: llvm-symbolizer -obj="%p/Inputs/test.exe" < %t.input \
RUN: | FileCheck %s
RUN: llvm-symbolizer --obj="%p/Inputs/test.exe" --no-demangle < %t.input \
RUN: | FileCheck %s --check-prefix=CHECK-NO-DEMANGLE
; Check that -dia works
RUN: llvm-symbolizer --dia --obj="%p/Inputs/test.exe" < %t.input \
Test with native pdb reader.
RUN: llvm-symbolizer -use-native-pdb-reader -obj="%p/Inputs/test.exe" < %t.input \
RUN: | FileCheck %s
RUN: llvm-symbolizer --dia --obj="%p/Inputs/test.exe" --no-demangle < %t.input \
RUN: llvm-symbolizer --use-native-pdb-reader --obj="%p/Inputs/test.exe" --no-demangle < %t.input \
RUN: | FileCheck %s --check-prefix=CHECK-NO-DEMANGLE
Subtract ImageBase from all the offsets and run the test again with
--relative-address.
@ -25,6 +24,10 @@ RUN: %python -c 'import sys;print("\n".join([hex(int(x, 16) - 0x400000) for x in
RUN: | llvm-symbolizer --obj="%p/Inputs/test.exe" --no-demangle --relative-address \
RUN: | FileCheck %s --check-prefix=CHECK-NO-DEMANGLE
RUN: %python -c 'import sys;print("\n".join([hex(int(x, 16) - 0x400000) for x in sys.stdin]))' < %t.input \
RUN: | llvm-symbolizer --use-native-pdb-reader --obj="%p/Inputs/test.exe" --no-demangle --relative-address \
RUN: | FileCheck %s --check-prefix=CHECK-NO-DEMANGLE
CHECK: foo(void)
CHECK-NEXT: test.cpp:10
CHECK: {{^private_symbol$}}

View File

@ -41,7 +41,7 @@ defm print_source_context_lines : Eq<"print-source-context-lines", "Print N line
def relative_address : F<"relative-address", "Interpret addresses as addresses relative to the image base">;
def relativenames : F<"relativenames", "Strip the compilation directory from paths">;
defm untag_addresses : B<"untag-addresses", "", "Remove memory tags from addresses before symbolization">;
def use_dia: F<"dia", "Use the DIA library to access symbols (Windows only)">;
def use_native_pdb_reader : F<"use-native-pdb-reader", "Use native PDB functionality">;
def verbose : F<"verbose", "Print verbose line info">;
def version : F<"version", "Display the version">;

View File

@ -288,13 +288,7 @@ int main(int argc, char **argv) {
Opts.RelativeAddresses = Args.hasArg(OPT_relative_address);
Opts.UntagAddresses =
Args.hasFlag(OPT_untag_addresses, OPT_no_untag_addresses, !IsAddr2Line);
Opts.UseDIA = Args.hasArg(OPT_use_dia);
#if !defined(LLVM_ENABLE_DIA_SDK)
if (Opts.UseDIA) {
WithColor::warning() << "DIA not available; using native PDB reader\n";
Opts.UseDIA = false;
}
#endif
Opts.UseNativePDBReader = Args.hasArg(OPT_use_native_pdb_reader);
Opts.UseSymbolTable = true;
for (const opt::Arg *A : Args.filtered(OPT_dsym_hint_EQ)) {