diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-02-09 10:35:20 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-02-09 10:35:20 +0100 |
commit | 8458ec8c9c93c8b3a6045c2b45cecadd345bbf4d (patch) | |
tree | 64ebfba454e67dd38d98c41a89496f305f298fdf | |
parent | Resolves: ofz#576 unexpected exception with invalid fraction (diff) | |
download | core-8458ec8c9c93c8b3a6045c2b45cecadd345bbf4d.tar.gz core-8458ec8c9c93c8b3a6045c2b45cecadd345bbf4d.zip |
Fix SAL_DEBUG_BACKTRACE
...after 56d071c10ca8016848f1f059aa3eb197fe928844 "rename SAL_DEBUG_TRACE to
SAL_DEBUG_BACKTRACE" (looks like this doesn't get used much...)
-rw-r--r-- | compilerplugins/clang/sallogareas.cxx | 2 | ||||
-rw-r--r-- | include/sal/log.hxx | 16 |
2 files changed, 14 insertions, 4 deletions
diff --git a/compilerplugins/clang/sallogareas.cxx b/compilerplugins/clang/sallogareas.cxx index e0ccf0bde7a3..bde35137f1a3 100644 --- a/compilerplugins/clang/sallogareas.cxx +++ b/compilerplugins/clang/sallogareas.cxx @@ -84,7 +84,7 @@ bool SalLogAreas::VisitCallExpr( const CallExpr* call ) loc = source.getImmediateExpansionRange( loc ).first ) { StringRef inMacro = Lexer::getImmediateMacroName( loc, source, compiler.getLangOpts()); - if( inMacro == "SAL_DEBUG" ) + if( inMacro == "SAL_DEBUG" || inMacro == "SAL_DEBUG_BACKTRACE" ) return true; // ok } report( DiagnosticsEngine::Warning, "missing log area", diff --git a/include/sal/log.hxx b/include/sal/log.hxx index ea070dd68d4e..b383fd030535 100644 --- a/include/sal/log.hxx +++ b/include/sal/log.hxx @@ -54,6 +54,14 @@ inline void SAL_CALL log( sal_detail_log(level, area, where, stream.str().c_str()); } +inline void SAL_CALL log_backtrace( + sal_detail_LogLevel level, char const * area, char const * where, + std::ostringstream const & stream, int maxNoStackFramesToDisplay) +{ + sal_detail_log_backtrace( + level, area, where, stream.str().c_str(), maxNoStackFramesToDisplay); +} + // Special handling of the common case where the message consists of just a // string literal, to produce smaller call-site code: @@ -357,12 +365,14 @@ inline char const * unwrapStream(SAL_UNUSED_PARAMETER StreamIgnore const &) { ::sal_detail_log_backtrace( \ ::SAL_DETAIL_LOG_LEVEL_DEBUG, NULL, NULL, \ ::sal::detail::unwrapStream( \ - ::sal::detail::StreamStart() << stream)); \ + ::sal::detail::StreamStart() << stream), \ + maxNoStackFramesToDisplay); \ } else { \ ::std::ostringstream sal_detail_stream; \ sal_detail_stream << stream; \ - ::sal::detail::log( \ - ::SAL_DETAIL_LOG_LEVEL_DEBUG, NULL, NULL, sal_detail_stream); \ + ::sal::detail::log_backtrace( \ + ::SAL_DETAIL_LOG_LEVEL_DEBUG, NULL, NULL, sal_detail_stream, \ + maxNoStackFramesToDisplay); \ } \ } while (false) |