JNodeOS v1.1.5 API

edu.utah.janos.nodeos
Class Debug

java.lang.Object
  |
  +--edu.utah.janos.nodeos.Debug

public final class Debug
extends java.lang.Object

The package-internal debugging infrastructure.

The majority of routines in this file deal with printing directly to stdout/stderr through VM facilities. See the corresponding native layer for the details on where that output is directed.

Author:
Janos Ministry of Development

Constructor Summary
Debug()
           
 
Method Summary
static java.lang.String dbgPacketSummary(BufferHandle bufh)
          Get a string of the given Buffer.
static java.lang.String dbgPacketSummary(BufferHandle bufh, int len)
          Get a string of maxDump bytes from the given Buffer.
static java.lang.String dbgPacketSummary(BufferHandle bufh, int offset, int length)
          Get a string of a subsequence of the bytes in the given packet.
static java.lang.String dbgPacketSummary(edu.utah.janos.nodeos.pj_BufferHandle b)
           
static java.lang.String dbgPacketSummary(edu.utah.janos.nodeos.pj_BufferHandle b, int len)
           
static java.lang.String dbgPacketSummary(edu.utah.janos.nodeos.pj_BufferHandle b, int offset, int len)
           
static java.lang.InternalError doPanic(java.lang.String str)
          A generic panic() function.
static java.lang.InternalError fatalException(java.lang.Throwable t, java.lang.String msg)
           
static java.lang.InternalError notImplemented(java.lang.String expl)
          A "not-implemented print-and-die" function.
static void print(java.lang.String msg)
           
static void printInt(int i)
           
static void printIntHex(int i)
           
static void println(java.lang.String msg)
           
static void printLocation(java.lang.String file, int line)
          Print a file:line location.
static void printStackTrace()
          Print the stack trace to the current point of execution in the current thread.
static void pTrace(java.lang.String file, int line, java.lang.String msg)
          Print a trace message.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Debug

public Debug()
Method Detail

print

public static void print(java.lang.String msg)

println

public static void println(java.lang.String msg)

printInt

public static void printInt(int i)

printIntHex

public static void printIntHex(int i)

printLocation

public static void printLocation(java.lang.String file,
                                 int line)
Print a file:line location. Used for asserts and trace macros.

Trims the filename down to just the base file name...

Parameters:
file - a file name
line - a line number

pTrace

public static void pTrace(java.lang.String file,
                          int line,
                          java.lang.String msg)
Print a trace message.

XXX move this into Trace.Java

Parameters:
file - the name of the file the TRACE is in
line - the line number of the file the TRACE is in
msg - the trace message to print

dbgPacketSummary

public static java.lang.String dbgPacketSummary(BufferHandle bufh)
Get a string of the given Buffer.

dbgPacketSummary

public static java.lang.String dbgPacketSummary(BufferHandle bufh,
                                                int len)
Get a string of maxDump bytes from the given Buffer.

dbgPacketSummary

public static java.lang.String dbgPacketSummary(BufferHandle bufh,
                                                int offset,
                                                int length)
Get a string of a subsequence of the bytes in the given packet.

dbgPacketSummary

public static java.lang.String dbgPacketSummary(edu.utah.janos.nodeos.pj_BufferHandle b)

dbgPacketSummary

public static java.lang.String dbgPacketSummary(edu.utah.janos.nodeos.pj_BufferHandle b,
                                                int len)

dbgPacketSummary

public static java.lang.String dbgPacketSummary(edu.utah.janos.nodeos.pj_BufferHandle b,
                                                int offset,
                                                int len)

printStackTrace

public static void printStackTrace()
Print the stack trace to the current point of execution in the current thread.

fatalException

public static java.lang.InternalError fatalException(java.lang.Throwable t,
                                                     java.lang.String msg)

notImplemented

public static java.lang.InternalError notImplemented(java.lang.String expl)
A "not-implemented print-and-die" function. Prints the provided string and a backtrace before killing the VM.
Parameters:
expl - the explaination for this rude behavior.

doPanic

public static java.lang.InternalError doPanic(java.lang.String str)
A generic panic() function. Prints the provided string, a backtrace, and then kills the VM.

Whee! This returns an InternalError so that the caller might throw the result giving the compiler the impression that dPanic() will never return. Hehehe.

Parameters:
str - The panic message to use as an excuse for killing the machine.

JNodeOS v1.1.5 API

This documentation is Copyright (C) 1998-2001 The University of Utah. All Rights Reserved. See the file LICENSE for distribution terms.
Documentation, software, and mailing list archives for Janos can be found at the Janos Project: http://www.cs.utah.edu/flux/janos/