Commit Graph

62 Commits

Author SHA1 Message Date
Tom Tromey f4a2a1deec sources.am, [...]: Rebuilt.
* sources.am, Makefile.in: Rebuilt.
	* scripts/makemake.tcl (emit_package_rule): Don't omit
	VMProcess.java.
	* Makefile.am (nat_source_files): Added natVMProcess.cc.
	(inner_nat_headers): Added ImmediateEOFInputStream.h.
	* gcj/javaprims.h: Regenerated.
	* java/lang/System.java (EnvironmentMap): Now package-private.
	(EnvironmentMap(Map)): New constructor.
	(EnvironmentMap.put): New method.
	* java/lang/natWin32Process.cc (startProcess): Update.
	* java/lang/Win32Process.java (Win32Process): Added 'redirect'
	argument.
	(startProcess): Likewise.
	* java/lang/EcosProcess.java (EcosProcess): Added 'redirect'
	argument.
	* java/lang/natPosixProcess.cc (nativeSpawn): Handle redirection.
	* java/lang/PosixProcess.java (redirect): New field.
	(PosixProcess): Added 'redirect' argument.
	* java/lang/natRuntime.cc (execInternal): Added 'redirect'
	argument to Process creation.
	* java/lang/natVMProcess.cc: New file.
	* java/lang/ProcessBuilder.java: Removed.
	* java/lang/VMProcess.java: New file.

From-SVN: r122553
2007-03-05 15:57:13 +00:00
Tom Tromey 262fa8a4b5 re PR java/29812 (env->klass value is not updated during the native calls)
PR java/29812:
	* testsuite/libjava.jni/pr29812.java: New file.
	* testsuite/libjava.jni/pr29812_injar.java: New file.
	* testsuite/libjava.jni/pr29812_injar.jar: New file.
	* testsuite/libjava.jni/pr29812.out: New file.
	* testsuite/libjava.jni/pr29812_injar.c: New file.
	* testsuite/libjava.jni/pr29812_injar.h: New file.
	* testsuite/libjava.jni/pr29812.jar: New file.
	* testsuite/libjava.jni/pr29812.c: New file.
	* testsuite/libjava.jni/pr29812.h: New file.
	* testsuite/libjava.jni/jni.exp (gcj_jni_get_cxxflags_invocation):
	New proc.
	(gcj_jni_invocation_test_one): Use it.
	(gcj_jni_pr29812): New proc.
	(gcj_jni_run): Use it.
	* java/lang/natRuntime.cc (_load): Push a new system frame before
	calling JNI_OnLoad.
	* include/jvm.h (_Jv_JNI_PopSystemFrame): Declare.
	(_Jv_GetJNIEnvNewFrameWithLoader): Likewise.
	* jni.cc (struct _Jv_JNI_LocalFrame) <marker>: Now unsigned char.
	<allocated_p>: Now bool.
	<loader>: New field.
	(_Jv_JNI_EnsureLocalCapacity): Updated.
	(_Jv_JNI_NewLocalRef): Likewise.
	(_Jv_JNI_NewLocalRef): Likewise.
	(_Jv_JNI_PopLocalFrame): Likewise.
	(_Jv_JNI_FindClass): Likewise.
	(_Jv_GetJNIEnvNewFrame): Likewise.
	(_Jv_JNI_AttachCurrentThread): Likewise.
	(_Jv_GetJNIEnvNewFrameWithLoader): New function.
	(_Jv_GetJNIEnvNewFrame): Use it.
	* include/jni_md.h (_CLASSPATH_JNIENV_CONTENTS): Removed 'klass'.

From-SVN: r121064
2007-01-22 23:04:16 +00:00
Tom Tromey 97b8365caf Merged gcj-eclipse branch to trunk.
From-SVN: r120621
2007-01-09 19:58:05 +00:00
Tom Tromey 1058a848dc natThread.cc (finish_): Don't clear 'group'.
* java/lang/natThread.cc (finish_): Don't clear 'group'.
	* sources.am, Makefile.in: Rebuilt.
	* java/lang/Runtime.java (exit): Merged with Classpath.
	(runShutdownHooks): New method from Classpath.
	* java/io/File.java (deleteOnExit): Use DeleteFileHelper, not
	FileDeleter.
	* gnu/gcj/runtime/FileDeleter.java: Removed.
	* java/lang/natRuntime.cc (runFinalizationForExit): New method.
	(exitInternal): Don't run finalizers or delete files.

