* jni.cc (_Jv_JNI_GetStringUTFChars): Pass length of string to
JvGetStringUTFRegion.
* java/lang/natPosixProcess.cc (new_string): Pass length of string
to JvGetStringUTFRegion.
* java/lang/natDouble.cc (parseDouble): Pass length of string to
JvGetStringUTFRegion.
* java/lang/natWin32Process.cc (startProcess): Pass length of
string to JvGetStringUTFRegion.
* java/lang/natClass.cc (forName): Pass length of string to
JvGetStringUTFRegion.
* gnu/gcj/runtime/natNameFinder.cc (getExternalLabel): Pass length
of string to JvGetStringUTFRegion.
* gnu/gcj/convert/natIconv.cc (init): Pass length of string to
JvGetStringUTFRegion.
* gnu/awt/gtk/natGtkLabelPeer.cc (setText): Pass length of string
to JvGetStringUTFRegion.
* gnu/awt/gtk/natGtkButtonPeer.cc (setLabel): Pass length of
string to JvGetStringUTFRegion.
From-SVN: r73571
* java/lang/reflect/Proxy.java (generate): Uncomment protection
domain code.
* java/lang/natClassLoader.cc (defineClass): Added `loader'
argument.
(linkClass0): Now in VMClassLoader.
(markClassErrorState0): Likewise.
(getSystemClassLoaderInternal): New method.
* java/lang/natClass.cc (initializeClass): Use
VMClassLoader::resolveClass.
* java/lang/ClassLoader.java: New version, from Classpath.
* java/lang/Class.java (getProtectionDomain):
protectionDomainPermission and unknownProtectionDomain now in
VMClassLoader.
* java/lang/Class.h: VMClassLoader now a friend class.
* gnu/gcj/runtime/VMClassLoader.java (instance): Now
package-private.
* gcj/javaprims.h: Regenerated class list.
* resolve.cc (_Jv_PrepareClass): Use VMClassLoader::resolveClass.
* java/lang/VMClassLoader.java: New version from Classpath;
modified for libgcj use.
From-SVN: r71765
* Makefile.in: Rebuilt.
* Makefile.am (ordinary_java_source_files): Added new files.
* java/lang/Class.h (_Jv_sharedlib_register_hook): Declare as
friend.
* java/net/URLClassLoader.java (findClass): Don't use
findURLResource. Use loader's getClass method.
(URLLoader.getClass): New method.
(addURL): Handle `gcjlib' URLs.
(SoURLLoader): New class.
(SoResource): Likewise.
* gnu/gcj/protocol/gcjlib/Connection.java: New file.
* gnu/gcj/protocol/gcjlib/Handler.java: New file.
* include/jvm.h (struct _Jv_core_chain): Moved from natCore.cc.
(_Jv_RegisterCoreHook): Declare.
(_Jv_FindCore): Declare.
* gnu/gcj/runtime/SharedLibHelper.java: New file.
* gnu/gcj/runtime/natSharedLibLoader.cc (CoreHookFunc): New
typedef.
(core_hook): New function.
(struct SharedLibDummy) [saved_core]: New field.
(init): Set _Jv_RegisterCoreHook. Throw exception on failure.
(register_hook): Set protection domain and class loader on new
class.
(finalize): Free core chain.
* gnu/gcj/Core.java (Core): New constructor.
* gnu/gcj/runtime/SharedLibLoader.java: Rewrote to use
SharedLibHelper.
* gnu/gcj/natCore.cc (_Jv_RegisterResource): Indentation fixlet.
(_Jv_create_core): New function.
(create): Use it.
(default_register_resource): New function.
(_Jv_RegisterCoreHook): New global.
(_Jv_RegisterResource): Use it.
(core_chain_struct): Removed.
(_Jv_FindCore): New function.
(_Jv_FreeCoreChain): New function.
From-SVN: r70892
2003-01-31 Andrew Haley <aph@redhat.com>
* except.c (prepare_eh_table_type): Use new encoding for exception
handlers when using -fno-assume-compiled.
2003-08-20 Andrew Haley <aph@redhat.com>
* gnu/gcj/runtime/StackTrace.java (getClass): New method.
* gnu/gcj/runtime/natStackTrace.cc (getClass): New method.
(classAt): Break out class lookup function into getClass().
* exception.cc (PERSONALITY_FUNCTION): Use new encoding for exception
handlers when using -fno-assume-compiled.
From-SVN: r70605
2003-07-20 Steve Pribyl <steve@netfuel.com.>
* gnu/gcj/runtime/natSharedLibLoader.cc (init): `libname' now a
String. Put dlerror() message into exception.
Include UnsatisfiedLinkError.
* gnu/gcj/runtime/SharedLibLoader.java (init): `libname' now a
String. Now native.
From-SVN: r69622
2003-03-10 2003-02-27 Mohan Embar <gnustuff@thisiscool.com>
* include/jvm.h: removed declaration of _Jv_ThisExecutable()
setter; made return value of getter const char* instead of char*
* prims.cc: removed all references to _Jv_ThisExecutable().
These are in the platform-specific sections now.
* posix.cc: define platform-specific _Jv_ThisExecutable().
Handle DISABLE_MAIN_ARGS and HAVE_PROC_SELF_EXE cases
* win32.cc: define platform-specific _Jv_ThisExecutable()
using GetModuleFilename()
* java/lang/natRuntime.cc: set gnu.gcj.progname property
to argv[0] instead of _Jv_ThisExecutable()
2003-03-10 Ranjit Mathew <rmathew@hotmail.com>
* gnu/gcj/runtime/NameFinder.java (usingAddr2name): New flag
that is set if we are using addr2name.awk instead of addr2line.
(NameFinder): Set usingAddr2name if using addr2name.awk.
(getExternalLabel): New native method to convert a method
name to an external label.
(lookup): Convert name given by addr2line to an external label
before demangling.
* gnu/gcj/runtime/natNameFinder.cc (LABEL_PREFIX): New string
constant representing the prefix attached to method names to
convert them to an external label.
(gnu::gcj::runtime::NameFinder::getExternalLabel): Define
using LABEL_PREFIX.
From-SVN: r64111
2002-02-13 Ranjit Mathew <rmathew@hotmail.com>
* gnu/gcj/runtime/NameFinder.java (createStackTraceElement): Use
lastIndexOf( ) instead of indexOf( ) to find the colon before
the line number, because Win32 file names might contain a
drive letter and a colon at the start of an absolute path.
From-SVN: r62834
* gnu/gcj/protocol/jar/Connection.java (getJarFile): download and
cache remote jar files.
* gnu/gcj/runtime/VMClassLoader.java: Don't construct jar URL, only
add File.separator to URL when it is a directory.
* java/lang/ClassLoader.java: Add Classpath javadoc.
(parent): final.
(getParent): Add (disabled) security check.
(findLibrary): New default method.
* java/net/JarURLConnection.java (getManifest): Implement.
(getInputStream): Only create InputStream when entry exists.
(getHeaders): Only use jarFileURLConnection or JarEntry to set length
when they exist.
* java/net/URLClassLoader.java: New/Rewritten version from Classpath.
From-SVN: r59949
2002-12-05 Andrew Haley <aph@redhat.com>
* gnu/gcj/runtime/natStackTrace.cc (fillInStackTrace): Throw
#ifdef (HAVE_BACKTRACE) around the whole function body.
From-SVN: r59855
2002-12-03 Andrew Haley <aph@redhat.com>
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Call
_Jv_PushClass.
(_Jv_InitNewClassFields): Set protectionDomain and chain = NULL.
(_Jv_PopClass): New.
(_Jv_PushClass): New.
* java/lang/natClass.cc (forName (jstring)): Use a StackTrace to
discover the ClassLoader of our caller.
(_Jv_CheckArrayStore): Don't check that a class is assignment
compatible with Object.
* java/lang/natVMTHrowable.cc: Delete.
* gnu/gcj/runtime/StackTrace.java: New, partly copied from
java.lang.VMThrowable.
(StackTrace(), StackTrace(int)): New constructors.
(classAt, methodAt, update, methodAtAddress): New methods.
(map): New field.
* java/lang/VMThrowable.java: Use StackTrace instead of
natVMTHrowable.
* java/lang/Class.h (getClassLoaderInternal): New.
(class Class): Be friendly with _Jv_PopClass and _Jv_PushClass.
Be friendly with gnu::gcj::runtime::StackTrace.
(Object.chain): New field.
* include/java-interp.h (class _Jv_InterpMethod): Be friendly with
gnu::gcj::runtime::StackTrace.
* gnu/gcj/runtime/natStackTrace.cc: New file.
* gnu/gcj/runtime/MethodRef.java: New file.
* prims.cc (_Jv_NewObjectArray): Use getClassLoaderInternal()
instead of getClassLoader().
* verify.cc (class _Jv_BytecodeVerifier): Likewise.
java::lang::VMThrowable.
* Makefile.am (core_java_source_files): Add MethodRef.java,
StackTrace.java.
(nat_source_files): Remove natVMThrowable.cc; add natStackTrace.cc.
* Makefile.in: Rebuild.
From-SVN: r59771
* gnu/gcj/runtime/NameFinder.java (remove_interpreter): New field.
(sanitizeStack): Correctly reset unknown and interpreter counters,
detect interpreter runtime frames.
(demangleInterpreterMethod): New method.
* gnu/gcj/runtime/natNameFinder.cc (lookupInterp): Use new method.
* java/lang/natVMThrowable.cc (fillInStackTrace): Change order of
filling in addrs[].
From-SVN: r56741
* include/jvm.h (struct _Jv_frame_info): New structure.
* gnu/gcj/runtime/natNameFinder.cc: Include StringBuffer.h,
java-interp.h.
(lookupInterp): New method.
(getAddrAsString): Use _Jv_frame_info.
(dladdrLookup): Likewise.
* gnu/gcj/runtime/NameFinder.java (lookup): Try to look up
interpreted frame.
(lookupInterp): Declare.
* java/lang/natVMThrowable.cc: Include Thread.h, java-interp.h.
(fillInStackTrace): Collect information on interpreted frames.
Use _Jv_frame_info.
* interpret.cc: Include Thread.h.
(run): Create and push _Jv_MethodChain object.
(_Jv_EndOfInterpreter): New global.
* java/lang/Thread.java (interp_frame): New field.
* include/java-interp.h (struct _Jv_MethodChain): New structure.
Include NameFinder.h.
From-SVN: r56657
* Makefile.am (libgcj_la_SOURCES): Remove name-finder.cc.
(core_java_source_files): Add VMThrowable.java and NameFinder.java
(nat_source_files): Remove natThrowable.cc, add natVMThrowable.cc
and natNameFinder.cc.
* Makefile.in: Regenerate.
* prims.cc: Use trace_enabled from VMThrowable.
* name-finder.cc: Removed.
* gcj/javaprims.h: Add class VMThrowable.
* gnu/gcj/runtime/NameFinder.java: New file.
* gnu/gcj/runtime/natNameFinder.cc: Likewise.
* include/name-finder.h: Removed.
* java/lang/Throwable.java (printStackTrace (PrintStream)): Use new
method stackTraceString().
(printStackTrace (PrintWriter)): Likewise.
(stackTraceString): Complete rewrite of old printStackTrace using
StringBuffer.
(stackTraceStringBuffer): New helper method for stackTraceString().
(fillInStackTrace): Delegate to VMTrowable.
(getStackTrace): Likewise.
(getStackTrace0): Removed.
(trace_enabled, stackTraceBytes): Moved to new VMThrowable.java.
(setStackTrace): Copy given array.
* java/lang/natThrowable.cc: Removed (replaced by natVMThrowable).
* java/lang/VMThrowable.java: New class.
* java/lang/natVMThrowable.cc: New file.
From-SVN: r56556
* include/jvm.h: Declare _Jv_RegisterResource.
* gnu/gcj/Core.java, gnu/gcj/natCore.cc,
gnu/gcj/protocol/core/Connection.java,
gnu/gcj/protocol/core/Handler.java,
gnu/gcj/protocol/core/CoreInputStream.java,
gnu/gcj/protocol/core/natCoreInputStream.cc: New files.
* java/net/URL.java (setURLStreamHandler): Use
gnu.gcj.protocol.core.Handler for the core protocol.
* gnu/gcj/runtime/VMClassLoader.java (init): Add "core:/" to the
end of java.class.path.
* Makefile.am (ordinary_java_source_files): Add new java files.
(nat_source_files): Add new native code files.
* Makefile.in: Rebuilt.
From-SVN: r45450
* Makefile.am: New friends for java/lang/Thread.h.
* prims.cc (runFirst): Removed.
(JvRunMain): Merged into _Jv_RunMain. Now just calls that.
(_Jv_RunMain): Now takes either a klass or class name parameter.
Create a gnu.gcj.runtime.FirstThread and attach the native thread
to that, then run it using _Jv_ThreadRun. Remove special handling of
jar files, instead pass is_jar parameter through to FirstThread.
* gcj/javaprims.h: Add prototypes for _Jv_ThreadRun and new variant
of _Jv_AttachCurrentThread.
* gnu/gcj/runtime/FirstThread.java (FirstThread): Now extends Thread.
(run): New method. Take care of looking up main class manifest
attribute and calling forName if neccessary. Then call call_main.
(call_main): New native method.
* gnu/gcj/runtime/natFirstThread.cc (call_main): New function, code
relocated from prims.cc. Look up and call main method.
* java/lang/Thread.java (run_): Removed.
* java/lang/natThread.cc (run_): Renamed to...
(_Jv_ThreadRun): this. JVMPI notification code moved to ...
(_Jv_NotifyThreadStart): here. New function.
(countStackFrames, destroy, resume, suspend, stop): Throw
UnsupportedOperationExceptions rather than JvFail'ing.
(_Jv_AttachCurrentThread): New variant takes a Thread argument.
Existing version wraps new variant.
From-SVN: r45182
* java/lang/natClass.cc (_Jv_CheckCast): add class names to exception
* gnu/gcj/runtime/FirstThread.java (main): replace / with . in jarMainClassName
From-SVN: r40604
2000-08-26 Anthony Green <green@redhat.com>
* Makefile.in: Rebuilt.
* Makefile.am (java/lang/ClassLoader.h): Make _Jv_RunMain a
friend.
* prims.cc: Include ClassLoader.h.
(_Jv_RunMain): When executing jar files, classpath must be the jar
file only. Lose our reference to the system ClassLoader in order
to get a new one with the correct classpath.
* java/lang/natSystem.cc (init_properties): When executing a jar
file, only use the jar file for java.class.path.
* gnu/gcj/runtime/VMClassLoader.java: Use the canonical file name
for bytecode archives.
* gnu/gcj/runtime/FirstThread.java: Handle case where manifest
exists, but not Main-Class.
From-SVN: r35999
* All files: Updated copyright information.
* COPYING: New file.
* COPYING.LIB: Removed.
* LIBGCJ_LICENSE: We now use GPL + special exception.
From-SVN: r32387