debug.c revision 7e7bd3dccbfe8f79e25e5c1554b5bc3a9aaca321
/*
libparted - a library for manipulating disk partitions
Copyright (C) 2000, 2005, 2007 Free Software Foundation, Inc.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#if ENABLE_NLS
# include <libintl.h>
#else
#endif /* ENABLE_NLS */
#ifdef DEBUG
#if HAVE_BACKTRACE
#include <execinfo.h>
#endif
/**
* Default debug handler.
* Will print all information to stderr.
*/
{
}
/**
* Send a debug message.
* Do not call this directly -- use PED_DEBUG() instead.
*
* level log level, 0 ~= "print definitely"
*/
{
ped_free ( msg_concat );
}
/*
* handler debug handler; NULL for default handler
*/
{
}
/*
* Check an assertion.
* Do not call this directly -- use PED_ASSERT() instead.
*/
{
if ( cond )
return 1;
#if HAVE_BACKTRACE
/* Print backtrace stack */
void *stack[20];
if (strings) {
}
#endif
/* Throw the exception */
_("Assertion (%s) at %s:%d in function %s() failed."),
return ( opt == PED_EXCEPTION_IGNORE );
}
#endif /* DEBUG */