From-SVN: r109400
2006-01-06 01:03:45 +00:00
Thomas Fitzsimmons 9ff284256a re PR libgcj/23761 (java.library.path doesn't affect module loading path)
2005-09-08  Thomas Fitzsimmons  <fitzsim@redhat.com>

	PR libgcj/23761
	* include/java-props.h (_Jv_Module_Load_Path): Declare variable.
	* java/lang/natRuntime.cc (init): Call lt_dlsetsearchpath after
	lt_dlinit.
	* gnu/classpath/natSystemProperties.cc (_Jv_Module_Load_Path):
	Define variable.
	(_Jv_SetDLLSearchPath): Do not call lt_dlsetsearchpath.  Set
	_Jv_Module_Load_Path.

From-SVN: r104044
2005-09-08 21:26:25 +00:00
Michael Koch ee141b8822 [multiple changes]
2005-04-25  Archie Cobbs  <archie@dellroad.org>

	* java/lang/Throwable.java: simplify initializing cause in constructor

2005-04-25  Michael Koch  <konqueror@gmx.de>

	* gnu/classpath/SystemProperties.java: New file.
	* gnu/classpath/natSystemProperties.cc: New file.
	* java/lang/Runtime.java
	(defaultProperties): Removed.
	(static): Likewise.
	(): Made thrown exceptions more verbose.
	(insertSystemProperties): Removed.
	* java/lang/System.java
	(static): Likewise.
	(properties): Likewise.
	(setSecurityManager): Reordered modifiers.
	(getenv): Improved javadoc.
	(): Likewise.
	(isWordsBigEndian): Removed.
	* java/lang/natRuntime.cc
	(_Jv_SetDLLSearchPath): Likewise.
	(file_encoding): Likewise.
	(default_file_encoding): Likewise.
	(getpwuid_adaptor): Likewise.
	(insertSystemProperties): Likewise.
	* java/lang/natSystem.cc
	(isWordsBigEndian): Likewise.
	* Makefile.am
	(ordinary_java_source_files):
	Added gnu/classpath/SystemProperties.java.
	(nat_source_files): Added gnu/classpath/natSystemProperties.cc.
	* Makefile.in: Regenerated.

From-SVN: r98734
2005-04-25 19:48:35 +00:00
Mark Wielaard 8a5691f87d natRuntime.cc (insertSystemProperties): Set java.class.path to CLASSPATH only when not empty.
* java/lang/natRuntime.cc (insertSystemProperties): Set
       java.class.path to CLASSPATH only when not empty. Fall back to
       default path "." when java.class.path is empty.

From-SVN: r98394
2005-04-19 09:29:16 +00:00
Mark Wielaard f5e002ce85 natRuntime.cc (insertSystemProperties): Set java.class.path to CLASSPATH if not already set.
* java/lang/natRuntime.cc (insertSystemProperties): Set
       java.class.path to CLASSPATH if not already set.

From-SVN: r98099
2005-04-13 16:46:47 +00:00
Thomas Fitzsimmons c33b7bf04a re PR libgcj/20750 (libgcj needs a --with-java-home configure option)
2005-04-05  Thomas Fitzsimmons  <fitzsim@redhat.com>

	* doc/install.texi (Configuration): Document --with-java-home.

2005-04-05  Thomas Fitzsimmons  <fitzsim@redhat.com>

	PR libgcj/20750
	* Makefile.am (AM_CXXFLAGS): Define JAVA_HOME.
	* Makefile.in: Regenerate.
	* configure.ac: Add --with-java-home option.
	* configure: Regenerate.
	* external/Makefile.in: Regenerate.
	* external/sax/Makefile.in: Regenerate.
	* external/w3c_dom/Makefile.in: Regenerate.
	* gcj/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* java/lang/natRuntime.cc (insertSystemProperties): Set java.home
	to JAVA_HOME macro.

From-SVN: r97671
2005-04-05 23:46:09 +00:00
Thomas Fitzsimmons b6121641fc re PR libgcj/20090 (gij should be implemented in Java)
2005-04-01  Thomas Fitzsimmons  <fitzsim@redhat.com>

	* gcj.texi (Invoking gij): Add descriptions of new -X options.
	Mention recognized-and-ignored compatibility options.
	(Memory allocation): Add descriptions of JvMalloc, JvRealloc and
	JvFree.
	(About CNI): Add Memory allocation section.

2005-04-01  Thomas Fitzsimmons  <fitzsim@redhat.com>

	PR libgcj/20090, PR libgcj/20526
	* gij.cc (nonstandard_opts_help): New function.
	(add_option): New function.
	(main): Support java options.  Set java.class.path.  Don't set
	_Jv_Jar_Class_Path.
	* prims.cc (parse_x_arg): New function.
	(parse_init_args): Call parse_x_arg for -X and _ options, when
	ignoreUnrecognized is true.
	(new _Jv_RunMain): New vm_args variant.
	(old _Jv_RunMain): Call new vm_args _Jv_RunMain.
	(_Jv_Jar_Class_Path): Remove variable.
	* include/java-props.h: Likewise.
	* include/cni.h (JvRealloc): New function.
	* include/jvm.h (_Jv_RunMain): Declare vm_args variant.
	* java/lang/natRuntime.cc (insertSystemProperties): Remove
	_Jv_Jar_Class_Path logic.  Use JV_VERSION and JV_API_VERSION
	macros.
	* configure.ac (JV_VERSION): Define.
	(JV_API_VERSION): Likewise.
	* configure: Regenerate.
	* include/config.h.in: Regenerate.

From-SVN: r97429
2005-04-02 02:26:51 +00:00
Tom Tromey dc0a6205e6 natRuntime.cc (insertSystemProperties): Set gnu.gcj.runtime.endorsed.dirs.
libjava:
	* java/lang/natRuntime.cc (insertSystemProperties): Set
	gnu.gcj.runtime.endorsed.dirs.
	* Makefile.in: Rebuilt.
	* Makefile.am (ordinary_java_source_files): Added
	HelperClassLoader.java.
	(AM_CXXFLAGS): Define GCJ_ENDORSED_DIRS.
	* gnu/gcj/runtime/VMClassLoader.java (VMClassLoader): Extends
	HelperClassLoader.
	(init): Use addDirectoriesFromProperty.
	* gnu/gcj/runtime/BootClassLoader.java (BootClassLoader): Extends
	HelperClassLoader.  Use addDirectoriesFromProperty.  Handle
	gnu.gcj.runtime.endorsed.dirs.
	* gnu/gcj/runtime/HelperClassLoader.java: New file.
gcc/java:
	* gcj.texi (libgcj Runtime Properties): Document
	gnu.gcj.runtime.endorsed.dirs.

From-SVN: r97207
2005-03-29 21:47:03 +00:00
Tom Tromey 558b8548b4 Main.java (main): Handle '-p'.
libjava:
	* gnu/gcj/tools/gcj_dbtool/Main.java (main): Handle '-p'.
	(usage): Document '-p'.
	* Makefile.in: Rebuilt.
	* Makefile.am (dbexecdir): New variable.
	(db_name): Likewise.
	(dbexec_DATA): Likewise.
	($(db_name)): New target.
	(AM_CXXFLAGS): Define LIBGCJ_DEFAULT_DATABASE.
	* java/lang/natRuntime.cc (insertSystemProperties): Set default
	system database.
gcc/java:
	* gcj.texi (Invoking gcj-dbtool): Document 'gcj-dbtool -p'.
	(libgcj Runtime Properties): Document the default .db.

From-SVN: r96303
2005-03-11 17:35:37 +00:00
Bryce McKinlay c0cbd60130 exception.cc: Remove stray MethodRef.h include.
2005-03-10  Bryce McKinlay  <mckinlay@redhat.com>

        * exception.cc: Remove stray MethodRef.h include.
        * java/lang/natClass.cc: Likewise.
        * gnu/gcj/runtime/MethodRef.java: Removed.
        * gnu/gcj/runtime/StackTrace.java, gnu/gcj/runtime/natNameFinder.cc,
        gnu/gcj/runtime/natStackTrace.cc: Really removed.
        * java/lang/natRuntime.cc (_load): Remove unsed variable.
        * Makefile.am (ordinary_java_source_files): Remove MethodRef.java.
        * Makefile.in: Rebuilt.

From-SVN: r96288
2005-03-11 04:30:20 +00:00
Bryce McKinlay 18744d9b72 New Stack Trace infrastructure.
2005-03-10  Bryce McKinlay  <mckinlay@redhat.com>

	New Stack Trace infrastructure.
	* Makefile.am (libgcj0_convenience_la_SOURCES): Add stacktrace.cc.
	(gnu/gcj/runtime/StackTrace.lo): Removed.
	(ordinary_java_source_files): Remove obsolete files.
	(nat_source_files): Remove obsolete files. Add natVMThrowable.cc.
	* configure.host (fallback_backtrace_h): Set backtrace header
	for mingw and cygwin targets.
	* configure.ac: Make symlink for fallback backtrace headers.
	* Makefile.in, configure: Rebuilt.
	* defineclass.cc (_Jv_ClassReader::read_one_code_attribute):
	Read 'LineNumberTable' attribute.
	(_Jv_ClassReader::read_one_class_attribute): Read 'SourceFile'
	attribute.
	(_Jv_ClassReader::handleCodeAttribute): Initialize method line
	table fields.
	* exception.cc: Remove unused include.
	* interpret.cc (DIRECT_THREADED, insn_slot): Moved to java-interp.h.
	(SAVE_PC): New macro. Save current PC in the interpreter frame.
	(NULLCHECK, NULLARRAYCHECK): Use SAVE_PC.
	(_Jv_InterpMethod::compile): Translate bytecode PC values in the line
	table to direct threaded instruction values.
	(_Jv_StartOfInterpreter, _Jv_EndOfInterpreter): Removed.
	(_Jv_InterpMethod::run): No longer member function. All
	callers updated. Remove _Unwind calls. Call SAVE_PC whenever a call
	is made or where an instruction could throw.
	(_Jv_InterpMethod::get_source_line): New. Look up source line numbers
	in line_table.
	* prims.cc (catch_segv): Construct exception after MAKE_THROW_FRAME.
	(catch_fpe): Likewise.
	* stacktrace.cc: New file. Stack trace code now here.
	* gnu/gcj/runtime/MethodRef.java:
	* gnu/gcj/runtime/NameFinder.java: Mostly reimplemented. Now simply
	calls addr2line to look up PC addresses in a given binary or shared
	library.
	* gnu/gcj/runtime/StackTrace.java, gnu/gcj/runtime/natNameFinder.cc,
	gnu/gcj/runtime/natStackTrace.cc: Removed.
	* gnu/java/lang/MainThread.java (call_main): Add comment warning that
	this function name is specially recognised by the stack trace code
	and shouldn't be changed.
	* include/java-interp.h (DIRECT_THREADED, insn_slot): Moved here.
	(struct  _Jv_LineTableEntry, line_table, line_table_len): New.
	(_Jv_InterpMethod::run): Update declaration.
	(_Jv_StackTrace_): New friend. NameFinder and StackTrace no longer
	friends.
	(_Jv_InterpFrame): Renamed from _Jv_MethodChain. Add PC field.
	* include/java-stack.h: New file. Declarations for stack tracing.
	* include/jvm.h (_Jv_Frame_info): Removed.
	* java/lang/Class.h: Update friend declarations.
	* java/lang/VMClassLoader.java (getSystemClassLoader): Simplify
	exception message.
	* java/lang/VMThrowable.java (fillInStackTrace): Now native.
	(getStackTrace): Now native.
	(data): New RawDataManaged field.
	* java/lang/natClass.cc: Update includes.
	(forName): Use _Jv_StackTrace::GetCallingClass for
	calling-classloader check.
	(getClassLoader): Likewise.
	* java/lang/natRuntime.cc: Update includes.
	(_load): Use _Jv_StackTrace::GetFirstNonSystemClassLoader.
	* java/lang/natVMSecurityManager.cc: Update includes.
	(getClassContext): Use _Jv_StackTrace::GetClassContext.
	* java/lang/natVMThrowable.cc: New file. Native methods for
	VMThrowable.
	* java/lang/reflect/natArray.cc: Update includes.
	(newInstance): Use _Jv_StackTrace::GetCallingClass to implement
	accessibility check.
	* java/lang/reflect/natConstructor.cc: Update includes.
	(newInstance): Use _Jv_StackTrace::GetCallingClass to implement
	accessibility check.
	* java/lang/reflect/natField.cc: Update includes.
	(getAddr): Use _Jv_StackTrace::GetCallingClass to implement
	accessibility check.
	* java/lang/reflect/natMethod.cc: Update includes.
	(invoke): Use _Jv_StackTrace::GetCallingClass to implement
	accessibility check.
	* java/util/natResourceBundle.cc: Update includes.
	(getCallingClassLoader): Use _Jv_StackTrace::GetCallingClass.
	* java/util/logging/natLogger.cc: Update includes. Use
	_Jv_StackTrace::GetCallerInfo to get call-site info.
	* sysdep/generic/backtrace.h: Fallback backtrace code. Stub
	implementation.
	* sysdep/i386/backtrace.h: New. Fallback backtrace code. i386
	implementation.

From-SVN: r96253
2005-03-10 19:02:21 +00:00
Tom Tromey b7a29fa9f2 natVMClassLoader.cc (defineClass): Reference 'systemClassLoader' field directly.
* java/lang/natVMClassLoader.cc (defineClass): Reference
	'systemClassLoader' field directly.
	* java/lang/natRuntime.cc (_load): Reference 'systemClassLoader'
	field directly.
	* java/lang/natClassLoader.cc (_Jv_RegisterInitiatingLoader):
	Reference 'systemClassLoader' field directly.
	(_Jv_UnregisterInitiatingLoader): Likewise.
	(_Jv_FindClass): Likewise.

From-SVN: r96208
2005-03-09 20:58:17 +00:00
Thomas Fitzsimmons bc71e4a22b re PR libgcj/16923 (-D* Options passed to JNI_CreateJavaVM are ignored)
2005-02-23  Thomas Fitzsimmons  <fitzsim@redhat.com>

	PR libgcj/16923
	* gcj.texi (Invocation): Add descriptions of JvVMInitArgs and
	JvVMOption.

2005-02-23  Thomas Fitzsimmons  <fitzsim@redhat.com>

	PR libgcj/16923
	* jni.cc (JNI_CreateJavaVM): Check JNI version.  Cast args to
	JvVMInitArgs.  Pass args to _Jv_CreateJavaVM and check return
	value.  Move argument parsing code to prims.cc.
	* prims.cc (no_properties): Remove.
	(_Jv_Compiler_Properties): Initialize to NULL.
	(_Jv_Properties_Count): Initialize to 0.
	(parse_verbose_args): New function.
	(parse_init_args): New function.
	(_Jv_CreateJavaVM): Call parse_init_args.
	(_Jv_RunMain): Check return value of _Jv_CreateJavaVM.
	* gcj/cni.h (JvVMOption): New struct.
	(JvVMInitArgs): Likewise.
	(JvCreateJavaVM): Declare vm_args as JvVMInitArgs* rather than
	void*.
	* libjava/gcj/javaprims.h (_Jv_VMOption): New struct.
	(_Jv_VMInitArgs): Likewise.
	* include/java-props.h (_Jv_Properties_Count): Declare.
	* java/lang/natRuntime.cc (insertSystemProperties): Use
	_Jv_Properties_Count in for loop exit condition.
	* testsuite/libjava.jni/jni.exp
	(gcj_invocation_compile_c_to_binary): New procedure.
	(gcj_invocation_test_one): Likewise.
	(gcj_jni_run): Run JNI invocation API tests.
	* testsuite/libjava.jni/invocation/PR16923.c,
	testsuite/libjava.jni/invocation/PR16923.java,
	testsuite/libjava.jni/invocation/PR16923.out: New test.

From-SVN: r95459
2005-02-23 17:36:26 +00:00
Anthony Green 95432490db natRuntime.cc (insertSystemProperties): Normalize x86 architecture names to "i386" for compatibility reasons.
2005-02-18  Anthony Green  <green@redhat.com>

        * java/lang/natRuntime.cc (insertSystemProperties): Normalize x86
        architecture names to "i386" for compatibility reasons.  Win32
        still uses "x86".

From-SVN: r95243
2005-02-18 23:29:44 +00:00
Tom Tromey b59c0c440c natRuntime.cc (insertSystemProperties): Set sun.boot.class.path earlier.
* java/lang/natRuntime.cc (insertSystemProperties): Set
	sun.boot.class.path earlier.

From-SVN: r94740
2005-02-08 17:44:13 +00:00
Tom Tromey 7385c78009 natRuntime.cc (insertSystemProperties): Set java.ext.dirs earlier.
* java/lang/natRuntime.cc (insertSystemProperties): Set
	java.ext.dirs earlier.

From-SVN: r92964
2005-01-05 18:55:27 +00:00
Tom Tromey 367390404d * Merged gcj-abi-2-dev-branch to trunk.
(Actual changes too large to list in the commit message;
see ChangeLog.)

From-SVN: r91270
2004-11-25 03:47:08 +00:00
Anthony Green a6845d137a Fix typo in last commit.
From-SVN: r82037
2004-05-19 21:49:40 +00:00
Anthony Green 0f22079ec2 Makefile.am: Define JAVA_EXT_DIRS.
2004-05-19  Anthony Green  <green@redhat.com>

	* Makefile.am: Define JAVA_EXT_DIRS.
	* Makefile.in: Rebuilt.
	* java/lang/natRuntime.cc (insertSystemProperties): Set
	java.ext.dirs property.

From-SVN: r82034
2004-05-19 19:31:42 +00:00
Michael Koch 9e129d901c re PR libgcj/13056 (import new libltdl)
2003-12-16  Michael Koch  <konqueror@gmx.de>

	Fix for PR libgcj/13056.
	* libltdl/configure.in,
	libltdl/config.h.in: Removed.
	* libltdl/configure.ac,
	libltdl/config-h.in,
	libltdl/install-sh,
	libltdl/config.guess,
	libltdl/config.sub,
	libltdl/missing,
	libltdl/mkinstalldirs,
	libltdl/ltmain.sh: New files.
	* libltdl/Makefile.am,
	libltdl/acinclude.m4,
	libltdl/aclocal.m4,
	libltdl/ltdl.c,
	libltdl/ltdl.h,
	libltdl/README: Update to versions from libtool 1.5.
	libltdl/configure,
	* libltdl/Makefile.in: Regenerated.
	* java/lang/natRuntime.cc (find_symbol):
	Use type 'lt_ptr' instead of 'lt_ptr_t'.

From-SVN: r74711
2003-12-16 21:48:25 +00:00
Andrew Haley fcbe85cdfe [multiple changes]
2003-08-08  Andrew Haley  <aph@redhat.com>

        * Makefile.am (AM_CXXFLAGS): Define BOOT_CLASS_PATH.
        * Makefile.in: Rebuild.
        * java/lang/natRuntime.cc (insertSystemProperties): Add
        "sun.boot.class.path".

2003-08-07  Andrew Haley  <aph@redhat.com>

        * java/io/PrintStream.java: Don't crash on a null string.

From-SVN: r70250
2003-08-08 16:26:00 +00:00
Mark Wielaard 337ecadfd0 + * java/lang/natRuntime.cc (_load): Add library name to
+       UnsatisfiedLinkError when thrown.

From-SVN: r69786
2003-07-25 13:04:15 +00:00
Mohan Embar c4519773ca jvm.h: (_Jv_GetNbArgs) added (_Jv_GetSafeArg) added (_Jv_SetArgs) added
2003-03-29  Mohan Embar  <gnustuff@thisiscool.com>

        * include/jvm.h: (_Jv_GetNbArgs) added
        (_Jv_GetSafeArg) added
        (_Jv_SetArgs) added
        * prims.cc: (_Jv_GetNbArgs) implemented
        (_Jv_GetSafeArg) implemented
        (_Jv_SetArgs) implemented
        (_Jv_RunMain) use _Jv_SetArgs() instead of explicitly
        setting _Jv_argc and _Jv_argv
        * posix.cc: (_Jv_ThisExecutable) use _Jv_GetSafeArg()
        instead of _Jv_argv
        * java/lang/natRuntime.cc: (insertSystemProperties) use
        _Jv_GetSafeArg() instead of _Jv_argv

From-SVN: r66067
2003-04-25 16:48:13 +00:00
Tom Tromey 1c81e34352 natRuntime.cc (insertSystemProperties): Set gnu.classpath.home.url.
* java/lang/natRuntime.cc (insertSystemProperties): Set
	gnu.classpath.home.url.
	* Makefile.in: Rebuilt.
	* Makefile.am: Define LIBDIR.

From-SVN: r64905
2003-03-26 22:31:52 +00:00
Tom Tromey 2b7f1f8f41 resolve.cc (ncode): Use _Jv_platform_ffi_abi.
* resolve.cc (ncode): Use _Jv_platform_ffi_abi.
	Include platform.h.
	* java/lang/natRuntime.cc (insertSystemProperties): Use
	_Jv_platform_path_separator.
	(nativeGetLibname): Use _Jv_platform_file_separator.
	(_load): Use _Jv_platform_onload_names.
	(onload_names): New global.
	* include/win32.h (_Jv_platform_file_separator): New define.
	(_Jv_platform_path_separator): Likewise.
	(_Jv_platform_onload_names): Likewise.
	(_Jv_platform_ffi_abi): Likewise.
	* include/posix.h (_Jv_platform_file_separator): New define.
	(_Jv_platform_path_separator): Likewise.
	(_Jv_platform_onload_names): Likewise.
	(_Jv_platform_ffi_abi): Likewise.

From-SVN: r64461
2003-03-17 00:45:37 +00:00
Andrew Haley c068c63834 [multiple changes]
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
2003-03-10 19:45:30 +00:00
Tom Tromey 804b2c48ea natRuntime.cc (libraries_size, [...]): Removed.
* java/lang/natRuntime.cc (libraries_size, libraries_count,
	libraries): Removed.
	(add_library): Removed.
	(_load): Don't call add_library.
	(loadLibraryInternal): Likewise.
	(init): Likewise.
	(lookup_data): New struct.
	(find_symbol): New function.
	(_Jv_FindSymbolInExecutable): Use it.

From-SVN: r63348
2003-02-24 00:53:21 +00:00
Rainer Orth a191802c42 natStackTrace.cc: Include platform.h immediately after config.h.
* gnu/gcj/runtime/natStackTrace.cc: Include platform.h immediately
	after config.h.  Use <> for consistency.
	* java/lang/natObject.cc: Likewise.
	* java/lang/natRuntime.cc: Likewise.
	* java/lang/natSystem.cc: Likewise.
	* java/util/natTimeZone.cc: Likewise.
	* win32.cc: Likewise.
	* include/posix.h (fcntl, socket, connect, close, bind, accept,
	listen, write, read): Undef to avoid interference from OS macros.

From-SVN: r63122
2003-02-19 16:28:37 +00:00
Ranjit Mathew d074ed7c01 natRuntime.cc (java::lang::Runtime::_load)): Take care of the fact that on Win32...
2003-02-03  Ranjit Mathew <rmathew@hotmail.com>

	* java/lang/natRuntime.cc (java::lang::Runtime::_load)): Take care
	of the fact that on Win32, JNI_OnLoad is an "stdcall" function and
	could also have been exported as "JNI_OnLoad@8" (MinGW) or
	"_JNI_OnLoad@8" (MSVC).

