aboutsummaryrefslogtreecommitdiff
path: root/gdb/rdi-share/logging.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2006-01-21 01:29:04 +0000
committerMark Mitchell <mark@codesourcery.com>2006-01-21 01:29:04 +0000
commitacab6ab29b26848dc49786d1b488961038bf99b4 (patch)
treeb7a323c58e413d5c3a770d7aaa72c8b939f712f0 /gdb/rdi-share/logging.c
parent4577207e6ff4ba9e63c121953361e4b2dd161298 (diff)
downloadgdb-acab6ab29b26848dc49786d1b488961038bf99b4.zip
gdb-acab6ab29b26848dc49786d1b488961038bf99b4.tar.gz
gdb-acab6ab29b26848dc49786d1b488961038bf99b4.tar.bz2
* Makefile.in (remote-rdi.o): Remove.
(rdi-share/libangsd.a): Likewise. * README: Don't mention remote-rdi.c. * NEWS: Mention removal of rdi-share. * configure.ac: Don't configure rdi-share subdirectory. * remote-rdi.c: Remove. * config/arm/embed.mt (TDEPFILES): Remove remote-rdi.o. (TDEPLIBS): Remove rdi-share/libangsd.a. * rdi-share/Makefile.am: Remove. * rdi-share/Makefile.in: Likewise. * rdi-share/README.CYGNUS: Likewise. * rdi-share/aclocal.m4: Likewise. * rdi-share/adp.h: Likewise. * rdi-share/adperr.h: Likewise. * rdi-share/angel.h: Likewise. * rdi-share/angel_bytesex.c: Likewise. * rdi-share/angel_bytesex.h: Likewise. * rdi-share/angel_endian.h: Likewise. * rdi-share/ardi.c: Likewise. * rdi-share/ardi.h: Likewise. * rdi-share/armdbg.h: Likewise. * rdi-share/buffers.h: Likewise. * rdi-share/chandefs.h: Likewise. * rdi-share/channels.h: Likewise. * rdi-share/chanpriv.h: Likewise. * rdi-share/configure: Likewise. * rdi-share/configure.in: Likewise. * rdi-share/crc.c: Likewise. * rdi-share/crc.h: Likewise. * rdi-share/dbg_conf.h: Likewise. * rdi-share/dbg_cp.h: Likewise. * rdi-share/dbg_hif.h: Likewise. * rdi-share/dbg_rdi.h: Likewise. * rdi-share/devclnt.h: Likewise. * rdi-share/devices.h: Likewise. * rdi-share/devsw.c: Likewise. * rdi-share/devsw.h: Likewise. * rdi-share/drivers.c: Likewise. * rdi-share/drivers.h: Likewise. * rdi-share/etherdrv.c: Likewise. * rdi-share/ethernet.h: Likewise. * rdi-share/host.h: Likewise. * rdi-share/hostchan.c: Likewise. * rdi-share/hostchan.h: Likewise. * rdi-share/hsys.c: Likewise. * rdi-share/hsys.h: Likewise. * rdi-share/logging.c: Likewise. * rdi-share/logging.h: Likewise. * rdi-share/msgbuild.c: Likewise. * rdi-share/msgbuild.h: Likewise. * rdi-share/params.c: Likewise. * rdi-share/params.h: Likewise. * rdi-share/rx.c: Likewise. * rdi-share/rxtx.h: Likewise. * rdi-share/serdrv.c: Likewise. * rdi-share/serpardr.c: Likewise. * rdi-share/sys.h: Likewise. * rdi-share/tx.c: Likewise. * rdi-share/unixcomm.c: Likewise. * rdi-share/unixcomm.h: Likewise.
Diffstat (limited to 'gdb/rdi-share/logging.c')
-rw-r--r--gdb/rdi-share/logging.c369
1 files changed, 0 insertions, 369 deletions
diff --git a/gdb/rdi-share/logging.c b/gdb/rdi-share/logging.c
deleted file mode 100644
index 79b70ef..0000000
--- a/gdb/rdi-share/logging.c
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- * Copyright (C) 1995 Advanced RISC Machines Limited. All rights reserved.
- *
- * This software may be freely used, copied, modified, and distributed
- * provided that the above copyright notice is preserved in all copies of the
- * software.
- */
-
-/* -*-C-*-
- *
- * $Revision$
- * $Date$
- *
- *
- * logging.c - methods for logging warnings, errors and trace info
- *
- */
-
-#include <stdarg.h> /* ANSI varargs support */
-
-#ifdef TARGET
-# include "angel.h"
-# include "devconf.h"
-#else
-# include "host.h"
-#endif
-
-#include "logging.h" /* Header file for this source code */
-
-#ifndef UNUSED
-# define UNUSED(x) ((x)=(x))
-#endif
-
-/*
- * __rt_warning
- * ------------
- * This routine is provided as a standard method of generating
- * run-time system warnings. The actual action taken by this code can
- * be board or target application specific, e.g. internal logging,
- * debug message, etc.
- */
-
-#ifdef DEBUG
-
-# ifdef DEBUG_METHOD
-
-# define STRINGIFY2(x) #x
-# define STRINGIFY(x) STRINGIFY2(x)
-# define DEBUG_METHOD_HEADER STRINGIFY(DEBUG_METHOD##.h)
-
-# include DEBUG_METHOD_HEADER
-
-# define METHOD_EXPAND_2(m, p, c) m##p(c)
-# define METHOD_EXPAND(m, p, c) METHOD_EXPAND_2(m, p, c)
-
-# define CHAROUT(c) METHOD_EXPAND(DEBUG_METHOD, _PutChar, (c))
-# define PRE_DEBUG(l) METHOD_EXPAND(DEBUG_METHOD, _PreWarn, (l))
-# define POST_DEBUG(n) METHOD_EXPAND(DEBUG_METHOD, _PostWarn, (n))
-
-# else
-# error Must define DEBUG_METHOD
-# endif
-
-#endif /* def DEBUG */
-
-/*
- * the guts of __rt_warning
- */
-
-#pragma no_check_stack
-#ifdef DEBUG
-
-static const char hextab[] = "0123456789ABCDEF";
-
-/*
- * If debugging, then we break va_warn into sub-functions which
- * allow us to get an easy breakpoint on the formatted string
- */
-static int va_warn0(char *format, va_list args)
-{
- int len = 0;
-
- while ((format != NULL) && (*format != '\0'))
- {
- if (*format == '%')
- {
- char fch = *(++format); /* get format character (skipping '%') */
- int ival; /* holder for integer arguments */
- char *string; /* holder for string arguments */
- int width = 0; /* No field width by default */
- int padzero = FALSE; /* By default we pad with spaces */
-
- /*
- * Check if the format has a width specified. NOTE: We do
- * not use the "isdigit" function here, since it will
- * require run-time support. The current ARM Ltd header
- * defines "isdigit" as a macro, that uses a fixed
- * character description table.
- */
- if ((fch >= '0') && (fch <= '9'))
- {
- if (fch == '0')
- {
- /* Leading zeroes padding */
- padzero = TRUE;
- fch = *(++format);
- }
-
- while ((fch >= '0') && (fch <= '9'))
- {
- width = ((width * 10) + (fch - '0'));
- fch = *(++format);
- }
- }
-
- if (fch == 'l')
- /* skip 'l' in "%lx", etc. */
- fch = *(++format);
-
- switch (fch)
- {
- case 'c':
- /* char */
- ival = va_arg(args, int);
- CHAROUT((char)ival);
- len++;
- break;
-
- case 'x':
- case 'X':
- {
- /* hexadecimal */
- unsigned int uval = va_arg(args, unsigned int);
- int loop;
-
- UNUSED(uval);
-
- if ((width == 0) || (width > 8))
- width = 8;
-
- for(loop = (width * 4); (loop != 0); loop -= 4)
- {
- CHAROUT(hextab[(uval >> (loop - 4)) & 0xF]);
- len++;
- }
- }
-
- break;
-
- case 'd':
- /* decimal */
- ival = va_arg(args, int);
-
- if (ival < 0)
- {
- ival = -ival;
- CHAROUT('-');
- len++;
- }
-
- if (ival == 0)
- {
- CHAROUT('0');
- len++;
- }
- else
- {
- /*
- * The simplest method of displaying numbers is
- * to provide a small recursive routine, that
- * nests until the most-significant digit is
- * reached, and then falls back out displaying
- * individual digits. However, we want to avoid
- * using recursive code within the lo-level
- * parts of Angel (to minimise the stack
- * usage). The following number conversion is a
- * non-recursive solution.
- */
- char buffer[16]; /* stack space used to hold number */
- int count = 0; /* pointer into buffer */
-
- /*
- * Place the conversion into the buffer in
- * reverse order:
- */
- while (ival != 0)
- {
- buffer[count++] = ('0' + ((unsigned int)ival % 10));
- ival = ((unsigned int)ival / 10);
- }
-
- /*
- * Check if we are placing the data in a
- * fixed width field:
- */
- if (width != 0)
- {
- width -= count;
-
- for (; (width != 0); width--)
- {
- CHAROUT(padzero ? '0': ' ');
- len++;
- }
- }
-
- /* then display the buffer in reverse order */
- for (; (count != 0); count--)
- {
- CHAROUT(buffer[count - 1]);
- len++;
- }
- }
-
- break;
-
- case 's':
- /* string */
- string = va_arg(args, char *);
-
- /* we only need this test once */
- if (string != NULL)
- /* whilst we check this for every character */
- while (*string)
- {
- CHAROUT(*string);
- len++;
- string++;
-
- /*
- * NOTE: We do not use "*string++" as the macro
- * parameter, since we do not know how many times
- *the parameter may be expanded within the macro.
- */
- }
-
- break;
-
- case '\0':
- /*
- * string terminated by '%' character, bodge things
- * to prepare for default "format++" below
- */
- format--;
-
- break;
-
- default:
- /* just display the character */
- CHAROUT(*format);
- len++;
-
- break;
- }
-
- format++; /* step over format character */
- }
- else
- {
- CHAROUT(*format);
- len++;
- format++;
- }
- }
- return len;
-}
-
-/*
- * this routine is simply here as a good breakpoint for dumping msg -
- * can be used by DEBUG_METHOD macros or functions, if required.
- */
-# ifdef DEBUG_NEED_VA_WARN1
-static void va_warn1(int len, char *msg)
-{
- UNUSED(len); UNUSED(msg);
-}
-# endif
-
-void va_warn(WarnLevel level, char *format, va_list args)
-{
- int len;
-
- if ( PRE_DEBUG( level ) )
- {
- len = va_warn0(format, args);
- POST_DEBUG( len );
- }
-}
-
-#else /* ndef DEBUG */
-
-void va_warn(WarnLevel level, char *format, va_list args)
-{
- UNUSED(level); UNUSED(format); UNUSED(args);
-}
-
-#endif /* ... else ndef(DEBUG) ... */
-#pragma check_stack
-
-#pragma no_check_stack
-void __rt_warning(char *format, ...)
-{
- va_list args;
-
- /*
- * For a multi-threaded system we should provide a lock at this point
- * to ensure that the warning messages are sequenced properly.
- */
-
- va_start(args, format);
- va_warn(WL_WARN, format, args);
- va_end(args);
-
- return;
-}
-#pragma check_stack
-
-#ifdef TARGET
-
-#pragma no_check_stack
-void __rt_uninterruptable_loop( void ); /* in suppasm.s */
-
-void __rt_error(char *format, ...)
-{
- va_list args;
-
- va_start(args, format);
-
- /* Display warning message */
- va_warn(WL_ERROR, format, args);
-
- __rt_uninterruptable_loop();
-
- va_end(args);
- return;
-}
-#pragma check_stack
-
-#endif /* def TARGET */
-
-#ifdef DO_TRACE
-
-static bool trace_on = FALSE; /* must be set true in debugger if req'd */
-
-#pragma no_check_stack
-void __rt_trace(char *format, ...)
-{
- va_list args;
-
- /*
- * For a multi-threaded system we should provide a lock at this point
- * to ensure that the warning messages are sequenced properly.
- */
-
- if (trace_on)
- {
- va_start(args, format);
- va_warn(WL_TRACE, format, args);
- va_end(args);
- }
-
- return;
-}
-#pragma check_stack
-
-#endif /* def DO_TRACE */
-
-
-/* EOF logging.c */