cecil icon indicating copy to clipboard operation
cecil copied to clipboard

Support custom streams with file name info

Open simonferquel opened this issue 3 years ago • 2 comments

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 [email protected]

simonferquel avatar Mar 16 '21 21:03 simonferquel

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

sschoener avatar Mar 17 '21 08:03 sschoener

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.

jbevain avatar Mar 17 '21 16:03 jbevain