[PATCH] D27894: Fix format string; sanitizers' internal printf() doesn't support %ld.
Martin Pelikán via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 17 20:52:27 PST 2016
pelikan created this revision.
pelikan added a reviewer: dberris.
pelikan added a subscriber: llvm-commits.
Herald added a subscriber: mehdi_amini.
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.
https://reviews.llvm.org/D27894
Files:
lib/xray/xray_x86_64.cc
Index: lib/xray/xray_x86_64.cc
===================================================================
--- lib/xray/xray_x86_64.cc
+++ lib/xray/xray_x86_64.cc
@@ -43,10 +43,8 @@
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 @@
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 @@
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) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27894.81871.patch
Type: text/x-patch
Size: 1992 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161218/55748b36/attachment.bin>
More information about the llvm-commits
mailing list