1 // natLogger.cc - Native part of Logger class.
3 /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
5 This Logger is part of libgcj.
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License. Please consult the Logger "LIBGCJ_LICENSE" for
16 #pragma implementation "Logger.h"
22 #include <java/lang/Object.h>
23 #include <java/lang/Class.h>
24 #include <java/util/logging/Logger.h>
25 #include <java/lang/StackTraceElement.h>
26 #include <java/lang/ArrayIndexOutOfBoundsException.h>
28 java::lang::StackTraceElement*
29 java::util::logging::Logger::getCallerStackFrame ()
31 gnu::gcj::runtime::StackTrace *t
32 = new gnu::gcj::runtime::StackTrace(4);
33 java::lang::Class *klass = NULL;
37 // skip until this class
38 while ((klass = t->classAt (i)) != getClass())
40 // skip the stackentries of this class
41 while ((klass = t->classAt (i)) == getClass() || klass == NULL)
44 catch (::java::lang::ArrayIndexOutOfBoundsException *e)
46 // FIXME: RuntimeError
49 java::lang::StackTraceElement *e
50 = new java::lang::StackTraceElement
51 (JvNewStringUTF (""), 0,
52 klass->getName(), t->methodAt(i), false);