mirror of
https://github.com/darlinghq/darling-compiler-rt.git
synced 2025-02-18 19:09:21 +00:00
[sanitizer] use simpler symbolizer interface (GetModuleNameForPc) where applicable
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@231337 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
533f45d369
commit
80343a3361
@ -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…
x
Reference in New Issue
Block a user