From-SVN: r62348
2003-02-03 21:23:59 +00:00
Andrew Haley 4cf0d20fce natRuntime.cc (_load): StackTrace access needs to be in a try block.
2003-01-14  Andrew Haley  <aph@redhat.com>

        * java/lang/natRuntime.cc (_load): StackTrace access needs to be
        in a try block.

From-SVN: r61293
2003-01-14 19:26:21 +00:00
Tom Tromey 78bb0444d2 win32.h (_Jv_platform_solib_prefix): New define.
* include/win32.h (_Jv_platform_solib_prefix): New define.
	(_Jv_platform_solib_suffix): Likewise.
	* include/posix.h (_Jv_platform_solib_prefix): New define.
	(_Jv_platform_solib_suffix): Likewise.
	* java/lang/natRuntime.cc: Include StackTrace.h.
	(_load): Use findLibrary and new platform defines.
	(nativeGetLibname): Use new platform defines.

From-SVN: r59976
2002-12-10 01:39:32 +00:00
Tom Tromey 06fa6442a3 natRuntime.cc (insertSystemProperties): Set gnu.classpath.home.
* java/lang/natRuntime.cc (insertSystemProperties): Set
	gnu.classpath.home.

From-SVN: r59108
2002-11-14 18:28:07 +00:00
Tom Tromey ca7c2b8529 natRuntime.cc (_Jv_SetDLLSearchPath): New function.
* java/lang/natRuntime.cc (_Jv_SetDLLSearchPath): New function.
	(_Jv_FindSymbolInExecutable): Removed argument name.
	(insertSystemProperties): Call _Jv_SetDLLSearchPath if
	java.library.path is set.

	* gij.cc (help): Document --showversion.
	(version): Don't exit.
	(main): Handle --showversion.  Exit if --version given.

