author | mickeyl <mickeyl> | 2005-02-12 17:20:07 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-02-12 17:20:07 (UTC) |
commit | 5ad68456ddf0b1dc722f92d7f6c94b82677c637c (patch) (side-by-side diff) | |
tree | 1f86710721e9ca624d3a2f59593b4f7be3ddbec6 | |
parent | 292ce81455773c463a8d7ed9c1aef2d08b90514d (diff) | |
download | opie-5ad68456ddf0b1dc722f92d7f6c94b82677c637c.zip opie-5ad68456ddf0b1dc722f92d7f6c94b82677c637c.tar.gz opie-5ad68456ddf0b1dc722f92d7f6c94b82677c637c.tar.bz2 |
disable backtracing if building against uclibc
-rw-r--r-- | libopie2/opiecore/odebug.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libopie2/opiecore/odebug.cpp b/libopie2/opiecore/odebug.cpp index d8dfe26..45709dc 100644 --- a/libopie2/opiecore/odebug.cpp +++ b/libopie2/opiecore/odebug.cpp @@ -1,132 +1,136 @@ /* This file is part of the Opie Project (C) 2003 Michael 'Mickey' Lauer (mickey@tm.informatik.uni-frankfurt.de) (C) 2002 Holger Freyther (freyther@kde.org) (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Include this header without OPIE_NO_DEBUG defined to avoid having the oDebugInfo // functions inlined to noops (which would then conflict with their definition here). #include <opie2/odebug.h> +#if defined(__UCLIBC__) +#define OPIE_NO_BACKTRACE +#endif + #ifdef OPIE_NO_DEBUG #undef odDebug #undef odBacktrace #endif /* OPIE */ #include <opie2/oapplication.h> #include <opie2/oglobalsettings.h> #include <opie2/oconfig.h> /* QT */ #include <qfile.h> #include <qmessagebox.h> #include <qsocketdevice.h> /* UNIX */ #include <stdlib.h> // abort #include <unistd.h> // getpid #include <stdarg.h> // vararg stuff #include <ctype.h> // isprint #include <syslog.h> #include <errno.h> #include <string.h> #ifndef OPIE_NO_BACKTRACE #include <execinfo.h> #endif namespace Opie { namespace Core { namespace Internal { /*====================================================================================== * debug levels *======================================================================================*/ enum DebugLevels { ODEBUG_INFO = 0, ODEBUG_WARN = 1, ODEBUG_ERROR = 2, ODEBUG_FATAL = 3 }; /*====================================================================================== * oDebug private data *======================================================================================*/ /*====================================================================================== * the main debug function *======================================================================================*/ struct DebugBackend { DebugBackend() : m_opened( false ), m_file( 0 ) ,m_port( -1 ),m_sock( 0 ) { m_outp = OGlobalSettings::debugMode(); } ~DebugBackend() { delete m_file; delete m_sock; } void debug( unsigned short level, unsigned int, const QString& data ); private: void debugFile( const QString&, const QString& data ); void debugMsgB( const QString&, const QString& data ); void debugShel( const QString&, const QString& data ); void debugSysl( int, const QString& ); void debugSock( const QString&, const QString& data ); QCString line( const QString&, const QString& data ); bool m_opened : 1; QFile *m_file; QHostAddress m_addr; int m_port; QSocketDevice *m_sock; short m_outp; }; void DebugBackend::debug(unsigned short level, unsigned int, const QString& data) { //qDebug( "oDebugBackend: Level=%d, Area=%d, Data=%s", level, area, data ); // ML: OPIE doesn't use areacodes at the moment. See the KDE debug classes for an // ML: example use. I think it's not necessary to implement such a strategy here. // ML: Comments? int priority = 0; QString caption; QString lev; switch( level ) { case ODEBUG_INFO: lev = "(Info)"; caption = "Info"; priority = LOG_INFO; break; case ODEBUG_WARN: lev = "(Warn)"; caption = "Warning"; priority = LOG_WARNING; break; case ODEBUG_FATAL: lev = "(Fatal)"; caption = "Fatal Error"; priority = LOG_CRIT; break; default: qDebug( "oDebugBackend: Warning: Unknown debug level! - defaulting to ODEBUG_ERROR." ); |