diff options
author | Dean Michael Berris <dberris@google.com> | 2016-12-19 00:47:40 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2016-12-19 00:47:40 +0000 |
commit | 140ee892452f4dc56ed45596fc605a20f9c71260 (patch) | |
tree | 7544bbecb7d547a3a60419caac7dc88e687746c1 /lib/xray/xray_x86_64.cc | |
parent | f1719e454d69859f99494686b99f6eb395f4117a (diff) |
[XRay] [compiler-rt] Fix format string; sanitizers' internal printf() doesn't support %ld.
Summary:
Getting rid of the distance number altogether because:
- a person knowledgeable enough to know what the message means will also
know how to do hexadecimal math (with the help of a calculator)
- numbers outside INT_MIN - INT_MAX are hard to comprehend anyway
This unbreaks the case when you dynamically link a library with XRay and
it exits pre-main() with a not very informative static string.
Author: pelikan
Reviewers: dberris
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D27894
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@290074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/xray/xray_x86_64.cc')
-rw-r--r-- | lib/xray/xray_x86_64.cc | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/xray/xray_x86_64.cc b/lib/xray/xray_x86_64.cc index 092e06db9..09ca34c0d 100644 --- a/lib/xray/xray_x86_64.cc +++ b/lib/xray/xray_x86_64.cc @@ -43,10 +43,8 @@ bool patchFunctionEntry(const bool Enable, const uint32_t FuncId, int64_t TrampolineOffset = reinterpret_cast<int64_t>(__xray_FunctionEntry) - (static_cast<int64_t>(Sled.Address) + 11); if (TrampolineOffset < MinOffset || TrampolineOffset > MaxOffset) { - Report("XRay Entry trampoline (%p) too far from sled (%p); distance = " - "%ld\n", - __xray_FunctionEntry, reinterpret_cast<void *>(Sled.Address), - TrampolineOffset); + Report("XRay Entry trampoline (%p) too far from sled (%p)\n", + __xray_FunctionEntry, reinterpret_cast<void *>(Sled.Address)); return false; } if (Enable) { @@ -90,10 +88,8 @@ bool patchFunctionExit(const bool Enable, const uint32_t FuncId, int64_t TrampolineOffset = reinterpret_cast<int64_t>(__xray_FunctionExit) - (static_cast<int64_t>(Sled.Address) + 11); if (TrampolineOffset < MinOffset || TrampolineOffset > MaxOffset) { - Report("XRay Exit trampoline (%p) too far from sled (%p); distance = " - "%ld\n", - __xray_FunctionExit, reinterpret_cast<void *>(Sled.Address), - TrampolineOffset); + Report("XRay Exit trampoline (%p) too far from sled (%p)\n", + __xray_FunctionExit, reinterpret_cast<void *>(Sled.Address)); return false; } if (Enable) { @@ -120,10 +116,8 @@ bool patchFunctionTailExit(const bool Enable, const uint32_t FuncId, reinterpret_cast<int64_t>(__xray_FunctionTailExit) - (static_cast<int64_t>(Sled.Address) + 11); if (TrampolineOffset < MinOffset || TrampolineOffset > MaxOffset) { - Report("XRay Exit trampoline (%p) too far from sled (%p); distance = " - "%ld\n", - __xray_FunctionExit, reinterpret_cast<void *>(Sled.Address), - TrampolineOffset); + Report("XRay Exit trampoline (%p) too far from sled (%p)\n", + __xray_FunctionExit, reinterpret_cast<void *>(Sled.Address)); return false; } if (Enable) { |