diff options
author | Filipe Cabecinhas <me@filcab.net> | 2016-08-15 19:30:21 +0000 |
---|---|---|
committer | Filipe Cabecinhas <me@filcab.net> | 2016-08-15 19:30:21 +0000 |
commit | 6682359e4a65e5eb8a6157e36f90b9410bf3f21e (patch) | |
tree | 129f1329797329a880670073648d0ed900457b54 /lib/asan/asan_report.cc | |
parent | 96ebe14bf1b7977bd2d87741687968560f20c9e9 (diff) |
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
Diffstat (limited to 'lib/asan/asan_report.cc')
-rw-r--r-- | lib/asan/asan_report.cc | 21 |
1 files changed, 1 insertions, 20 deletions
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) { |