Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DesmondWillowbrook
Copy link

fixes #1386

@DesmondWillowbrook DesmondWillowbrook marked this pull request as ready for review March 3, 2024 23:09
@@ -35,6 +35,23 @@ impl DebugContext {
}
Ok(())
});

self.add_gdb_debugger_visualizers(product);
Copy link
Member

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

fn create_entry_fn(
and a load of the produced global needs to be inserted there too to ensure the section only gets inserted a single time in the whole program and that it doesn't get removed by the linker.

self.add_gdb_debugger_visualizers(product);
}

fn add_gdb_debugger_visualizers(&mut self, product: &mut ObjectProduct) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

fn add_gdb_debugger_visualizers(&mut self, product: &mut ObjectProduct) {
let mut section = WriterRelocate::new(self.endian);
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement #![debugger_visualizer]
2 participants