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 custom streams with file name info #734

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

Conversation

simonferquel
Copy link

Many operations involved in rewriting debug symbols assume the rewritten
assembly base stream is a FileStream to get file name information. This
may not always be the case.

To cover this, this changes the way file name is resolved so that a
custom stream implementing IHaveAFileName can be understood by Cecil.

Signed-off-by: Simon Ferquel simon.ferquel@unity3d.com

@simonferquel simonferquel changed the title Support custom scripts with file name info Support custom streams with file name info Mar 16, 2021
Many operations involved in rewriting debug symbols assume the rewritten
assembly base stream is a FileStream to get file name information. This
may not always be the case.

To cover this, this changes the way file name is resolved so that a
custom stream implementing `IHaveAFileName` can be understood by Cecil.

Signed-off-by: Simon Ferquel <simon.ferquel@unity3d.com>
@simonferquel simonferquel force-pushed the add-support-for-filename-info-in-custom-streams branch from 8871d88 to 94b3e71 Compare March 16, 2021 22:05
@sschoener
Copy link

To add to this: This callsite in particular will write out an empty PDB path unless you write out to a file. This is undesirable in scenarios where you modify the assembly in memory and write to a MemoryStream which is later copied to to a FileStream. The net effect is that the resulting assembly will contain an empty PDB path. (I'm not sure what the best solution to this is, but this is the problem we are seeing.)

@jbevain
Copy link
Owner

jbevain commented Mar 17, 2021

Hey folks; Yeah I know that part is horrible.

Thanks for starting this discussion. I might not take this PR as is, but I'll think about how I want to fix this and get back to this PR.

Thanks again.

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

3 participants