From-SVN: r58520
2002-10-25 03:28:00 +00:00
Ranjit Mathew 6d0b22ecb0 natRuntime.cc (insertSystemProperties): Added GCJ runtime property "gnu.gcj.progname" containing the name used to...
2002-10-19  Ranjit Mathew <rmathew@hotmail.com>

	* java/lang/natRuntime.cc (insertSystemProperties): Added GCJ
	runtime property "gnu.gcj.progname" containing the name used to
	invoke the current Java program (similar to argv[0] for C
	programs).

From-SVN: r58343
2002-10-20 23:47:43 +00:00
Jesse Rosenstock eb812b2c15 Fix for PR libgcj/7570 and PR libgcj/7578:
2002-08-13  Jesse Rosenstock  <jmr@ugcs.caltech.edu>

	Fix for PR libgcj/7570 and PR libgcj/7578:
	* java/lang/natPosixProcess.cc: Include java/io/File.h.
	(startProcess): Handle new `dir' argument.
	* java/lang/Win32Process.java (ConcreteProcess): Added `dir'
	argument.
	* java/lang/PosixProcess.java (ConcreteProcess): Added `dir'
	argument.
	(startProcess): Likewise.
	* java/lang/EcosProcess.java (ConcreteProcess): Added `dir'
	argument.
	* java/lang/Runtime.java (execInternal): Added `dir' argument.
	(exec): Don't create new environment if ENV==null.  Pass DIR to
	execInternal.
	* java/lang/natRuntime.cc: Include java/io/File.h.
	(execInternal): Added `dir' argument.

