forked from OSchip/llvm-project
[sanitizer] use simpler symbolizer interface (GetModuleNameForPc) where applicable
llvm-svn: 231337
This commit is contained in:
parent
478559a532
commit
c89aa6d697
|
@ -81,14 +81,10 @@ bool IsStackTraceSuppressed(const StackTrace *stack) {
|
|||
uptr addr = stack->trace[i];
|
||||
|
||||
if (suppression_ctx->HasSuppressionType(kInterceptorViaLibrary)) {
|
||||
const char *module_name;
|
||||
uptr module_offset;
|
||||
// Match "interceptor_via_lib" suppressions.
|
||||
if (symbolizer->GetModuleNameAndOffsetForPC(addr, &module_name,
|
||||
&module_offset) &&
|
||||
suppression_ctx->Match(module_name, kInterceptorViaLibrary, &s)) {
|
||||
return true;
|
||||
}
|
||||
if (const char *module_name = symbolizer->GetModuleNameForPc(addr))
|
||||
if (suppression_ctx->Match(module_name, kInterceptorViaLibrary, &s))
|
||||
return true;
|
||||
}
|
||||
|
||||
if (suppression_ctx->HasSuppressionType(kInterceptorViaFunction)) {
|
||||
|
|
|
@ -435,13 +435,11 @@ static Suppression *GetSuppressionForAddr(uptr addr) {
|
|||
Suppression *s = nullptr;
|
||||
|
||||
// Suppress by module name.
|
||||
const char *module_name;
|
||||
uptr module_offset;
|
||||
SuppressionContext *suppressions = GetSuppressionContext();
|
||||
if (Symbolizer::GetOrInit()->GetModuleNameAndOffsetForPC(addr, &module_name,
|
||||
&module_offset) &&
|
||||
suppressions->Match(module_name, kSuppressionLeak, &s))
|
||||
return s;
|
||||
if (const char *module_name =
|
||||
Symbolizer::GetOrInit()->GetModuleNameForPc(addr))
|
||||
if (suppressions->Match(module_name, kSuppressionLeak, &s))
|
||||
return s;
|
||||
|
||||
// Suppress by file or function name.
|
||||
SymbolizedStack *frames = Symbolizer::GetOrInit()->SymbolizePC(addr);
|
||||
|
|
Loading…
Reference in New Issue