perfview
perfview copied to clipboard
Open symbol files with sharing so that other applications can still overwrite them
A common scenario here is that I profile an application just built within VS. Looking up source for certain methods from the trace will then open the generated symbol file, but locks it until I close PerfView. Perhaps PerfView could open the symbol file with a suitable sharing mode and handle the symbol file vanishing gracefully.
PerfView uses MS DIA to load (native) symbols, so the sharing mode isn't under PerfView's direct control. It sounds like you're trying to delete the PDB while PerfView is still running. Is that right? For that DIA would need to use FILE_SHARE_DELETE. I don't know if that's possible; we'd have to ask the DIA team.
Ah, missed that from the opening comment: I basically cannot recompile the application until I close PerfView, as the PDB file remains locked. So the workflow in question is: Profile application that I'm developing; looking at the profiling data, making changes, trying to profile again. And having to close everything in between can be a bit annoying. Perhaps it would be the same problem if I tried recompiling while the application is still running in the debugger, although that's far less frequent, as one would typically do both from within the IDE, and understandably, the running executable cannot be replaced, either.
I'm not sure it's FILE_SHARE_DELETE, in that case, though. That would depend on whether the compiler (C# in my case) simply tries to open the file for writing or whether it deletes it prior to that.