From-SVN: r56268
2002-08-14 01:07:59 +00:00
Tony Kimball 16da5ae295 natRuntime.cc (nativeGetLibname): Added missing `#'.
2002-07-05  Tony Kimball  <alk@pobox.com>

	* java/lang/natRuntime.cc (nativeGetLibname): Added missing `#'.

From-SVN: r55280
2002-07-06 05:11:53 +00:00
Tom Tromey e86c533b01 natRuntime.cc: Don't include sys/time.h and time.h.
* java/lang/natRuntime.cc: Don't include sys/time.h and time.h.
	* java/util/natTimeZone.cc: Include sys/time.h and time.h here.
	Include platform.h.

From-SVN: r53443
2002-05-14 05:29:30 +00:00
Tom Tromey 8639786815 re PR libgcj/6389 (System.getProperty("") should always throw an IllegalArgumentException)
Fixes PR libgcj/6389:
	* Makefile.in: Rebuilt.
	* Makefile.am (nat_source_files): Added natTimeZone.cc.
	* java/util/natTimeZone.cc: New file.
	* java/util/TimeZone.java (getDefaultTimeZoneId): New method.
	* java/lang/System.java: Merged with Classpath.
	* java/lang/Runtime.java: Merged with Classpath.
	* java/lang/natSystem.cc (setErr0): Renamed from setErr; don't run
	security check.
	(setIn0): Renamed from setIn; don't run security check.
	(setOut0): Renamed from setOut; don't run security check.
	(file_encoding, getpwuid_adaptor, getSystemTimeZone,
	init_properties): Moved to natRuntime.cc.
	Moved many includes to natRuntime.cc.
	(isWordsBigEndian): New method.
	* java/lang/natRuntime.cc: Include Long.h, also other includes
	previously in natSystem.cc.
	(maxMemory): New function.
	(exitInternal): Renamed from `_exit'.
	(exit): Removed.
	(init): Don't set finalize_on_exit.
	(exitInternal): Use `finalizeOnExit'.
	(file_encoding, getpwuid_adaptor): New functions from
	natSystem.cc.
	(insertSystemProperties): New method, renamed from
	System::init_properties.  Don't set user.timezone.
	(_load): Don't call checkLink.
	(execInternal): New method.
	(availableProcessors): Likewise.
	(nativeGetLibname): Likewise.

