-
Notifications
You must be signed in to change notification settings - Fork 158
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
Throwing once per file #465
Conversation
// '{0}' was not evaluated for check '{1}' because its PDB could not be loaded ({2}). | ||
string fileName = context.TargetUri.GetFileName(); | ||
string key = $"{fileName}@{pdbException.ExceptionDisplayMessage}"; | ||
if (s_PdbExceptions.ContainsKey(key)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
context.Logger.LogConfigurationNotification( | ||
Errors.CreateNotification( | ||
context.TargetUri, | ||
"ERR997.ExceptionLoadingPdb", | ||
context.Rule.Id, | ||
string.Empty, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pdbException.ExceptionDisplayMessage)); | ||
|
||
s_PdbExceptions.TryAdd(key, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/BinSkim.Rules/RuleResources.resx
Outdated
@@ -569,4 +569,7 @@ Modules did not meet the criteria: {1}</value> | |||
<data name="BA5002_Pass" xml:space="preserve"> | |||
<value>Executable stack is not allowed on executable '{0}'.</value> | |||
</data> | |||
<data name="ERR997)ExceptionLoadingPdbGeneric" xml:space="preserve"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes! thanks for reviewing!
@@ -130,20 +134,27 @@ public static void LogExceptionLoadingPdb(IAnalysisContext context, PdbException | |||
throw new ArgumentNullException(nameof(context)); | |||
} | |||
|
|||
// '{0}' was not evaluated for check '{1}' because its PDB could not be loaded ({2}). | |||
string fileName = context.TargetUri.GetFileName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to OriginalString as path. That will prevent issues like you showed.
thanks!
Fixes #304
Previous:
Current: