diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp --- a/lld/COFF/Driver.cpp +++ b/lld/COFF/Driver.cpp @@ -693,7 +693,16 @@ return std::string(data.str()); } -enum class DebugKind { Unknown, None, Full, FastLink, GHash, Dwarf, Symtab }; +enum class DebugKind { + Unknown, + None, + Full, + FastLink, + GHash, + NoGHash, + Dwarf, + Symtab +}; static DebugKind parseDebugKind(const opt::InputArgList &args) { auto *a = args.getLastArg(OPT_debug, OPT_debug_opt); @@ -703,14 +712,15 @@ return DebugKind::Full; DebugKind debug = StringSwitch(a->getValue()) - .CaseLower("none", DebugKind::None) - .CaseLower("full", DebugKind::Full) - .CaseLower("fastlink", DebugKind::FastLink) - // LLD extensions - .CaseLower("ghash", DebugKind::GHash) - .CaseLower("dwarf", DebugKind::Dwarf) - .CaseLower("symtab", DebugKind::Symtab) - .Default(DebugKind::Unknown); + .CaseLower("none", DebugKind::None) + .CaseLower("full", DebugKind::Full) + .CaseLower("fastlink", DebugKind::FastLink) + // LLD extensions + .CaseLower("ghash", DebugKind::GHash) + .CaseLower("ghash-", DebugKind::NoGHash) + .CaseLower("dwarf", DebugKind::Dwarf) + .CaseLower("symtab", DebugKind::Symtab) + .Default(DebugKind::Unknown); if (debug == DebugKind::FastLink) { warn("/debug:fastlink unsupported; using /debug:full"); @@ -1392,7 +1402,7 @@ // Handle /debug DebugKind debug = parseDebugKind(args); if (debug == DebugKind::Full || debug == DebugKind::Dwarf || - debug == DebugKind::GHash) { + debug == DebugKind::GHash || debug == DebugKind::NoGHash) { config->debug = true; config->incremental = true; } @@ -1415,7 +1425,8 @@ // Handle /pdb bool shouldCreatePDB = - (debug == DebugKind::Full || debug == DebugKind::GHash); + (debug == DebugKind::Full || debug == DebugKind::GHash || + debug == DebugKind::NoGHash); if (shouldCreatePDB) { if (auto *arg = args.getLastArg(OPT_pdb)) config->pdbPath = arg->getValue(); @@ -1748,7 +1759,7 @@ config->terminalServerAware = !config->dll && args.hasFlag(OPT_tsaware, OPT_tsaware_no, true); config->debugDwarf = debug == DebugKind::Dwarf; - config->debugGHashes = debug == DebugKind::GHash; + config->debugGHashes = debug == DebugKind::GHash || debug == DebugKind::Full; config->debugSymtab = debug == DebugKind::Symtab; config->autoImport = args.hasFlag(OPT_auto_import, OPT_auto_import_no, config->mingw); diff --git a/lld/test/COFF/pdb-type-server-simple.test b/lld/test/COFF/pdb-type-server-simple.test --- a/lld/test/COFF/pdb-type-server-simple.test +++ b/lld/test/COFF/pdb-type-server-simple.test @@ -20,7 +20,7 @@ RUN: yaml2obj %S/Inputs/pdb-type-server-simple-a.yaml -o a.obj RUN: yaml2obj %S/Inputs/pdb-type-server-simple-b.yaml -o b.obj RUN: llvm-pdbutil yaml2pdb %S/Inputs/pdb-type-server-simple-ts.yaml -pdb ts.pdb -RUN: lld-link a.obj b.obj -entry:main -debug -out:t.exe -pdb:t.pdb -nodefaultlib -summary | FileCheck %s -check-prefix SUMMARY +RUN: lld-link a.obj b.obj -entry:main -debug:ghash- -out:t.exe -pdb:t.pdb -nodefaultlib -summary | FileCheck %s -check-prefix SUMMARY RUN: llvm-pdbutil dump -symbols -types -ids -globals %t/t.pdb | FileCheck %s Re-run with /DEBUG:GHASH