The S_ENVBLOCK is used for the Linker information inside of the pdb file contains an entry "cmd" for the command line arguments.
This patch aligns this entry to what MSVC generates, stripping the input files arguments.
The issue we encountered was in the case of a large project where we link many .obj files, and trying to use the Live++ tool for edit-and-continue.
Since the linker's command line reached 100KB, it gets truncated to match the 64 KB limit of the S_ENVBLOCK of the PDB file.
Live++ uses it to detect whether the appropriate flags (like /FUNCTIONPADMIN) were used for proper hotpatching.
It may miss truncated arguments and give false warnings to the user.
In our case, with this patch, the 100KB command line (which tends to get bigger as the project evolves) gets reduced to about 12KB, and evolves much slower.
Pros:
- align on MSVC's behavior
- keep S_ENVBLOCK size under the 64KB limit
Cons:
- the command line found in the pdb can't be used as-is to link the project the way it was.
Instead of this line, maybe config->argv.push_back(argv[0]);? Maybe a bit more direct.