From-SVN: r53429
2002-05-13 20:10:37 +00:00
Tom Tromey 880f8c16ad Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (java/lang/Thread.h): Mark
	_Jv_AttachCurrentThreadAsDaemon as friend.
	* gcj/javaprims.h (_Jv_AttachCurrentThreadAsDaemon): Declare.
	* gcj/cni.h (JvAttachCurrentThreadAsDaemon): New function.
	* java/lang/natThread.cc (_Jv_AttachCurrentThreadAsDaemon): New
	function.
	* java/lang/natRuntime.cc (_load): Recognize JNI_VERSION_1_4.
	* jni.cc (_Jv_JNI_GetVersion): Return JNI_VERSION_1_4.
	(_Jv_JNI_InvokeFunctions): Added
	_Jv_JNI_AttachCurrentThreadAsDaemon.
	(_Jv_JNI_GetEnv): Handle JNI_VERSION_1_4.
	(JNI_GetDefaultJavaVMInitArgs): Likewise.
	(JNI_CreateJavaVM): Likewise.
	(_Jv_JNI_AttachCurrentThread): Likewise.
	(_Jv_JNI_AttachCurrentThread): Added `is_daemon' argument.
	(_Jv_JNI_AttachCurrentThreadAsDaemon): New method.
	(_Jv_JNIFunctions): Initialize new fields.
	(_Jv_JNI_NewDirectByteBuffer): New function.
	(_Jv_JNI_GetDirectBufferAddress): Likewise.
	(_Jv_JNI_GetDirectBufferCapacity): Likewise.
	* include/jni.h (JNI_VERSION_1_4): New macro.
	(JNIInvokeInterface::AttachCurrentThreadAsDaemon): New field.
	(_Jv_JavaVM::AttachCurrentThreadAsDaemon): New method.
	(JNINativeInterface::NewDirectByteBuffer): New field.
	(JNINativeInterface::GetDirectBufferAddress): New field.
	(JNINativeInterface::GetDirectBufferCapacity): New field.
	(_Jv_JNIEnv::NewDirectByteBuffer): New method.
	(_Jv_JNIEnv::GetDirectBufferAddress): New method.
	(_Jv_JNIEnv::GetDirectBufferCapacity): New method.

From-SVN: r52144
2002-04-10 20:36:04 +00:00
Bryce McKinlay 107abb2f61 Eliminate use of C++ static constructors.
* interpret.cc: Remove static Utf8Consts. Use namespace gcj.
	* jni.cc: Likewise.
	* resolve.cc: Likewise.
	* defineclass.cc: Likewise.
	(_Jv_ClassReader::handleClassBegin): Synchronize call to
	_Jv_RegisterClass.
	* include/jvm.h (void_signature, clinit_name, init_name, finit_name):
	Declare in namespace gcj.
	* java/lang/Class.h (Class): Remove initialization for primitive
	types.
	(friend void _Jv_InitPrimClass): This is in prims.cc.
	* prims.cc (_Jv_InitPrimClass): Do primitive type initialization
	here instead.
	(void_signature, clinit_name, init_name, finit_name): Define in
	namespace gcj.
	(_Jv_CreateJavaVM): Call _Jv_InitThreads, _Jv_InitGC, and
	_Jv_InitializeSyncMutex from here. Initialize Utf8 constants.
	Initialize primitive types.
	* java/lang/natClassLoader.cc (_Jv_RegisterClasses): Don't call
	initialization routines. Don't synchronize.
	* java/lang/natRuntime.cc (_load): Synchronize on java.lang.Class
	across dlopen call.

From-SVN: r46282
2001-10-16 09:35:17 +01:00
Tom Tromey eeedeb5a17 natFinalizerThread.cc: New file.
* gnu/gcj/runtime/natFinalizerThread.cc: New file.
	* java/lang/natRuntime.cc: Include FinalizerThread.h.
	(runFinalization): Call finalizerReady.
	* nogc.cc (_Jv_GCInitializeFinalizers): New function.
	* prims.cc: Include VirtualMachineError.h, FinalizerThread.h.
	(_Jv_CreateJavaVM): Start the finalizer thread.
	* no-threads.cc: Include InternalError.h.
	(_Jv_ThreadStart): Throw InternalError.
	(_Jv_ThreadInitData): Don't throw error if this is not the first
	thread.
	* Makefile.in: Rebuilt.
	* Makefile.am (ordinary_java_source_files): Added
	FinalizerThread.java.
	(nat_source_files): Added natFinalizerThread.cc.
	* include/jvm.h (_Jv_GCInitializeFinalizers): Declare.
	* boehm.cc (_Jv_GCInitializeFinalizers): New function.
	* gnu/gcj/runtime/FirstThread.java (run): Start finalizer thread.
	* gnu/gcj/runtime/FinalizerThread.java: New file.

From-SVN: r46163
2001-10-10 22:25:43 +00:00
Tom Tromey 6728a61d1f natRuntime.cc (_Jv_FindSymbolInExecutable): Return NULL if no library on the list has the symbol.
* java/lang/natRuntime.cc (_Jv_FindSymbolInExecutable): Return
	NULL if no library on the list has the symbol.
	(init): Call add_library on the program itself.
	* prims.cc (JvRunMain): Initialize Runtime before searching for
	`main'.
	(_Jv_RunMain): Likewise.

