+2006-09-26 Jack Howarth <howarth@bromo.med.uc.edu>
+
+ PR target/26792:
+ * exception.cc (PERSONALITY_FUNCTION): use _Unwind_GetIP
+ if HAVE_GETIPINFO not defined.
+ * stacktrace.cc (_Jv_StackTrace::UnwindTraceFn): Likewise.
+ (_Jv_StackTrace::getLineNumberForFrame): Likewise.
+ * configure.ac: use GCC_CHECK_UNWIND_GETIPINFO.
+ * aclocal.m4, configure, include/config.h.in, Makefile.in:
+ Rebuilt.
+
2006-09-27 Tom Tromey <tromey@redhat.com>
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=201712
$(top_srcdir)/../config/lib-link.m4 \
$(top_srcdir)/../config/lib-prefix.m4 \
$(top_srcdir)/../config/no-executables.m4 \
- $(top_srcdir)/../config/tls.m4 $(top_srcdir)/../libtool.m4 \
- $(top_srcdir)/mingwld.m4 $(top_srcdir)/pkg.m4 \
- $(top_srcdir)/shlibpath.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/../config/tls.m4 \
+ $(top_srcdir)/../config/unwind_ipinfo.m4 \
+ $(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \
+ $(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
m4_include([../config/lib-prefix.m4])
m4_include([../config/no-executables.m4])
m4_include([../config/tls.m4])
+m4_include([../config/unwind_ipinfo.m4])
m4_include([../libtool.m4])
m4_include([mingwld.m4])
m4_include([pkg.m4])
mips*-*-linux*)
SIGNAL_HANDLER=include/mips-signal.h
;;
- *-*-darwin*)
+ powerpc*-*-darwin*)
SIGNAL_HANDLER=include/darwin-signal.h
;;
*)
fi
+# For _Unwind_GetIPInfo.
+
+
+
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+ echo "$as_me:$LINENO: checking for _Unwind_GetIPInfo" >&5
+echo $ECHO_N "checking for _Unwind_GetIPInfo... $ECHO_C" >&6
+ if test "${gcc_cv_getipinfo+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+extern "C" { extern void _Unwind_GetIPInfo(); }
+int
+main ()
+{
+_Unwind_GetIPInfo();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ gcc_cv_getipinfo=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gcc_cv_getipinfo=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+ if test $gcc_cv_getipinfo = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETIPINFO 1
+_ACEOF
+
+ fi
+ echo "$as_me:$LINENO: result: $gcc_cv_getipinfo" >&5
+echo "${ECHO_T}$gcc_cv_getipinfo" >&6
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
# Check if linker supports static linking on a per library basis
LD_START_STATIC_SPEC=
LD_FINISH_STATIC_SPEC=
# See if we support thread-local storage.
GCC_CHECK_TLS
+# For _Unwind_GetIPInfo.
+GCC_CHECK_UNWIND_GETIPINFO
+
# Check if linker supports static linking on a per library basis
LD_START_STATIC_SPEC=
LD_FINISH_STATIC_SPEC=
// Parse the LSDA header.
p = parse_lsda_header (context, language_specific_data, &info);
+#ifdef HAVE_GETIPINFO
ip = _Unwind_GetIPInfo (context, &ip_before_insn);
if (! ip_before_insn)
--ip;
+#else
+ ip = _Unwind_GetIP (context) - 1;
+#endif
landing_pad = 0;
action_record = 0;
handler_switch_value = 0;
$(top_srcdir)/../config/lib-link.m4 \
$(top_srcdir)/../config/lib-prefix.m4 \
$(top_srcdir)/../config/no-executables.m4 \
- $(top_srcdir)/../config/tls.m4 $(top_srcdir)/../libtool.m4 \
- $(top_srcdir)/mingwld.m4 $(top_srcdir)/pkg.m4 \
- $(top_srcdir)/shlibpath.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/../config/tls.m4 \
+ $(top_srcdir)/../config/unwind_ipinfo.m4 \
+ $(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \
+ $(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
CONFIG_HEADER = $(top_builddir)/include/config.h libgcj-config.h
$(top_srcdir)/../config/lib-link.m4 \
$(top_srcdir)/../config/lib-prefix.m4 \
$(top_srcdir)/../config/no-executables.m4 \
- $(top_srcdir)/../config/tls.m4 $(top_srcdir)/../libtool.m4 \
- $(top_srcdir)/mingwld.m4 $(top_srcdir)/pkg.m4 \
- $(top_srcdir)/shlibpath.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/../config/tls.m4 \
+ $(top_srcdir)/../config/unwind_ipinfo.m4 \
+ $(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \
+ $(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
CONFIG_HEADER = config.h $(top_builddir)/gcj/libgcj-config.h
/* Define to 1 if you have the `getifaddrs' function. */
#undef HAVE_GETIFADDRS
+/* Define if _Unwind_GetIPInfo is available. */
+#undef HAVE_GETIPINFO
+
/* Define to 1 if you have the `getpwuid_r' function. */
#undef HAVE_GETPWUID_R
else
#endif
{
+#ifdef HAVE_GETIPINFO
_Unwind_Ptr ip;
int ip_before_insn = 0;
ip = _Unwind_GetIPInfo (context, &ip_before_insn);
// to ensure we get the correct line number for the call itself.
if (! ip_before_insn)
--ip;
-
+#endif
state->frames[pos].type = frame_native;
+#ifdef HAVE_GETIPINFO
state->frames[pos].ip = (void *) ip;
+#else
+ state->frames[pos].ip = (void *) _Unwind_GetIP (context);
+#endif
state->frames[pos].start_ip = func_addr;
}
else
offset = (_Unwind_Ptr) ip - (_Unwind_Ptr) info.base;
+#ifndef HAVE_GETIPINFO
+ // The unwinder gives us the return address. In order to get the right
+ // line number for the stack trace, roll it back a little.
+ offset -= 1;
+#endif
+
finder->lookup (binaryName, (jlong) offset);
*sourceFileName = finder->getSourceFile();
*lineNum = finder->getLineNum();
$(top_srcdir)/../config/lib-link.m4 \
$(top_srcdir)/../config/lib-prefix.m4 \
$(top_srcdir)/../config/no-executables.m4 \
- $(top_srcdir)/../config/tls.m4 $(top_srcdir)/../libtool.m4 \
- $(top_srcdir)/mingwld.m4 $(top_srcdir)/pkg.m4 \
- $(top_srcdir)/shlibpath.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/../config/tls.m4 \
+ $(top_srcdir)/../config/unwind_ipinfo.m4 \
+ $(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \
+ $(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
CONFIG_HEADER = $(top_builddir)/include/config.h \