From c5e29ad23da99913a73e28e7d5d1c096c7b9e312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Sat, 12 Feb 2022 23:40:20 +0100 Subject: [PATCH] may just as well use -Z7 if trying to avoid shared .pdb access MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Z7 writes all debug info into the .obj file, so it avoids the .pdb altogether. Change-Id: I89265009782d0a901ba3583a7241da0daf83860e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129877 Tested-by: Jenkins Reviewed-by: Luboš Luňák --- solenv/gcc-wrappers/wrapper.cxx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx index c97b57808be9..c84fd4990b75 100644 --- a/solenv/gcc-wrappers/wrapper.cxx +++ b/solenv/gcc-wrappers/wrapper.cxx @@ -107,11 +107,12 @@ std::string processccargs(const std::vector& rawargs, std::string & std::string linkargs; bool block_linkargs = false; - // instead of using synced PDB access (-FS), use individual PDB files based on output + // Instead of using synced PDB access (-FS), use individual PDB files based on output. + // In fact, simply use -Z7, which doesn't use PDB files at all and writes all debug into the .obj file. const char *const pEnvIndividualPDBs(getenv("MSVC_USE_INDIVIDUAL_PDBS")); const bool bIndividualPDBs = (pEnvIndividualPDBs && !strcmp(pEnvIndividualPDBs, "TRUE")); const char *const pEnvEnableZ7Debug(getenv("ENABLE_Z7_DEBUG")); - const bool bEnableZ7Debug = (pEnvEnableZ7Debug && !strcmp(pEnvEnableZ7Debug, "TRUE")); + const bool bEnableZ7Debug = (pEnvEnableZ7Debug && !strcmp(pEnvEnableZ7Debug, "TRUE")) || bIndividualPDBs; for(std::vector::const_iterator i = rawargs.begin(); i != rawargs.end(); ++i) { if (env_prefix_next_arg) @@ -152,21 +153,12 @@ std::string processccargs(const std::vector& rawargs, std::string & << (*i) << "\"" << std::endl; exit(1); } - - if (bIndividualPDBs && !bEnableZ7Debug) - { - if (dot == std::string::npos) - args.append(" -Fd" + *i + ".pdb"); - else - args.append(" -Fd" + (*i).substr(0, dot) + ".pdb"); - } } else if(*i == "-g" || !(*i).compare(0,5,"-ggdb")) { if(!bEnableZ7Debug) { args.append("-Zi"); - if (!bIndividualPDBs) - args.append(" -FS"); + args.append(" -FS"); } else {