diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-12-25 08:01:16 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-12-25 08:01:16 +0000 |
commit | 13f95364475e0952e2059825bde9c3d707476c7d (patch) | |
tree | 37f8d2833f0dc9bc4755fe456d943367989a27a7 /lib/sanitizer_common/sanitizer_procmaps.h | |
parent | 81cf34157c0f3946cda5180f12d82369aa0e0642 (diff) | |
download | compiler-rt-13f95364475e0952e2059825bde9c3d707476c7d.tar.gz |
[Sanitizer] Move OS-specific code for MemoryMappingLayout into separate source files.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@198003 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_procmaps.h')
-rw-r--r-- | lib/sanitizer_common/sanitizer_procmaps.h | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/lib/sanitizer_common/sanitizer_procmaps.h b/lib/sanitizer_common/sanitizer_procmaps.h index 65bcac633..7468d6588 100644 --- a/lib/sanitizer_common/sanitizer_procmaps.h +++ b/lib/sanitizer_common/sanitizer_procmaps.h @@ -71,33 +71,10 @@ class MemoryMappingLayout { // lookup. bool IterateForObjectNameAndOffset(uptr addr, uptr *offset, char filename[], uptr filename_size, - uptr *protection) { - Reset(); - uptr start, end, file_offset; - for (int i = 0; Next(&start, &end, &file_offset, filename, filename_size, - protection); - i++) { - if (addr >= start && addr < end) { - // Don't subtract 'start' for the first entry: - // * If a binary is compiled w/o -pie, then the first entry in - // process maps is likely the binary itself (all dynamic libs - // are mapped higher in address space). For such a binary, - // instruction offset in binary coincides with the actual - // instruction address in virtual memory (as code section - // is mapped to a fixed memory range). - // * If a binary is compiled with -pie, all the modules are - // mapped high at address space (in particular, higher than - // shadow memory of the tool), so the module can't be the - // first entry. - *offset = (addr - (i ? start : 0)) + file_offset; - return true; - } - } - if (filename_size) - filename[0] = '\0'; - return false; - } + uptr *protection); + // FIXME: Hide implementation details for different platforms in + // platform-specific files. # if SANITIZER_LINUX ProcSelfMapsBuff proc_self_maps_; char *current_; |