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

PE: Support multiple debug directories and VCFeature metadata #403

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kkent030315
Copy link
Contributor

@kkent030315 kkent030315 commented Apr 12, 2024

This PR addresses the issue #314.

If anyone have suggestion of making this semantics without breaking the backward compatibility I am open to discuss.

Copy link
Owner

@m4b m4b left a comment

Choose a reason for hiding this comment

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

this seems fine to me, other than the fixes w.r.t. &Vec<T> -> &[T]

Ok(idd)
let idd_list = (0..entries)
.map(|i| {
let entry = offset + i * core::mem::size_of::<ImageDebugDirectory>();
Copy link
Owner

Choose a reason for hiding this comment

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

nice :)

@@ -127,60 +145,119 @@ pub struct CodeviewPDB70DebugInfo<'a> {
}

impl<'a> CodeviewPDB70DebugInfo<'a> {
pub fn parse(bytes: &'a [u8], idd: &ImageDebugDirectory) -> error::Result<Option<Self>> {
pub fn parse(bytes: &'a [u8], idd: &Vec<ImageDebugDirectory>) -> error::Result<Option<Self>> {
Copy link
Owner

Choose a reason for hiding this comment

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

this should take a &[ImageDebugDirectory] to be more idiomatic rust

Self::parse_with_opts(bytes, idd, &options::ParseOptions::default())
}

pub fn parse_with_opts(
bytes: &'a [u8],
idd: &ImageDebugDirectory,
idd: &Vec<ImageDebugDirectory>,
Copy link
Owner

Choose a reason for hiding this comment

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

ditto here

}

impl<'a> VCFeatureInfo {
pub fn parse(bytes: &'a [u8], idd: &Vec<ImageDebugDirectory>) -> error::Result<Option<Self>> {
Copy link
Owner

Choose a reason for hiding this comment

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

ditto, &[IMageDebugDirectory]


pub fn parse_with_opts(
bytes: &'a [u8],
idd: &Vec<ImageDebugDirectory>,
Copy link
Owner

Choose a reason for hiding this comment

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

ditto

pub struct DebugData<'a> {
pub image_debug_directory: ImageDebugDirectory,
pub image_debug_directories: Vec<ImageDebugDirectory>,
Copy link
Owner

Choose a reason for hiding this comment

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

do you know if there is a maximum image debug directories possible? if yes, perhaps we should make this an array and put it back to Copy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

None yet

2 participants