Skip to content

Support custom streams with file name info#734

Open
simonferquel wants to merge 1 commit intojbevain:masterfrom
simonferquel:add-support-for-filename-info-in-custom-streams
Open

Support custom streams with file name info#734
simonferquel wants to merge 1 commit intojbevain:masterfrom
simonferquel:add-support-for-filename-info-in-custom-streams

Conversation

@simonferquel
Copy link
Copy Markdown
Contributor

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
Copy Markdown

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
Copy Markdown
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.

3 participants