OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [rdi-share/] [logging.h] - Diff between revs 107 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 107 Rev 1765
/*
/*
 * Copyright (C) 1995 Advanced RISC Machines Limited. All rights reserved.
 * Copyright (C) 1995 Advanced RISC Machines Limited. All rights reserved.
 *
 *
 * This software may be freely used, copied, modified, and distributed
 * This software may be freely used, copied, modified, and distributed
 * provided that the above copyright notice is preserved in all copies of the
 * provided that the above copyright notice is preserved in all copies of the
 * software.
 * software.
 */
 */
 
 
/* -*-C-*-
/* -*-C-*-
 *
 *
 * $Revision: 1.1.1.1 $
 * $Revision: 1.1.1.1 $
 *     $Date: 2001-05-18 11:16:45 $
 *     $Date: 2001-05-18 11:16:45 $
 *
 *
 *
 *
 * logging.h - methods for logging warnings, errors and trace info
 * logging.h - methods for logging warnings, errors and trace info
 */
 */
 
 
#ifndef angel_logging_h
#ifndef angel_logging_h
#define angel_logging_h
#define angel_logging_h
 
 
#include <stdarg.h>
#include <stdarg.h>
 
 
/*
/*
 * __rt_warning
 * __rt_warning
 * ------------
 * ------------
 * Provides a standard method of generating run-time system
 * Provides a standard method of generating run-time system
 * warnings. The actual action taken by this code can be board or
 * warnings. The actual action taken by this code can be board or
 * target application specific, e.g. internal logging, debug message,
 * target application specific, e.g. internal logging, debug message,
 * etc.
 * etc.
 */
 */
extern void __rt_warning(char *format, ...);
extern void __rt_warning(char *format, ...);
 
 
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
 
 
/*
/*
 * __rt_error
 * __rt_error
 * ----------
 * ----------
 * Raise an internal Angel error. The parameters are passed directly
 * Raise an internal Angel error. The parameters are passed directly
 * to "__rt_warning" for display, and the code then raises a debugger
 * to "__rt_warning" for display, and the code then raises a debugger
 * event and stops the target processing.
 * event and stops the target processing.
 */
 */
extern void __rt_error(char *format, ...);
extern void __rt_error(char *format, ...);
 
 
/*
/*
 * Some macros for debugging and warning messages
 * Some macros for debugging and warning messages
 */
 */
 
 
typedef enum WarnLevel {
typedef enum WarnLevel {
    WL_TRACE,
    WL_TRACE,
    WL_WARN,
    WL_WARN,
    WL_ERROR
    WL_ERROR
} WarnLevel;
} WarnLevel;
 
 
void va_warn(WarnLevel level, char *format, va_list args);
void va_warn(WarnLevel level, char *format, va_list args);
 
 
#ifdef _WINGDI_
#ifdef _WINGDI_
/* stupidity in MSVC <wingdi.h> (in <windows.h> in <winsock.h>) */
/* stupidity in MSVC <wingdi.h> (in <windows.h> in <winsock.h>) */
# undef ERROR
# undef ERROR
#endif
#endif
 
 
#ifndef ERROR
#ifndef ERROR
# define ERROR_FORMAT "Error \"%s\" in %s at line %d\n"
# define ERROR_FORMAT "Error \"%s\" in %s at line %d\n"
# define ERROR(e) __rt_error(ERROR_FORMAT, (e), __FILE__, __LINE__)
# define ERROR(e) __rt_error(ERROR_FORMAT, (e), __FILE__, __LINE__)
#endif
#endif
 
 
#ifndef ASSERT
#ifndef ASSERT
# ifdef ASSERTIONS_ENABLED
# ifdef ASSERTIONS_ENABLED
#   define ASSERT(x, y) ((x) ? (void)(0) : ERROR((y)))
#   define ASSERT(x, y) ((x) ? (void)(0) : ERROR((y)))
# else
# else
#   define ASSERT(x, y) ((void)(0))
#   define ASSERT(x, y) ((void)(0))
# endif
# endif
#endif
#endif
 
 
#ifndef WARN
#ifndef WARN
# ifdef ASSERTIONS_ENABLED
# ifdef ASSERTIONS_ENABLED
#   define WARN_FORMAT "Warning \"%s\" in %s at line %d\n"
#   define WARN_FORMAT "Warning \"%s\" in %s at line %d\n"
#   define WARN(w) __rt_warning(WARN_FORMAT, (w), __FILE__, __LINE__)
#   define WARN(w) __rt_warning(WARN_FORMAT, (w), __FILE__, __LINE__)
# else
# else
#   define WARN(w) ((void)(0))
#   define WARN(w) ((void)(0))
# endif
# endif
#endif
#endif
 
 
 
 
#ifdef NO_INFO_MESSAGES
#ifdef NO_INFO_MESSAGES
# define __rt_info (void)
# define __rt_info (void)
# ifndef INFO
# ifndef INFO
#   define INFO(w)
#   define INFO(w)
# endif
# endif
#else
#else
# define __rt_info __rt_warning
# define __rt_info __rt_warning
# ifndef INFO
# ifndef INFO
#  ifdef DEBUG
#  ifdef DEBUG
#   define INFO(w) __rt_warning("%s\n", (w))
#   define INFO(w) __rt_warning("%s\n", (w))
#  else
#  else
#   define INFO(w) ((void)(0))
#   define INFO(w) ((void)(0))
#  endif
#  endif
# endif
# endif
#endif
#endif
 
 
 
 
#if defined(DEBUG) && !defined(NO_IDLE_CHITCHAT)
#if defined(DEBUG) && !defined(NO_IDLE_CHITCHAT)
# ifndef DO_TRACE
# ifndef DO_TRACE
#   define DO_TRACE (1)
#   define DO_TRACE (1)
# endif
# endif
#endif
#endif
 
 
#ifdef DO_TRACE
#ifdef DO_TRACE
extern void __rt_trace(char *format, ...);
extern void __rt_trace(char *format, ...);
#endif
#endif
 
 
#ifndef TRACE
#ifndef TRACE
# ifdef DO_TRACE
# ifdef DO_TRACE
#   define TRACE(w) __rt_trace("%s ", (w))
#   define TRACE(w) __rt_trace("%s ", (w))
# else
# else
#   define TRACE(w) ((void)(0))
#   define TRACE(w) ((void)(0))
# endif
# endif
#endif
#endif
 
 
#endif /* ndef angel_logging_h */
#endif /* ndef angel_logging_h */
 
 
/* EOF logging.h */
/* EOF logging.h */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.