diff options
author | Alexander Golubev <fatzer2@gmail.com> | 2013-08-25 14:46:19 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2015-12-23 02:22:29 +0100 |
commit | 918ff4b4ae94c71f5cc5fff755a3ace1325ec816 (patch) | |
tree | 143e8020c338331bfc196ef55011ae1dce63cf5c /kdecore/kdebug.h | |
parent | 5bb41966dbc963d39c9660de7c9bbd7bcc2b9553 (diff) | |
download | tdelibs-918ff4b4ae94c71f5cc5fff755a3ace1325ec816.tar.gz tdelibs-918ff4b4ae94c71f5cc5fff755a3ace1325ec816.zip |
Improved creation backtraces
(cherry picked from commit a5ba7ad71203a7ff1b3a716e7171e919a2e2e5bb)
Diffstat (limited to 'kdecore/kdebug.h')
-rw-r--r-- | kdecore/kdebug.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/kdecore/kdebug.h b/kdecore/kdebug.h index be7d031bf..e22f90e5a 100644 --- a/kdecore/kdebug.h +++ b/kdecore/kdebug.h @@ -601,17 +601,21 @@ KDECORE_EXPORT kdbgstream kdDebug(bool cond, int area = 0); /** * \relates KGlobal * Returns a backtrace. + * @param levels the number of levels of the backtrace. Defauls to -1 (as much as avalible). * @return a backtrace + * @since 3.1 */ -KDECORE_EXPORT TQString kdBacktrace(); +KDECORE_EXPORT TQString kdBacktrace(int levels=-1); /** * \relates KGlobal - * Returns a backtrace. - * @param levels the number of levels of the backtrace - * @return a backtrace - * @since 3.1 + * Writes a backtrace to the given file descriptor. In contrast to + * kdBacktrace, this function doesn't call any malloc(). So it supposed to be + * used in situations than any extra memmmory allocation may lead to yet + * another crash. As a limitation it doesn't produce any symbol demangling. + * @param fd a file descriptor to write to. Defaults to 2 (stderr) + * @since 14.0 */ -KDECORE_EXPORT TQString kdBacktrace(int levels); +KDECORE_EXPORT void kdBacktraceFD(int fd=2); /** * Returns a dummy debug stream. The stream does not print anything. * @param area an id to identify the output, 0 for default @@ -619,9 +623,6 @@ KDECORE_EXPORT TQString kdBacktrace(int levels); */ inline kndbgstream kndDebug(int area = 0) { Q_UNUSED(area); return kndbgstream(); } inline kndbgstream kndDebug(bool , int = 0) { return kndbgstream(); } -inline TQString kndBacktrace() { return TQString::null; } -inline TQString kndBacktrace(int) { return TQString::null; } - /** * \relates KGlobal * Returns a warning stream. You can use it to print warning @@ -658,7 +659,6 @@ KDECORE_EXPORT void kdClearDebugConfig(); #ifdef NDEBUG #define kdDebug kndDebug -#define kdBacktrace kndBacktrace #endif #endif |