-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
feat(sources): Source bundles for debug files #154
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jan-auer
changed the title
feat(sources): Initialize a sources module
feat(sources): Source bundles for debug files
Jun 24, 2019
The ObjectLike trait should only contain methods that generally make sense for all types of object files. The debug file name is a special construct of PE files, and therefore only resides on PeObject. The same is true for `BreakpadObject::name`, for instance.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains two major additions to the
debuginfo
crate:DebugSession::source_by_path
now exposes source code contents that are stored within object files. However, this is not implemented for any of the existing object file formats yet. The information whether an object file might even contain sources is exposed viaObjectLike::has_source
.A new object file format,
SourceBundle
, allows for platform-independent bundling of source context. It is a ZIP archive containing all source files referenced by an object file. Currently, this is derived by walking the debug information in the source file.SourceBundle
Source bundles are a ZIP zip files with a well-defined internal structure. First it contains a binary header, followed by a ZIP stream:
The internal structure of the ZIP file is as follows:
The manifest describes the entire contents of the bundle. Files that are not listed in the manifest are skipped. The manifest for the above bundle would look like this:
Path Canonicalization
Paths in the source bundle are stored in a canonical way. This makes it easier to match them from different platforms. This functionality is implemented in
symbolic_common::path::clean_path
. Roughly, it performs the following actions:.
path components..
path components.For instance, the path
C:\Users\..\..\Program Files\\Hello
becomesC:\Program Files\Hello
.TODO
DebugSession::file_names() -> Iterator<&str>
that just emits all source file names.