Viladoman / CompileScore

Tools for profiling and visualizing C++ build times.
MIT License
460 stars 19 forks source link

minor bug: VS extension not properly parsing include headers #7

Closed ikrima closed 3 years ago

ikrima commented 3 years ago

Not new bug, at least since I first started using the extension. Just finally hit it enough to cross my threshold for reporting :P

I looked into it initially and iirc, the issue was with < & > not escaped when serialized to some buffer (maybe the compile.scor file?) but it's been a months

The problematic headers are things like #include <windows>

Stack trace:

System.ArgumentException: Illegal characters in path.&#x000D;&#x000A;   
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)&#x000D;&#x000A;
at System.IO.Path.GetFileName(String path)&#x000D;&#x000A;
at CompileScore.ScoreGlyphTagger.CreateTrackingSpans()&#x000D;&#x000A;
at CompileScore.ScoreGlyphTagger..ctor(ITextView view, ITextBuffer sourceBuffer)&#x000D;&#x000A;
at CompileScore.ScoreGlyphTaggerProvider.CreateTagger[T](ITextView textView, ITextBuffer buffer)&#x000D;&#x000A;
at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.InstantiateViewTagger(ITextView textView, Lazy`2 factory, ITextBuffer textBuffer, IList`1 newTaggers)&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
ikrima commented 3 years ago

meh, n/m, found out it was bc of this line: #error("Do not include this file directly, use #include <es2/es2.h> instead.")

Tentatively closing since it was an easy fix by escaping

Viladoman commented 3 years ago

Interesting! And I am glad you managed to workaround it! I have never seen this error! It might still be useful to guard the code against it, just in case, for safety. Was it crashing the application? Is there a super simple repro case for me to make it happen?

ikrima commented 3 years ago

Nah; it would just display a minorly annoying status bar message along the lines of "MSVC encountered a crash"

Confusingly, I can't get it to repro if I revert my workaround. If it comes up again, I'll try to get a capture