New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
debuginfo: embed gdb visualizers in module #1462
base: master
Are you sure you want to change the base?
debuginfo: embed gdb visualizers in module #1462
Conversation
@@ -35,6 +35,23 @@ impl DebugContext { | |||
} | |||
Ok(()) | |||
}); | |||
|
|||
self.add_gdb_debugger_visualizers(product); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function needs to be called at
rustc_codegen_cranelift/src/main_shim.rs
Line 40 in 8c46d93
fn create_entry_fn( |
self.add_gdb_debugger_visualizers(product); | ||
} | ||
|
||
fn add_gdb_debugger_visualizers(&mut self, product: &mut ObjectProduct) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If https://github.com/rust-lang/rust/blob/7606c13961ddc1174b70638e934df0439b7dc515/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs#L85-L117 returns false you need to skip adding the section.
} | ||
|
||
fn add_gdb_debugger_visualizers(&mut self, product: &mut ObjectProduct) { | ||
let mut section = WriterRelocate::new(self.endian); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to go through WriterRelocate
here. A plain Vec
is enough. There will be no relocations inside this section.
fixes #1386