diff --git a/src/sled/debugging/demangle.h b/src/sled/debugging/demangle.h index 500840e..5379ff2 100644 --- a/src/sled/debugging/demangle.h +++ b/src/sled/debugging/demangle.h @@ -2,10 +2,11 @@ #define SLED_DEBUGGING_DEMANGLE_H #pragma once +#include "sled/lang/attributes.h" #include namespace sled { -bool Demangle(const char *mangled, char *out, size_t out_size); -std::string DemangleString(const char *mangled); +bool SLED_NO_INSTRUMENT_FUNCTION Demangle(const char *mangled, char *out, size_t out_size); +std::string SLED_NO_INSTRUMENT_FUNCTION DemangleString(const char *mangled); }// namespace sled #endif// SLED_DEBUGGING_DEMANGLE_H diff --git a/src/sled/debugging/symbolize.cc b/src/sled/debugging/symbolize.cc index 14f353e..6d70f7c 100644 --- a/src/sled/debugging/symbolize.cc +++ b/src/sled/debugging/symbolize.cc @@ -1,4 +1,5 @@ #include "sled/debugging/symbolize.h" +#include "sled/lang/attributes.h" #ifdef _WIN32 void diff --git a/src/sled/debugging/symbolize_darwin.inc b/src/sled/debugging/symbolize_darwin.inc index 7578c87..cbe4ca4 100644 --- a/src/sled/debugging/symbolize_darwin.inc +++ b/src/sled/debugging/symbolize_darwin.inc @@ -10,6 +10,7 @@ namespace sled { namespace { static std::string +SLED_NO_INSTRUMENT_FUNCTION GetSymbolString(const std::string &backtrace_line) { // Example Backtrace lines: @@ -40,10 +41,12 @@ GetSymbolString(const std::string &backtrace_line) }// namespace void +SLED_NO_INSTRUMENT_FUNCTION InitializeSymbolizer(const char *argv0) {} bool +SLED_NO_INSTRUMENT_FUNCTION Symbolize(const void *pc, char *out, int out_size) { if (out_size <= 0 || pc == nullptr) { diff --git a/src/sled/lang/attributes.h b/src/sled/lang/attributes.h index d786595..42fe757 100644 --- a/src/sled/lang/attributes.h +++ b/src/sled/lang/attributes.h @@ -56,4 +56,6 @@ #define SLED_UNLOCK_FUNCTION(...) SLED_THREAD_ANNOTATION_ATTRIBUTE__(unlock_function(__VA_ARGS__)) #define SLED_ASSERT_EXCLUSIVE_LOCK(...) SLED_THREAD_ANNOTATION_ATTRIBUTE__(assert_exclusive_lock(__VA_ARGS__)) +#define SLED_NO_INSTRUMENT_FUNCTION SLED_THREAD_ANNOTATION_ATTRIBUTE__(no_instrument_function) + #endif// SLED_LANG_ATTRIBUTES_H