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

Support source-context resolution from multiple files #1112

Open
vaind opened this issue Mar 22, 2023 · 1 comment
Open

Support source-context resolution from multiple files #1112

vaind opened this issue Mar 22, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@vaind
Copy link
Contributor

vaind commented Mar 22, 2023

Historically, only source-bundles contained sources for source-context. Nowadays, you can also have them in Portable PDBs, whether as embedded, or as links. In the future, other formats may follow.

In order to resolve source context as best as we can, we should not limit resolution to a single debug file that reports has_sources() = true but instead try to match each of them until a match is found. Alternatively, they should be combined. This resolution could be cached if needed.

@vaind
Copy link
Contributor Author

vaind commented Nov 13, 2024

This came up in getsentry/sentry#60236

We'd need to change how the candidates are looked up. Doesn't seem so hard to do but maybe I'm missing something:

let objects = objects.clone();
let find_request = FindObject {
filetypes: FileType::sources(),
purpose: ObjectPurpose::Source,
identifier: object_id_from_object_info(&entry.object_info.raw),
sources: self.sources.clone(),
scope: self.scope.clone(),
};
let fut = async move {
let FindResult { meta, candidates } = objects.find(find_request).await;
let source_object = match meta {
Some(meta) => match meta.handle {
Ok(handle) => objects.fetch(handle).await,
Err(err) => Err(err),
},
None => Err(CacheError::NotFound),
};
(idx, source_object, candidates)
};

Notably from objects.find() docs: " /// Fetches matching objects and returns the metadata of the most suitable object." - it returns a single object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

3 participants