From-SVN: r43413
2001-06-15 23:22:02 +00:00
Anthony Green 20f914dc05 !defined(USE_LTDL) fix
From-SVN: r42813
2001-06-02 19:40:53 +00:00
Richard Henderson b3208f56cb exception.cc (java_eh_info): Make value type jthrowable.
* exception.cc (java_eh_info): Make value type jthrowable.
	(_Jv_type_matcher): Remove now unneeded cast.
	(_Jv_Throw): Make argument type jthrowable.  Munge name
	for SJLJ_EXCEPTIONS here ...
	* gcj/cni.h: ... not here.
	(JvThrow): Remove.
	* gcj/javaprims.h (_Jv_Throw, _Jv_Sjlj_Throw): Update declarations.

	* defineclass.cc, interpret.cc, jni.cc, posix-threads.cc,
	prims.cc, resolve.cc, gnu/gcj/runtime/natFirstThread.cc,
	gnu/gcj/xlib/natDrawable.cc, gnu/gcj/xlib/natFont.cc,
	gnu/gcj/xlib/natWMSizeHints.cc, gnu/gcj/xlib/natWindowAttributes.cc,
	gnu/gcj/xlib/natXImage.cc, java/io/natFile.cc,
	java/io/natFileDescriptorEcos.cc, java/io/natFileDescriptorPosix.cc,
	java/io/natFileDescriptorWin32.cc, java/io/natFileWin32.cc,
	java/lang/natClass.cc, java/lang/natClassLoader.cc,
	java/lang/natDouble.cc, java/lang/natObject.cc,
	java/lang/natPosixProcess.cc, java/lang/natRuntime.cc,
	java/lang/natString.cc, java/lang/natSystem.cc,
	java/lang/natThread.cc, java/lang/reflect/natArray.cc,
	java/lang/reflect/natConstructor.cc, java/lang/reflect/natField.cc,
	java/lang/reflect/natMethod.cc, java/util/zip/natDeflater.cc,
	java/util/zip/natInflater.cc:
	Use throw, not JvThrow or _Jv_Throw.

