-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
3.2.0
-
None
Seems, since GCC 4.7 we can use this `-gsplit-dwarf` option to generate a separate debug information in a form of *.dwo files, see e.g. https://gcc.gnu.org/wiki/DebugFission
Right now we do it trough an `objcopy`:
function separateDebugInfoCommands(product, outputs, primaryOutput) {
var commands = [];
var debugInfo = outputs.debuginfo_app || outputs.debuginfo_dll
|| outputs.debuginfo_loadablemodule;
if (debugInfo && !product.qbs.toolchain.includes("emscripten")) {
var objcopy = product.cpp.objcopyPath;
var cmd = new Command(objcopy, ["--only-keep-debug", primaryOutput.filePath,
debugInfo[0].filePath]);
cmd.silent = true;
commands.push(cmd);
cmd = new Command(objcopy, ["--strip-debug", primaryOutput.filePath]);
cmd.silent = true;
commands.push(cmd);
cmd = new Command(objcopy, ["--add-gnu-debuglink=" + debugInfo[0].filePath,
primaryOutput.filePath]);
cmd.silent = true;
commands.push(cmd);
}
return commands;
}
So, at least, we can keep this approach only for a GCC with the version less than 4.7... But for all other GCC we can use `-gsplit-dwarf`, AFAIK.