Support custom streams with file name info #734

Open
simonferquel wants to merge 1 commit from simonferquel/add-support-for-filename-info-in-custom-streams into master
simonferquel commented 2021-03-16 16:50:07 -05:00 (Migrated from github.com)

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

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>
sschoener commented 2021-03-17 03:45:38 -05:00 (Migrated from github.com)

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.)

To add to this: [This callsite](https://github.com/jbevain/cecil/blob/master/Mono.Cecil.Cil/PortablePdb.cs#L304) 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 commented 2021-03-17 11:21:27 -05:00 (Migrated from github.com)

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.

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.
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'simonferquel/add-support-for-filename-info-in-custom-streams:simonferquel/add-support-for-filename-info-in-custom-streams'
git switch 'simonferquel/add-support-for-filename-info-in-custom-streams'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'master'
git merge --no-ff 'simonferquel/add-support-for-filename-info-in-custom-streams'
git switch 'simonferquel/add-support-for-filename-info-in-custom-streams'
git rebase 'master'
git switch 'master'
git merge --ff-only 'simonferquel/add-support-for-filename-info-in-custom-streams'
git switch 'simonferquel/add-support-for-filename-info-in-custom-streams'
git rebase 'master'
git switch 'master'
git merge --no-ff 'simonferquel/add-support-for-filename-info-in-custom-streams'
git switch 'master'
git merge --squash 'simonferquel/add-support-for-filename-info-in-custom-streams'
git switch 'master'
git merge --ff-only 'simonferquel/add-support-for-filename-info-in-custom-streams'
git switch 'master'
git merge 'simonferquel/add-support-for-filename-info-in-custom-streams'
git push origin 'master'
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-jbevain/cecil!734
No description provided.