From-SVN: r40838
2001-03-25 23:05:32 -08:00
Bryce McKinlay 456c0b60ad Runtime.java (_exit): Declare new package-private native.
2001-03-12  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/Runtime.java (_exit): Declare new package-private native.
	* java/lang/natRuntime.cc (_exit): Implemented. Same as exit() but
	without a security manager check.
	(exit): Call _exit after security check.
	* prims.cc (JvRunMain): Call Runtime._exit to shutdown the runtime
	"naturally".
	* java/lang/System.java (setSecurityManager): If a security manager
	is already in place, call checkPermission.
	* java/lang/ThreadGroup.java (uncaughtException): If printStackTrace()
	throws an exception, try to deal with it gracefully.
	* java/lang/ExceptionInInitializerError.java (printStackTrace):
	Only try to print the subordinate stack trace if "exception" is set.
	Print our class name first.

From-SVN: r40401
2001-03-12 07:40:17 +00:00
Alexandre Oliva 064a791cf5 * java/lang/natRuntime.cc (lt_preloaded_symbols): Define as `extern'.
From-SVN: r36405
2000-09-14 07:56:28 +00:00
Anthony Green 890a31f478 File.java (deleteOnExit): New method.
* java/io/File.java (deleteOnExit): New method.
        * gnu/gcj/runtime/FileDeleter.java: New class.
        * java/lang/natRuntime.cc (exit): Call
        FileDeleter.deleteOnExitNow()
        * Makefile.am: Add FileDeleter.java.
        * Makefile.in: Rebuilt.

From-SVN: r36141
2000-09-04 16:55:48 +00:00