2007-09-04 Andrew Haley <aph@redhat.com>
PR java/27908
* testsuite/libjava.lang/PR27908.java
({run1,run2,run3}.isRunning): New Method.
(main): Fix race condition.
2007-08-29 Andrew Haley <aph@redhat.com>
* gnu/classpath/natVMStackWalker.cc (VMStackWalker::getCallingClass):
Make sure we're not sibcalled.
(GET_CALLING_CLASS): Define for ARM EABI.
2007-08-22 Andrew Haley <aph@redhat.com>
* configure.host (BACKTRACESPEC): Add arm*-linux*.
2007-08-22 Andrew Haley <aph@redhat.com>
* configure.ac (LIBSTDCXXSPEC): New.
* configure.host: Add arm*-linux* to pthread test.
* configure.ac (LIBGCJTESTSPEC): Add path to libstdc++ for ARM
EABI.
* testsuite/libjava.jni/jni.exp (gcj_jni_compile_c_to_so): Use
-fexceptions for ARM EABI.
* testsuite/lib/libjava.exp (libjava_arguments): Add libgcj-test.spec.
(libjava_invoke): Log the invocation.
2007-08-15 Andrew Haley <aph@redhat.com>
* configure.ac (extra_ldflags): Define.
* Makefile.am: Use extra_ldflags for all executables.
2007-08-14 Andrew Haley <aph@redhat.com>
* sysdep/arm/backtrace.h: Remove stubs for _Unwind_GetIPInfo,
_Unwind_GetRegionStart, and _Unwind_Backtrace.
2007-07-27 Andrew Haley <aph@redhat.com>
* gnu/classpath/natVMStackWalker.cc (GET_CALLING_CLASS): Stub for
ARM EABI.
* exception.cc (get_exception_header_from_ue): New.
(get_ttype_entry): ARM EABI version.
(PERSONALITY_FUNCTION): Add ARM EABI code.
* sysdep/arm/backtrace.h: New file.
* stacktrace.cc (_URC_NORMAL_STOP): New.
* configure.ac (extra_ldflags_libjava): Add libsupc++.la for ARM
EABI.
* configure.host (BACKTRACESPEC): Add arm/backtrace.h.
From-SVN: r128098
* configure.ac (INTERPRETER): New AM_CONDITIONAL.
* scripts/makemake.tcl (package_map): Mark jdwp and jvmti packages
as being for interpreter only. Place interpreter related files in
'if INTERPRETER' block.
(interpreter_package_files): New list.
(interpreter_header_vars): Ditto.
(emit_package_rule_to_list): Renamed from emit_package_rule with
new target list parameter.
(emit_package_rule): Rewritten to call emit_package_rule_to_list.
(emit_interpreter_rule): New function.
(emit_source_var): Place interpreter related files in
interpreter_header_vars.
* Makefile.am (ACLOCAL_AMFLAGS): Add -I libltdl.
(libgcj_interpret_source_files): New variable.
(libgcj_la_SOURCES): Move jvmti.cc and interpret.cc to
libgcj_interpret_source_files and include
libgcj_interpret_source_files.
(nat_jdwp_source_files): New variable.
(nat_jvmti_source_files): Ditto.
(nat_source_files): Move jdwp and jvmti related files to
nat_jdwp_source_files and nat_jvmti_source_files and include
nat_jdwp_source_files and nat_jvmti_source_files.
* Makefile.in: Regenerate.
* include/Makefile.in: Ditto.
* testsuite/Makefile.in: Ditto.
* gcj/Makefile.in: Ditto.
* sources.am: Ditto.
* configure: Ditto.
* include/config.h.in: Ditto.
* interpret.cc: Remove #ifdef INTERPRETER block.
* stacktrace.cc (UnwindTraceFn): Do not handle proxy frames if
interpreter disabled.
* include/java-interp.h (_Jv_FrameType): Move outside of
#ifdef INTERPRETER block.
* include/execution.h (_Jv_IndirectCompiledEngine::do_get_closure_list,
_Jv_InterpreterEngine, _Jv_soleInterpreterEngine): Place in
#ifdef INTERPRETER block.
* jni.cc (jvmti.h, jvmti-int.h): Only include if INTERPRETER is
defined.
(_Jv_JNI_PopSystemFrame, _Jv_JNI_GetEnv): Only do jvmti processing
if INTERPRETER is defined.
* prims.cc (jvmti.h, jvmti-int.h, Jdwp.h, VMVirtualMachine.h): Only
include if INTERPRETER is defined.
(defaultJdwpOptions, jdwpOptions, jvmti_agent_onload_func,
jvmti_agent_onunload_func, jvmti_agentonload, jvmti_agentonunload,
jvmti_agent_opts, load_jvmti_agent): Only define if INTERPRETER is
defined.
(parse_x_arg): Only process 'runjdwp:' if INTERPRETER is defined.
(parse_init_args): Only process jvmti related options if
INTERPRETER is defined.
(_Jv_CreateJavaVM): Only call _Jv_JVMTI_Init if INTERPRETER is
defined.
(_Jv_RunMain): Only do jvmti and jdwp processing if INTERPRETER is
defined.
* link.cc (jvmti.h, jvmti-int.h): Only include if INTERPRETER is
defined.
(_Jv_ThrowNoClassDefFoundError, _Jv_Linker::create_error_method):
Define if if INTERPRETER is not defined.
(_Jv_Linker::wait_for_state): Only do jvmti proccessing if
INTERPRETER is defined.
* boehm.cc (closure_list_pointer, finalize_closure_list,
_Jv_ClosureListFinalizer): Only define if INTERPRETER is
defined.
* java/lang/natThread.cc (jvmti.h, jvmti-int.h): Only include if
INTERPRETER is defined.
(finish_, _Jv_NotifyThreadStart): Only do jvmti proccessing if
INTERPRETER is defined.
* java/lang/Class.h (_Jv_InterpreterEngine): Move declaration
and friend declaration inside #ifdef INTERPRETER block.
* java/lang/natClass.cc (_Jv_ClosureList::releaseClosures,
_Jv_ClosureList::registerClosure, _Jv_GetInterpClassSourceFile):
Only define if INTERPRETER is defined.
* java/lang/reflect/natVMProxy.cc (UnsupportedOperationException.h):
Include.
(generateProxyClass): Throw UnsupportedOperationException unless
INTERPRETER is defined.
From-SVN: r127097
2007-01-29 Kyle Galloway <kgallowa@redhat.com>
* include/java-interp.h: Added _Jv_Frame class and its two
subclasses _Jv_InterpFrame and _Jv_NativeFrame. Also moved
_Jv_FrameType from java-stack.h.
* include/java-stack.h: Removed _Jv_FrameType.
* java/lang/Thread.java: Added frame member to hold new
composite frame stack.
* java/lang/Thread.h: Regenerated.
* java/lang/Thread.class: Rebuilt.
* jni.cc (_Jv_JNIMethod::call): Push a frame onto the stack when
calling a JNI method.
* jvmti.cc (_Jv_JVMTI_GetStackTrace): New Method.
(_Jv_JVMTI_GetFrameCount): New method.
* stacktrace.cc (UnwindTraceFn): Modified to use new _Jv_Frame
classes.
* testsuite/libjava.jvmti/interp/getstacktrace.jar: New test.
* testsuite/libjava.jvmti/interp/natgetstacktrace.cc: New test.
* testsuite/libjava.jvmti/interp/getstacktrace.h: New test.
* testsuite/libjava.jvmti/interp/getstacktrace.jar: New test.
* testsuite/libjava.jvmti/interp/getstacktrace.out: Output file
for test.
From-SVN: r121314
* include/java-stack.h (ncodeMap): Declare.
(_Jv_StackTrace): Make _Jv_GetMethodDeclaringClass friend.
* java/lang/Class.h (_Jv_GetMethodDeclaringClass): Declare.
* java/lang/natClass.cc (_Jv_GetMethodDeclaringClass): New
function.
* stacktrace.cc (ncodeMap): Redefine from file global to global
for class _Jv_StackTrace.
(_Jv_StackTrace::UpdateNCodeMap): Add interpreted classes, too,
so that _Jv_GetMethodDeclaringClass can find them all.
(_Jv_StackTrace::ClassForFrame): Exclude interpreted classes.
* jvmti.cc (_Jv_JVMTI_GetMethodDeclaringClass): New function.
(_Jv_JVMTI_Interface): Define GetMethodDeclaringClass function.
From-SVN: r118100
2006-08-15 Kyle Galloway <kgallowa@redhat.com>
* include/java-interp.h (_Jv_InterpMethod::run_debug): New method.
* interpret.cc: Added placeholder for debug variable type info to STORE*
macros.
(_Jv_InterpMethod::run_debug): New method.
(_Jv_InterpMethod::run_sync_object_debug): New method.
(_Jv_InterpMethod::run_sync_class_debug): New method.
(_Jv_InterpMethod::run_normal_debug): New method.
(_Jv_InterpMethod::run_class_debug): New method.
(_Jv_InterpMethod::ncode ()): Changed to select either debug or normal
versions of these functions.
* interpret-run.cc: New file, holds contents of old
_Jv_InterpMethod::run method.
* stacktrace.cc (_Jv_StackTrace::UnwindTraceFn): Changed to select
appropriate function for debug or normal mode.
From-SVN: r116167
2006-08-10 Gary Benson <gbenson@redhat.com>
* include/java-stack.h (GetAccessControlStack): Change return
type.
* stacktrace.cc (accesscontrol_trace_fn): Record the number of
Java frames encountered.
(GetAccessControlStack): Return a flag indicating whether a call to
doPrivileged was encountered rather than an array of method names.
* java/security/natVMAccessController.cc (getStack): Change return
type.
* java/security/VMAccessController.java (getStack): Likewise.
(getContext): Change to reflect the above.
From-SVN: r116058
* stacktrace.cc (_Jv_StackTrace::GetStackTrace): Unconditionally use
_Unwind_Backtrace().
(_Jv_StackTrace::GetCallerInfo): Enable even for targets using SJLJ
EH.
(_Jv_StackTrace::GetClassContext): Unconditionally use
_Unwind_Backtrace().
(_Jv_StackTrace::GetFirstNonSystemClassLoader): Likewise.
* sysdep/i386/backtrace.h (HAVE_FALLBACK_BACKTRACE): Do not define.
(_Unwind_GetIPInfo): Define macro if SJLJ EH is in use.
(_Unwind_GetRegionStart): Likewise.
(_Unwind_Backtrace): Likewise.
(fallback_backtrace): Accept additional unwind trace function
argument. Call it during unwinding. Stop when any of _Jv_RunMain(),
_Jv_ThreadStart() or main() is seen during unwinding.
* sysdep/generic/backtrace.h (fallback_backtrace): Accept an
additional unwind trace function argument.
From-SVN: r115449
2006-07-12 Bryce McKinlay <mckinlay@redhat.com>
PR libgcj/28352
* stacktrace.cc (getLineNumberForFrame): Roll back PC by 1 when
looking up line number for interpreted frame.
From-SVN: r115370
2006-07-06 Bryce McKinlay <mckinlay@redhat.com>
* stacktrace.cc (ClassForFrame): Remove commented-out code.
(UnwindTraceFn): Use _Unwind_GetIPInfo and adjust IP
only when needed.
(getLineNumberForFrame): Don't adjust IP here.
* testsuite/libjava.lang/StackTrace.java: New test case.
* testsuite/libjava.lang/StackTrace.out: Ditto.
From-SVN: r115235
* gcj/javaprims.h (_Jv_uintptr_t): New typedef similar to uintptr_t in
C99.
* include/java-stack.h: Include stdlib.h.
(_Jv_AddrInfo): New structure to hold address information.
* include/posix.h (_Jv_platform_dladdr): Declare.
* include/win32.h (_Jv_platform_dladdr): Declare.
(backtrace): Remove declaration.
* posix.cc: Include dlfcn.h if available. Include java-stack.h.
(_Jv_platform_dladdr): Define.
* win32.cc: Include string.h. Include java-stack.h.
(backtrace): Remove.
(_Jv_platform_dladdr): Define.
* sysdep/i386/backtrace.h (fallback_backtrace): Check that a potential
frame pointer value is 32-bit word-aligned. Use operand of the CALL
instruction calling the current function to find its starting address.
* stacktrace.cc: Do not include dlfcn.h. Include platform.h.
(_Jv_StackTrace::getLineNumberForFrame): Use _Jv_platform_dladdr()
instead of dladdr().
(_Jv_StackTrace::GetStackTraceElements): Use nCodeMap even for Windows.
(_Jv_StackTrace::GetClassContext): Use fallback_backtrace() for
targets with SJLJ exceptions instead of using _Unwind_Backtrace().
(_Jv_StackTrace::GetFirstNonSystemClassLoader): Likewise.
From-SVN: r115069
2006-06-05 David Daney <ddaney@avtrex.com>
* gcj.texi (libgcj Runtime Properties): Document
gnu.gcj.runtime.NameFinder.show_raw and
gnu.gcj.runtime.NameFinder.remove_unknown.
2006-06-05 David Daney <ddaney@avtrex.com>
* gnu/gcj/runtime/NameFinder.java (show_raw): New field.
(showRaw): New method.
* stacktrace.cc : Include gnu/gcj/runtime/StringBuffer.h.
(getLineNumberForFrame): Show IP offset in trace if line number
not available and show_raw true.
From-SVN: r114437
2006-05-15 Andreas Tobler <a.tobler@schweiz.ch>
* stacktrace.cc (StackTrace::FillInFrameInfo): Use
UNWRAP_FUNCTION_DESCRIPTOR to compare frame->start_ip against the
klass->methods[j].ncode.
From-SVN: r113801
2006-02-16 Andrew Haley <aph@redhat.com>
* stacktrace.cc (GetStackTraceElements): Call
gnu::gcj::runtime::NameFinder::removeUnknown() to determine if
non-Java frames should be removed from a printed stack trace.
Pass methodName to getLineNumberForFrame().
(getLineNumberForFrame): Set method_name from info.dli_sname.
* gnu/gcj/runtime/NameFinder.java (removeUnknown): New method.
(remove_unknown): New variable.
* include/java-stack.h (_Jv_StackTrace::getLineNumberForFrame):
Add methodName arg.
From-SVN: r111181
PR libgcj/23507
* stacktrace.cc (_Jv_StackTrace::UnwindTraceFn): Fix typo in newLength
assignment. Cast operands of compare to function pointer type.
From-SVN: r103325
PR libgcj/21692
* sysdep/descriptor-n.h: New file.
* sysdep/descriptor-y.h: New file.
* sysdep/powerpc/descriptor.h: New file.
* configure.host: Set $descriptor_h appropriate for the host.
* configure.ac: Link it.
* configure: Regenerate.
* stacktrace.cc: Include sysdep/descriptor.h.
(_Jv_StackTrace::UpdateNCodeMap): Use UNWRAP_FUNCTION_DESCRIPTOR.
From-SVN: r100173
* Makefile.in: Rebuilt.
* Makefile.am (AM_CXXFLAGS): Define TOOLEXECLIBDIR.
(libgcj0_convenience_la_SOURCES): Don't include
gnu_xml_source_files.
(libgcj0_convenience_la_LIBADD): New variable.
(libgcj_la_LIBADD): Don't include sax or w3c_dom.
(all_java_source_files): javax_imageio_source_files,
javax_xml_source_files, and gnu_java_beans_source_files.
($(gnu_xml_source_files:.java=.lo)): Removed target.
(gnu-xml.lo): New target.
(javax-imageio.lo): Likewise.
(javax-xml.lo): Likewise.
(gnu-java-beans.lo): Likewise.
(gnu_java_beans_source_files): New variable.
(javax_imageio_source_files): Likewise.
(javax_xml_source_files): Likewise.
(javax_source_files): Moved files to other variable.
(awt_java_source_files): Likewise.
(ordinary_java_source_files): Added BootClassLoader.java.
* java/lang/natVMClassLoader.cc (defineClass): Use boot loader,
not system class loader.
(initBootLoader): New method.
(loadClass): Search bootLoader.
* java/lang/natClassLoader.cc (_Jv_RegisterInitiatingLoader): Use
boot loader, not system class loader.
(_Jv_UnregisterInitiatingLoader): Likewise.
(_Jv_FindClass): Likewise. Ensure entries in
bootstrap_class_list are unique.
* java/lang/natClass.cc (getClassLoader): Don't special case
system class loader.
* java/lang/VMClassLoader.java (bootLoader): New field.
(getResource): Use bootLoader.
(getResources): Likewise.
(initBootLoader): Declare.
* gnu/gcj/runtime/BootClassLoader.java: New file.
* external/sax/org/xml/sax/helpers/NamespaceSupport.java
(EMPTY_ENUMERATION): Now package-private.
* external/w3c_com/Makefile.in: Rebuilt.
* external/w3c_com/Makefile.am (MULTIBUILDTOP): New variable.
(w3c.jar): New target.
(classes.stamp): Updated.
(toolexeclib_LTLIBRARIES): Renamed from noinst_LTLIBRARIES.
Changed name of library.
(libw3c_gcj_la_SOURCES): New variable.
(libw3c_gcj_la_GCJFLAGS): Likewise.
(source_files): Renamed from lib3c_convenience_la_SOURCES.
* external/sax/Makefile.in: Rebuilt.
* external/sax/Makefile.am (MULTIBUILDTOP): New variable.
(sax.jar): New target.
(classes.stamp): Updated.
(toolexeclib_LTLIBRARIES): Renamed from noinst_LTLIBRARIES.
Changed name of library.
(libsax_gcj_la_SOURCES): New variable.
(libsax_gcj_la_GCJFLAGS): Likewise.
(source_files): Renamed from libsax_convenience_la_SOURCES.
* stacktrace.cc (non_system_trace_fn): Don't look at system class
loader.
* prims.cc (_Jv_CreateJavaVM): Initialize the bootstrap class
loader.
(_Jv_RunMain): Handle case where 'runtime' is NULL at exit.
From-SVN: r96960
2005-03-12 Andreas Tobler <a.tobler@schweiz.ch>
* stacktrace.cc (GetCallerInfo): Return nothing in case of
SJLJ_EXCEPTIONS is defined.
From-SVN: r96340
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