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

Feature request - Embed source in PDB #5397

Closed
noahfalk opened this issue Sep 22, 2015 · 8 comments
Closed

Feature request - Embed source in PDB #5397

noahfalk opened this issue Sep 22, 2015 · 8 comments

Comments

@noahfalk
Copy link
Member

The PDB format has long had the capability to include the full text of source files, but most compilers have not made use of it. I would like to add an optional command line argument to the compiler to use this PDB feature.

Including the source gives the developer a way to transmit his code to anyone debugging it without requiring auxiliary mechanisms such as source control servers or saving source files on known file shares. Although it makes the PDB larger, in some cases this size gain might be preferable to overhead configuring those alternate mechanisms. Here are a few cases I imagine it might be useful:

  1. During the build, source code is auto-generated and then compiled. This auto-generated source does not exist on source control server and is often not preserved as a build artifact. Even if it is preserved, it can't be indexed on a symbol server making acquisition difficult at debug time. (This is my particular case)
  2. A company is OK from an IP standpoint to release source for some of their projects, but their source control system is behind a firewall. Their IT security policies prevent giving any external access to the source control system, which prevents typical usage of source server. They already provide PDBs to customers, and by including source in the PDBs the customer's debugging experience improves with minimal additional work.
  3. An Open Source project is doing all their development on GitHub and they current use source server to distribute source, but they don't like additional configuration necessary in VS to enable it. By distributing the source in the PDB they eliminate this additional configuration.

From my quick experiments, the work to enable such a feature is not very much. This is a simple prototype I've been working on to get a quick idea of the scope:
noahfalk@e4e20bf

To the best of my knowledge Visual Studio Debugger doesn't currently automatically use source embedded in PDBs, but I would collaborate with both teams to enable the debugging experience together with the compiler experience.

Please let me know what are the useful next steps. Thanks!

@gafter
Copy link
Member

gafter commented Sep 22, 2015

/cc @tmat

@gafter gafter added this to the 2.0 milestone Sep 22, 2015
@RichiCoder1
Copy link

I presume PPDB support would also be desirable?

@noahfalk
Copy link
Member Author

For my particular scenario it doesn't matter but it is easy to imagine other potential consumers of the feature would enjoy PPDB support.

I am working with the build process for .Net Native, the PDB produced by csc will consumed by the NUTC compiler and transformed into a C++ style PDB before the build is complete (I would do work to ensure the source information in the csc produced PDB was transferred to the NUTC produced PDB as we do with other PDB data).

@roterdam
Copy link

roterdam commented Nov 9, 2015

this would be a great feature to add, if not to the compiler at least open the hook to do it publically without messing with internals.

@tmat tmat self-assigned this Nov 9, 2015
@nguerrera nguerrera assigned nguerrera and unassigned tmat May 24, 2016
@nguerrera
Copy link
Contributor

nguerrera commented May 24, 2016

As discussed with @tmat and others, I will be looking at this. Self-assigning.

@nguerrera
Copy link
Contributor

nguerrera commented May 26, 2016

I've cherry-picked @noahfalk's prototype and will build from there: master...nguerrera:embed-source-in-pdb

@nguerrera
Copy link
Contributor

#12625 tracks design proposal for this.

@nguerrera
Copy link
Contributor

Closing as #13707 tracks the only remaining work (Windows PDB support). Full support for this in VB and C# for portable PDBs is in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants