diff options
author | Richard Henderson <rth@redhat.com> | 2005-05-25 16:24:07 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2005-05-25 16:24:07 -0700 |
commit | eb2925b676cb88c2c28b5bf7484fb432f709ce88 (patch) | |
tree | decadfd6855f01f7f2fa5b72d94ed6ce6e6edfea /libjava | |
parent | 2f828272d85e2ef044aaab493d67d38dbd2dead8 (diff) | |
download | gcc-eb2925b676cb88c2c28b5bf7484fb432f709ce88.zip gcc-eb2925b676cb88c2c28b5bf7484fb432f709ce88.tar.gz gcc-eb2925b676cb88c2c28b5bf7484fb432f709ce88.tar.bz2 |
re PR libgcj/21692 (unexpected java.lang.NoClassDefFoundError)
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
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 12 | ||||
-rwxr-xr-x | libjava/configure | 3 | ||||
-rw-r--r-- | libjava/configure.ac | 1 | ||||
-rw-r--r-- | libjava/configure.host | 14 | ||||
-rw-r--r-- | libjava/stacktrace.cc | 9 | ||||
-rw-r--r-- | libjava/sysdep/descriptor-n.h | 3 | ||||
-rw-r--r-- | libjava/sysdep/descriptor-y.h | 5 | ||||
-rw-r--r-- | libjava/sysdep/powerpc/descriptor.h | 9 |
8 files changed, 52 insertions, 4 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 717747e..ca1e1f2 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,15 @@ +2005-05-25 Richard Henderson <rth@redhat.com> + + 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. + 2005-05-25 Chris Burdess <dog@gnu.org> * gnu/xml/dom/ls/SAXEventSink.java: Ignore XML entities in start/ diff --git a/libjava/configure b/libjava/configure index 76b062a..0e971e1 100755 --- a/libjava/configure +++ b/libjava/configure @@ -8511,6 +8511,8 @@ if test -d sysdep; then true; else mkdir sysdep; fi ac_config_links="$ac_config_links sysdep/backtrace.h:$fallback_backtrace_h" + ac_config_links="$ac_config_links sysdep/descriptor.h:$descriptor_h" + HASH_SYNC_SPEC= # Hash synchronization is only useful with posix threads right now. @@ -16892,6 +16894,7 @@ do "include/java-threads.h" ) CONFIG_LINKS="$CONFIG_LINKS include/java-threads.h:include/$THREADH" ;; "sysdep/locks.h" ) CONFIG_LINKS="$CONFIG_LINKS sysdep/locks.h:sysdep/$sysdeps_dir/locks.h" ;; "sysdep/backtrace.h" ) CONFIG_LINKS="$CONFIG_LINKS sysdep/backtrace.h:$fallback_backtrace_h" ;; + "sysdep/descriptor.h" ) CONFIG_LINKS="$CONFIG_LINKS sysdep/descriptor.h:$descriptor_h" ;; "include/java-signal.h" ) CONFIG_LINKS="$CONFIG_LINKS include/java-signal.h:$SIGNAL_HANDLER" ;; "include/java-signal-aux.h" ) CONFIG_LINKS="$CONFIG_LINKS include/java-signal-aux.h:$SIGNAL_HANDLER_AUX" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; diff --git a/libjava/configure.ac b/libjava/configure.ac index 594df41..b28d1e3 100644 --- a/libjava/configure.ac +++ b/libjava/configure.ac @@ -707,6 +707,7 @@ AM_CONDITIONAL(USING_NO_THREADS, test "$THREADS" = none) if test -d sysdep; then true; else mkdir sysdep; fi AC_CONFIG_LINKS(sysdep/locks.h:sysdep/$sysdeps_dir/locks.h) AC_CONFIG_LINKS(sysdep/backtrace.h:$fallback_backtrace_h) +AC_CONFIG_LINKS(sysdep/descriptor.h:$descriptor_h) HASH_SYNC_SPEC= # Hash synchronization is only useful with posix threads right now. diff --git a/libjava/configure.host b/libjava/configure.host index ff86d72..aec0304 100644 --- a/libjava/configure.host +++ b/libjava/configure.host @@ -32,6 +32,7 @@ # (i.e it is broken). # fallback_backtrace_h Header to use for fallback backtrace implementation # (only for targets that don't support DWARF2 unwind) +# descriptor_h Header to use for looking past function descriptors libgcj_flags= libgcj_cflags= @@ -268,6 +269,19 @@ case "${host}" in ;; esac +case "${host}" in + ia64-* | hppa*-*) + descriptor_h=sysdep/descriptor-y.h + ;; + + rs6000-* | powerpc*-*) + descriptor_h=sysdep/powerpc/descriptor.h + ;; + + *) + descriptor_h=sysdep/descriptor-n.h + ;; +esac libgcj_cflags="${libgcj_cflags} ${libgcj_flags}" libgcj_cxxflags="${libgcj_cxxflags} ${libgcj_flags}" diff --git a/libjava/stacktrace.cc b/libjava/stacktrace.cc index a849f6f..e027678 100644 --- a/libjava/stacktrace.cc +++ b/libjava/stacktrace.cc @@ -29,6 +29,7 @@ details. */ #include <gnu/gcj/runtime/NameFinder.h> #include <sysdep/backtrace.h> +#include <sysdep/descriptor.h> using namespace java::lang; using namespace java::lang::reflect; @@ -62,12 +63,12 @@ _Jv_StackTrace::UpdateNCodeMap () for (int i=0; i < klass->method_count; i++) { _Jv_Method *method = &klass->methods[i]; + void *ncode = method->ncode; // Add non-abstract methods to ncodeMap. - if (method->ncode) + if (ncode) { - //printf("map->put 0x%x / %s.%s\n", method->ncode, klass->name->data, - // method->name->data); - ncodeMap->put ((java::lang::Object *) method->ncode, klass); + ncode = UNWRAP_FUNCTION_DESCRIPTOR (ncode); + ncodeMap->put ((java::lang::Object *)ncode, klass); } } } diff --git a/libjava/sysdep/descriptor-n.h b/libjava/sysdep/descriptor-n.h new file mode 100644 index 0000000..d640405 --- /dev/null +++ b/libjava/sysdep/descriptor-n.h @@ -0,0 +1,3 @@ +// Given a function pointer, return the code address. + +#define UNWRAP_FUNCTION_DESCRIPTOR(X) (X) diff --git a/libjava/sysdep/descriptor-y.h b/libjava/sysdep/descriptor-y.h new file mode 100644 index 0000000..ca61550 --- /dev/null +++ b/libjava/sysdep/descriptor-y.h @@ -0,0 +1,5 @@ +// Given a function pointer, return the code address. + +// The function descriptor is actually multiple words, +// but we don't care about anything except the first. +#define UNWRAP_FUNCTION_DESCRIPTOR(X) (*(void **)(X)) diff --git a/libjava/sysdep/powerpc/descriptor.h b/libjava/sysdep/powerpc/descriptor.h new file mode 100644 index 0000000..51296c2 --- /dev/null +++ b/libjava/sysdep/powerpc/descriptor.h @@ -0,0 +1,9 @@ +// Given a function pointer, return the code address. + +#ifdef _CALL_AIX +// The function descriptor is actually multiple words, +// but we don't care about anything except the first. +# define UNWRAP_FUNCTION_DESCRIPTOR(X) (*(void **)(X)) +#else +# define UNWRAP_FUNCTION_DESCRIPTOR(X) (X) +#endif |