natThrowable.cc: New file.
2000-01-14 Andrew Haley <aph@cygnus.com> * java/lang/natThrowable.cc: New file. * java/lang/Throwable.java (fillInStackTrace): Make native. (printStackTrace): Call native method to do this. (Throwable): Call fillInStackTrace. (stackTrace): New variable. * include/jvm.h: Add _Jv_ThisExecutable functions. * prims.cc: (_Jv_execName): New variable. (catch_segv): Call fillInStackTrace. (catch_fpe): Ditto. (_Jv_ThisExecutable): New functions. (JvRunMain): Set the name of this executable. * Makefile.am: Add java/lang/natThrowable.cc. Add name-finder.cc. * Makefile.in: Rebuilt. * acconfig.h: Add HAVE_PROC_SELF_EXE. * configure.in: Force link with __frame_state_for in FORCELIBGCCSPEC. Add new checks for backtrace. * include/config.h.in: Rebuilt. * name-finder.cc: New file. * include/name-finder.h: New file. From-SVN: r31460
This commit is contained in:
parent
1353681247
commit
283a159fe3
13 changed files with 732 additions and 162 deletions
|
@ -12,6 +12,7 @@ package java.lang;
|
|||
import java.io.PrintStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Serializable;
|
||||
import java.io.OutputStreamWriter;
|
||||
|
||||
/**
|
||||
* @author Tom Tromey <tromey@cygnus.com>
|
||||
|
@ -26,55 +27,51 @@ import java.io.Serializable;
|
|||
|
||||
public class Throwable implements Serializable
|
||||
{
|
||||
public Throwable fillInStackTrace ()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
public native Throwable fillInStackTrace ();
|
||||
|
||||
public String getLocalizedMessage ()
|
||||
{
|
||||
return getMessage ();
|
||||
}
|
||||
{
|
||||
return getMessage ();
|
||||
}
|
||||
|
||||
public String getMessage ()
|
||||
{
|
||||
return detailMessage;
|
||||
}
|
||||
{
|
||||
return detailMessage;
|
||||
}
|
||||
|
||||
public void printStackTrace ()
|
||||
{
|
||||
printStackTrace (System.err);
|
||||
}
|
||||
|
||||
public void printStackTrace (PrintStream s)
|
||||
{
|
||||
// No stack trace, but we can still print this object.
|
||||
s.println(toString ());
|
||||
}
|
||||
|
||||
public void printStackTrace (PrintWriter wr)
|
||||
{
|
||||
// No stack trace, but we can still print this object.
|
||||
wr.println(toString ());
|
||||
}
|
||||
{
|
||||
printStackTrace (System.err);
|
||||
}
|
||||
|
||||
public void printStackTrace (PrintStream ps)
|
||||
{
|
||||
printStackTrace (new PrintWriter(new OutputStreamWriter(ps)));
|
||||
}
|
||||
|
||||
public native void printStackTrace (PrintWriter wr);
|
||||
|
||||
public Throwable ()
|
||||
{
|
||||
detailMessage = null;
|
||||
}
|
||||
{
|
||||
detailMessage = null;
|
||||
fillInStackTrace ();
|
||||
}
|
||||
|
||||
public Throwable (String message)
|
||||
{
|
||||
detailMessage = message;
|
||||
}
|
||||
{
|
||||
detailMessage = message;
|
||||
fillInStackTrace ();
|
||||
}
|
||||
|
||||
public String toString ()
|
||||
{
|
||||
return ((detailMessage == null)
|
||||
? getClass().getName()
|
||||
: getClass().getName() + ": " + getMessage ());
|
||||
}
|
||||
{
|
||||
return ((detailMessage == null)
|
||||
? getClass().getName()
|
||||
: getClass().getName() + ": " + getMessage ());
|
||||
}
|
||||
|
||||
// Name of this field comes from serialization spec.
|
||||
private String detailMessage;
|
||||
|
||||
private byte stackTrace[];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue