summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_common.h
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2018-05-08 18:35:11 +0000
committerVitaly Buka <vitalybuka@google.com>2018-05-08 18:35:11 +0000
commit52e511265630ca2cad19fdf815919c1a55b6a388 (patch)
treeec0185885d201e2ebe57999e74f4ce6fb16e8fe0 /lib/sanitizer_common/sanitizer_common.h
parent6d2f5b966ec2b0bf44bd9a8c5afd1528a02810ca (diff)
downloadcompiler-rt-52e511265630ca2cad19fdf815919c1a55b6a388.tar.gz
[sanitizer] Read file to InternalMmapVectorNoCtor
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@331791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_common.h')
-rw-r--r--lib/sanitizer_common/sanitizer_common.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/sanitizer_common/sanitizer_common.h b/lib/sanitizer_common/sanitizer_common.h
index 267903ebc..39f9414fa 100644
--- a/lib/sanitizer_common/sanitizer_common.h
+++ b/lib/sanitizer_common/sanitizer_common.h
@@ -198,15 +198,6 @@ class ScopedErrorReportLock {
extern uptr stoptheworld_tracer_pid;
extern uptr stoptheworld_tracer_ppid;
-// Opens the file 'file_name" and reads up to 'max_len' bytes.
-// The resulting buffer is mmaped and stored in '*buff'.
-// The size of the mmaped region is stored in '*buff_size'.
-// The total number of read bytes is stored in '*read_len'.
-// Returns true if file was successfully opened and read.
-bool ReadFileToBuffer(const char *file_name, char **buff, uptr *buff_size,
- uptr *read_len, uptr max_len = 1 << 26,
- error_t *errno_p = nullptr);
-
bool IsAccessibleMemoryRange(uptr beg, uptr size);
// Error report formatting.
@@ -645,6 +636,21 @@ enum ModuleArch {
kModuleArchARM64
};
+// Opens the file 'file_name" and reads up to 'max_len' bytes.
+// The resulting buffer is mmaped and stored in '*buff'.
+// The size of the mmaped region is stored in '*buff_size'.
+// The total number of read bytes is stored in '*read_len'.
+// Returns true if file was successfully opened and read.
+bool ReadFileToBuffer(const char *file_name, char **buff, uptr *buff_size,
+ uptr *read_len, uptr max_len = 1 << 26,
+ error_t *errno_p = nullptr);
+// Opens the file 'file_name" and reads up to 'max_len' bytes.
+// The resulting buffer is mmaped and stored in '*buff'.
+// Returns true if file was successfully opened and read.
+bool ReadFileToBuffer(const char *file_name,
+ InternalMmapVectorNoCtor<char> *buff,
+ uptr max_len = 1 << 26, error_t *errno_p = nullptr);
+
// When adding a new architecture, don't forget to also update
// script/asan_symbolize.py and sanitizer_symbolizer_libcdep.cc.
inline const char *ModuleArchToString(ModuleArch arch) {