Preserve, clarify, and extend debug information
`-Cdebuginfo=1` was never line tables only and can't be due to backwards compatibility issues. This was clarified and an option for line tables only was added. Additionally an option for line info directives only was added, which is well needed for some targets. The debug info options should now behave the same as clang's debug info options.
This commit is contained in:
@@ -1121,9 +1121,12 @@ impl<'a> Linker for EmLinker<'a> {
|
||||
|
||||
fn debuginfo(&mut self, _strip: Strip, _: &[PathBuf]) {
|
||||
// Preserve names or generate source maps depending on debug info
|
||||
// For more information see https://emscripten.org/docs/tools_reference/emcc.html#emcc-g
|
||||
self.cmd.arg(match self.sess.opts.debuginfo {
|
||||
DebugInfo::None => "-g0",
|
||||
DebugInfo::Limited => "--profiling-funcs",
|
||||
DebugInfo::Limited | DebugInfo::LineTablesOnly | DebugInfo::LineDirectivesOnly => {
|
||||
"--profiling-funcs"
|
||||
}
|
||||
DebugInfo::Full => "-g",
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user