diff options
author | Alexander Golubev <fatzer2@gmail.com> | 2013-08-25 14:46:19 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2013-08-25 14:47:14 +0200 |
commit | a5ba7ad71203a7ff1b3a716e7171e919a2e2e5bb (patch) | |
tree | 94e80ee122d72650ec2998419b234cab208a49f1 /tdecore/kdebug.h | |
parent | edb0581f3426731bb8247d61f3676d6ce00506f1 (diff) | |
download | tdelibs-a5ba7ad71203a7ff1b3a716e7171e919a2e2e5bb.tar.gz tdelibs-a5ba7ad71203a7ff1b3a716e7171e919a2e2e5bb.zip |
Improved creation backtraces
Diffstat (limited to 'tdecore/kdebug.h')
-rw-r--r-- | tdecore/kdebug.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tdecore/kdebug.h b/tdecore/kdebug.h index d8a1998f9..46af54e97 100644 --- a/tdecore/kdebug.h +++ b/tdecore/kdebug.h @@ -601,17 +601,21 @@ TDECORE_EXPORT kdbgstream kdDebug(bool cond, int area = 0); /** * \relates TDEGlobal * 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 */ -TDECORE_EXPORT TQString kdBacktrace(); +TDECORE_EXPORT TQString kdBacktrace(int levels=-1); /** * \relates TDEGlobal - * 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 */ -TDECORE_EXPORT TQString kdBacktrace(int levels); +TDECORE_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 @@ TDECORE_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 TDEGlobal * Returns a warning stream. You can use it to print warning @@ -658,7 +659,6 @@ TDECORE_EXPORT void kdClearDebugConfig(); #ifdef NDEBUG #define kdDebug kndDebug -#define kdBacktrace kndBacktrace #endif #endif |