diff options
| author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-12-22 06:19:24 +0000 |
|---|---|---|
| committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-12-22 06:19:24 +0000 |
| commit | e0b22e777cefe4894586f4914f3517dfdf4a4e68 (patch) | |
| tree | 66855e76aba1a3329f80828763a2d88be59a8adb /libjava | |
| parent | f15e7e724dcf97a0c30d5d397bc807db3047a9e5 (diff) | |
| download | ppe42-gcc-e0b22e777cefe4894586f4914f3517dfdf4a4e68.tar.gz ppe42-gcc-e0b22e777cefe4894586f4914f3517dfdf4a4e68.zip | |
* java/lang/Throwable.java (trace_enabled): New static field.
* java/lang/natThrowable.cc (fillInStackTrace): Do nothing if
trace_enabled not set.
* prims.cc (main_init): Turn off trace_enabled while creating
default exception objects.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38442 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
| -rw-r--r-- | libjava/ChangeLog | 8 | ||||
| -rw-r--r-- | libjava/java/lang/Throwable.java | 2 | ||||
| -rw-r--r-- | libjava/java/lang/natThrowable.cc | 2 | ||||
| -rw-r--r-- | libjava/prims.cc | 6 |
4 files changed, 18 insertions, 0 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 34b917512eb..f7ce1f3f29d 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,11 @@ +2000-12-22 Bryce McKinlay <bryce@albatross.co.nz> + + * java/lang/Throwable.java (trace_enabled): New static field. + * java/lang/natThrowable.cc (fillInStackTrace): Do nothing if + trace_enabled not set. + * prims.cc (main_init): Turn off trace_enabled while creating + default exception objects. + 2000-12-21 Tom Tromey <tromey@redhat.com> * java/beans/PropertyChangeListener.java: Extends EventListener. diff --git a/libjava/java/lang/Throwable.java b/libjava/java/lang/Throwable.java index 610a499a2cb..4aa21399c5a 100644 --- a/libjava/java/lang/Throwable.java +++ b/libjava/java/lang/Throwable.java @@ -164,6 +164,8 @@ public class Throwable implements Serializable // Name of this field comes from serialization spec. private String detailMessage; + // Setting this flag to false prevents fillInStackTrace() from running. + static boolean trace_enabled = true; private transient byte stackTrace[]; private static final long serialVersionUID = -3042686055658047285L; } diff --git a/libjava/java/lang/natThrowable.cc b/libjava/java/lang/natThrowable.cc index c7f19bec09d..dab3ba6387a 100644 --- a/libjava/java/lang/natThrowable.cc +++ b/libjava/java/lang/natThrowable.cc @@ -50,6 +50,8 @@ extern "C" int __ia64_backtrace (void **array, int size); java::lang::Throwable * java::lang::Throwable::fillInStackTrace (void) { + if (! trace_enabled) + return this; #if defined (HAVE_BACKTRACE) || defined (__ia64__) void *p[128]; diff --git a/libjava/prims.cc b/libjava/prims.cc index c6b8d2030e1..06585749c5f 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -687,6 +687,10 @@ win32_exception_handler (LPEXCEPTION_POINTERS e) static void main_init () { + // Turn stack trace generation off while creating exception objects. + _Jv_InitClass (&java::lang::Throwable::class$); + java::lang::Throwable::trace_enabled = 0; + INIT_SEGV; #ifdef HANDLE_FPE INIT_FPE; @@ -697,6 +701,8 @@ main_init () no_memory = new java::lang::OutOfMemoryError; + java::lang::Throwable::trace_enabled = 1; + #ifdef USE_LTDL LTDL_SET_PRELOADED_SYMBOLS (); #endif |

