From 6682359e4a65e5eb8a6157e36f90b9410bf3f21e Mon Sep 17 00:00:00 2001 From: Filipe Cabecinhas Date: Mon, 15 Aug 2016 19:30:21 +0000 Subject: Split DescribeAddressIfShadow between a function that gets all the information, and one that prints it. Summary: Replacement for part of D23518 This is the first patch to start reifying information about errors. It deals only with reifying shadow address-related information. It will allow us to generate structures with all the relevant information for a given error so a debugger can get to them or they can be included in a core dump. Reviewers: kcc, samsonov Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23519 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278718 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/asan/asan_report.cc | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'lib/asan/asan_report.cc') diff --git a/lib/asan/asan_report.cc b/lib/asan/asan_report.cc index afdd4ea63..7b632ac10 100644 --- a/lib/asan/asan_report.cc +++ b/lib/asan/asan_report.cc @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include "asan_flags.h" +#include "asan_descriptions.h" #include "asan_internal.h" #include "asan_mapping.h" #include "asan_report.h" @@ -336,26 +337,6 @@ static bool DescribeAddressIfGlobal(uptr addr, uptr size, return true; } -bool DescribeAddressIfShadow(uptr addr, AddressDescription *descr, bool print) { - if (AddrIsInMem(addr)) - return false; - const char *area_type = nullptr; - if (AddrIsInShadowGap(addr)) area_type = "shadow gap"; - else if (AddrIsInHighShadow(addr)) area_type = "high shadow"; - else if (AddrIsInLowShadow(addr)) area_type = "low shadow"; - if (area_type != nullptr) { - if (print) { - Printf("Address %p is located in the %s area.\n", addr, area_type); - } else { - CHECK(descr); - descr->region_kind = area_type; - } - return true; - } - CHECK(0 && "Address is not in memory and not in shadow?"); - return false; -} - // Return " (thread_name) " or an empty string if the name is empty. const char *ThreadNameWithParenthesis(AsanThreadContext *t, char buff[], uptr buff_len) { -- cgit v1.2.3