Merge
This commit is contained in:
commit
5db557f689
2
.hgtags
2
.hgtags
@ -203,3 +203,5 @@ d17eb2e13e362085e866d46235314c50cc4661cc jdk8-b77
|
||||
a1313a8d90d17d363a3b2a645dc4030ec204b168 jdk8-b79
|
||||
3fa21fbf9be7e6b482af43aacb6a09acfa30bdb6 jdk8-b80
|
||||
e41d716405b209d3eddef8bd4240cec2bd34dcca jdk8-b81
|
||||
5e8c55025644730385a6f8fa029ecdb2d2c98a07 jdk8-b82
|
||||
bcebd3fdefc91abb9d7fa0c5af6211b3f8720da6 jdk8-b83
|
||||
|
@ -203,3 +203,5 @@ fd1a5574cf68af24bfd52decc37ac6361afb278a jdk8-b78
|
||||
91d35211e74464dca5edf9b66ab01d0d0d8cded7 jdk8-b79
|
||||
907a926d3c96472f357617b48b6b968ea855c23c jdk8-b80
|
||||
145dbc56f931c134e837b675b9e6e7bf08902e93 jdk8-b81
|
||||
29153d0df68f84162ffe8c2cf4f402a3f2245e85 jdk8-b82
|
||||
466685ba01bfb7bc1e1ac61490fd8c0f3cc18763 jdk8-b83
|
||||
|
@ -43,14 +43,24 @@ fi
|
||||
|
||||
custom_hook=$custom_script_dir/custom-hook.m4
|
||||
|
||||
if test "x`which autoconf 2> /dev/null`" = x; then
|
||||
AUTOCONF=$(which autoconf 2> /dev/null);
|
||||
AUTOCONF_267=$(which autoconf-2.67 2> /dev/null);
|
||||
|
||||
echo "Autoconf found: ${AUTOCONF}"
|
||||
echo "Autoconf-2.67 found: ${AUTOCONF_267}"
|
||||
|
||||
if test "x${AUTOCONF}" = x; then
|
||||
echo You need autoconf installed to be able to regenerate the configure script
|
||||
echo Error: Cannot find autoconf 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo Generating generated-configure.sh
|
||||
cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | autoconf -W all -I$script_dir - > $script_dir/generated-configure.sh
|
||||
if test "x${AUTOCONF_267}" != x; then
|
||||
AUTOCONF=${AUTOCONF_267};
|
||||
fi
|
||||
|
||||
echo Generating generated-configure.sh with ${AUTOCONF}
|
||||
cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | ${AUTOCONF} -W all -I$script_dir - > $script_dir/generated-configure.sh
|
||||
rm -rf autom4te.cache
|
||||
|
||||
if test -e $custom_hook; then
|
||||
@ -58,7 +68,7 @@ if test -e $custom_hook; then
|
||||
# We have custom sources available; also generate configure script
|
||||
# with custom hooks compiled in.
|
||||
cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | \
|
||||
sed -e "s|#CUSTOM_AUTOCONF_INCLUDE|m4_include([$custom_hook])|" | autoconf -W all -I$script_dir - > $custom_script_dir/generated-configure.sh
|
||||
sed -e "s|#CUSTOM_AUTOCONF_INCLUDE|m4_include([$custom_hook])|" | ${AUTOCONF} -W all -I$script_dir - > $custom_script_dir/generated-configure.sh
|
||||
rm -rf autom4te.cache
|
||||
else
|
||||
echo No custom hook found: $custom_hook
|
||||
|
@ -1013,6 +1013,7 @@ with_freetype
|
||||
with_alsa
|
||||
with_alsa_include
|
||||
with_alsa_lib
|
||||
with_giflib
|
||||
with_zlib
|
||||
with_stdc__lib
|
||||
with_num_cores
|
||||
@ -1771,6 +1772,8 @@ Optional Packages:
|
||||
headers under PATH/include)
|
||||
--with-alsa-include specify directory for the alsa include files
|
||||
--with-alsa-lib specify directory for the alsa library
|
||||
--with-giflib use giflib from build system or OpenJDK source
|
||||
(system, bundled) [bundled]
|
||||
--with-zlib use zlib from build system or OpenJDK source
|
||||
(system, bundled) [bundled]
|
||||
--with-stdc++lib=<static>,<dynamic>,<default>
|
||||
@ -3753,7 +3756,7 @@ fi
|
||||
#CUSTOM_AUTOCONF_INCLUDE
|
||||
|
||||
# Do not change or remove the following line, it is needed for consistency checks:
|
||||
DATE_WHEN_GENERATED=1363706268
|
||||
DATE_WHEN_GENERATED=1364922883
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
@ -28903,14 +28906,15 @@ $as_echo "$ENABLE_DEBUG_SYMBOLS" >&6; }
|
||||
#
|
||||
# ZIP_DEBUGINFO_FILES
|
||||
#
|
||||
# Check whether --enable-zip-debug-info was given.
|
||||
if test "${enable_zip_debug_info+set}" = set; then :
|
||||
enableval=$enable_zip_debug_info;
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should zip debug-info files" >&5
|
||||
$as_echo_n "checking if we should zip debug-info files... " >&6; }
|
||||
# Check whether --enable-zip-debug-info was given.
|
||||
if test "${enable_zip_debug_info+set}" = set; then :
|
||||
enableval=$enable_zip_debug_info; enable_zip_debug_info="${enableval}"
|
||||
else
|
||||
enable_zip_debug_info="yes"
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enable_zip_debug_info}" >&5
|
||||
$as_echo "${enable_zip_debug_info}" >&6; }
|
||||
|
||||
@ -31178,10 +31182,44 @@ fi
|
||||
# Check for the gif library
|
||||
#
|
||||
|
||||
USE_EXTERNAL_LIBJPEG=true
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgif" >&5
|
||||
$as_echo_n "checking for main in -lgif... " >&6; }
|
||||
if ${ac_cv_lib_gif_main+:} false; then :
|
||||
|
||||
# Check whether --with-giflib was given.
|
||||
if test "${with_giflib+set}" = set; then :
|
||||
withval=$with_giflib;
|
||||
fi
|
||||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for which giflib to use" >&5
|
||||
$as_echo_n "checking for which giflib to use... " >&6; }
|
||||
|
||||
# default is bundled
|
||||
DEFAULT_GIFLIB=bundled
|
||||
|
||||
#
|
||||
# if user didn't specify, use DEFAULT_GIFLIB
|
||||
#
|
||||
if test "x${with_giflib}" = "x"; then
|
||||
with_giflib=${DEFAULT_GIFLIB}
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_giflib}" >&5
|
||||
$as_echo "${with_giflib}" >&6; }
|
||||
|
||||
if test "x${with_giflib}" = "xbundled"; then
|
||||
USE_EXTERNAL_LIBGIF=false
|
||||
elif test "x${with_giflib}" = "xsystem"; then
|
||||
ac_fn_cxx_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_gif_lib_h" = xyes; then :
|
||||
|
||||
else
|
||||
as_fn_error $? "--with-giflib=system specified, but gif_lib.h not found!" "$LINENO" 5
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifGetCode in -lgif" >&5
|
||||
$as_echo_n "checking for DGifGetCode in -lgif... " >&6; }
|
||||
if ${ac_cv_lib_gif_DGifGetCode+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
@ -31189,27 +31227,33 @@ LIBS="-lgif $LIBS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char DGifGetCode ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return main ();
|
||||
return DGifGetCode ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_cxx_try_link "$LINENO"; then :
|
||||
ac_cv_lib_gif_main=yes
|
||||
ac_cv_lib_gif_DGifGetCode=yes
|
||||
else
|
||||
ac_cv_lib_gif_main=no
|
||||
ac_cv_lib_gif_DGifGetCode=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_main" >&5
|
||||
$as_echo "$ac_cv_lib_gif_main" >&6; }
|
||||
if test "x$ac_cv_lib_gif_main" = xyes; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_DGifGetCode" >&5
|
||||
$as_echo "$ac_cv_lib_gif_DGifGetCode" >&6; }
|
||||
if test "x$ac_cv_lib_gif_DGifGetCode" = xyes; then :
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_LIBGIF 1
|
||||
_ACEOF
|
||||
@ -31217,13 +31261,15 @@ _ACEOF
|
||||
LIBS="-lgif $LIBS"
|
||||
|
||||
else
|
||||
USE_EXTERNAL_LIBGIF=false
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Will use gif decoder bundled with the OpenJDK source" >&5
|
||||
$as_echo "$as_me: Will use gif decoder bundled with the OpenJDK source" >&6;}
|
||||
|
||||
as_fn_error $? "--with-giflib=system specified, but no giflib found!" "$LINENO" 5
|
||||
fi
|
||||
|
||||
|
||||
USE_EXTERNAL_LIBGIF=true
|
||||
else
|
||||
as_fn_error $? "Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled'" "$LINENO" 5
|
||||
fi
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
|
@ -519,10 +519,10 @@ AC_MSG_RESULT([$ENABLE_DEBUG_SYMBOLS])
|
||||
#
|
||||
# ZIP_DEBUGINFO_FILES
|
||||
#
|
||||
AC_ARG_ENABLE([zip-debug-info],
|
||||
[AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])])
|
||||
|
||||
AC_MSG_CHECKING([if we should zip debug-info files])
|
||||
AC_ARG_ENABLE([zip-debug-info],
|
||||
[AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])],
|
||||
[enable_zip_debug_info="${enableval}"], [enable_zip_debug_info="yes"])
|
||||
AC_MSG_RESULT([${enable_zip_debug_info}])
|
||||
|
||||
if test "x${enable_zip_debug_info}" = "xno"; then
|
||||
|
@ -499,11 +499,36 @@ AC_SUBST(USE_EXTERNAL_LIBJPEG)
|
||||
# Check for the gif library
|
||||
#
|
||||
|
||||
USE_EXTERNAL_LIBJPEG=true
|
||||
AC_CHECK_LIB(gif, main, [],
|
||||
[ USE_EXTERNAL_LIBGIF=false
|
||||
AC_MSG_NOTICE([Will use gif decoder bundled with the OpenJDK source])
|
||||
])
|
||||
AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib],
|
||||
[use giflib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
|
||||
|
||||
|
||||
AC_MSG_CHECKING([for which giflib to use])
|
||||
|
||||
# default is bundled
|
||||
DEFAULT_GIFLIB=bundled
|
||||
|
||||
#
|
||||
# if user didn't specify, use DEFAULT_GIFLIB
|
||||
#
|
||||
if test "x${with_giflib}" = "x"; then
|
||||
with_giflib=${DEFAULT_GIFLIB}
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT(${with_giflib})
|
||||
|
||||
if test "x${with_giflib}" = "xbundled"; then
|
||||
USE_EXTERNAL_LIBGIF=false
|
||||
elif test "x${with_giflib}" = "xsystem"; then
|
||||
AC_CHECK_HEADER(gif_lib.h, [],
|
||||
[ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!])])
|
||||
AC_CHECK_LIB(gif, DGifGetCode, [],
|
||||
[ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])])
|
||||
|
||||
USE_EXTERNAL_LIBGIF=true
|
||||
else
|
||||
AC_MSG_ERROR([Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled'])
|
||||
fi
|
||||
AC_SUBST(USE_EXTERNAL_LIBGIF)
|
||||
|
||||
###############################################################################
|
||||
|
@ -51,9 +51,8 @@ decompress_paths=$(SED) -f $(SRC_ROOT)/common/makefiles/support/ListPathsSafely-
|
||||
-e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(SRC_ROOT)|g' \
|
||||
-e 's|X00|X|g' | tr '\n' '$2'
|
||||
|
||||
# Subst in an extra $ to prevent it from disappearing.
|
||||
define ListPathsSafely_If
|
||||
$(if $(word $3,$($1)),$(eval $1_LPS$3:=$(call compress_paths,$(subst $$,$$$$,$(wordlist $3,$4,$($1))))))
|
||||
$(if $(word $3,$($1)),$(eval $1_LPS$3:=$(call compress_paths,$(wordlist $3,$4,$($1)))))
|
||||
endef
|
||||
|
||||
define ListPathsSafely_Printf
|
||||
|
@ -203,3 +203,5 @@ d4e68ce17795601017ac2f952baad7272942c36e jdk8-b75
|
||||
e41fb1aa0329767b2737303c994e38bede1baa07 jdk8-b79
|
||||
5f3d4a6bdd027a1631d97e2dfff63fd5e46987a4 jdk8-b80
|
||||
2a00aeeb466b9dee22508f6261f63b70f9c696fe jdk8-b81
|
||||
48e1bc77004d9af575b733c04637b98fd17603c2 jdk8-b82
|
||||
a45bb25a67c7517b45f00c9682e317f46fecbba9 jdk8-b83
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,9 +23,9 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
orbd.usage=Utilizzo: {0} <opzioni> \n\ndove <opzioni> include:\n -port Porta di attivazione da cui avviare ORBD, valore predefinito 1049 (opzionale)\n -defaultdb Directory per i file ORBD, valore predefinito "./orb.db" (opzionale)\n -serverid ID server per ORBD, valore predefinito 1 (opzionale)\n -ORBInitialPort Porta iniziale (richiesta)\n -ORBInitialHost HostName iniziale (richiesto)\n
|
||||
orbd.usage=Uso: {0} <opzioni> \n\ndove <opzioni> include:\n -port Porta di attivazione da cui avviare ORBD, valore predefinito 1049 (opzionale)\n -defaultdb Directory per i file ORBD, valore predefinito "./orb.db" (opzionale)\n -serverid ID server per ORBD, valore predefinito 1 (opzionale)\n -ORBInitialPort Porta iniziale (richiesta)\n -ORBInitialHost HostName iniziale (richiesto)\n
|
||||
|
||||
servertool.usage=Utilizzo: {0} <opzioni> \n\ndove <opzioni> include:\n -ORBInitialPort Porta iniziale (richiesta)\n -ORBInitialHost HostName iniziale (richiesto)\n
|
||||
servertool.usage=Uso: {0} <opzioni> \n\ndove <opzioni> include:\n -ORBInitialPort Porta iniziale (richiesta)\n -ORBInitialHost HostName iniziale (richiesto)\n
|
||||
servertool.banner=\n\nBenvenuti in Java IDL Server Tool \nimmettere i comandi quando richiesto \n
|
||||
servertool.shorthelp=\n\n\tComandi disponibili:\n\t-------------------- \n
|
||||
servertool.baddef=Definizione server errata: {0}
|
||||
@ -82,13 +82,13 @@ servertool.quit1=esci dall'applicazione corrente
|
||||
servertool.help=\thelp\n\tOR\n\thelp <nome comando>\n
|
||||
servertool.help1=Guida
|
||||
|
||||
servertool.orbidmap=\tUtilizzo: orblist [ -serverid <id server> | -applicationName <nome> ]\n
|
||||
servertool.orbidmap=\tUso: orblist [ -serverid <id server> | -applicationName <nome> ]\n
|
||||
servertool.orbidmap1=lista nomi orb e relativa mappatura
|
||||
servertool.orbidmap2=\n\tId ORB\t\tNome ORB\n\t------\t\t--------\n
|
||||
pnameserv.success=NameServer persistente avviato correttamente
|
||||
|
||||
|
||||
bootstrap.usage=Utilizzo: {0} <opzioni> \n\ndove <opzioni> include:\n -ORBInitialPort Porta iniziale (richiesta)\n -InitialServicesFile File contenente la lista dei servizi iniziali (richiesto)\n
|
||||
bootstrap.usage=Uso: {0} <opzioni> \n\ndove <opzioni> include:\n -ORBInitialPort Porta iniziale (richiesta)\n -InitialServicesFile File contenente la lista dei servizi iniziali (richiesto)\n
|
||||
bootstrap.success=impostazione porta su {0} e lettura servizi da {1} in corso
|
||||
bootstrap.filenotreadable=il file {0} non \u00E8 leggibile
|
||||
bootstrap.filenotfound=impossibile trovare il file {0}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -60,12 +60,12 @@ servertool.getserverid=\n\tgetserverid [ -applicationName <name> ]\n
|
||||
servertool.getserverid1=applicationName\u306E\u30B5\u30FC\u30D0\u30FCID\u3092\u8FD4\u3057\u307E\u3059
|
||||
servertool.getserverid2=\tapplicationName {0}\u306E\u30B5\u30FC\u30D0\u30FCID\u306F{1}\u3067\u3059
|
||||
|
||||
servertool.list=\n\t\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059\n
|
||||
servertool.list=\n\tlist\n
|
||||
servertool.list1=\u767B\u9332\u3055\u308C\u305F\u3059\u3079\u3066\u306E\u30B5\u30FC\u30D0\u30FC\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059
|
||||
servertool.list2=\n\t\u30B5\u30FC\u30D0\u30FCID\t\u30B5\u30FC\u30D0\u30FC\u306E\u30AF\u30E9\u30B9\u540D\t\t\u30B5\u30FC\u30D0\u30FC\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\n\t---------\t----------------\t\t----------------------\n
|
||||
servertool.listactive=\n\t\u30A2\u30AF\u30C6\u30A3\u30D6\u306A\u30B5\u30FC\u30D0\u30FC\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059
|
||||
servertool.listactive=\n\tlistactive
|
||||
servertool.listactive1=\u73FE\u5728\u30A2\u30AF\u30C6\u30A3\u30D6\u306A\u30B5\u30FC\u30D0\u30FC\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059
|
||||
servertool.listappnames=\tapplicationNames\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059\n
|
||||
servertool.listappnames=\tlistappnames\n
|
||||
servertool.listappnames1=\u73FE\u5728\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308BapplicationNames\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059
|
||||
servertool.listappnames2=\u73FE\u5728\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308B\u30B5\u30FC\u30D0\u30FCapplicationNames:
|
||||
|
||||
@ -76,7 +76,7 @@ servertool.startserver=\n\tstartup [ -serverid <server id> | -applicationName <n
|
||||
servertool.startserver1=\u767B\u9332\u3055\u308C\u305F\u30B5\u30FC\u30D0\u30FC\u3092\u8D77\u52D5\u3057\u307E\u3059
|
||||
servertool.startserver2=\t\u30B5\u30FC\u30D0\u30FC\u306E\u8D77\u52D5\u306B\u6210\u529F\u3057\u307E\u3057\u305F\u3002
|
||||
|
||||
servertool.quit=\n\t\u7D42\u4E86\u3057\u307E\u3059\n
|
||||
servertool.quit=\n\tquit\n
|
||||
servertool.quit1=\u3053\u306E\u30C4\u30FC\u30EB\u3092\u7D42\u4E86\u3057\u307E\u3059
|
||||
|
||||
servertool.help=\thelp\n\t\u307E\u305F\u306F\n\thelp <command name>\n
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -68,7 +68,7 @@ Compile.parsing=%0\u306E\u89E3\u6790\u4E2D
|
||||
Compile.parseDone=\u5B8C\u4E86 - %0
|
||||
Compile.generating=%0\u306E\u751F\u6210\u4E2D
|
||||
Compile.genDone=\u5B8C\u4E86 - %0
|
||||
Deprecated.keyword=\u8B66\u544A: \u30AD\u30FC\u30EF\u30FC\u30C9`%0'\u306F\u63A8\u5968\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
|
||||
Deprecated.keyword=\u8B66\u544A: \u30AD\u30FC\u30EF\u30FC\u30C9`%0'\u306F\u975E\u63A8\u5968\u3067\u3059\u3002
|
||||
EvaluationException.1=%0\u6F14\u7B97\u5B50\u306E\u30AA\u30DA\u30E9\u30F3\u30C9\u306B\u4E00\u8CAB\u6027\u304C\u3042\u308A\u307E\u305B\u3093: %1\u304A\u3088\u3073%2\u3002
|
||||
EvaluationException.2=%0\u6F14\u7B97\u5B50\u306E\u30AA\u30DA\u30E9\u30F3\u30C9\u306F\u3001%1\u3067\u306F\u306A\u304F\u6570\u5024\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
|
||||
EvaluationException.or=\u30D3\u30C3\u30C8\u5358\u4F4D\u306EOR\u6F14\u7B97
|
||||
@ -114,7 +114,7 @@ ParseException.badRepIDPrefix=%0 (\u884C%1): \u30A4\u30F3\u30BF\u30D5\u30A7\u30F
|
||||
ParseException.badState=%0 (\u884C%1): %2\u306F\u30B9\u30C6\u30FC\u30C8\u30D5\u30EB\u30FB\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u3067\u304D\u307E\u305B\u3093\u3002\u8907\u6570\u306E\u30B9\u30C6\u30FC\u30C8\u30D5\u30EB\u89AA\u304C\u3042\u308A\u307E\u3059\u3002\n%3\n%4
|
||||
ParseException.branchLabel=%0 (\u884C%1): case %2\u306F\u3059\u3067\u306B\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n%3\n%4
|
||||
ParseException.branchName=%0 (\u884C%1): %2\u3068\u3044\u3046\u540D\u524D\u306E\u5206\u5C90\u306F\u3059\u3067\u306B\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n%3\n%4
|
||||
ParseException.duplicateInit=%0 (\u884C%1): \u521D\u671F\u5316\u5B50\u306B\u306F\u524D\u306E\u521D\u671F\u5316\u5B50\u3068\u540C\u3058\u7F72\u540D\u304C\u3042\u308A\u307E\u3059\u3002\n%2\n%3
|
||||
ParseException.duplicateInit=%0 (\u884C%1): \u521D\u671F\u5316\u5B50\u306B\u306F\u524D\u306E\u521D\u671F\u5316\u5B50\u3068\u540C\u3058\u30B7\u30B0\u30CD\u30C1\u30E3\u304C\u3042\u308A\u307E\u3059\u3002\n%2\n%3
|
||||
ParseException.duplicateState=%0 (\u884C%1): \u30C7\u30FC\u30BF\u30FB\u30E1\u30F3\u30D0\u30FC%2\u306E\u540D\u524D\u304C\u524D\u306E\u30C7\u30FC\u30BF\u30FB\u30E1\u30F3\u30D0\u30FC\u3068\u540C\u3058\u3067\u3059\u3002\n%3\n%4
|
||||
ParseException.elseNoIf=%0 (\u884C%1): \u4E00\u81F4\u3059\u308B#if\u304C\u306A\u3044#else\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\n%2\n%3
|
||||
ParseException.endNoIf=%0 (\u884C%1): \u4E00\u81F4\u3059\u308B#if\u304C\u306A\u3044#endif\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\n%2\n%3
|
||||
@ -146,7 +146,7 @@ ParseException.selfInherit=%0 (\u884C%1): %2\u3092\u305D\u308C\u81EA\u4F53\u304B
|
||||
ParseException.stringTooLong=%0 (\u884C%1): "%2"\u306F%3\u6587\u5B57\u4EE5\u5185\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n%4\n%5
|
||||
ParseException.syntax1=%0 (\u884C%1): `%2'\u304C\u5FC5\u8981\u3067\u3059\u304C\u3001`%3'\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\n%4\n%5
|
||||
ParseException.syntax2=%0 (\u884C%1): %2\u306E1\u3064\u304C\u5FC5\u8981\u3067\u3059\u304C\u3001`%3'\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\n%4\n%5
|
||||
ParseException.unclosed=%0: \u30B3\u30E1\u30F3\u30C8\u3067\u4E88\u671F\u3057\u306A\u3044EOF\u3092\u691C\u51FA\u3057\u307E\u3057\u305F\u3002
|
||||
ParseException.unclosed=%0: \u30B3\u30E1\u30F3\u30C8\u3067\u4E88\u671F\u3057\u306A\u3044\u30D5\u30A1\u30A4\u30EB\u306E\u7D42\u308F\u308A\u3092\u691C\u51FA\u3057\u307E\u3057\u305F\u3002
|
||||
ParseException.undeclaredType=%0 (\u884C%1): %2\u306F\u5BA3\u8A00\u3055\u308C\u3066\u3044\u306A\u3044\u578B\u3067\u3059\u3002\n%3\n%4
|
||||
ParseException.warning=%0 (\u884C%1): %2\n%3\n%4
|
||||
ParseException.constExprType=%0 (\u884C%1): \u5B9A\u6570\u5F0F\u306E\u578B\u306F%2\u3067\u3059\u304C\u3001%3\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n%4\n%5
|
||||
@ -173,5 +173,5 @@ default=\u30A8\u30E9\u30FC\u3002\u5B58\u5728\u3057\u306A\u3044\u30E1\u30C3\u30BB
|
||||
# -i, -d, -keep, -emitAll, -noWarn, -v, -verbose, -version, #define
|
||||
# Do not translate the string "java com.sun.tools.corba.se.idl.Compile"
|
||||
|
||||
usage=\u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u4F7F\u7528\u65B9\u6CD5:\n\ java com.sun.tools.corba.se.idl.Compile [options] <idl file>\n<idl file>\u306FIDL\u5B9A\u7FA9\u3092\u542B\u3080\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u3067\u3001\n[options]\u306F\u6B21\u306B\u30EA\u30B9\u30C8\u3059\u308B\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u7D44\u5408\u305B\u3067\u3059\u3002\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\n\u7701\u7565\u53EF\u80FD\u3067\u3001\u4EFB\u610F\u306E\u9806\u5E8F\u3067\u8868\u793A\u3055\u308C\u307E\u3059\u3002<idl file>\u306F\u5FC5\u9808\u3067\u3001\n\u6700\u5F8C\u306B\u8868\u793A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\ \n\u30AA\u30D7\u30B7\u30E7\u30F3:\n-d <symbol> IDL\u30D5\u30A1\u30A4\u30EB\u306E\u6B21\u306E\u884C\u3068\n\ \u540C\u3058\u3067\u3059: #define <symbol>\n-emitAll #included\u30D5\u30A1\u30A4\u30EB\u3067\u898B\u3064\u304B\u3063\u305F\u30BF\u30A4\u30D7\u3092\u542B\u3080\u3001\u3059\u3079\u3066\u306E\u30BF\u30A4\u30D7\u3092\n\ \u767A\u884C\u3057\u307E\u3059\u3002\n-i <include path> \u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u304C\n\ \u30B9\u30AD\u30E3\u30F3\u3055\u308C\u307E\u3059\u3002\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u5225\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002\n-keep \u751F\u6210\u3055\u308C\u308B\u30D5\u30A1\u30A4\u30EB\u304C\u3059\u3067\u306B\u5B58\u5728\u3059\u308B\u5834\u5408\u306F\u3001\u4E0A\u66F8\u304D\n\ \u3057\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u4E0A\u66F8\u304D\u3055\u308C\u307E\u3059\u3002\n-noWarn \u8B66\u544A\u3092\u51FA\u3055\u306A\u3044\u3088\u3046\u306B\u3057\u307E\u3059\u3002\n-v, -verbose \u8A73\u7D30\u30E2\u30FC\u30C9\u3002\n-version \u30D0\u30FC\u30B8\u30E7\u30F3\u756A\u53F7\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n
|
||||
usage=\u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u4F7F\u7528\u65B9\u6CD5:\n java com.sun.tools.corba.se.idl.Compile [options] <idl file>\n<idl file>\u306FIDL\u5B9A\u7FA9\u3092\u542B\u3080\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u3067\u3001\n[options]\u306F\u6B21\u306B\u30EA\u30B9\u30C8\u3059\u308B\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u7D44\u5408\u305B\u3067\u3059\u3002\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\n\u7701\u7565\u53EF\u80FD\u3067\u3001\u4EFB\u610F\u306E\u9806\u5E8F\u3067\u8868\u793A\u3055\u308C\u307E\u3059\u3002<idl file>\u306F\u5FC5\u9808\u3067\u3001\n\u6700\u5F8C\u306B\u8868\u793A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n \n\u30AA\u30D7\u30B7\u30E7\u30F3:\n-d <symbol> IDL\u30D5\u30A1\u30A4\u30EB\u306E\u6B21\u306E\u884C\u3068\n \u540C\u3058\u3067\u3059: #define <symbol>\n-emitAll #included\u30D5\u30A1\u30A4\u30EB\u3067\u898B\u3064\u304B\u3063\u305F\u30BF\u30A4\u30D7\u3092\u542B\u3080\u3001\u3059\u3079\u3066\u306E\u30BF\u30A4\u30D7\u3092\n \u767A\u884C\u3057\u307E\u3059\u3002\n-i <include path> \u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u304C\n \u30B9\u30AD\u30E3\u30F3\u3055\u308C\u307E\u3059\u3002\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u5225\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002\n-keep \u751F\u6210\u3055\u308C\u308B\u30D5\u30A1\u30A4\u30EB\u304C\u3059\u3067\u306B\u5B58\u5728\u3059\u308B\u5834\u5408\u306F\u3001\u4E0A\u66F8\u304D\n \u3057\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u4E0A\u66F8\u304D\u3055\u308C\u307E\u3059\u3002\n-noWarn \u8B66\u544A\u3092\u51FA\u3055\u306A\u3044\u3088\u3046\u306B\u3057\u307E\u3059\u3002\n-v, -verbose \u8A73\u7D30\u30E2\u30FC\u30C9\u3002\n-version \u30D0\u30FC\u30B8\u30E7\u30F3\u756A\u53F7\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n
|
||||
|
||||
|
@ -173,5 +173,5 @@ default=\u9519\u8BEF! \u8BF7\u6C42\u4E86\u4E0D\u5B58\u5728\u7684\u6D88\u606F\u30
|
||||
# -i, -d, -keep, -emitAll, -noWarn, -v, -verbose, -version, #define
|
||||
# Do not translate the string "java com.sun.tools.corba.se.idl.Compile"
|
||||
|
||||
usage=\u7F16\u8BD1\u5668\u7528\u6CD5:\n\ java com.sun.tools.corba.se.idl.Compile [\u9009\u9879] <idl \u6587\u4EF6>\n\u5176\u4E2D, <idl \u6587\u4EF6> \u662F\u5305\u542B IDL \u5B9A\u4E49\u7684\u6587\u4EF6\u7684\u540D\u79F0, \u800C\n[\u9009\u9879] \u662F\u4E0B\u5217\u9009\u9879\u7684\u4EFB\u610F\u7EC4\u5408\u3002\u8FD9\u4E9B\u9009\u9879\n\u662F\u53EF\u9009\u7684, \u5E76\u4E14\u663E\u793A\u987A\u5E8F\u5E76\u4E0D\u56FA\u5B9A; <idl \u6587\u4EF6> \u662F\u5FC5\u9700\u7684\n\u5E76\u4E14\u5FC5\u987B\u663E\u793A\u5728\u6700\u540E\u3002\n\ \n\u9009\u9879:\n-d <\u7B26\u53F7> \u8FD9\u7B49\u540C\u4E8E IDL \u6587\u4EF6\u4E2D\u7684\n\ \u4E0B\u9762\u4E00\u884C: #define <\u7B26\u53F7>\n-emitAll \u53D1\u51FA\u6240\u6709\u7C7B\u578B, \u5305\u62EC\u5728 #included\n\ \u6587\u4EF6\u4E2D\u627E\u5230\u7684\u7C7B\u578B\u3002\n-i <\u5305\u542B\u8DEF\u5F84> \u9ED8\u8BA4\u60C5\u51B5\u4E0B, \u5C06\u5728\u5F53\u524D\u76EE\u5F55\u4E2D\u626B\u63CF\n\ \u5305\u542B\u7684\u6587\u4EF6\u3002\u6B64\u9009\u9879\u5C06\u6DFB\u52A0\u53E6\u4E00\u4E2A\u76EE\u5F55\u3002\n-keep \u5982\u679C\u8981\u751F\u6210\u7684\u6587\u4EF6\u5DF2\u5B58\u5728, \u8BF7\u4E0D\u8981\n\ \u8986\u76D6\u5B83\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u4F1A\u8986\u76D6\u5B83\u3002\n-noWarn \u9690\u85CF\u8B66\u544A\u3002\n-v, -verbose \u8BE6\u7EC6\u6A21\u5F0F\u3002\n-version \u663E\u793A\u7248\u672C\u53F7\u3002\n
|
||||
usage=\u7F16\u8BD1\u5668\u7528\u6CD5:\n java com.sun.tools.corba.se.idl.Compile [\u9009\u9879] <idl \u6587\u4EF6>\n\u5176\u4E2D, <idl \u6587\u4EF6> \u662F\u5305\u542B IDL \u5B9A\u4E49\u7684\u6587\u4EF6\u7684\u540D\u79F0, \u800C\n[\u9009\u9879] \u662F\u4E0B\u5217\u9009\u9879\u7684\u4EFB\u610F\u7EC4\u5408\u3002\u8FD9\u4E9B\u9009\u9879\n\u662F\u53EF\u9009\u7684, \u5E76\u4E14\u663E\u793A\u987A\u5E8F\u5E76\u4E0D\u56FA\u5B9A; <idl \u6587\u4EF6> \u662F\u5FC5\u9700\u7684\n\u5E76\u4E14\u5FC5\u987B\u663E\u793A\u5728\u6700\u540E\u3002\n \n\u9009\u9879:\n-d <\u7B26\u53F7> \u8FD9\u7B49\u540C\u4E8E IDL \u6587\u4EF6\u4E2D\u7684\n \u4E0B\u9762\u4E00\u884C: #define <\u7B26\u53F7>\n-emitAll \u53D1\u51FA\u6240\u6709\u7C7B\u578B, \u5305\u62EC\u5728 #included\n \u6587\u4EF6\u4E2D\u627E\u5230\u7684\u7C7B\u578B\u3002\n-i <\u5305\u542B\u8DEF\u5F84> \u9ED8\u8BA4\u60C5\u51B5\u4E0B, \u5C06\u5728\u5F53\u524D\u76EE\u5F55\u4E2D\u626B\u63CF\n \u5305\u542B\u7684\u6587\u4EF6\u3002\u6B64\u9009\u9879\u5C06\u6DFB\u52A0\u53E6\u4E00\u4E2A\u76EE\u5F55\u3002\n-keep \u5982\u679C\u8981\u751F\u6210\u7684\u6587\u4EF6\u5DF2\u5B58\u5728, \u8BF7\u4E0D\u8981\n \u8986\u76D6\u5B83\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u4F1A\u8986\u76D6\u5B83\u3002\n-noWarn \u9690\u85CF\u8B66\u544A\u3002\n-v, -verbose \u8BE6\u7EC6\u6A21\u5F0F\u3002\n-version \u663E\u793A\u7248\u672C\u53F7\u3002\n
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -65,4 +65,4 @@ NameModifier.InvalidChar=\u6A21\u5F0F\u4E2D\u5305\u542B\u65E0\u6548\u5B57\u7B26
|
||||
# -d, -emitAll, -f, -i, -keep, -m, -sep, -pkgPrefix, -td, -v, -verbose, -version, -implbase
|
||||
# Do not translate the string "java com.sun.tools.corba.se.idl.toJavaPortable.Compile"
|
||||
#
|
||||
usage=\u7F16\u8BD1\u5668\u7528\u6CD5:\n\n\ java com.sun.tools.corba.se.idl.toJavaPortable.Compile [\u9009\u9879] <idl \u6587\u4EF6>\n\n\u5176\u4E2D, <idl \u6587\u4EF6> \u662F\u5305\u542B IDL \u5B9A\u4E49\u7684\u6587\u4EF6\u7684\u540D\u79F0, \u800C\n[\u9009\u9879] \u662F\u4E0B\u5217\u9009\u9879\u7684\u4EFB\u610F\u7EC4\u5408\u3002\u9009\u9879\n\u662F\u53EF\u9009\u7684, \u5E76\u4E14\u663E\u793A\u987A\u5E8F\u5E76\u4E0D\u56FA\u5B9A; <idl \u6587\u4EF6> \u662F\u5FC5\u9700\u7684,\n\u5E76\u4E14\u5FC5\u987B\u663E\u793A\u5728\u6700\u540E\u3002\n\ \n\u9009\u9879:\n-d <\u7B26\u53F7> \u8FD9\u7B49\u540C\u4E8E IDL \u6587\u4EF6\u4E2D\u7684\n\ \u4E0B\u9762\u4E00\u884C: #define <\u7B26\u53F7>\n-emitAll \u53D1\u51FA\u6240\u6709\u7C7B\u578B, \u5305\u62EC\u5728 #included \u6587\u4EF6\u4E2D\u627E\u5230\u7684\u7C7B\u578B\u3002\n-f<side> \u5B9A\u4E49\u8981\u53D1\u51FA\u54EA\u4E9B\u7ED1\u5B9A\u3002<side> \u662F client,\n\ server, all, serverTIE, allTIE \u4E4B\u4E00\u3002serverTIE \u548C allTIE\n\ \u5BFC\u81F4\u53D1\u51FA\u59D4\u6D3E\u6A21\u578B\u9AA8\u67B6\u3002\u5982\u679C\u672A\u4F7F\u7528\n\ \u6B64\u6807\u8BB0, \u5C06\u5047\u5B9A\u4E3A -fclient\u3002\n-i <\u5305\u542B\u8DEF\u5F84> \u9ED8\u8BA4\u60C5\u51B5\u4E0B, \u5C06\u5728\u5F53\u524D\u76EE\u5F55\u4E2D\u626B\u63CF\n\ \u5305\u542B\u7684\u6587\u4EF6\u3002\u6B64\u9009\u9879\u5C06\u6DFB\u52A0\u53E6\u4E00\u4E2A\u76EE\u5F55\u3002\n-keep \u5982\u679C\u8981\u751F\u6210\u7684\u6587\u4EF6\u5DF2\u5B58\u5728, \u8BF7\u4E0D\u8981\n\ \u8986\u76D6\u5B83\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u4F1A\u8986\u76D6\u5B83\u3002\n-noWarn \u9690\u85CF\u8B66\u544A\u3002\n-oldImplBase \u751F\u6210\u4E0E\u65E7\u7248 (1.4 \u7248\u4E4B\u524D) JDK ORB \u517C\u5BB9\u7684\u9AA8\u67B6\u3002\n-pkgPrefix <t> <\u524D\u7F00> \u5F53\u5728\u6587\u4EF6\u8303\u56F4\u5185\u9047\u5230\u7C7B\u578B\u6216\u6A21\u5757\u540D <t> \u65F6,\n\ \u5728\u4E3A <t> \u751F\u6210\u7684\u6240\u6709\u6587\u4EF6\u7684 Java \u7A0B\u5E8F\u5305\u540D\u524D\n\ \u6DFB\u52A0 <\u524D\u7F00>\u3002\n-pkgTranslate <t> <pkg> \u5F53\u9047\u5230\u7C7B\u578B\u6216\u6A21\u5757\u540D <t> \u65F6, \u5728\n\ \u751F\u6210\u7684 Java \u7A0B\u5E8F\u5305\u4E2D\u5C06\u5176\u66FF\u6362\u4E3A <pkg>\u3002\u8BF7\u6CE8\u610F, \n\ \u5C06\u9996\u5148\u8FDB\u884C pkgPrefix \u66F4\u6539\u3002<t> \u5FC5\u987B\u4E0E\n\ \u5B8C\u6574\u7A0B\u5E8F\u5305\u540D\u5B8C\u5168\u5339\u914D\u3002\u53E6\u5916, <t> \u4E0D\u80FD\u4E3A\n\ org, org.omg \u6216 org.omg \u7684\u4EFB\u4F55\u5B50\u7A0B\u5E8F\u5305\u3002\n-skeletonName <xxx%yyy> \u6839\u636E\u6A21\u5F0F\u547D\u540D\u9AA8\u67B6\u3002\n\ \u9ED8\u8BA4\u503C\u4E3A:\n\ %POA \u8868\u793A POA \u57FA\u7C7B (-fserver \u6216 -fall) \n\ _%ImplBase \u8868\u793A oldImplBase \u57FA\u7C7B\n\ (-oldImplBase \u548C (-fserver \u6216 -fall))\u3002\n-td <dir> \u4F7F\u7528 <dir> \u8868\u793A\u8F93\u51FA\u76EE\u5F55\u4EE5\u4EE3\u66FF\n\ \u5F53\u524D\u76EE\u5F55\u3002\n-tieName <xxx%yyy> \u6839\u636E\u6A21\u5F0F\u547D\u540D tie\u3002\u9ED8\u8BA4\u503C\u4E3A:\n\ %POATie \u8868\u793A POA tie (-fserverTie \u6216 -fallTie) \n\ %_Tie \u8868\u793A oldImplBase tie\n\ (-oldImplBase \u548C (-fserverTie \u6216 -fallTie))\u3002\n-v, -verbose \u8BE6\u7EC6\u6A21\u5F0F\u3002\n-version \u663E\u793A\u7248\u672C\u53F7\u5E76\u9000\u51FA\u3002\n
|
||||
usage=\u7F16\u8BD1\u5668\u7528\u6CD5:\n\n java com.sun.tools.corba.se.idl.toJavaPortable.Compile [\u9009\u9879] <idl \u6587\u4EF6>\n\n\u5176\u4E2D, <idl \u6587\u4EF6> \u662F\u5305\u542B IDL \u5B9A\u4E49\u7684\u6587\u4EF6\u7684\u540D\u79F0, \u800C\n[\u9009\u9879] \u662F\u4E0B\u5217\u9009\u9879\u7684\u4EFB\u610F\u7EC4\u5408\u3002\u9009\u9879\n\u662F\u53EF\u9009\u7684, \u5E76\u4E14\u663E\u793A\u987A\u5E8F\u5E76\u4E0D\u56FA\u5B9A; <idl \u6587\u4EF6> \u662F\u5FC5\u9700\u7684,\n\u5E76\u4E14\u5FC5\u987B\u663E\u793A\u5728\u6700\u540E\u3002\n \n\u9009\u9879:\n-d <\u7B26\u53F7> \u8FD9\u7B49\u540C\u4E8E IDL \u6587\u4EF6\u4E2D\u7684\n \u4E0B\u9762\u4E00\u884C: #define <\u7B26\u53F7>\n-emitAll \u53D1\u51FA\u6240\u6709\u7C7B\u578B, \u5305\u62EC\u5728 #included \u6587\u4EF6\u4E2D\u627E\u5230\u7684\u7C7B\u578B\u3002\n-f<side> \u5B9A\u4E49\u8981\u53D1\u51FA\u54EA\u4E9B\u7ED1\u5B9A\u3002<side> \u662F client,\n server, all, serverTIE, allTIE \u4E4B\u4E00\u3002serverTIE \u548C allTIE\n \u5BFC\u81F4\u53D1\u51FA\u59D4\u6D3E\u6A21\u578B\u9AA8\u67B6\u3002\u5982\u679C\u672A\u4F7F\u7528\n \u6B64\u6807\u8BB0, \u5C06\u5047\u5B9A\u4E3A -fclient\u3002\n-i <\u5305\u542B\u8DEF\u5F84> \u9ED8\u8BA4\u60C5\u51B5\u4E0B, \u5C06\u5728\u5F53\u524D\u76EE\u5F55\u4E2D\u626B\u63CF\n \u5305\u542B\u7684\u6587\u4EF6\u3002\u6B64\u9009\u9879\u5C06\u6DFB\u52A0\u53E6\u4E00\u4E2A\u76EE\u5F55\u3002\n-keep \u5982\u679C\u8981\u751F\u6210\u7684\u6587\u4EF6\u5DF2\u5B58\u5728, \u8BF7\u4E0D\u8981\n \u8986\u76D6\u5B83\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u4F1A\u8986\u76D6\u5B83\u3002\n-noWarn \u9690\u85CF\u8B66\u544A\u3002\n-oldImplBase \u751F\u6210\u4E0E\u65E7\u7248 (1.4 \u7248\u4E4B\u524D) JDK ORB \u517C\u5BB9\u7684\u9AA8\u67B6\u3002\n-pkgPrefix <t> <\u524D\u7F00> \u5F53\u5728\u6587\u4EF6\u8303\u56F4\u5185\u9047\u5230\u7C7B\u578B\u6216\u6A21\u5757\u540D <t> \u65F6,\n \u5728\u4E3A <t> \u751F\u6210\u7684\u6240\u6709\u6587\u4EF6\u7684 Java \u7A0B\u5E8F\u5305\u540D\u524D\n \u6DFB\u52A0 <\u524D\u7F00>\u3002\n-pkgTranslate <t> <pkg> \u5F53\u9047\u5230\u7C7B\u578B\u6216\u6A21\u5757\u540D <t> \u65F6, \u5728\n \u751F\u6210\u7684 Java \u7A0B\u5E8F\u5305\u4E2D\u5C06\u5176\u66FF\u6362\u4E3A <pkg>\u3002\u8BF7\u6CE8\u610F, \n \u5C06\u9996\u5148\u8FDB\u884C pkgPrefix \u66F4\u6539\u3002<t> \u5FC5\u987B\u4E0E\n \u5B8C\u6574\u7A0B\u5E8F\u5305\u540D\u5B8C\u5168\u5339\u914D\u3002\u53E6\u5916, <t> \u4E0D\u80FD\u4E3A\n org, org.omg \u6216 org.omg \u7684\u4EFB\u4F55\u5B50\u7A0B\u5E8F\u5305\u3002\n-skeletonName <xxx%yyy> \u6839\u636E\u6A21\u5F0F\u547D\u540D\u9AA8\u67B6\u3002\n \u9ED8\u8BA4\u503C\u4E3A:\n %POA \u8868\u793A POA \u57FA\u7C7B (-fserver \u6216 -fall) \n _%ImplBase \u8868\u793A oldImplBase \u57FA\u7C7B\n (-oldImplBase \u548C (-fserver \u6216 -fall))\u3002\n-td <dir> \u4F7F\u7528 <dir> \u8868\u793A\u8F93\u51FA\u76EE\u5F55\u4EE5\u4EE3\u66FF\n \u5F53\u524D\u76EE\u5F55\u3002\n-tieName <xxx%yyy> \u6839\u636E\u6A21\u5F0F\u547D\u540D tie\u3002\u9ED8\u8BA4\u503C\u4E3A:\n %POATie \u8868\u793A POA tie (-fserverTie \u6216 -fallTie) \n %_Tie \u8868\u793A oldImplBase tie\n (-oldImplBase \u548C (-fserverTie \u6216 -fallTie))\u3002\n-v, -verbose \u8BE6\u7EC6\u6A21\u5F0F\u3002\n-version \u663E\u793A\u7248\u672C\u53F7\u5E76\u9000\u51FA\u3002\n
|
||||
|
@ -324,3 +324,7 @@ df5396524152118535c36da5801d828b560d19a2 hs25-b21
|
||||
dd6350b4abc4a6c19c89dd982cc0e4f3d119885c hs25-b22
|
||||
65b797426a3bec6e91b64085a0cfb94adadb634a jdk8-b81
|
||||
0631ebcc45f05c73b09a56c2586685af1f781c1d hs25-b23
|
||||
3db4ab0e12f437fe374817de346b2b0c6b4a5b31 jdk8-b82
|
||||
e3a41fc0234895eba4f272b984f7dacff495f8eb hs25-b24
|
||||
1c8db54ee9f315e20d6d5d9bf0b5c10349e9d301 jdk8-b83
|
||||
8d0f263a370c5f3e61791bb06054560804117288 hs25-b25
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -40,12 +40,34 @@
|
||||
#import <errno.h>
|
||||
#import <sys/types.h>
|
||||
#import <sys/ptrace.h>
|
||||
#include "libproc_impl.h"
|
||||
|
||||
jboolean debug = JNI_FALSE;
|
||||
#define UNSUPPORTED_ARCH "Unsupported architecture!"
|
||||
|
||||
#if defined(x86_64) && !defined(amd64)
|
||||
#define amd64 1
|
||||
#endif
|
||||
|
||||
#if amd64
|
||||
#include "sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext.h"
|
||||
#else
|
||||
#error UNSUPPORTED_ARCH
|
||||
#endif
|
||||
|
||||
static jfieldID symbolicatorID = 0; // set in _init0
|
||||
static jfieldID taskID = 0; // set in _init0
|
||||
|
||||
static jfieldID p_ps_prochandle_ID = 0;
|
||||
static jfieldID loadObjectList_ID = 0;
|
||||
static jmethodID listAdd_ID = 0;
|
||||
|
||||
static jmethodID createClosestSymbol_ID = 0;
|
||||
static jmethodID createLoadObject_ID = 0;
|
||||
static jmethodID getJavaThreadsInfo_ID = 0;
|
||||
|
||||
// indicator if thread id (lwpid_t) was set
|
||||
static bool _threads_filled = false;
|
||||
|
||||
static void putSymbolicator(JNIEnv *env, jobject this_obj, id symbolicator) {
|
||||
(*env)->SetLongField(env, this_obj, symbolicatorID, (jlong)(intptr_t)symbolicator);
|
||||
}
|
||||
@ -76,6 +98,11 @@ static void throw_new_debugger_exception(JNIEnv* env, const char* errMsg) {
|
||||
(*env)->ThrowNew(env, (*env)->FindClass(env, "sun/jvm/hotspot/debugger/DebuggerException"), errMsg);
|
||||
}
|
||||
|
||||
static struct ps_prochandle* get_proc_handle(JNIEnv* env, jobject this_obj) {
|
||||
jlong ptr = (*env)->GetLongField(env, this_obj, p_ps_prochandle_ID);
|
||||
return (struct ps_prochandle*)(intptr_t)ptr;
|
||||
}
|
||||
|
||||
#if defined(__i386__)
|
||||
#define hsdb_thread_state_t x86_thread_state32_t
|
||||
#define hsdb_float_state_t x86_float_state32_t
|
||||
@ -91,7 +118,7 @@ static void throw_new_debugger_exception(JNIEnv* env, const char* errMsg) {
|
||||
#define HSDB_THREAD_STATE_COUNT x86_THREAD_STATE64_COUNT
|
||||
#define HSDB_FLOAT_STATE_COUNT x86_FLOAT_STATE64_COUNT
|
||||
#else
|
||||
#error "Unsupported architecture"
|
||||
#error UNSUPPORTED_ARCH
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -104,6 +131,66 @@ Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_init0(JNIEnv *env, jclass cls
|
||||
symbolicatorID = (*env)->GetFieldID(env, cls, "symbolicator", "J");
|
||||
taskID = (*env)->GetFieldID(env, cls, "task", "J");
|
||||
CHECK_EXCEPTION;
|
||||
|
||||
// for core file
|
||||
p_ps_prochandle_ID = (*env)->GetFieldID(env, cls, "p_ps_prochandle", "J");
|
||||
CHECK_EXCEPTION;
|
||||
loadObjectList_ID = (*env)->GetFieldID(env, cls, "loadObjectList", "Ljava/util/List;");
|
||||
CHECK_EXCEPTION;
|
||||
|
||||
// methods we use
|
||||
createClosestSymbol_ID = (*env)->GetMethodID(env, cls, "createClosestSymbol",
|
||||
"(Ljava/lang/String;J)Lsun/jvm/hotspot/debugger/cdbg/ClosestSymbol;");
|
||||
CHECK_EXCEPTION;
|
||||
createLoadObject_ID = (*env)->GetMethodID(env, cls, "createLoadObject",
|
||||
"(Ljava/lang/String;JJ)Lsun/jvm/hotspot/debugger/cdbg/LoadObject;");
|
||||
CHECK_EXCEPTION;
|
||||
|
||||
// java.util.List method we call
|
||||
jclass listClass = (*env)->FindClass(env, "java/util/List");
|
||||
CHECK_EXCEPTION;
|
||||
listAdd_ID = (*env)->GetMethodID(env, listClass, "add", "(Ljava/lang/Object;)Z");
|
||||
CHECK_EXCEPTION;
|
||||
getJavaThreadsInfo_ID = (*env)->GetMethodID(env, cls, "getJavaThreadsInfo",
|
||||
"()[J");
|
||||
CHECK_EXCEPTION;
|
||||
|
||||
init_libproc(getenv("LIBSAPROC_DEBUG") != NULL);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_getAddressSize
|
||||
(JNIEnv *env, jclass cls)
|
||||
{
|
||||
#ifdef _LP64
|
||||
return 8;
|
||||
#else
|
||||
#error UNSUPPORTED_ARCH
|
||||
#endif
|
||||
}
|
||||
|
||||
/** called by Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_lookupByName0 */
|
||||
jlong lookupByNameIncore(
|
||||
JNIEnv *env, struct ps_prochandle *ph, jobject this_obj, jstring objectName, jstring symbolName)
|
||||
{
|
||||
const char *objectName_cstr, *symbolName_cstr;
|
||||
jlong addr;
|
||||
jboolean isCopy;
|
||||
objectName_cstr = NULL;
|
||||
if (objectName != NULL) {
|
||||
objectName_cstr = (*env)->GetStringUTFChars(env, objectName, &isCopy);
|
||||
CHECK_EXCEPTION_(0);
|
||||
}
|
||||
symbolName_cstr = (*env)->GetStringUTFChars(env, symbolName, &isCopy);
|
||||
CHECK_EXCEPTION_(0);
|
||||
|
||||
print_debug("look for %s \n", symbolName_cstr);
|
||||
addr = (jlong) lookup_symbol(ph, objectName_cstr, symbolName_cstr);
|
||||
|
||||
if (objectName_cstr != NULL) {
|
||||
(*env)->ReleaseStringUTFChars(env, objectName, objectName_cstr);
|
||||
}
|
||||
(*env)->ReleaseStringUTFChars(env, symbolName, symbolName_cstr);
|
||||
return addr;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -116,14 +203,17 @@ Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_lookupByName0(
|
||||
JNIEnv *env, jobject this_obj,
|
||||
jstring objectName, jstring symbolName)
|
||||
{
|
||||
struct ps_prochandle* ph = get_proc_handle(env, this_obj);
|
||||
if (ph->core != NULL) {
|
||||
return lookupByNameIncore(env, ph, this_obj, objectName, symbolName);
|
||||
}
|
||||
|
||||
jlong address = 0;
|
||||
|
||||
JNF_COCOA_ENTER(env);
|
||||
NSString *symbolNameString = JNFJavaToNSString(env, symbolName);
|
||||
|
||||
if (debug) {
|
||||
printf("lookupInProcess called for %s\n", [symbolNameString UTF8String]);
|
||||
}
|
||||
print_debug("lookupInProcess called for %s\n", [symbolNameString UTF8String]);
|
||||
|
||||
id symbolicator = getSymbolicator(env, this_obj);
|
||||
if (symbolicator != nil) {
|
||||
@ -131,14 +221,48 @@ JNF_COCOA_ENTER(env);
|
||||
address = (jlong) dynamicCall(symbolicator, @selector(addressForSymbol:), symbolNameString);
|
||||
}
|
||||
|
||||
if (debug) {
|
||||
printf("address of symbol %s = %llx\n", [symbolNameString UTF8String], address);
|
||||
}
|
||||
print_debug("address of symbol %s = %llx\n", [symbolNameString UTF8String], address);
|
||||
JNF_COCOA_EXIT(env);
|
||||
|
||||
return address;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal
|
||||
* Method: lookupByAddress0
|
||||
* Signature: (J)Lsun/jvm/hotspot/debugger/cdbg/ClosestSymbol;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_lookupByAddress0
|
||||
(JNIEnv *env, jobject this_obj, jlong addr) {
|
||||
uintptr_t offset;
|
||||
const char* sym = NULL;
|
||||
|
||||
struct ps_prochandle* ph = get_proc_handle(env, this_obj);
|
||||
sym = symbol_for_pc(ph, (uintptr_t) addr, &offset);
|
||||
if (sym == NULL) return 0;
|
||||
return (*env)->CallObjectMethod(env, this_obj, createClosestSymbol_ID,
|
||||
(*env)->NewStringUTF(env, sym), (jlong)offset);
|
||||
}
|
||||
|
||||
/** called from Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_readBytesFromProcess0 */
|
||||
jbyteArray readBytesFromCore(
|
||||
JNIEnv *env, struct ps_prochandle *ph, jobject this_obj, jlong addr, jlong numBytes)
|
||||
{
|
||||
jboolean isCopy;
|
||||
jbyteArray array;
|
||||
jbyte *bufPtr;
|
||||
ps_err_e err;
|
||||
|
||||
array = (*env)->NewByteArray(env, numBytes);
|
||||
CHECK_EXCEPTION_(0);
|
||||
bufPtr = (*env)->GetByteArrayElements(env, array, &isCopy);
|
||||
CHECK_EXCEPTION_(0);
|
||||
|
||||
err = ps_pread(ph, (psaddr_t) (uintptr_t)addr, bufPtr, numBytes);
|
||||
(*env)->ReleaseByteArrayElements(env, array, bufPtr, 0);
|
||||
return (err == PS_OK)? array : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal
|
||||
* Method: readBytesFromProcess0
|
||||
@ -149,12 +273,15 @@ Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_readBytesFromProcess0(
|
||||
JNIEnv *env, jobject this_obj,
|
||||
jlong addr, jlong numBytes)
|
||||
{
|
||||
if (debug) printf("readBytesFromProcess called. addr = %llx numBytes = %lld\n", addr, numBytes);
|
||||
print_debug("readBytesFromProcess called. addr = %llx numBytes = %lld\n", addr, numBytes);
|
||||
|
||||
// must allocate storage instead of using former parameter buf
|
||||
jboolean isCopy;
|
||||
jbyteArray array;
|
||||
jbyte *bufPtr;
|
||||
|
||||
struct ps_prochandle* ph = get_proc_handle(env, this_obj);
|
||||
if (ph->core != NULL) {
|
||||
return readBytesFromCore(env, ph, this_obj, addr, numBytes);
|
||||
}
|
||||
|
||||
array = (*env)->NewByteArray(env, numBytes);
|
||||
CHECK_EXCEPTION_(0);
|
||||
@ -189,7 +316,7 @@ Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_readBytesFromProcess0(
|
||||
// assume all failures are unmapped pages
|
||||
}
|
||||
|
||||
if (debug) fprintf(stderr, "%ld pages\n", pageCount);
|
||||
print_debug("%ld pages\n", pageCount);
|
||||
|
||||
remaining = numBytes;
|
||||
|
||||
@ -207,7 +334,7 @@ Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_readBytesFromProcess0(
|
||||
}
|
||||
|
||||
if (mapped[i]) {
|
||||
if (debug) fprintf(stderr, "page %d mapped (len %ld start %ld)\n", i, len, start);
|
||||
print_debug("page %d mapped (len %ld start %ld)\n", i, len, start);
|
||||
(*env)->SetByteArrayRegion(env, array, 0, len, ((jbyte *) pages[i] + start));
|
||||
vm_deallocate(mach_task_self(), pages[i], vm_page_size);
|
||||
}
|
||||
@ -220,6 +347,115 @@ Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_readBytesFromProcess0(
|
||||
return array;
|
||||
}
|
||||
|
||||
/** Only used for core file reading, set thread_id for threads which is got after core file parsed.
|
||||
* Thread context is available in Mach-O core file but thread id is not. We can get thread id
|
||||
* from Threads which store all java threads information when they are created. Here we can identify
|
||||
* them as java threads by checking if a thread's rsp or rbp within a java thread's stack.
|
||||
* Note Macosx uses unique_thread_id which is different from other platforms though printed ids
|
||||
* are still pthread id. Function BsdDebuggerLocal.getJavaThreadsInfo returns an array of long
|
||||
* integers to host all java threads' id, stack_start, stack_end as:
|
||||
* [uid0, stack_start0, stack_end0, uid1, stack_start1, stack_end1, ...]
|
||||
*
|
||||
* The work cannot be done at init0 since Threads is not available yet(VM not initialized yet).
|
||||
* This function should be called only once if succeeded
|
||||
*/
|
||||
bool fill_java_threads(JNIEnv* env, jobject this_obj, struct ps_prochandle* ph) {
|
||||
int n = 0, i = 0, j;
|
||||
struct reg regs;
|
||||
|
||||
jlongArray thrinfos = (*env)->CallObjectMethod(env, this_obj, getJavaThreadsInfo_ID);
|
||||
CHECK_EXCEPTION_(false);
|
||||
int len = (int)(*env)->GetArrayLength(env, thrinfos);
|
||||
uint64_t* cinfos = (uint64_t *)(*env)->GetLongArrayElements(env, thrinfos, NULL);
|
||||
CHECK_EXCEPTION_(false);
|
||||
n = get_num_threads(ph);
|
||||
print_debug("fill_java_threads called, num_of_thread = %d\n", n);
|
||||
for (i = 0; i < n; i++) {
|
||||
if (!get_nth_lwp_regs(ph, i, ®s)) {
|
||||
print_debug("Could not get regs of thread %d, already set!\n", i);
|
||||
return false;
|
||||
}
|
||||
for (j = 0; j < len; j += 3) {
|
||||
lwpid_t uid = cinfos[j];
|
||||
uint64_t beg = cinfos[j + 1];
|
||||
uint64_t end = cinfos[j + 2];
|
||||
if ((regs.r_rsp < end && regs.r_rsp >= beg) ||
|
||||
(regs.r_rbp < end && regs.r_rbp >= beg)) {
|
||||
set_lwp_id(ph, i, uid);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
(*env)->ReleaseLongArrayElements(env, thrinfos, (jlong*)cinfos, 0);
|
||||
CHECK_EXCEPTION_(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* For core file only, called from
|
||||
* Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_getThreadIntegerRegisterSet0
|
||||
*/
|
||||
jlongArray getThreadIntegerRegisterSetFromCore(JNIEnv *env, jobject this_obj, long lwp_id) {
|
||||
if (!_threads_filled) {
|
||||
if (!fill_java_threads(env, this_obj, get_proc_handle(env, this_obj))) {
|
||||
throw_new_debugger_exception(env, "Failed to fill in threads");
|
||||
return 0;
|
||||
} else {
|
||||
_threads_filled = true;
|
||||
}
|
||||
}
|
||||
|
||||
struct reg gregs;
|
||||
jboolean isCopy;
|
||||
jlongArray array;
|
||||
jlong *regs;
|
||||
|
||||
struct ps_prochandle* ph = get_proc_handle(env, this_obj);
|
||||
if (get_lwp_regs(ph, lwp_id, &gregs) != true) {
|
||||
THROW_NEW_DEBUGGER_EXCEPTION_("get_thread_regs failed for a lwp", 0);
|
||||
}
|
||||
|
||||
#undef NPRGREG
|
||||
#undef REG_INDEX
|
||||
#if amd64
|
||||
#define NPRGREG sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_NPRGREG
|
||||
#define REG_INDEX(reg) sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_##reg
|
||||
|
||||
array = (*env)->NewLongArray(env, NPRGREG);
|
||||
CHECK_EXCEPTION_(0);
|
||||
regs = (*env)->GetLongArrayElements(env, array, &isCopy);
|
||||
|
||||
regs[REG_INDEX(R15)] = gregs.r_r15;
|
||||
regs[REG_INDEX(R14)] = gregs.r_r14;
|
||||
regs[REG_INDEX(R13)] = gregs.r_r13;
|
||||
regs[REG_INDEX(R12)] = gregs.r_r12;
|
||||
regs[REG_INDEX(RBP)] = gregs.r_rbp;
|
||||
regs[REG_INDEX(RBX)] = gregs.r_rbx;
|
||||
regs[REG_INDEX(R11)] = gregs.r_r11;
|
||||
regs[REG_INDEX(R10)] = gregs.r_r10;
|
||||
regs[REG_INDEX(R9)] = gregs.r_r9;
|
||||
regs[REG_INDEX(R8)] = gregs.r_r8;
|
||||
regs[REG_INDEX(RAX)] = gregs.r_rax;
|
||||
regs[REG_INDEX(RCX)] = gregs.r_rcx;
|
||||
regs[REG_INDEX(RDX)] = gregs.r_rdx;
|
||||
regs[REG_INDEX(RSI)] = gregs.r_rsi;
|
||||
regs[REG_INDEX(RDI)] = gregs.r_rdi;
|
||||
regs[REG_INDEX(RIP)] = gregs.r_rip;
|
||||
regs[REG_INDEX(CS)] = gregs.r_cs;
|
||||
regs[REG_INDEX(RSP)] = gregs.r_rsp;
|
||||
regs[REG_INDEX(SS)] = gregs.r_ss;
|
||||
regs[REG_INDEX(FSBASE)] = 0;
|
||||
regs[REG_INDEX(GSBASE)] = 0;
|
||||
regs[REG_INDEX(DS)] = gregs.r_ds;
|
||||
regs[REG_INDEX(ES)] = gregs.r_es;
|
||||
regs[REG_INDEX(FS)] = gregs.r_fs;
|
||||
regs[REG_INDEX(GS)] = gregs.r_gs;
|
||||
regs[REG_INDEX(TRAPNO)] = gregs.r_trapno;
|
||||
regs[REG_INDEX(RFL)] = gregs.r_rflags;
|
||||
|
||||
#endif /* amd64 */
|
||||
(*env)->ReleaseLongArrayElements(env, array, regs, JNI_COMMIT);
|
||||
return array;
|
||||
}
|
||||
|
||||
/*
|
||||
* Lookup the thread_t that corresponds to the given thread_id.
|
||||
@ -232,9 +468,7 @@ Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_readBytesFromProcess0(
|
||||
*/
|
||||
thread_t
|
||||
lookupThreadFromThreadId(task_t task, jlong thread_id) {
|
||||
if (debug) {
|
||||
printf("lookupThreadFromThreadId thread_id=0x%llx\n", thread_id);
|
||||
}
|
||||
print_debug("lookupThreadFromThreadId thread_id=0x%llx\n", thread_id);
|
||||
|
||||
thread_array_t thread_list = NULL;
|
||||
mach_msg_type_number_t thread_list_count = 0;
|
||||
@ -244,9 +478,7 @@ lookupThreadFromThreadId(task_t task, jlong thread_id) {
|
||||
// get the list of all the send rights
|
||||
kern_return_t result = task_threads(task, &thread_list, &thread_list_count);
|
||||
if (result != KERN_SUCCESS) {
|
||||
if (debug) {
|
||||
printf("task_threads returned 0x%x\n", result);
|
||||
}
|
||||
print_debug("task_threads returned 0x%x\n", result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -257,9 +489,7 @@ lookupThreadFromThreadId(task_t task, jlong thread_id) {
|
||||
// get the THREAD_IDENTIFIER_INFO for the send right
|
||||
result = thread_info(thread_list[i], THREAD_IDENTIFIER_INFO, (thread_info_t) &m_ident_info, &count);
|
||||
if (result != KERN_SUCCESS) {
|
||||
if (debug) {
|
||||
printf("thread_info returned 0x%x\n", result);
|
||||
}
|
||||
print_debug("thread_info returned 0x%x\n", result);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -288,15 +518,17 @@ Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_getThreadIntegerRegisterSet0(
|
||||
JNIEnv *env, jobject this_obj,
|
||||
jlong thread_id)
|
||||
{
|
||||
if (debug)
|
||||
printf("getThreadRegisterSet0 called\n");
|
||||
print_debug("getThreadRegisterSet0 called\n");
|
||||
|
||||
struct ps_prochandle* ph = get_proc_handle(env, this_obj);
|
||||
if (ph->core != NULL) {
|
||||
return getThreadIntegerRegisterSetFromCore(env, this_obj, thread_id);
|
||||
}
|
||||
|
||||
kern_return_t result;
|
||||
thread_t tid;
|
||||
mach_msg_type_number_t count = HSDB_THREAD_STATE_COUNT;
|
||||
hsdb_thread_state_t state;
|
||||
unsigned int *r;
|
||||
int i;
|
||||
jlongArray registerArray;
|
||||
jlong *primitiveArray;
|
||||
task_t gTask = getTask(env, this_obj);
|
||||
@ -306,97 +538,56 @@ Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_getThreadIntegerRegisterSet0(
|
||||
result = thread_get_state(tid, HSDB_THREAD_STATE, (thread_state_t)&state, &count);
|
||||
|
||||
if (result != KERN_SUCCESS) {
|
||||
if (debug)
|
||||
printf("getregs: thread_get_state(%d) failed (%d)\n", tid, result);
|
||||
print_error("getregs: thread_get_state(%d) failed (%d)\n", tid, result);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// 40 32-bit registers on ppc, 16 on x86.
|
||||
// Output order is the same as the order in the ppc_thread_state/i386_thread_state struct.
|
||||
#if defined(__i386__)
|
||||
r = (unsigned int *)&state;
|
||||
registerArray = (*env)->NewLongArray(env, 8);
|
||||
primitiveArray = (*env)->GetLongArrayElements(env, registerArray, NULL);
|
||||
primitiveArray[0] = r[0]; // eax
|
||||
primitiveArray[1] = r[2]; // ecx
|
||||
primitiveArray[2] = r[3]; // edx
|
||||
primitiveArray[3] = r[1]; // ebx
|
||||
primitiveArray[4] = r[7]; // esp
|
||||
primitiveArray[5] = r[6]; // ebp
|
||||
primitiveArray[6] = r[5]; // esi
|
||||
primitiveArray[7] = r[4]; // edi
|
||||
(*env)->ReleaseLongArrayElements(env, registerArray, primitiveArray, 0);
|
||||
#elif defined(__x86_64__)
|
||||
/* From AMD64ThreadContext.java
|
||||
public static final int R15 = 0;
|
||||
public static final int R14 = 1;
|
||||
public static final int R13 = 2;
|
||||
public static final int R12 = 3;
|
||||
public static final int R11 = 4;
|
||||
public static final int R10 = 5;
|
||||
public static final int R9 = 6;
|
||||
public static final int R8 = 7;
|
||||
public static final int RDI = 8;
|
||||
public static final int RSI = 9;
|
||||
public static final int RBP = 10;
|
||||
public static final int RBX = 11;
|
||||
public static final int RDX = 12;
|
||||
public static final int RCX = 13;
|
||||
public static final int RAX = 14;
|
||||
public static final int TRAPNO = 15;
|
||||
public static final int ERR = 16;
|
||||
public static final int RIP = 17;
|
||||
public static final int CS = 18;
|
||||
public static final int RFL = 19;
|
||||
public static final int RSP = 20;
|
||||
public static final int SS = 21;
|
||||
public static final int FS = 22;
|
||||
public static final int GS = 23;
|
||||
public static final int ES = 24;
|
||||
public static final int DS = 25;
|
||||
public static final int FSBASE = 26;
|
||||
public static final int GSBASE = 27;
|
||||
*/
|
||||
// 64 bit
|
||||
if (debug) printf("Getting threads for a 64-bit process\n");
|
||||
registerArray = (*env)->NewLongArray(env, 28);
|
||||
primitiveArray = (*env)->GetLongArrayElements(env, registerArray, NULL);
|
||||
#if amd64
|
||||
#define NPRGREG sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_NPRGREG
|
||||
#undef REG_INDEX
|
||||
#define REG_INDEX(reg) sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_##reg
|
||||
|
||||
primitiveArray[0] = state.__r15;
|
||||
primitiveArray[1] = state.__r14;
|
||||
primitiveArray[2] = state.__r13;
|
||||
primitiveArray[3] = state.__r12;
|
||||
primitiveArray[4] = state.__r11;
|
||||
primitiveArray[5] = state.__r10;
|
||||
primitiveArray[6] = state.__r9;
|
||||
primitiveArray[7] = state.__r8;
|
||||
primitiveArray[8] = state.__rdi;
|
||||
primitiveArray[9] = state.__rsi;
|
||||
primitiveArray[10] = state.__rbp;
|
||||
primitiveArray[11] = state.__rbx;
|
||||
primitiveArray[12] = state.__rdx;
|
||||
primitiveArray[13] = state.__rcx;
|
||||
primitiveArray[14] = state.__rax;
|
||||
primitiveArray[15] = 0; // trapno ?
|
||||
primitiveArray[16] = 0; // err ?
|
||||
primitiveArray[17] = state.__rip;
|
||||
primitiveArray[18] = state.__cs;
|
||||
primitiveArray[19] = state.__rflags;
|
||||
primitiveArray[20] = state.__rsp;
|
||||
primitiveArray[21] = 0; // We don't have SS
|
||||
primitiveArray[22] = state.__fs;
|
||||
primitiveArray[23] = state.__gs;
|
||||
primitiveArray[24] = 0;
|
||||
primitiveArray[25] = 0;
|
||||
primitiveArray[26] = 0;
|
||||
primitiveArray[27] = 0;
|
||||
// 64 bit
|
||||
print_debug("Getting threads for a 64-bit process\n");
|
||||
registerArray = (*env)->NewLongArray(env, NPRGREG);
|
||||
CHECK_EXCEPTION_(0);
|
||||
primitiveArray = (*env)->GetLongArrayElements(env, registerArray, NULL);
|
||||
|
||||
if (debug) printf("set registers\n");
|
||||
primitiveArray[REG_INDEX(R15)] = state.__r15;
|
||||
primitiveArray[REG_INDEX(R14)] = state.__r14;
|
||||
primitiveArray[REG_INDEX(R13)] = state.__r13;
|
||||
primitiveArray[REG_INDEX(R12)] = state.__r12;
|
||||
primitiveArray[REG_INDEX(R11)] = state.__r11;
|
||||
primitiveArray[REG_INDEX(R10)] = state.__r10;
|
||||
primitiveArray[REG_INDEX(R9)] = state.__r9;
|
||||
primitiveArray[REG_INDEX(R8)] = state.__r8;
|
||||
primitiveArray[REG_INDEX(RDI)] = state.__rdi;
|
||||
primitiveArray[REG_INDEX(RSI)] = state.__rsi;
|
||||
primitiveArray[REG_INDEX(RBP)] = state.__rbp;
|
||||
primitiveArray[REG_INDEX(RBX)] = state.__rbx;
|
||||
primitiveArray[REG_INDEX(RDX)] = state.__rdx;
|
||||
primitiveArray[REG_INDEX(RCX)] = state.__rcx;
|
||||
primitiveArray[REG_INDEX(RAX)] = state.__rax;
|
||||
primitiveArray[REG_INDEX(TRAPNO)] = 0; // trapno, not used
|
||||
primitiveArray[REG_INDEX(ERR)] = 0; // err, not used
|
||||
primitiveArray[REG_INDEX(RIP)] = state.__rip;
|
||||
primitiveArray[REG_INDEX(CS)] = state.__cs;
|
||||
primitiveArray[REG_INDEX(RFL)] = state.__rflags;
|
||||
primitiveArray[REG_INDEX(RSP)] = state.__rsp;
|
||||
primitiveArray[REG_INDEX(SS)] = 0; // We don't have SS
|
||||
primitiveArray[REG_INDEX(FS)] = state.__fs;
|
||||
primitiveArray[REG_INDEX(GS)] = state.__gs;
|
||||
primitiveArray[REG_INDEX(ES)] = 0;
|
||||
primitiveArray[REG_INDEX(DS)] = 0;
|
||||
primitiveArray[REG_INDEX(FSBASE)] = 0;
|
||||
primitiveArray[REG_INDEX(GSBASE)] = 0;
|
||||
print_debug("set registers\n");
|
||||
|
||||
(*env)->ReleaseLongArrayElements(env, registerArray, primitiveArray, 0);
|
||||
|
||||
(*env)->ReleaseLongArrayElements(env, registerArray, primitiveArray, 0);
|
||||
#else
|
||||
#error Unsupported architecture
|
||||
#endif
|
||||
#error UNSUPPORTED_ARCH
|
||||
#endif /* amd64 */
|
||||
|
||||
return registerArray;
|
||||
}
|
||||
@ -410,8 +601,7 @@ JNIEXPORT jint JNICALL
|
||||
Java_sun_jvm_hotspot_debugger_macosx_MacOSXDebuggerLocal_translateTID0(
|
||||
JNIEnv *env, jobject this_obj, jint tid)
|
||||
{
|
||||
if (debug)
|
||||
printf("translateTID0 called on tid = 0x%x\n", (int)tid);
|
||||
print_debug("translateTID0 called on tid = 0x%x\n", (int)tid);
|
||||
|
||||
kern_return_t result;
|
||||
thread_t foreign_tid, usable_tid;
|
||||
@ -426,8 +616,7 @@ Java_sun_jvm_hotspot_debugger_macosx_MacOSXDebuggerLocal_translateTID0(
|
||||
if (result != KERN_SUCCESS)
|
||||
return -1;
|
||||
|
||||
if (debug)
|
||||
printf("translateTID0: 0x%x -> 0x%x\n", foreign_tid, usable_tid);
|
||||
print_debug("translateTID0: 0x%x -> 0x%x\n", foreign_tid, usable_tid);
|
||||
|
||||
return (jint) usable_tid;
|
||||
}
|
||||
@ -437,7 +626,7 @@ static bool ptrace_continue(pid_t pid, int signal) {
|
||||
// pass the signal to the process so we don't swallow it
|
||||
int res;
|
||||
if ((res = ptrace(PT_CONTINUE, pid, (caddr_t)1, signal)) < 0) {
|
||||
fprintf(stderr, "attach: ptrace(PT_CONTINUE, %d) failed with %d\n", pid, res);
|
||||
print_error("attach: ptrace(PT_CONTINUE, %d) failed with %d\n", pid, res);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -461,11 +650,11 @@ static bool ptrace_waitpid(pid_t pid) {
|
||||
return true;
|
||||
}
|
||||
if (!ptrace_continue(pid, WSTOPSIG(status))) {
|
||||
fprintf(stderr, "attach: Failed to correctly attach to VM. VM might HANG! [PTRACE_CONT failed, stopped by %d]\n", WSTOPSIG(status));
|
||||
print_error("attach: Failed to correctly attach to VM. VM might HANG! [PTRACE_CONT failed, stopped by %d]\n", WSTOPSIG(status));
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "attach: waitpid(): Child process exited/terminated (status = 0x%x)\n", status);
|
||||
print_error("attach: waitpid(): Child process exited/terminated (status = 0x%x)\n", status);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
@ -474,13 +663,13 @@ static bool ptrace_waitpid(pid_t pid) {
|
||||
continue;
|
||||
break;
|
||||
case ECHILD:
|
||||
fprintf(stderr, "attach: waitpid() failed. Child process pid (%d) does not exist \n", pid);
|
||||
print_error("attach: waitpid() failed. Child process pid (%d) does not exist \n", pid);
|
||||
break;
|
||||
case EINVAL:
|
||||
fprintf(stderr, "attach: waitpid() failed. Invalid options argument.\n");
|
||||
print_error("attach: waitpid() failed. Invalid options argument.\n");
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "attach: waitpid() failed. Unexpected error %d\n",errno);
|
||||
print_error("attach: waitpid() failed. Unexpected error %d\n",errno);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
@ -492,7 +681,7 @@ static bool ptrace_waitpid(pid_t pid) {
|
||||
static bool ptrace_attach(pid_t pid) {
|
||||
int res;
|
||||
if ((res = ptrace(PT_ATTACH, pid, 0, 0)) < 0) {
|
||||
fprintf(stderr, "ptrace(PT_ATTACH, %d) failed with %d\n", pid, res);
|
||||
print_error("ptrace(PT_ATTACH, %d) failed with %d\n", pid, res);
|
||||
return false;
|
||||
} else {
|
||||
return ptrace_waitpid(pid);
|
||||
@ -504,23 +693,19 @@ static bool ptrace_attach(pid_t pid) {
|
||||
* Method: attach0
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
JNIEXPORT void JNICALL
|
||||
Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_attach0__I(
|
||||
JNIEnv *env, jobject this_obj, jint jpid)
|
||||
JNIEnv *env, jobject this_obj, jint jpid)
|
||||
{
|
||||
print_debug("attach0 called for jpid=%d\n", (int)jpid);
|
||||
|
||||
JNF_COCOA_ENTER(env);
|
||||
if (getenv("JAVA_SAPROC_DEBUG") != NULL)
|
||||
debug = JNI_TRUE;
|
||||
else
|
||||
debug = JNI_FALSE;
|
||||
if (debug) printf("attach0 called for jpid=%d\n", (int)jpid);
|
||||
|
||||
// get the task from the pid
|
||||
|
||||
kern_return_t result;
|
||||
task_t gTask = 0;
|
||||
result = task_for_pid(mach_task_self(), jpid, &gTask);
|
||||
if (result != KERN_SUCCESS) {
|
||||
fprintf(stderr, "attach: task_for_pid(%d) failed (%d)\n", (int)jpid, result);
|
||||
print_error("attach: task_for_pid(%d) failed (%d)\n", (int)jpid, result);
|
||||
THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the process");
|
||||
}
|
||||
putTask(env, this_obj, gTask);
|
||||
@ -550,18 +735,79 @@ JNF_COCOA_ENTER(env);
|
||||
JNF_COCOA_EXIT(env);
|
||||
}
|
||||
|
||||
/** For core file,
|
||||
called from Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_attach0__Ljava_lang_String_2Ljava_lang_String_2 */
|
||||
static void fillLoadObjects(JNIEnv* env, jobject this_obj, struct ps_prochandle* ph) {
|
||||
int n = 0, i = 0;
|
||||
|
||||
// add load objects
|
||||
n = get_num_libs(ph);
|
||||
for (i = 0; i < n; i++) {
|
||||
uintptr_t base;
|
||||
const char* name;
|
||||
jobject loadObject;
|
||||
jobject loadObjectList;
|
||||
|
||||
base = get_lib_base(ph, i);
|
||||
name = get_lib_name(ph, i);
|
||||
loadObject = (*env)->CallObjectMethod(env, this_obj, createLoadObject_ID,
|
||||
(*env)->NewStringUTF(env, name), (jlong)0, (jlong)base);
|
||||
CHECK_EXCEPTION;
|
||||
loadObjectList = (*env)->GetObjectField(env, this_obj, loadObjectList_ID);
|
||||
CHECK_EXCEPTION;
|
||||
(*env)->CallBooleanMethod(env, loadObjectList, listAdd_ID, loadObject);
|
||||
CHECK_EXCEPTION;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal
|
||||
* Method: attach0
|
||||
* Signature: (Ljava/lang/String;Ljava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_attach0__Ljava_lang_String_2Ljava_lang_String_2(
|
||||
JNIEnv *env, jobject this_obj, jstring execName, jstring coreName)
|
||||
{
|
||||
const char *execName_cstr;
|
||||
const char *coreName_cstr;
|
||||
jboolean isCopy;
|
||||
struct ps_prochandle* ph;
|
||||
|
||||
execName_cstr = (*env)->GetStringUTFChars(env, execName, &isCopy);
|
||||
CHECK_EXCEPTION;
|
||||
coreName_cstr = (*env)->GetStringUTFChars(env, coreName, &isCopy);
|
||||
CHECK_EXCEPTION;
|
||||
|
||||
print_debug("attach: %s %s\n", execName_cstr, coreName_cstr);
|
||||
|
||||
if ( (ph = Pgrab_core(execName_cstr, coreName_cstr)) == NULL) {
|
||||
(*env)->ReleaseStringUTFChars(env, execName, execName_cstr);
|
||||
(*env)->ReleaseStringUTFChars(env, coreName, coreName_cstr);
|
||||
THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the core file");
|
||||
}
|
||||
(*env)->SetLongField(env, this_obj, p_ps_prochandle_ID, (jlong)(intptr_t)ph);
|
||||
(*env)->ReleaseStringUTFChars(env, execName, execName_cstr);
|
||||
(*env)->ReleaseStringUTFChars(env, coreName, coreName_cstr);
|
||||
fillLoadObjects(env, this_obj, ph);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal
|
||||
* Method: detach0
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
JNIEXPORT void JNICALL
|
||||
Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_detach0(
|
||||
JNIEnv *env, jobject this_obj)
|
||||
JNIEnv *env, jobject this_obj)
|
||||
{
|
||||
print_debug("detach0 called\n");
|
||||
struct ps_prochandle* ph = get_proc_handle(env, this_obj);
|
||||
if (ph != NULL && ph->core != NULL) {
|
||||
Prelease(ph);
|
||||
return;
|
||||
}
|
||||
JNF_COCOA_ENTER(env);
|
||||
if (debug) printf("detach0 called\n");
|
||||
|
||||
task_t gTask = getTask(env, this_obj);
|
||||
|
||||
// detach from the ptraced process causing it to resume execution
|
||||
@ -569,15 +815,15 @@ JNF_COCOA_ENTER(env);
|
||||
kern_return_t k_res;
|
||||
k_res = pid_for_task(gTask, &pid);
|
||||
if (k_res != KERN_SUCCESS) {
|
||||
fprintf(stderr, "detach: pid_for_task(%d) failed (%d)\n", pid, k_res);
|
||||
print_error("detach: pid_for_task(%d) failed (%d)\n", pid, k_res);
|
||||
}
|
||||
else {
|
||||
int res = ptrace(PT_DETACH, pid, 0, 0);
|
||||
if (res < 0) {
|
||||
fprintf(stderr, "detach: ptrace(PT_DETACH, %d) failed (%d)\n", pid, res);
|
||||
print_error("detach: ptrace(PT_DETACH, %d) failed (%d)\n", pid, res);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mach_port_deallocate(mach_task_self(), gTask);
|
||||
id symbolicator = getSymbolicator(env, this_obj);
|
||||
if (symbolicator != nil) {
|
||||
@ -585,170 +831,3 @@ JNF_COCOA_ENTER(env);
|
||||
}
|
||||
JNF_COCOA_EXIT(env);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: sun_jvm_hotspot_asm_Disassembler
|
||||
* Method: load_library
|
||||
* Signature: (Ljava/lang/String;)L
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_sun_jvm_hotspot_asm_Disassembler_load_1library(
|
||||
JNIEnv * env,
|
||||
jclass disclass,
|
||||
jstring jrepath_s,
|
||||
jstring libname_s)
|
||||
{
|
||||
uintptr_t func = 0;
|
||||
const char* error_message = NULL;
|
||||
const char* java_home;
|
||||
jboolean isCopy;
|
||||
uintptr_t *handle = NULL;
|
||||
|
||||
const char * jrepath = (*env)->GetStringUTFChars(env, jrepath_s, &isCopy); // like $JAVA_HOME/jre/lib/sparc/
|
||||
const char * libname = (*env)->GetStringUTFChars(env, libname_s, &isCopy);
|
||||
char buffer[128];
|
||||
|
||||
/* Load the hsdis library */
|
||||
void* hsdis_handle;
|
||||
hsdis_handle = dlopen(libname, RTLD_LAZY | RTLD_GLOBAL);
|
||||
if (hsdis_handle == NULL) {
|
||||
snprintf(buffer, sizeof(buffer), "%s%s", jrepath, libname);
|
||||
hsdis_handle = dlopen(buffer, RTLD_LAZY | RTLD_GLOBAL);
|
||||
}
|
||||
if (hsdis_handle != NULL) {
|
||||
func = (uintptr_t)dlsym(hsdis_handle, "decode_instructions_virtual");
|
||||
}
|
||||
if (func == 0) {
|
||||
error_message = dlerror();
|
||||
fprintf(stderr, "%s\n", error_message);
|
||||
}
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, libname_s, libname);
|
||||
(*env)->ReleaseStringUTFChars(env, jrepath_s, jrepath);
|
||||
|
||||
if (func == 0) {
|
||||
/* Couldn't find entry point. error_message should contain some
|
||||
* platform dependent error message.
|
||||
*/
|
||||
THROW_NEW_DEBUGGER_EXCEPTION_(error_message, (jlong)func);
|
||||
}
|
||||
return (jlong)func;
|
||||
}
|
||||
|
||||
/* signature of decode_instructions_virtual from hsdis.h */
|
||||
typedef void* (*decode_func)(uintptr_t start_va, uintptr_t end_va,
|
||||
unsigned char* start, uintptr_t length,
|
||||
void* (*event_callback)(void*, const char*, void*),
|
||||
void* event_stream,
|
||||
int (*printf_callback)(void*, const char*, ...),
|
||||
void* printf_stream,
|
||||
const char* options);
|
||||
|
||||
/* container for call back state when decoding instructions */
|
||||
typedef struct {
|
||||
JNIEnv* env;
|
||||
jobject dis;
|
||||
jobject visitor;
|
||||
jmethodID handle_event;
|
||||
jmethodID raw_print;
|
||||
char buffer[4096];
|
||||
} decode_env;
|
||||
|
||||
|
||||
/* event callback binding to Disassembler.handleEvent */
|
||||
static void* event_to_env(void* env_pv, const char* event, void* arg) {
|
||||
decode_env* denv = (decode_env*)env_pv;
|
||||
JNIEnv* env = denv->env;
|
||||
jstring event_string = (*env)->NewStringUTF(env, event);
|
||||
jlong result = (*env)->CallLongMethod(env, denv->dis, denv->handle_event, denv->visitor,
|
||||
event_string, (jlong) (uintptr_t)arg);
|
||||
/* ignore exceptions for now */
|
||||
CHECK_EXCEPTION_CLEAR_((void *)0);
|
||||
return (void*)(uintptr_t)result;
|
||||
}
|
||||
|
||||
/* printing callback binding to Disassembler.rawPrint */
|
||||
static int printf_to_env(void* env_pv, const char* format, ...) {
|
||||
jstring output;
|
||||
va_list ap;
|
||||
int cnt;
|
||||
decode_env* denv = (decode_env*)env_pv;
|
||||
JNIEnv* env = denv->env;
|
||||
size_t flen = strlen(format);
|
||||
const char* raw = NULL;
|
||||
|
||||
if (flen == 0) return 0;
|
||||
if (flen < 2 ||
|
||||
strchr(format, '%') == NULL) {
|
||||
raw = format;
|
||||
} else if (format[0] == '%' && format[1] == '%' &&
|
||||
strchr(format+2, '%') == NULL) {
|
||||
// happens a lot on machines with names like %foo
|
||||
flen--;
|
||||
raw = format+1;
|
||||
}
|
||||
if (raw != NULL) {
|
||||
jstring output = (*env)->NewStringUTF(env, raw);
|
||||
(*env)->CallVoidMethod(env, denv->dis, denv->raw_print, denv->visitor, output);
|
||||
CHECK_EXCEPTION_CLEAR;
|
||||
return (int) flen;
|
||||
}
|
||||
va_start(ap, format);
|
||||
cnt = vsnprintf(denv->buffer, sizeof(denv->buffer), format, ap);
|
||||
va_end(ap);
|
||||
|
||||
output = (*env)->NewStringUTF(env, denv->buffer);
|
||||
(*env)->CallVoidMethod(env, denv->dis, denv->raw_print, denv->visitor, output);
|
||||
CHECK_EXCEPTION_CLEAR;
|
||||
return cnt;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: sun_jvm_hotspot_asm_Disassembler
|
||||
* Method: decode
|
||||
* Signature: (Lsun/jvm/hotspot/asm/InstructionVisitor;J[BLjava/lang/String;J)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_sun_jvm_hotspot_asm_Disassembler_decode(
|
||||
JNIEnv * env,
|
||||
jobject dis,
|
||||
jobject visitor,
|
||||
jlong startPc,
|
||||
jbyteArray code,
|
||||
jstring options_s,
|
||||
jlong decode_instructions_virtual)
|
||||
{
|
||||
jboolean isCopy;
|
||||
jbyte* start = (*env)->GetByteArrayElements(env, code, &isCopy);
|
||||
jbyte* end = start + (*env)->GetArrayLength(env, code);
|
||||
const char * options = (*env)->GetStringUTFChars(env, options_s, &isCopy);
|
||||
jclass disclass = (*env)->GetObjectClass(env, dis);
|
||||
|
||||
decode_env denv;
|
||||
denv.env = env;
|
||||
denv.dis = dis;
|
||||
denv.visitor = visitor;
|
||||
|
||||
/* find Disassembler.handleEvent callback */
|
||||
denv.handle_event = (*env)->GetMethodID(env, disclass, "handleEvent",
|
||||
"(Lsun/jvm/hotspot/asm/InstructionVisitor;Ljava/lang/String;J)J");
|
||||
CHECK_EXCEPTION_CLEAR_VOID
|
||||
|
||||
/* find Disassembler.rawPrint callback */
|
||||
denv.raw_print = (*env)->GetMethodID(env, disclass, "rawPrint",
|
||||
"(Lsun/jvm/hotspot/asm/InstructionVisitor;Ljava/lang/String;)V");
|
||||
CHECK_EXCEPTION_CLEAR_VOID
|
||||
|
||||
/* decode the buffer */
|
||||
(*(decode_func)(uintptr_t)decode_instructions_virtual)(startPc,
|
||||
startPc + end - start,
|
||||
(unsigned char*)start,
|
||||
end - start,
|
||||
&event_to_env, (void*) &denv,
|
||||
&printf_to_env, (void*) &denv,
|
||||
options);
|
||||
|
||||
/* cleanup */
|
||||
(*env)->ReleaseByteArrayElements(env, code, start, JNI_ABORT);
|
||||
(*env)->ReleaseStringUTFChars(env, options_s, options);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -22,34 +22,60 @@
|
||||
#
|
||||
#
|
||||
|
||||
ARCH := $(shell if ([ `uname -m` = "ia64" ]) ; then echo ia64 ; elif ([ `uname -m` = "amd64" ]) ; then echo amd64; elif ([ `uname -m` = "sparc64" ]) ; then echo sparc; else echo i386 ; fi )
|
||||
ARCH := $(shell if ([ `uname -m` = "ia64" ]) ; then echo ia64 ; elif ([ `uname -m` = "amd64" ]) ; then echo amd64; elif ([ `uname -m` = "x86_64" ]) ; then echo amd64; elif ([ `uname -m` = "sparc64" ]) ; then echo sparc; else echo i386 ; fi )
|
||||
|
||||
OS := $(shell uname -s)
|
||||
|
||||
GCC = gcc
|
||||
|
||||
JAVAH = ${JAVA_HOME}/bin/javah
|
||||
|
||||
ifneq ($(OS), Darwin)
|
||||
SOURCES = salibelf.c \
|
||||
symtab.c \
|
||||
libproc_impl.c \
|
||||
ps_proc.c \
|
||||
ps_core.c \
|
||||
BsdDebuggerLocal.c
|
||||
|
||||
INCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/$(shell uname -s | tr "[:upper:]" "[:lower:]")
|
||||
|
||||
OBJS = $(SOURCES:.c=.o)
|
||||
OBJS = $(SOURCES:.c=.o)
|
||||
OBJSPLUS = $(OBJS) sadis.o
|
||||
LIBSA = $(ARCH)/libsaproc.so
|
||||
|
||||
LIBS = -lutil -lthread_db
|
||||
|
||||
CFLAGS = -c -fPIC -g -Wall -D_ALLBSD_SOURCE -D_GNU_SOURCE -D$(ARCH) $(INCLUDES)
|
||||
else
|
||||
|
||||
SOURCES = symtab.c \
|
||||
libproc_impl.c \
|
||||
ps_core.c
|
||||
OBJS = $(SOURCES:.c=.o)
|
||||
OBJSPLUS = MacosxDebuggerLocal.o sadis.o $(OBJS)
|
||||
EXTINCLUDE = -I/System/Library/Frameworks/JavaVM.framework/Headers -I.
|
||||
EXTCFLAGS = -m64 -D__APPLE__ -framework JavaNativeFoundation
|
||||
FOUNDATIONFLAGS = -framework Foundation -F/System/Library/Frameworks/JavaVM.framework/Frameworks -framework JavaNativeFoundation -framework Security -framework CoreFoundation
|
||||
LIBSA = $(ARCH)/libsaproc.dylib
|
||||
endif # Darwin
|
||||
|
||||
INCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") $(EXTINCLUDE)
|
||||
|
||||
|
||||
|
||||
CFLAGS = -c -fPIC -g -Wall -D_ALLBSD_SOURCE -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) $(EXTCFLAGS)
|
||||
|
||||
|
||||
LIBSA = $(ARCH)/libsaproc.so
|
||||
|
||||
all: $(LIBSA)
|
||||
|
||||
BsdDebuggerLocal.o: BsdDebuggerLocal.c
|
||||
$(JAVAH) -jni -classpath ../../../../../build/bsd-i586/hotspot/outputdir/bsd_i486_compiler2/generated/saclasses \
|
||||
MacosxDebuggerLocal.o: MacosxDebuggerLocal.m
|
||||
echo "OS="$(OS)
|
||||
$(JAVAH) -jni -classpath ../../../build/classes \
|
||||
sun.jvm.hotspot.debugger.x86.X86ThreadContext \
|
||||
sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
|
||||
$(GCC) $(CFLAGS) $(FOUNDATIONFLAGS) $<
|
||||
|
||||
sadis.o: ../../share/native/sadis.c
|
||||
$(JAVAH) -jni -classpath ../../../build/classes \
|
||||
sun.jvm.hotspot.asm.Disassembler
|
||||
$(GCC) $(CFLAGS) $<
|
||||
|
||||
.c.obj:
|
||||
@ -59,9 +85,9 @@ ifndef LDNOMAP
|
||||
LFLAGS_LIBSA = -Xlinker --version-script=mapfile
|
||||
endif
|
||||
|
||||
$(LIBSA): $(OBJS) mapfile
|
||||
$(LIBSA): $(OBJSPLUS) mapfile
|
||||
if [ ! -d $(ARCH) ] ; then mkdir $(ARCH) ; fi
|
||||
$(GCC) -shared $(LFLAGS_LIBSA) -o $(LIBSA) $(OBJS) $(LIBS)
|
||||
$(GCC) -shared $(LFLAGS_LIBSA) -o $(LIBSA) $(FOUNDATIONFLAGS) $(OBJSPLUS) $(LIBS) $(SALIBS)
|
||||
|
||||
test.o: $(LIBSA) test.c
|
||||
$(GCC) -c -o test.o -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) test.c
|
||||
@ -71,7 +97,6 @@ test: test.o
|
||||
|
||||
clean:
|
||||
rm -f $(LIBSA)
|
||||
rm -f $(OBJS)
|
||||
rm -f *.o
|
||||
rm -f test.o
|
||||
-rmdir $(ARCH)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -27,9 +27,38 @@
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
typedef enum ps_err_e {
|
||||
PS_OK, PS_ERR, PS_BADPID, PS_BADLID,
|
||||
PS_BADADDR, PS_NOSYM, PS_NOFREGS
|
||||
} ps_err_e;
|
||||
|
||||
#ifndef psaddr_t
|
||||
#define psaddr_t uintptr_t
|
||||
#endif
|
||||
|
||||
#ifndef bool
|
||||
typedef int bool;
|
||||
#define true 1
|
||||
#define false 0
|
||||
#endif // bool
|
||||
|
||||
#ifndef lwpid_t
|
||||
#define lwpid_t uintptr_t
|
||||
#endif
|
||||
|
||||
#include <mach/thread_status.h>
|
||||
#else // __APPLE__
|
||||
#include <elf.h>
|
||||
#include <link.h>
|
||||
#include <machine/reg.h>
|
||||
#include <proc_service.h>
|
||||
|
||||
#if defined(sparc) || defined(sparcv9)
|
||||
/*
|
||||
If _LP64 is defined ptrace.h should be taken from /usr/include/asm-sparc64
|
||||
@ -44,6 +73,14 @@
|
||||
|
||||
#endif //sparc or sparcv9
|
||||
|
||||
// This C bool type must be int for compatibility with BSD calls and
|
||||
// it would be a mistake to equivalence it to C++ bool on many platforms
|
||||
typedef int bool;
|
||||
#define true 1
|
||||
#define false 0
|
||||
|
||||
#endif // __APPLE__
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
0. This is very minimal subset of Solaris libproc just enough for current application.
|
||||
@ -72,13 +109,7 @@ combination of ptrace and /proc calls.
|
||||
|
||||
*************************************************************************************/
|
||||
|
||||
// This C bool type must be int for compatibility with BSD calls and
|
||||
// it would be a mistake to equivalence it to C++ bool on many platforms
|
||||
|
||||
typedef int bool;
|
||||
#define true 1
|
||||
#define false 0
|
||||
|
||||
struct reg;
|
||||
struct ps_prochandle;
|
||||
|
||||
// attach to a process
|
||||
|
@ -21,12 +21,6 @@
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <thread_db.h>
|
||||
#include "libproc_impl.h"
|
||||
|
||||
static const char* alt_root = NULL;
|
||||
@ -34,61 +28,65 @@ static int alt_root_len = -1;
|
||||
|
||||
#define SA_ALTROOT "SA_ALTROOT"
|
||||
|
||||
off_t ltell(int fd) {
|
||||
return lseek(fd, 0, SEEK_CUR);
|
||||
}
|
||||
|
||||
static void init_alt_root() {
|
||||
if (alt_root_len == -1) {
|
||||
alt_root = getenv(SA_ALTROOT);
|
||||
if (alt_root) {
|
||||
alt_root_len = strlen(alt_root);
|
||||
} else {
|
||||
alt_root_len = 0;
|
||||
}
|
||||
}
|
||||
if (alt_root_len == -1) {
|
||||
alt_root = getenv(SA_ALTROOT);
|
||||
if (alt_root) {
|
||||
alt_root_len = strlen(alt_root);
|
||||
} else {
|
||||
alt_root_len = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int pathmap_open(const char* name) {
|
||||
int fd;
|
||||
char alt_path[PATH_MAX + 1];
|
||||
int fd;
|
||||
char alt_path[PATH_MAX + 1];
|
||||
|
||||
init_alt_root();
|
||||
fd = open(name, O_RDONLY);
|
||||
if (fd >= 0) {
|
||||
init_alt_root();
|
||||
|
||||
if (alt_root_len > 0) {
|
||||
strcpy(alt_path, alt_root);
|
||||
strcat(alt_path, name);
|
||||
fd = open(alt_path, O_RDONLY);
|
||||
if (fd >= 0) {
|
||||
print_debug("path %s substituted for %s\n", alt_path, name);
|
||||
return fd;
|
||||
}
|
||||
}
|
||||
|
||||
if (alt_root_len > 0) {
|
||||
if (strrchr(name, '/')) {
|
||||
strcpy(alt_path, alt_root);
|
||||
strcat(alt_path, name);
|
||||
strcat(alt_path, strrchr(name, '/'));
|
||||
fd = open(alt_path, O_RDONLY);
|
||||
if (fd >= 0) {
|
||||
print_debug("path %s substituted for %s\n", alt_path, name);
|
||||
return fd;
|
||||
print_debug("path %s substituted for %s\n", alt_path, name);
|
||||
return fd;
|
||||
}
|
||||
|
||||
if (strrchr(name, '/')) {
|
||||
strcpy(alt_path, alt_root);
|
||||
strcat(alt_path, strrchr(name, '/'));
|
||||
fd = open(alt_path, O_RDONLY);
|
||||
if (fd >= 0) {
|
||||
print_debug("path %s substituted for %s\n", alt_path, name);
|
||||
return fd;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
fd = open(name, O_RDONLY);
|
||||
if (fd >= 0) {
|
||||
return fd;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static bool _libsaproc_debug;
|
||||
|
||||
void print_debug(const char* format,...) {
|
||||
if (_libsaproc_debug) {
|
||||
va_list alist;
|
||||
if (_libsaproc_debug) {
|
||||
va_list alist;
|
||||
|
||||
va_start(alist, format);
|
||||
fputs("libsaproc DEBUG: ", stderr);
|
||||
vfprintf(stderr, format, alist);
|
||||
va_end(alist);
|
||||
}
|
||||
va_start(alist, format);
|
||||
fputs("libsaproc DEBUG: ", stderr);
|
||||
vfprintf(stderr, format, alist);
|
||||
va_end(alist);
|
||||
}
|
||||
}
|
||||
|
||||
void print_error(const char* format,...) {
|
||||
@ -100,172 +98,235 @@ void print_error(const char* format,...) {
|
||||
}
|
||||
|
||||
bool is_debug() {
|
||||
return _libsaproc_debug;
|
||||
return _libsaproc_debug;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
// get arch offset in file
|
||||
bool get_arch_off(int fd, cpu_type_t cputype, off_t *offset) {
|
||||
struct fat_header fatheader;
|
||||
struct fat_arch fatarch;
|
||||
off_t img_start = 0;
|
||||
|
||||
off_t pos = ltell(fd);
|
||||
if (read(fd, (void *)&fatheader, sizeof(struct fat_header)) != sizeof(struct fat_header)) {
|
||||
return false;
|
||||
}
|
||||
if (fatheader.magic == FAT_CIGAM) {
|
||||
int i;
|
||||
for (i = 0; i < ntohl(fatheader.nfat_arch); i++) {
|
||||
if (read(fd, (void *)&fatarch, sizeof(struct fat_arch)) != sizeof(struct fat_arch)) {
|
||||
return false;
|
||||
}
|
||||
if (ntohl(fatarch.cputype) == cputype) {
|
||||
print_debug("fat offset=%x\n", ntohl(fatarch.offset));
|
||||
img_start = ntohl(fatarch.offset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (img_start == 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
lseek(fd, pos, SEEK_SET);
|
||||
*offset = img_start;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool is_macho_file(int fd) {
|
||||
mach_header_64 fhdr;
|
||||
off_t x86_64_off;
|
||||
|
||||
if (fd < 0) {
|
||||
print_debug("Invalid file handle passed to is_macho_file\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
off_t pos = ltell(fd);
|
||||
// check fat header
|
||||
if (!get_arch_off(fd, CPU_TYPE_X86_64, &x86_64_off)) {
|
||||
print_debug("failed to get fat header\n");
|
||||
return false;
|
||||
}
|
||||
lseek(fd, x86_64_off, SEEK_SET);
|
||||
if (read(fd, (void *)&fhdr, sizeof(mach_header_64)) != sizeof(mach_header_64)) {
|
||||
return false;
|
||||
}
|
||||
lseek(fd, pos, SEEK_SET); // restore
|
||||
print_debug("fhdr.magic %x\n", fhdr.magic);
|
||||
return (fhdr.magic == MH_MAGIC_64 || fhdr.magic == MH_CIGAM_64);
|
||||
}
|
||||
|
||||
#endif //__APPLE__
|
||||
|
||||
// initialize libproc
|
||||
bool init_libproc(bool debug) {
|
||||
// init debug mode
|
||||
_libsaproc_debug = debug;
|
||||
|
||||
#ifndef __APPLE__
|
||||
// initialize the thread_db library
|
||||
if (td_init() != TD_OK) {
|
||||
print_debug("libthread_db's td_init failed\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // __APPLE__
|
||||
return true;
|
||||
}
|
||||
|
||||
static void destroy_lib_info(struct ps_prochandle* ph) {
|
||||
lib_info* lib = ph->libs;
|
||||
while (lib) {
|
||||
lib_info *next = lib->next;
|
||||
if (lib->symtab) {
|
||||
destroy_symtab(lib->symtab);
|
||||
}
|
||||
free(lib);
|
||||
lib = next;
|
||||
}
|
||||
void destroy_lib_info(struct ps_prochandle* ph) {
|
||||
lib_info* lib = ph->libs;
|
||||
while (lib) {
|
||||
lib_info* next = lib->next;
|
||||
if (lib->symtab) {
|
||||
destroy_symtab(lib->symtab);
|
||||
}
|
||||
free(lib);
|
||||
lib = next;
|
||||
}
|
||||
}
|
||||
|
||||
static void destroy_thread_info(struct ps_prochandle* ph) {
|
||||
thread_info* thr = ph->threads;
|
||||
while (thr) {
|
||||
thread_info *next = thr->next;
|
||||
free(thr);
|
||||
thr = next;
|
||||
}
|
||||
void destroy_thread_info(struct ps_prochandle* ph) {
|
||||
sa_thread_info* thr = ph->threads;
|
||||
while (thr) {
|
||||
sa_thread_info* n = thr->next;
|
||||
free(thr);
|
||||
thr = n;
|
||||
}
|
||||
}
|
||||
|
||||
// ps_prochandle cleanup
|
||||
|
||||
// ps_prochandle cleanup
|
||||
void Prelease(struct ps_prochandle* ph) {
|
||||
// do the "derived class" clean-up first
|
||||
ph->ops->release(ph);
|
||||
destroy_lib_info(ph);
|
||||
destroy_thread_info(ph);
|
||||
free(ph);
|
||||
// do the "derived class" clean-up first
|
||||
ph->ops->release(ph);
|
||||
destroy_lib_info(ph);
|
||||
destroy_thread_info(ph);
|
||||
free(ph);
|
||||
}
|
||||
|
||||
lib_info* add_lib_info(struct ps_prochandle* ph, const char* libname, uintptr_t base) {
|
||||
return add_lib_info_fd(ph, libname, -1, base);
|
||||
return add_lib_info_fd(ph, libname, -1, base);
|
||||
}
|
||||
|
||||
lib_info* add_lib_info_fd(struct ps_prochandle* ph, const char* libname, int fd, uintptr_t base) {
|
||||
lib_info* newlib;
|
||||
print_debug("add_lib_info_fd %s\n", libname);
|
||||
|
||||
if ( (newlib = (lib_info*) calloc(1, sizeof(struct lib_info))) == NULL) {
|
||||
print_debug("can't allocate memory for lib_info\n");
|
||||
return NULL;
|
||||
}
|
||||
if ( (newlib = (lib_info*) calloc(1, sizeof(struct lib_info))) == NULL) {
|
||||
print_debug("can't allocate memory for lib_info\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
strncpy(newlib->name, libname, sizeof(newlib->name));
|
||||
newlib->base = base;
|
||||
strncpy(newlib->name, libname, sizeof(newlib->name));
|
||||
newlib->base = base;
|
||||
|
||||
if (fd == -1) {
|
||||
if ( (newlib->fd = pathmap_open(newlib->name)) < 0) {
|
||||
print_debug("can't open shared object %s\n", newlib->name);
|
||||
free(newlib);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
newlib->fd = fd;
|
||||
}
|
||||
|
||||
// check whether we have got an ELF file. /proc/<pid>/map
|
||||
// gives out all file mappings and not just shared objects
|
||||
if (is_elf_file(newlib->fd) == false) {
|
||||
close(newlib->fd);
|
||||
if (fd == -1) {
|
||||
if ( (newlib->fd = pathmap_open(newlib->name)) < 0) {
|
||||
print_debug("can't open shared object %s\n", newlib->name);
|
||||
free(newlib);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newlib->fd = fd;
|
||||
}
|
||||
|
||||
newlib->symtab = build_symtab(newlib->fd);
|
||||
if (newlib->symtab == NULL) {
|
||||
print_debug("symbol table build failed for %s\n", newlib->name);
|
||||
}
|
||||
else {
|
||||
print_debug("built symbol table for %s\n", newlib->name);
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
// check whether we have got an Macho file.
|
||||
if (is_macho_file(newlib->fd) == false) {
|
||||
close(newlib->fd);
|
||||
free(newlib);
|
||||
print_debug("not a mach-o file\n");
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
// check whether we have got an ELF file. /proc/<pid>/map
|
||||
// gives out all file mappings and not just shared objects
|
||||
if (is_elf_file(newlib->fd) == false) {
|
||||
close(newlib->fd);
|
||||
free(newlib);
|
||||
return NULL;
|
||||
}
|
||||
#endif // __APPLE__
|
||||
|
||||
// even if symbol table building fails, we add the lib_info.
|
||||
// This is because we may need to read from the ELF file for core file
|
||||
// address read functionality. lookup_symbol checks for NULL symtab.
|
||||
if (ph->libs) {
|
||||
ph->lib_tail->next = newlib;
|
||||
ph->lib_tail = newlib;
|
||||
} else {
|
||||
ph->libs = ph->lib_tail = newlib;
|
||||
}
|
||||
ph->num_libs++;
|
||||
newlib->symtab = build_symtab(newlib->fd);
|
||||
if (newlib->symtab == NULL) {
|
||||
print_debug("symbol table build failed for %s\n", newlib->name);
|
||||
} else {
|
||||
print_debug("built symbol table for %s\n", newlib->name);
|
||||
}
|
||||
|
||||
return newlib;
|
||||
// even if symbol table building fails, we add the lib_info.
|
||||
// This is because we may need to read from the ELF file or MachO file for core file
|
||||
// address read functionality. lookup_symbol checks for NULL symtab.
|
||||
if (ph->libs) {
|
||||
ph->lib_tail->next = newlib;
|
||||
ph->lib_tail = newlib;
|
||||
} else {
|
||||
ph->libs = ph->lib_tail = newlib;
|
||||
}
|
||||
ph->num_libs++;
|
||||
return newlib;
|
||||
}
|
||||
|
||||
// lookup for a specific symbol
|
||||
uintptr_t lookup_symbol(struct ps_prochandle* ph, const char* object_name,
|
||||
const char* sym_name) {
|
||||
// ignore object_name. search in all libraries
|
||||
// FIXME: what should we do with object_name?? The library names are obtained
|
||||
// by parsing /proc/<pid>/maps, which may not be the same as object_name.
|
||||
// What we need is a utility to map object_name to real file name, something
|
||||
// dlopen() does by looking at LD_LIBRARY_PATH and /etc/ld.so.cache. For
|
||||
// now, we just ignore object_name and do a global search for the symbol.
|
||||
// ignore object_name. search in all libraries
|
||||
// FIXME: what should we do with object_name?? The library names are obtained
|
||||
// by parsing /proc/<pid>/maps, which may not be the same as object_name.
|
||||
// What we need is a utility to map object_name to real file name, something
|
||||
// dlopen() does by looking at LD_LIBRARY_PATH and /etc/ld.so.cache. For
|
||||
// now, we just ignore object_name and do a global search for the symbol.
|
||||
|
||||
lib_info* lib = ph->libs;
|
||||
while (lib) {
|
||||
if (lib->symtab) {
|
||||
uintptr_t res = search_symbol(lib->symtab, lib->base, sym_name, NULL);
|
||||
if (res) return res;
|
||||
}
|
||||
lib = lib->next;
|
||||
}
|
||||
lib_info* lib = ph->libs;
|
||||
while (lib) {
|
||||
if (lib->symtab) {
|
||||
uintptr_t res = search_symbol(lib->symtab, lib->base, sym_name, NULL);
|
||||
if (res) return res;
|
||||
}
|
||||
lib = lib->next;
|
||||
}
|
||||
|
||||
print_debug("lookup failed for symbol '%s' in obj '%s'\n",
|
||||
print_debug("lookup failed for symbol '%s' in obj '%s'\n",
|
||||
sym_name, object_name);
|
||||
return (uintptr_t) NULL;
|
||||
return (uintptr_t) NULL;
|
||||
}
|
||||
|
||||
|
||||
const char* symbol_for_pc(struct ps_prochandle* ph, uintptr_t addr, uintptr_t* poffset) {
|
||||
const char* res = NULL;
|
||||
lib_info* lib = ph->libs;
|
||||
while (lib) {
|
||||
if (lib->symtab && addr >= lib->base) {
|
||||
res = nearest_symbol(lib->symtab, addr - lib->base, poffset);
|
||||
if (res) return res;
|
||||
}
|
||||
lib = lib->next;
|
||||
}
|
||||
return NULL;
|
||||
const char* res = NULL;
|
||||
lib_info* lib = ph->libs;
|
||||
while (lib) {
|
||||
if (lib->symtab && addr >= lib->base) {
|
||||
res = nearest_symbol(lib->symtab, addr - lib->base, poffset);
|
||||
if (res) return res;
|
||||
}
|
||||
lib = lib->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// add a thread to ps_prochandle
|
||||
thread_info* add_thread_info(struct ps_prochandle* ph, pthread_t pthread_id, lwpid_t lwp_id) {
|
||||
thread_info* newthr;
|
||||
if ( (newthr = (thread_info*) calloc(1, sizeof(thread_info))) == NULL) {
|
||||
print_debug("can't allocate memory for thread_info\n");
|
||||
return NULL;
|
||||
}
|
||||
sa_thread_info* add_thread_info(struct ps_prochandle* ph, pthread_t pthread_id, lwpid_t lwp_id) {
|
||||
sa_thread_info* newthr;
|
||||
if ( (newthr = (sa_thread_info*) calloc(1, sizeof(sa_thread_info))) == NULL) {
|
||||
print_debug("can't allocate memory for thread_info\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// initialize thread info
|
||||
newthr->pthread_id = pthread_id;
|
||||
newthr->lwp_id = lwp_id;
|
||||
// initialize thread info
|
||||
newthr->pthread_id = pthread_id;
|
||||
newthr->lwp_id = lwp_id;
|
||||
|
||||
// add new thread to the list
|
||||
newthr->next = ph->threads;
|
||||
ph->threads = newthr;
|
||||
ph->num_threads++;
|
||||
return newthr;
|
||||
// add new thread to the list
|
||||
newthr->next = ph->threads;
|
||||
ph->threads = newthr;
|
||||
ph->num_threads++;
|
||||
return newthr;
|
||||
}
|
||||
|
||||
|
||||
#ifndef __APPLE__
|
||||
// struct used for client data from thread_db callback
|
||||
struct thread_db_client_data {
|
||||
struct ps_prochandle* ph;
|
||||
thread_info_callback callback;
|
||||
struct ps_prochandle* ph;
|
||||
thread_info_callback callback;
|
||||
};
|
||||
|
||||
// callback function for libthread_db
|
||||
@ -314,6 +375,7 @@ bool read_thread_info(struct ps_prochandle* ph, thread_info_callback cb) {
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // __APPLE__
|
||||
|
||||
// get number of threads
|
||||
int get_num_threads(struct ps_prochandle* ph) {
|
||||
@ -322,18 +384,54 @@ int get_num_threads(struct ps_prochandle* ph) {
|
||||
|
||||
// get lwp_id of n'th thread
|
||||
lwpid_t get_lwp_id(struct ps_prochandle* ph, int index) {
|
||||
int count = 0;
|
||||
thread_info* thr = ph->threads;
|
||||
while (thr) {
|
||||
if (count == index) {
|
||||
return thr->lwp_id;
|
||||
}
|
||||
count++;
|
||||
thr = thr->next;
|
||||
}
|
||||
return -1;
|
||||
int count = 0;
|
||||
sa_thread_info* thr = ph->threads;
|
||||
while (thr) {
|
||||
if (count == index) {
|
||||
return thr->lwp_id;
|
||||
}
|
||||
count++;
|
||||
thr = thr->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
// set lwp_id of n'th thread
|
||||
bool set_lwp_id(struct ps_prochandle* ph, int index, lwpid_t lwpid) {
|
||||
int count = 0;
|
||||
sa_thread_info* thr = ph->threads;
|
||||
while (thr) {
|
||||
if (count == index) {
|
||||
thr->lwp_id = lwpid;
|
||||
return true;
|
||||
}
|
||||
count++;
|
||||
thr = thr->next;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// get regs of n-th thread, only used in fillThreads the first time called
|
||||
bool get_nth_lwp_regs(struct ps_prochandle* ph, int index, struct reg* regs) {
|
||||
int count = 0;
|
||||
sa_thread_info* thr = ph->threads;
|
||||
while (thr) {
|
||||
if (count == index) {
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
thr = thr->next;
|
||||
}
|
||||
if (thr != NULL) {
|
||||
memcpy(regs, &thr->regs, sizeof(struct reg));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // __APPLE__
|
||||
|
||||
// get regs for a given lwp
|
||||
bool get_lwp_regs(struct ps_prochandle* ph, lwpid_t lwp_id, struct reg* regs) {
|
||||
return ph->ops->get_lwp_regs(ph, lwp_id, regs);
|
||||
@ -341,35 +439,35 @@ bool get_lwp_regs(struct ps_prochandle* ph, lwpid_t lwp_id, struct reg* regs) {
|
||||
|
||||
// get number of shared objects
|
||||
int get_num_libs(struct ps_prochandle* ph) {
|
||||
return ph->num_libs;
|
||||
return ph->num_libs;
|
||||
}
|
||||
|
||||
// get name of n'th solib
|
||||
const char* get_lib_name(struct ps_prochandle* ph, int index) {
|
||||
int count = 0;
|
||||
lib_info* lib = ph->libs;
|
||||
while (lib) {
|
||||
if (count == index) {
|
||||
return lib->name;
|
||||
}
|
||||
count++;
|
||||
lib = lib->next;
|
||||
}
|
||||
return NULL;
|
||||
int count = 0;
|
||||
lib_info* lib = ph->libs;
|
||||
while (lib) {
|
||||
if (count == index) {
|
||||
return lib->name;
|
||||
}
|
||||
count++;
|
||||
lib = lib->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// get base address of a lib
|
||||
uintptr_t get_lib_base(struct ps_prochandle* ph, int index) {
|
||||
int count = 0;
|
||||
lib_info* lib = ph->libs;
|
||||
while (lib) {
|
||||
if (count == index) {
|
||||
return lib->base;
|
||||
}
|
||||
count++;
|
||||
lib = lib->next;
|
||||
}
|
||||
return (uintptr_t)NULL;
|
||||
int count = 0;
|
||||
lib_info* lib = ph->libs;
|
||||
while (lib) {
|
||||
if (count == index) {
|
||||
return lib->base;
|
||||
}
|
||||
count++;
|
||||
lib = lib->next;
|
||||
}
|
||||
return (uintptr_t)NULL;
|
||||
}
|
||||
|
||||
bool find_lib(struct ps_prochandle* ph, const char *lib_name) {
|
||||
@ -425,6 +523,7 @@ ps_plog (const char *format, ...)
|
||||
va_end(alist);
|
||||
}
|
||||
|
||||
#ifndef __APPLE__
|
||||
// ------------------------------------------------------------------------
|
||||
// Functions below this point are not yet implemented. They are here only
|
||||
// to make the linker happy.
|
||||
@ -458,3 +557,4 @@ ps_err_e ps_pcontinue(struct ps_prochandle *ph) {
|
||||
print_debug("ps_pcontinue not implemented\n");
|
||||
return PS_OK;
|
||||
}
|
||||
#endif // __APPLE__
|
||||
|
@ -30,6 +30,60 @@
|
||||
#include "libproc.h"
|
||||
#include "symtab.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <inttypes.h> // for PRIx64, 32, ...
|
||||
#include <pthread.h>
|
||||
#include <mach-o/loader.h>
|
||||
#include <mach-o/nlist.h>
|
||||
#include <mach-o/fat.h>
|
||||
|
||||
#ifndef register_t
|
||||
#define register_t uint64_t
|
||||
#endif
|
||||
|
||||
/*** registers copied from bsd/amd64 */
|
||||
typedef struct reg {
|
||||
register_t r_r15;
|
||||
register_t r_r14;
|
||||
register_t r_r13;
|
||||
register_t r_r12;
|
||||
register_t r_r11;
|
||||
register_t r_r10;
|
||||
register_t r_r9;
|
||||
register_t r_r8;
|
||||
register_t r_rdi;
|
||||
register_t r_rsi;
|
||||
register_t r_rbp;
|
||||
register_t r_rbx;
|
||||
register_t r_rdx;
|
||||
register_t r_rcx;
|
||||
register_t r_rax;
|
||||
uint32_t r_trapno; // not used
|
||||
uint16_t r_fs;
|
||||
uint16_t r_gs;
|
||||
uint32_t r_err; // not used
|
||||
uint16_t r_es; // not used
|
||||
uint16_t r_ds; // not used
|
||||
register_t r_rip;
|
||||
register_t r_cs;
|
||||
register_t r_rflags;
|
||||
register_t r_rsp;
|
||||
register_t r_ss; // not used
|
||||
} reg;
|
||||
|
||||
// convenient defs
|
||||
typedef struct mach_header_64 mach_header_64;
|
||||
typedef struct load_command load_command;
|
||||
typedef struct segment_command_64 segment_command_64;
|
||||
typedef struct thread_command thread_command;
|
||||
typedef struct dylib_command dylib_command;
|
||||
typedef struct symtab_command symtab_command;
|
||||
typedef struct nlist_64 nlist_64;
|
||||
#else
|
||||
#include <thread_db.h>
|
||||
#include "salibelf.h"
|
||||
#endif // __APPLE__
|
||||
|
||||
// data structures in this file mimic those of Solaris 8.0 - libproc's Pcontrol.h
|
||||
|
||||
#define BUF_SIZE (PATH_MAX + NAME_MAX + 1)
|
||||
@ -44,12 +98,12 @@ typedef struct lib_info {
|
||||
} lib_info;
|
||||
|
||||
// list of threads
|
||||
typedef struct thread_info {
|
||||
lwpid_t lwp_id;
|
||||
pthread_t pthread_id; // not used cores, always -1
|
||||
typedef struct sa_thread_info {
|
||||
lwpid_t lwp_id; // same as pthread_t
|
||||
pthread_t pthread_id; //
|
||||
struct reg regs; // not for process, core uses for caching regset
|
||||
struct thread_info* next;
|
||||
} thread_info;
|
||||
struct sa_thread_info* next;
|
||||
} sa_thread_info;
|
||||
|
||||
// list of virtual memory maps
|
||||
typedef struct map_info {
|
||||
@ -91,6 +145,7 @@ struct core_data {
|
||||
// part of the class sharing workaround
|
||||
map_info* class_share_maps;// class share maps in a linked list
|
||||
map_info** map_array; // sorted (by vaddr) array of map_info pointers
|
||||
char exec_path[4096]; // file name java
|
||||
};
|
||||
|
||||
struct ps_prochandle {
|
||||
@ -100,12 +155,11 @@ struct ps_prochandle {
|
||||
lib_info* libs; // head of lib list
|
||||
lib_info* lib_tail; // tail of lib list - to append at the end
|
||||
int num_threads;
|
||||
thread_info* threads; // head of thread list
|
||||
sa_thread_info* threads; // head of thread list
|
||||
struct core_data* core; // data only used for core dumps, NULL for process
|
||||
};
|
||||
|
||||
int pathmap_open(const char* name);
|
||||
|
||||
void print_debug(const char* format,...);
|
||||
void print_error(const char* format,...);
|
||||
bool is_debug();
|
||||
@ -122,10 +176,45 @@ lib_info* add_lib_info(struct ps_prochandle* ph, const char* libname, uintptr_t
|
||||
lib_info* add_lib_info_fd(struct ps_prochandle* ph, const char* libname, int fd,
|
||||
uintptr_t base);
|
||||
|
||||
// adds a new thread to threads list, returns NULL on failure
|
||||
thread_info* add_thread_info(struct ps_prochandle* ph, pthread_t pthread_id, lwpid_t lwp_id);
|
||||
|
||||
sa_thread_info* add_thread_info(struct ps_prochandle* ph, pthread_t pthread_id, lwpid_t lwp_id);
|
||||
// a test for ELF signature without using libelf
|
||||
bool is_elf_file(int fd);
|
||||
|
||||
#ifdef __APPLE__
|
||||
// a test for Mach-O signature
|
||||
bool is_macho_file(int fd);
|
||||
// skip fat head to get image start offset of cpu_type_t
|
||||
// return false if any error happens, else value in offset.
|
||||
bool get_arch_off(int fd, cpu_type_t cputype, off_t *offset);
|
||||
#else
|
||||
bool is_elf_file(int fd);
|
||||
#endif // __APPLE__
|
||||
|
||||
lwpid_t get_lwp_id(struct ps_prochandle* ph, int index);
|
||||
bool set_lwp_id(struct ps_prochandle* ph, int index, lwpid_t lwpid);
|
||||
bool get_nth_lwp_regs(struct ps_prochandle* ph, int index, struct reg* regs);
|
||||
|
||||
// ps_pglobal_lookup() looks up the symbol sym_name in the symbol table
|
||||
// of the load object object_name in the target process identified by ph.
|
||||
// It returns the symbol's value as an address in the target process in
|
||||
// *sym_addr.
|
||||
|
||||
ps_err_e ps_pglobal_lookup(struct ps_prochandle *ph, const char *object_name,
|
||||
const char *sym_name, psaddr_t *sym_addr);
|
||||
|
||||
// read "size" bytes info "buf" from address "addr"
|
||||
ps_err_e ps_pread(struct ps_prochandle *ph, psaddr_t addr,
|
||||
void *buf, size_t size);
|
||||
|
||||
// write "size" bytes of data to debuggee at address "addr"
|
||||
ps_err_e ps_pwrite(struct ps_prochandle *ph, psaddr_t addr,
|
||||
const void *buf, size_t size);
|
||||
|
||||
// fill in ptrace_lwpinfo for lid
|
||||
ps_err_e ps_linfo(struct ps_prochandle *ph, lwpid_t lwp_id, void *linfo);
|
||||
|
||||
// needed for when libthread_db is compiled with TD_DEBUG defined
|
||||
void ps_plog (const char *format, ...);
|
||||
|
||||
// untility, tells the position in file
|
||||
off_t ltell(int fd);
|
||||
#endif //_LIBPROC_IMPL_H_
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,32 +28,182 @@
|
||||
#include <string.h>
|
||||
#include <db.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "libproc_impl.h"
|
||||
#include "symtab.h"
|
||||
#ifndef __APPLE__
|
||||
#include "salibelf.h"
|
||||
#endif // __APPLE__
|
||||
|
||||
|
||||
// ----------------------------------------------------
|
||||
// functions for symbol lookups
|
||||
// ----------------------------------------------------
|
||||
|
||||
typedef struct symtab_symbol {
|
||||
char *name; // name like __ZThread_...
|
||||
uintptr_t offset; // to loaded address
|
||||
uintptr_t size; // size strlen
|
||||
} symtab_symbol;
|
||||
|
||||
typedef struct symtab {
|
||||
char *strs; // all symbols "__symbol1__'\0'__symbol2__...."
|
||||
size_t num_symbols;
|
||||
DB* hash_table;
|
||||
symtab_symbol* symbols;
|
||||
} symtab_t;
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
void build_search_table(symtab_t *symtab) {
|
||||
int i;
|
||||
for (i = 0; i < symtab->num_symbols; i++) {
|
||||
DBT key, value;
|
||||
key.data = symtab->symbols[i].name;
|
||||
key.size = strlen(key.data) + 1;
|
||||
value.data = &(symtab->symbols[i]);
|
||||
value.size = sizeof(symtab_symbol);
|
||||
(*symtab->hash_table->put)(symtab->hash_table, &key, &value, 0);
|
||||
|
||||
// check result
|
||||
if (is_debug()) {
|
||||
DBT rkey, rvalue;
|
||||
char* tmp = (char *)malloc(strlen(symtab->symbols[i].name) + 1);
|
||||
strcpy(tmp, symtab->symbols[i].name);
|
||||
rkey.data = tmp;
|
||||
rkey.size = strlen(tmp) + 1;
|
||||
(*symtab->hash_table->get)(symtab->hash_table, &rkey, &rvalue, 0);
|
||||
// we may get a copy back so compare contents
|
||||
symtab_symbol *res = (symtab_symbol *)rvalue.data;
|
||||
if (strcmp(res->name, symtab->symbols[i].name) ||
|
||||
res->offset != symtab->symbols[i].offset ||
|
||||
res->size != symtab->symbols[i].size) {
|
||||
print_debug("error to get hash_table value!\n");
|
||||
}
|
||||
free(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// read symbol table from given fd.
|
||||
struct symtab* build_symtab(int fd) {
|
||||
symtab_t* symtab = NULL;
|
||||
int i;
|
||||
mach_header_64 header;
|
||||
off_t image_start;
|
||||
|
||||
if (!get_arch_off(fd, CPU_TYPE_X86_64, &image_start)) {
|
||||
print_debug("failed in get fat header\n");
|
||||
return NULL;
|
||||
}
|
||||
lseek(fd, image_start, SEEK_SET);
|
||||
if (read(fd, (void *)&header, sizeof(mach_header_64)) != sizeof(mach_header_64)) {
|
||||
print_debug("reading header failed!\n");
|
||||
return NULL;
|
||||
}
|
||||
// header
|
||||
if (header.magic != MH_MAGIC_64) {
|
||||
print_debug("not a valid .dylib file\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
load_command lcmd;
|
||||
symtab_command symtabcmd;
|
||||
nlist_64 lentry;
|
||||
|
||||
bool lcsymtab_exist = false;
|
||||
|
||||
long filepos = ltell(fd);
|
||||
for (i = 0; i < header.ncmds; i++) {
|
||||
lseek(fd, filepos, SEEK_SET);
|
||||
if (read(fd, (void *)&lcmd, sizeof(load_command)) != sizeof(load_command)) {
|
||||
print_debug("read load_command failed for file\n");
|
||||
return NULL;
|
||||
}
|
||||
filepos += lcmd.cmdsize; // next command position
|
||||
if (lcmd.cmd == LC_SYMTAB) {
|
||||
lseek(fd, -sizeof(load_command), SEEK_CUR);
|
||||
lcsymtab_exist = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!lcsymtab_exist) {
|
||||
print_debug("No symtab command found!\n");
|
||||
return NULL;
|
||||
}
|
||||
if (read(fd, (void *)&symtabcmd, sizeof(symtab_command)) != sizeof(symtab_command)) {
|
||||
print_debug("read symtab_command failed for file");
|
||||
return NULL;
|
||||
}
|
||||
symtab = (symtab_t *)malloc(sizeof(symtab_t));
|
||||
if (symtab == NULL) {
|
||||
print_debug("out of memory: allocating symtab\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// create hash table, we use berkeley db to
|
||||
// manipulate the hash table.
|
||||
symtab->hash_table = dbopen(NULL, O_CREAT | O_RDWR, 0600, DB_HASH, NULL);
|
||||
if (symtab->hash_table == NULL)
|
||||
goto quit;
|
||||
|
||||
symtab->num_symbols = symtabcmd.nsyms;
|
||||
symtab->symbols = (symtab_symbol *)malloc(sizeof(symtab_symbol) * symtab->num_symbols);
|
||||
symtab->strs = (char *)malloc(sizeof(char) * symtabcmd.strsize);
|
||||
if (symtab->symbols == NULL || symtab->strs == NULL) {
|
||||
print_debug("out of memory: allocating symtab.symbol or symtab.strs\n");
|
||||
goto quit;
|
||||
}
|
||||
lseek(fd, image_start + symtabcmd.symoff, SEEK_SET);
|
||||
for (i = 0; i < symtab->num_symbols; i++) {
|
||||
if (read(fd, (void *)&lentry, sizeof(nlist_64)) != sizeof(nlist_64)) {
|
||||
print_debug("read nlist_64 failed at %i\n", i);
|
||||
goto quit;
|
||||
}
|
||||
symtab->symbols[i].offset = lentry.n_value;
|
||||
symtab->symbols[i].size = lentry.n_un.n_strx; // index
|
||||
}
|
||||
|
||||
// string table
|
||||
lseek(fd, image_start + symtabcmd.stroff, SEEK_SET);
|
||||
int size = read(fd, (void *)(symtab->strs), symtabcmd.strsize * sizeof(char));
|
||||
if (size != symtabcmd.strsize * sizeof(char)) {
|
||||
print_debug("reading string table failed\n");
|
||||
goto quit;
|
||||
}
|
||||
|
||||
for (i = 0; i < symtab->num_symbols; i++) {
|
||||
symtab->symbols[i].name = symtab->strs + symtab->symbols[i].size;
|
||||
if (i > 0) {
|
||||
// fix size
|
||||
symtab->symbols[i - 1].size = symtab->symbols[i].size - symtab->symbols[i - 1].size;
|
||||
print_debug("%s size = %d\n", symtab->symbols[i - 1].name, symtab->symbols[i - 1].size);
|
||||
|
||||
}
|
||||
|
||||
if (i == symtab->num_symbols - 1) {
|
||||
// last index
|
||||
symtab->symbols[i].size =
|
||||
symtabcmd.strsize - symtab->symbols[i].size;
|
||||
print_debug("%s size = %d\n", symtab->symbols[i].name, symtab->symbols[i].size);
|
||||
}
|
||||
}
|
||||
|
||||
// build a hashtable for fast query
|
||||
build_search_table(symtab);
|
||||
return symtab;
|
||||
quit:
|
||||
if (symtab) destroy_symtab(symtab);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#else // __APPLE__
|
||||
|
||||
struct elf_section {
|
||||
ELF_SHDR *c_shdr;
|
||||
void *c_data;
|
||||
};
|
||||
|
||||
struct elf_symbol {
|
||||
char *name;
|
||||
uintptr_t offset;
|
||||
uintptr_t size;
|
||||
};
|
||||
|
||||
typedef struct symtab {
|
||||
char *strs;
|
||||
size_t num_symbols;
|
||||
struct elf_symbol *symbols;
|
||||
DB* hash_table;
|
||||
} symtab_t;
|
||||
|
||||
// read symbol table from given fd.
|
||||
struct symtab* build_symtab(int fd) {
|
||||
ELF_EHDR ehdr;
|
||||
@ -176,7 +326,7 @@ struct symtab* build_symtab(int fd) {
|
||||
key.data = sym_name;
|
||||
key.size = strlen(sym_name) + 1;
|
||||
value.data = &(symtab->symbols[j]);
|
||||
value.size = sizeof(void *);
|
||||
value.size = sizeof(symtab_symbol);
|
||||
(*symtab->hash_table->put)(symtab->hash_table, &key, &value, 0);
|
||||
}
|
||||
}
|
||||
@ -201,30 +351,29 @@ quit:
|
||||
return symtab;
|
||||
}
|
||||
|
||||
void destroy_symtab(struct symtab* symtab) {
|
||||
#endif // __APPLE__
|
||||
|
||||
void destroy_symtab(symtab_t* symtab) {
|
||||
if (!symtab) return;
|
||||
if (symtab->strs) free(symtab->strs);
|
||||
if (symtab->symbols) free(symtab->symbols);
|
||||
if (symtab->hash_table) {
|
||||
(*symtab->hash_table->close)(symtab->hash_table);
|
||||
}
|
||||
free(symtab->strs);
|
||||
free(symtab->symbols);
|
||||
free(symtab);
|
||||
}
|
||||
|
||||
uintptr_t search_symbol(struct symtab* symtab, uintptr_t base,
|
||||
const char *sym_name, int *sym_size) {
|
||||
uintptr_t search_symbol(struct symtab* symtab, uintptr_t base, const char *sym_name, int *sym_size) {
|
||||
DBT key, value;
|
||||
int ret;
|
||||
|
||||
// library does not have symbol table
|
||||
if (!symtab || !symtab->hash_table)
|
||||
if (!symtab || !symtab->hash_table) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
key.data = (char*)(uintptr_t)sym_name;
|
||||
key.size = strlen(sym_name) + 1;
|
||||
ret = (*symtab->hash_table->get)(symtab->hash_table, &key, &value, 0);
|
||||
if (ret == 0) {
|
||||
struct elf_symbol *sym = value.data;
|
||||
symtab_symbol *sym = value.data;
|
||||
uintptr_t rslt = (uintptr_t) ((char*)base + sym->offset);
|
||||
if (sym_size) *sym_size = sym->size;
|
||||
return rslt;
|
||||
@ -238,7 +387,7 @@ const char* nearest_symbol(struct symtab* symtab, uintptr_t offset,
|
||||
int n = 0;
|
||||
if (!symtab) return NULL;
|
||||
for (; n < symtab->num_symbols; n++) {
|
||||
struct elf_symbol* sym = &(symtab->symbols[n]);
|
||||
symtab_symbol* sym = &(symtab->symbols[n]);
|
||||
if (sym->name != NULL &&
|
||||
offset >= sym->offset && offset < sym->offset + sym->size) {
|
||||
if (poffset) *poffset = (offset - sym->offset);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -27,11 +27,11 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// interface to manage ELF symbol tables
|
||||
// interface to manage ELF or MachO symbol tables
|
||||
|
||||
struct symtab;
|
||||
|
||||
// build symbol table for a given ELF file descriptor
|
||||
// build symbol table for a given ELF or MachO file escriptor
|
||||
struct symtab* build_symtab(int fd);
|
||||
|
||||
// destroy the symbol table
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -34,11 +34,18 @@ public class BsdVtblAccess extends BasicVtblAccess {
|
||||
public BsdVtblAccess(SymbolLookup symbolLookup,
|
||||
String[] dllNames) {
|
||||
super(symbolLookup, dllNames);
|
||||
|
||||
if (symbolLookup.lookup("libjvm.so", "__vt_10JavaThread") != null ||
|
||||
symbolLookup.lookup("libjvm_g.so", "__vt_10JavaThread") != null) {
|
||||
boolean oldVT = false;
|
||||
boolean isDarwin = dllNames[0].lastIndexOf(".dylib") != -1;
|
||||
String vtJavaThread = isDarwin ? "_vt_10JavaThread" : "__vt_10JavaThread";
|
||||
for (String dllName : dllNames) {
|
||||
if (symbolLookup.lookup(dllName, vtJavaThread) != null) {
|
||||
oldVT = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (oldVT) {
|
||||
// old C++ ABI
|
||||
vt = "__vt_";
|
||||
vt = isDarwin ? "_vt_" : "__vt_";
|
||||
} else {
|
||||
// new C++ ABI
|
||||
vt = "_ZTV";
|
||||
|
@ -24,36 +24,81 @@
|
||||
|
||||
package sun.jvm.hotspot;
|
||||
|
||||
import java.io.*;
|
||||
import java.math.*;
|
||||
import java.util.*;
|
||||
import java.util.regex.*;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Stack;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import sun.jvm.hotspot.types.Type;
|
||||
import sun.jvm.hotspot.types.Field;
|
||||
import sun.jvm.hotspot.HotSpotTypeDataBase;
|
||||
import sun.jvm.hotspot.types.basic.BasicType;
|
||||
import sun.jvm.hotspot.types.basic.BasicTypeDataBase;
|
||||
import sun.jvm.hotspot.types.CIntegerType;
|
||||
import sun.jvm.hotspot.code.*;
|
||||
import sun.jvm.hotspot.compiler.*;
|
||||
import sun.jvm.hotspot.debugger.*;
|
||||
import sun.jvm.hotspot.interpreter.*;
|
||||
import sun.jvm.hotspot.memory.*;
|
||||
import sun.jvm.hotspot.oops.*;
|
||||
import sun.jvm.hotspot.opto.*;
|
||||
import sun.jvm.hotspot.ci.*;
|
||||
import sun.jvm.hotspot.asm.*;
|
||||
import sun.jvm.hotspot.runtime.*;
|
||||
import sun.jvm.hotspot.utilities.*;
|
||||
import sun.jvm.hotspot.utilities.soql.*;
|
||||
import sun.jvm.hotspot.ui.classbrowser.*;
|
||||
import sun.jvm.hotspot.ui.tree.*;
|
||||
import sun.jvm.hotspot.tools.*;
|
||||
import sun.jvm.hotspot.ci.ciEnv;
|
||||
import sun.jvm.hotspot.code.CodeBlob;
|
||||
import sun.jvm.hotspot.code.CodeCacheVisitor;
|
||||
import sun.jvm.hotspot.code.NMethod;
|
||||
import sun.jvm.hotspot.debugger.Address;
|
||||
import sun.jvm.hotspot.debugger.OopHandle;
|
||||
import sun.jvm.hotspot.memory.SymbolTable;
|
||||
import sun.jvm.hotspot.memory.SystemDictionary;
|
||||
import sun.jvm.hotspot.memory.Universe;
|
||||
import sun.jvm.hotspot.oops.DefaultHeapVisitor;
|
||||
import sun.jvm.hotspot.oops.HeapVisitor;
|
||||
import sun.jvm.hotspot.oops.InstanceKlass;
|
||||
import sun.jvm.hotspot.oops.Klass;
|
||||
import sun.jvm.hotspot.oops.Metadata;
|
||||
import sun.jvm.hotspot.oops.Method;
|
||||
import sun.jvm.hotspot.oops.MethodData;
|
||||
import sun.jvm.hotspot.oops.Oop;
|
||||
import sun.jvm.hotspot.oops.RawHeapVisitor;
|
||||
import sun.jvm.hotspot.oops.Symbol;
|
||||
import sun.jvm.hotspot.oops.UnknownOopException;
|
||||
import sun.jvm.hotspot.opto.Compile;
|
||||
import sun.jvm.hotspot.opto.InlineTree;
|
||||
import sun.jvm.hotspot.runtime.CompiledVFrame;
|
||||
import sun.jvm.hotspot.runtime.CompilerThread;
|
||||
import sun.jvm.hotspot.runtime.JavaThread;
|
||||
import sun.jvm.hotspot.runtime.JavaVFrame;
|
||||
import sun.jvm.hotspot.runtime.Threads;
|
||||
import sun.jvm.hotspot.runtime.VM;
|
||||
import sun.jvm.hotspot.tools.ObjectHistogram;
|
||||
import sun.jvm.hotspot.tools.PMap;
|
||||
import sun.jvm.hotspot.tools.PStack;
|
||||
import sun.jvm.hotspot.tools.StackTrace;
|
||||
import sun.jvm.hotspot.tools.jcore.ClassDump;
|
||||
import sun.jvm.hotspot.tools.jcore.ClassFilter;
|
||||
import sun.jvm.hotspot.types.CIntegerType;
|
||||
import sun.jvm.hotspot.types.Field;
|
||||
import sun.jvm.hotspot.types.Type;
|
||||
import sun.jvm.hotspot.types.basic.BasicType;
|
||||
import sun.jvm.hotspot.ui.classbrowser.HTMLGenerator;
|
||||
import sun.jvm.hotspot.ui.tree.CTypeTreeNodeAdapter;
|
||||
import sun.jvm.hotspot.ui.tree.OopTreeNodeAdapter;
|
||||
import sun.jvm.hotspot.ui.tree.SimpleTreeNode;
|
||||
import sun.jvm.hotspot.utilities.AddressOps;
|
||||
import sun.jvm.hotspot.utilities.Assert;
|
||||
import sun.jvm.hotspot.utilities.HeapProgressThunk;
|
||||
import sun.jvm.hotspot.utilities.LivenessPathElement;
|
||||
import sun.jvm.hotspot.utilities.MethodArray;
|
||||
import sun.jvm.hotspot.utilities.ObjectReader;
|
||||
import sun.jvm.hotspot.utilities.PointerFinder;
|
||||
import sun.jvm.hotspot.utilities.PointerLocation;
|
||||
import sun.jvm.hotspot.utilities.ReversePtrs;
|
||||
import sun.jvm.hotspot.utilities.ReversePtrsAnalysis;
|
||||
import sun.jvm.hotspot.utilities.RobustOopDeterminator;
|
||||
import sun.jvm.hotspot.utilities.SystemDictionaryHelper;
|
||||
import sun.jvm.hotspot.utilities.soql.JSJavaFactory;
|
||||
import sun.jvm.hotspot.utilities.soql.JSJavaFactoryImpl;
|
||||
import sun.jvm.hotspot.utilities.soql.JSJavaScriptEngine;
|
||||
|
||||
public class CommandProcessor {
|
||||
public abstract static class DebuggerInterface {
|
||||
@ -1132,6 +1177,10 @@ public class CommandProcessor {
|
||||
Klass klass = null;
|
||||
if (t.countTokens() == 1) {
|
||||
klass = SystemDictionaryHelper.findInstanceKlass(t.nextToken());
|
||||
if (klass == null) {
|
||||
out.println("No such type.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
while (base != null && base.lessThan(end)) {
|
||||
long step = stride;
|
||||
@ -1517,7 +1566,7 @@ public class CommandProcessor {
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
thread.printThreadIDOn(new PrintStream(bos));
|
||||
if (all || bos.toString().equals(name)) {
|
||||
out.println(bos.toString() + " = " + thread.getAddress());
|
||||
out.println("Thread " + bos.toString() + " Address: " + thread.getAddress());
|
||||
HTMLGenerator gen = new HTMLGenerator(false);
|
||||
try {
|
||||
out.println(gen.genHTMLForJavaStackTrace(thread));
|
||||
@ -1546,7 +1595,7 @@ public class CommandProcessor {
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
thread.printThreadIDOn(new PrintStream(bos));
|
||||
if (all || bos.toString().equals(name)) {
|
||||
out.println(bos.toString() + " = " + thread.getAddress());
|
||||
out.println("Thread " + bos.toString() + " Address " + thread.getAddress());
|
||||
if (!all) return;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -311,6 +311,8 @@ public class HotSpotAgent {
|
||||
setupDebuggerLinux();
|
||||
} else if (os.equals("bsd")) {
|
||||
setupDebuggerBsd();
|
||||
} else if (os.equals("darwin")) {
|
||||
setupDebuggerDarwin();
|
||||
} else {
|
||||
// Add support for more operating systems here
|
||||
throw new DebuggerException("Operating system " + os + " not yet supported");
|
||||
@ -370,6 +372,10 @@ public class HotSpotAgent {
|
||||
db = new HotSpotTypeDataBase(machDesc,
|
||||
new BsdVtblAccess(debugger, jvmLibNames),
|
||||
debugger, jvmLibNames);
|
||||
} else if (os.equals("darwin")) {
|
||||
db = new HotSpotTypeDataBase(machDesc,
|
||||
new BsdVtblAccess(debugger, jvmLibNames),
|
||||
debugger, jvmLibNames);
|
||||
} else {
|
||||
throw new DebuggerException("OS \"" + os + "\" not yet supported (no VtblAccess yet)");
|
||||
}
|
||||
@ -459,6 +465,8 @@ public class HotSpotAgent {
|
||||
setupJVMLibNamesLinux();
|
||||
} else if (os.equals("bsd")) {
|
||||
setupJVMLibNamesBsd();
|
||||
} else if (os.equals("darwin")) {
|
||||
setupJVMLibNamesDarwin();
|
||||
} else {
|
||||
throw new RuntimeException("Unknown OS type");
|
||||
}
|
||||
@ -567,6 +575,29 @@ public class HotSpotAgent {
|
||||
jvmLibNames = new String[] { "libjvm.so", "libjvm_g.so" };
|
||||
}
|
||||
|
||||
//
|
||||
// Darwin
|
||||
//
|
||||
|
||||
private void setupDebuggerDarwin() {
|
||||
setupJVMLibNamesDarwin();
|
||||
|
||||
if (cpu.equals("amd64") || cpu.equals("x86_64")) {
|
||||
machDesc = new MachineDescriptionAMD64();
|
||||
} else {
|
||||
throw new DebuggerException("Darwin only supported on x86_64. Current arch: " + cpu);
|
||||
}
|
||||
|
||||
BsdDebuggerLocal dbg = new BsdDebuggerLocal(machDesc, !isServer);
|
||||
debugger = dbg;
|
||||
|
||||
attachDebugger();
|
||||
}
|
||||
|
||||
private void setupJVMLibNamesDarwin() {
|
||||
jvmLibNames = new String[] { "libjvm.dylib", "libjvm_g.dylib" };
|
||||
}
|
||||
|
||||
/** Convenience routine which should be called by per-platform
|
||||
debugger setup. Should not be called when startupMode is
|
||||
REMOTE_MODE. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -31,6 +31,9 @@ import sun.jvm.hotspot.debugger.*;
|
||||
import sun.jvm.hotspot.debugger.x86.*;
|
||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
||||
import sun.jvm.hotspot.utilities.*;
|
||||
import sun.jvm.hotspot.runtime.VM;
|
||||
import sun.jvm.hotspot.runtime.Threads;
|
||||
import sun.jvm.hotspot.runtime.JavaThread;
|
||||
import java.lang.reflect.*;
|
||||
|
||||
/** <P> An implementation of the JVMDebugger interface. The basic debug
|
||||
@ -51,10 +54,11 @@ import java.lang.reflect.*;
|
||||
public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger {
|
||||
private boolean useGCC32ABI;
|
||||
private boolean attached;
|
||||
private long p_ps_prochandle; // native debugger handle
|
||||
private long symbolicator; // macosx symbolicator handle
|
||||
private long task; // macosx task handle
|
||||
private long p_ps_prochandle; // native debugger handle
|
||||
private long symbolicator; // macosx symbolicator handle
|
||||
private long task; // macosx task handle
|
||||
private boolean isCore;
|
||||
private boolean isDarwin; // variant for bsd
|
||||
|
||||
// CDebugger support
|
||||
private BsdCDebugger cdbg;
|
||||
@ -208,6 +212,7 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger {
|
||||
}
|
||||
}
|
||||
|
||||
isDarwin = getOS().equals("darwin");
|
||||
workerThread = new BsdDebuggerLocalWorkerThread(this);
|
||||
workerThread.start();
|
||||
}
|
||||
@ -240,8 +245,11 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger {
|
||||
|
||||
/* called from attach methods */
|
||||
private void findABIVersion() throws DebuggerException {
|
||||
if (lookupByName0("libjvm.so", "__vt_10JavaThread") != 0 ||
|
||||
lookupByName0("libjvm_g.so", "__vt_10JavaThread") != 0) {
|
||||
String libjvmName = isDarwin ? "libjvm.dylib" : "libjvm.so";
|
||||
String libjvm_gName = isDarwin? "libjvm_g.dylib" : "libjvm_g.so";
|
||||
String javaThreadVt = isDarwin ? "_vt_10JavaThread" : "__vt_10JavaThread";
|
||||
if (lookupByName0(libjvmName, javaThreadVt) != 0 ||
|
||||
lookupByName0(libjvm_gName, javaThreadVt) != 0) {
|
||||
// old C++ ABI
|
||||
useGCC32ABI = false;
|
||||
} else {
|
||||
@ -360,7 +368,8 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger {
|
||||
}
|
||||
|
||||
if (isCore) {
|
||||
long addr = lookupByName0(objectName, symbol);
|
||||
// MacOSX symbol with "_" as leading
|
||||
long addr = lookupByName0(objectName, isDarwin ? "_" + symbol : symbol);
|
||||
return (addr == 0)? null : new BsdAddress(this, handleGCC32ABI(addr, symbol));
|
||||
} else {
|
||||
class LookupByNameTask implements WorkerThreadTask {
|
||||
@ -403,12 +412,12 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger {
|
||||
public ThreadProxy getThreadForIdentifierAddress(Address threadIdAddr, Address uniqueThreadIdAddr) {
|
||||
return new BsdThread(this, threadIdAddr, uniqueThreadIdAddr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThreadProxy getThreadForIdentifierAddress(Address addr) {
|
||||
throw new RuntimeException("unimplemented");
|
||||
}
|
||||
|
||||
|
||||
/** From the ThreadAccess interface via Debugger and JVMDebugger */
|
||||
public ThreadProxy getThreadForThreadId(long id) {
|
||||
return new BsdThread(this, id);
|
||||
@ -601,6 +610,33 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger {
|
||||
throw new DebuggerException("Unimplemented");
|
||||
}
|
||||
|
||||
/** this functions used for core file reading and called from native attach0,
|
||||
it returns an array of long integers as
|
||||
[thread_id, stack_start, stack_end, thread_id, stack_start, stack_end, ....] for
|
||||
all java threads recorded in Threads. Also adds the ThreadProxy to threadList */
|
||||
public long[] getJavaThreadsInfo() {
|
||||
requireAttach();
|
||||
Threads threads = VM.getVM().getThreads();
|
||||
int len = threads.getNumberOfThreads();
|
||||
long[] result = new long[len * 3]; // triple
|
||||
JavaThread t = threads.first();
|
||||
long beg, end;
|
||||
int i = 0;
|
||||
while (t != null) {
|
||||
end = t.getStackBaseValue();
|
||||
beg = end - t.getStackSize();
|
||||
BsdThread bsdt = (BsdThread)t.getThreadProxy();
|
||||
long uid = bsdt.getUniqueThreadId();
|
||||
if (threadList != null) threadList.add(bsdt);
|
||||
result[i] = uid;
|
||||
result[i + 1] = beg;
|
||||
result[i + 2] = end;
|
||||
t = t.next();
|
||||
i += 3;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static {
|
||||
System.loadLibrary("saproc");
|
||||
init0();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -44,7 +44,8 @@ class BsdThread implements ThreadProxy {
|
||||
|
||||
BsdThread(BsdDebugger debugger, long id) {
|
||||
this.debugger = debugger;
|
||||
this.thread_id = (int) id;
|
||||
// use unique_thread_id to identify thread
|
||||
this.unique_thread_id = id;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
@ -52,7 +53,7 @@ class BsdThread implements ThreadProxy {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (((BsdThread) obj).thread_id == thread_id);
|
||||
return (((BsdThread) obj).unique_thread_id == unique_thread_id);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
@ -80,4 +81,9 @@ class BsdThread implements ThreadProxy {
|
||||
throws IllegalThreadStateException, DebuggerException {
|
||||
throw new DebuggerException("Unimplemented");
|
||||
}
|
||||
|
||||
/** this is not interface function, used in core file to get unique thread id on Macosx*/
|
||||
public long getUniqueThreadId() {
|
||||
return unique_thread_id;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -148,7 +148,7 @@ public class Oop {
|
||||
if (doVMFields) {
|
||||
visitor.doCInt(mark, true);
|
||||
if (VM.getVM().isCompressedKlassPointersEnabled()) {
|
||||
throw new InternalError("unimplemented");
|
||||
visitor.doMetadata(compressedKlass, true);
|
||||
} else {
|
||||
visitor.doMetadata(klass, true);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -320,6 +320,10 @@ public class JavaThread extends Thread {
|
||||
return stackBaseField.getValue(addr);
|
||||
}
|
||||
|
||||
public long getStackBaseValue() {
|
||||
return VM.getVM().getAddressValue(getStackBase());
|
||||
}
|
||||
|
||||
public long getStackSize() {
|
||||
return stackSizeField.getValue(addr);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -42,6 +42,7 @@ import sun.jvm.hotspot.utilities.*;
|
||||
public class Threads {
|
||||
private static JavaThreadFactory threadFactory;
|
||||
private static AddressField threadListField;
|
||||
private static CIntegerField numOfThreadsField;
|
||||
private static VirtualConstructor virtualConstructor;
|
||||
private static JavaThreadPDAccess access;
|
||||
|
||||
@ -57,6 +58,7 @@ public class Threads {
|
||||
Type type = db.lookupType("Threads");
|
||||
|
||||
threadListField = type.getAddressField("_thread_list");
|
||||
numOfThreadsField = type.getCIntegerField("_number_of_threads");
|
||||
|
||||
// Instantiate appropriate platform-specific JavaThreadFactory
|
||||
String os = VM.getVM().getOS();
|
||||
@ -102,6 +104,10 @@ public class Threads {
|
||||
} else if (cpu.equals("amd64") || cpu.equals("x86_64")) {
|
||||
access = new BsdAMD64JavaThreadPDAccess();
|
||||
}
|
||||
} else if (os.equals("darwin")) {
|
||||
if (cpu.equals("amd64") || cpu.equals("x86_64")) {
|
||||
access = new BsdAMD64JavaThreadPDAccess();
|
||||
}
|
||||
}
|
||||
|
||||
if (access == null) {
|
||||
@ -144,6 +150,10 @@ public class Threads {
|
||||
return createJavaThreadWrapper(threadAddr);
|
||||
}
|
||||
|
||||
public int getNumberOfThreads() {
|
||||
return (int) numOfThreadsField.getValue();
|
||||
}
|
||||
|
||||
/** Routine for instantiating appropriately-typed wrapper for a
|
||||
JavaThread. Currently needs to be public for OopUtilities to
|
||||
access it. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -32,6 +32,7 @@ import sun.jvm.hotspot.debugger.*;
|
||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
||||
import sun.jvm.hotspot.oops.*;
|
||||
import sun.jvm.hotspot.runtime.*;
|
||||
import sun.jvm.hotspot.utilities.PlatformInfo;
|
||||
|
||||
public class PStack extends Tool {
|
||||
// in non-verbose mode, Method*s are not printed in java frames
|
||||
@ -54,6 +55,11 @@ public class PStack extends Tool {
|
||||
}
|
||||
|
||||
public void run(PrintStream out, Debugger dbg) {
|
||||
if (PlatformInfo.getOS().equals("darwin")) {
|
||||
out.println("Not available on Darwin");
|
||||
return;
|
||||
}
|
||||
|
||||
CDebugger cdbg = dbg.getCDebugger();
|
||||
if (cdbg != null) {
|
||||
ConcurrentLocksPrinter concLocksPrinter = null;
|
||||
|
@ -24,10 +24,15 @@
|
||||
|
||||
package sun.jvm.hotspot.types.basic;
|
||||
|
||||
import java.util.*;
|
||||
import sun.jvm.hotspot.debugger.*;
|
||||
import sun.jvm.hotspot.types.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import sun.jvm.hotspot.debugger.Address;
|
||||
import sun.jvm.hotspot.debugger.MachineDescription;
|
||||
import sun.jvm.hotspot.runtime.VM;
|
||||
import sun.jvm.hotspot.types.Type;
|
||||
import sun.jvm.hotspot.types.TypeDataBase;
|
||||
|
||||
/** <P> This is a basic implementation of the TypeDataBase interface.
|
||||
It allows an external type database builder to add types to be
|
||||
@ -150,7 +155,7 @@ public class BasicTypeDataBase implements TypeDataBase {
|
||||
return VM.getVM().getOopSize();
|
||||
}
|
||||
|
||||
static HashMap typeToVtbl = new HashMap();
|
||||
HashMap typeToVtbl = new HashMap();
|
||||
|
||||
private Address vtblForType(Type type) {
|
||||
Address vtblAddr = (Address)typeToVtbl.get(type);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -43,8 +43,8 @@ public class PlatformInfo {
|
||||
return "bsd";
|
||||
} else if (os.equals("OpenBSD")) {
|
||||
return "bsd";
|
||||
} else if (os.equals("Darwin") || os.contains("OS X")) {
|
||||
return "bsd";
|
||||
} else if (os.contains("Darwin") || os.contains("OS X")) {
|
||||
return "darwin";
|
||||
} else if (os.startsWith("Windows")) {
|
||||
return "win32";
|
||||
} else {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -48,7 +48,10 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#ifndef __APPLE__
|
||||
#include <link.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -109,9 +112,7 @@ JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_asm_Disassembler_load_1library(JNIE
|
||||
jstring libname_s) {
|
||||
uintptr_t func = 0;
|
||||
const char* error_message = NULL;
|
||||
const char* java_home;
|
||||
jboolean isCopy;
|
||||
uintptr_t *handle = NULL;
|
||||
|
||||
const char * jrepath = (*env)->GetStringUTFChars(env, jrepath_s, &isCopy); // like $JAVA_HOME/jre/lib/sparc/
|
||||
const char * libname = (*env)->GetStringUTFChars(env, libname_s, &isCopy);
|
||||
@ -167,7 +168,8 @@ typedef void* (*decode_func)(uintptr_t start_va, uintptr_t end_va,
|
||||
void* event_stream,
|
||||
int (*printf_callback)(void*, const char*, ...),
|
||||
void* printf_stream,
|
||||
const char* options);
|
||||
const char* options,
|
||||
int newline);
|
||||
|
||||
/* container for call back state when decoding instructions */
|
||||
typedef struct {
|
||||
@ -281,7 +283,7 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_asm_Disassembler_decode(JNIEnv * env
|
||||
end - start,
|
||||
&event_to_env, (void*) &denv,
|
||||
&printf_to_env, (void*) &denv,
|
||||
options);
|
||||
options, 0 /* newline */);
|
||||
|
||||
/* cleanup */
|
||||
(*env)->ReleaseByteArrayElements(env, code, start, JNI_ABORT);
|
||||
|
@ -532,6 +532,39 @@ $(JDK_IMAGE_DIR)/jre/lib/rt.jar:
|
||||
$(TAR) -cf - *) | \
|
||||
($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)
|
||||
|
||||
|
||||
# Testing the built JVM
|
||||
RUN_JVM=JAVA_HOME=$(JDK_IMPORT_PATH) $(JDK_IMPORT_PATH)/bin/java -d$(ARCH_DATA_MODEL) -Dsun.java.launcher=gamma
|
||||
generic_test:
|
||||
@$(ECHO) "Running with: $(ALTJVM_DIR)"
|
||||
@$(RUN_JVM) -XXaltjvm=$(ALTJVM_DIR) -Xinternalversion
|
||||
@$(RUN_JVM) -XXaltjvm=$(ALTJVM_DIR) -showversion -help
|
||||
|
||||
# C2 test targets
|
||||
test_product test_optimized test_fastdebug test_jvmg:
|
||||
@$(MAKE) generic_test ALTJVM_DIR="$(C2_DIR)/$(@:test_%=%)"
|
||||
|
||||
# C1 test targets
|
||||
test_product1 test_optimized1 test_fastdebug1 test_jvmg1:
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
@$(MAKE) generic_test ALTJVM_DIR="$(C1_DIR)/$(@:test_%1=%)"
|
||||
else
|
||||
@$(ECHO) "No compiler1 ($(@:test_%=%)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
|
||||
endif
|
||||
|
||||
# Zero test targets
|
||||
test_productzero test_optimizedzero test_fastdebugzero test_jvmgzero:
|
||||
@$(MAKE) generic_test ALTJVM_DIR="$(ZERO_DIR)/$(@:test_%zero=%)"
|
||||
|
||||
# Shark test targets
|
||||
test_productshark test_optimizedshark test_fastdebugshark test_jvmgshark:
|
||||
@$(MAKE) generic_test ALTJVM_DIR="$(SHARK_DIR)/$(@:test_%shark=%)"
|
||||
|
||||
# Minimal1 test targets
|
||||
test_productminimal1 test_optimizedminimal1 test_fastdebugminimal1 test_jvmgminimal1:
|
||||
@$(MAKE) generic_test ALTJVM_DIR="$(MINIMAL1_DIR)/$(@:test_%minimal1=%)"
|
||||
|
||||
|
||||
test_jdk:
|
||||
ifeq ($(JVM_VARIANT_CLIENT), true)
|
||||
$(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -client -Xinternalversion
|
||||
|
@ -299,63 +299,42 @@ platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
|
||||
|
||||
$(TARGETS_C2): $(SUBDIRS_C2)
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
||||
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
|
||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
||||
$(TARGETS_C1): $(SUBDIRS_C1)
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
||||
$(TARGETS_CORE): $(SUBDIRS_CORE)
|
||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
||||
$(TARGETS_ZERO): $(SUBDIRS_ZERO)
|
||||
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
||||
$(TARGETS_SHARK): $(SUBDIRS_SHARK)
|
||||
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
||||
$(TARGETS_MINIMAL1): $(SUBDIRS_MINIMAL1)
|
||||
cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
@ -50,7 +50,6 @@
|
||||
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
|
||||
# sa.make - generate SA jar file and natives
|
||||
# env.[ck]sh - environment settings
|
||||
# test_gamma - script to run the Queens program
|
||||
#
|
||||
# The makefiles are split this way so that "make foo" will run faster by not
|
||||
# having to read the dependency files for the vm.
|
||||
@ -67,9 +66,6 @@ include $(GAMMADIR)/make/altsrc.make
|
||||
# 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
|
||||
QUIETLY$(MAKE_VERBOSE) = @
|
||||
|
||||
# For now, until the compiler is less wobbly:
|
||||
TESTFLAGS = -Xbatch -showversion
|
||||
|
||||
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
|
||||
PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero
|
||||
else
|
||||
@ -135,7 +131,7 @@ BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
|
||||
# dtrace.make is used on BSD versions that implement Dtrace (like MacOS X)
|
||||
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make \
|
||||
jvmti.make sa.make dtrace.make \
|
||||
env.sh env.csh jdkpath.sh .dbxrc test_gamma
|
||||
env.sh env.csh jdkpath.sh
|
||||
|
||||
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
|
||||
SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
|
||||
@ -352,7 +348,7 @@ env.sh: $(BUILDTREE_MAKE)
|
||||
@echo Creating $@ ...
|
||||
$(QUIETLY) ( \
|
||||
$(BUILDTREE_COMMENT); \
|
||||
[ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \
|
||||
{ echo "JAVA_HOME=$(JDK_IMPORT_PATH)"; }; \
|
||||
{ \
|
||||
echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
|
||||
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
|
||||
@ -364,8 +360,7 @@ env.csh: env.sh
|
||||
@echo Creating $@ ...
|
||||
$(QUIETLY) ( \
|
||||
$(BUILDTREE_COMMENT); \
|
||||
[ -n "$$JAVA_HOME" ] && \
|
||||
{ echo "if (! \$$?JAVA_HOME) setenv JAVA_HOME \"$$JAVA_HOME\""; }; \
|
||||
{ echo "setenv JAVA_HOME \"$(JDK_IMPORT_PATH)\""; }; \
|
||||
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
|
||||
) > $@
|
||||
|
||||
@ -376,119 +371,6 @@ jdkpath.sh: $(BUILDTREE_MAKE)
|
||||
echo "JDK=${JAVA_HOME}"; \
|
||||
) > $@
|
||||
|
||||
.dbxrc: $(BUILDTREE_MAKE)
|
||||
@echo Creating $@ ...
|
||||
$(QUIETLY) ( \
|
||||
echo "echo '# Loading $(PLATFORM_DIR)/$(TARGET)/.dbxrc'"; \
|
||||
echo "if [ -f \"\$${HOTSPOT_DBXWARE}\" ]"; \
|
||||
echo "then"; \
|
||||
echo " source \"\$${HOTSPOT_DBXWARE}\""; \
|
||||
echo "elif [ -f \"\$$HOME/.dbxrc\" ]"; \
|
||||
echo "then"; \
|
||||
echo " source \"\$$HOME/.dbxrc\""; \
|
||||
echo "fi"; \
|
||||
) > $@
|
||||
|
||||
# Skip the test for product builds (which only work when installed in a JDK), to
|
||||
# avoid exiting with an error and causing make to halt.
|
||||
NO_TEST_MSG = \
|
||||
echo "$@: skipping the test--this build must be tested in a JDK."
|
||||
|
||||
NO_JAVA_HOME_MSG = \
|
||||
echo "JAVA_HOME must be set to run this test."
|
||||
|
||||
DATA_MODE = $(DATA_MODE/$(BUILDARCH))
|
||||
JAVA_FLAG = $(JAVA_FLAG/$(DATA_MODE))
|
||||
|
||||
DATA_MODE/i486 = 32
|
||||
DATA_MODE/sparc = 32
|
||||
DATA_MODE/sparcv9 = 64
|
||||
DATA_MODE/amd64 = 64
|
||||
DATA_MODE/ia64 = 64
|
||||
DATA_MODE/zero = $(ARCH_DATA_MODEL)
|
||||
|
||||
JAVA_FLAG/32 = -d32
|
||||
JAVA_FLAG/64 = -d64
|
||||
|
||||
WRONG_DATA_MODE_MSG = \
|
||||
echo "JAVA_HOME must point to a $(DATA_MODE)-bit OpenJDK."
|
||||
|
||||
CROSS_COMPILING_MSG = \
|
||||
echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run."
|
||||
|
||||
test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
|
||||
@echo Creating $@ ...
|
||||
$(QUIETLY) ( \
|
||||
echo "#!/bin/sh"; \
|
||||
echo ""; \
|
||||
$(BUILDTREE_COMMENT); \
|
||||
echo ""; \
|
||||
echo "# Include environment settings for gamma run"; \
|
||||
echo ""; \
|
||||
echo ". ./env.sh"; \
|
||||
echo ""; \
|
||||
echo "# Do not run gamma test for cross compiles"; \
|
||||
echo ""; \
|
||||
echo "if [ -n \"$(CROSS_COMPILE_ARCH)\" ]; then "; \
|
||||
echo " $(CROSS_COMPILING_MSG)"; \
|
||||
echo " exit 0"; \
|
||||
echo "fi"; \
|
||||
echo ""; \
|
||||
echo "# Make sure JAVA_HOME is set as it is required for gamma"; \
|
||||
echo ""; \
|
||||
echo "if [ -z \"\$${JAVA_HOME}\" ]; then "; \
|
||||
echo " $(NO_JAVA_HOME_MSG)"; \
|
||||
echo " exit 0"; \
|
||||
echo "fi"; \
|
||||
echo ""; \
|
||||
echo "# Check JAVA_HOME version to be used for the test"; \
|
||||
echo ""; \
|
||||
echo "\$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion > /dev/null 2>&1"; \
|
||||
echo "if [ \$$? -ne 0 ]; then "; \
|
||||
echo " $(WRONG_DATA_MODE_MSG)"; \
|
||||
echo " exit 0"; \
|
||||
echo "fi"; \
|
||||
echo ""; \
|
||||
echo "GAMMA_PROG=gamma"; \
|
||||
echo ""; \
|
||||
echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
|
||||
echo " # Ensure architecture for gamma and JAVA_HOME is the same."; \
|
||||
echo " # NOTE: gamma assumes the OpenJDK directory layout."; \
|
||||
echo ""; \
|
||||
echo " GAMMA_ARCH=\"\`file \$${GAMMA_PROG} | awk '{print \$$NF}'\`\""; \
|
||||
echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/libjava.$(LIBRARY_SUFFIX)\""; \
|
||||
echo " if [ ! -f \$${JVM_LIB} ]; then"; \
|
||||
echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/$${LIBARCH}/libjava.$(LIBRARY_SUFFIX)\""; \
|
||||
echo " fi"; \
|
||||
echo " if [ ! -f \$${JVM_LIB} ] || [ -z \"\`file \$${JVM_LIB} | grep \$${GAMMA_ARCH}\`\" ]; then "; \
|
||||
echo " $(WRONG_DATA_MODE_MSG)"; \
|
||||
echo " exit 0"; \
|
||||
echo " fi"; \
|
||||
echo "fi"; \
|
||||
echo ""; \
|
||||
echo "# Compile Queens program for test"; \
|
||||
echo ""; \
|
||||
echo "rm -f Queens.class"; \
|
||||
echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \
|
||||
echo ""; \
|
||||
echo "# Set library path solely for gamma launcher test run"; \
|
||||
echo ""; \
|
||||
echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
|
||||
echo "export LD_LIBRARY_PATH"; \
|
||||
echo "unset LD_LIBRARY_PATH_32"; \
|
||||
echo "unset LD_LIBRARY_PATH_64"; \
|
||||
echo ""; \
|
||||
echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
|
||||
echo " DYLD_LIBRARY_PATH=.:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/native_threads:\$${JAVA_HOME}/jre/lib:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
|
||||
echo " export DYLD_LIBRARY_PATH"; \
|
||||
echo "fi"; \
|
||||
echo ""; \
|
||||
echo "# Use the gamma launcher and JAVA_HOME to run the test"; \
|
||||
echo ""; \
|
||||
echo "./\$${GAMMA_PROG} $(TESTFLAGS) Queens < /dev/null"; \
|
||||
) > $@
|
||||
$(QUIETLY) chmod +x $@
|
||||
|
||||
FORCE:
|
||||
|
||||
.PHONY: all FORCE
|
||||
|
@ -135,6 +135,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetEnclosingMethodInfo;
|
||||
JVM_GetFieldAnnotations;
|
||||
JVM_GetFieldIxModifiers;
|
||||
JVM_GetFieldTypeAnnotations;
|
||||
JVM_GetHostName;
|
||||
JVM_GetInheritedAccessControlContext;
|
||||
JVM_GetInterfaceVersion;
|
||||
@ -156,6 +157,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetMethodIxSignatureUTF;
|
||||
JVM_GetMethodParameterAnnotations;
|
||||
JVM_GetMethodParameters;
|
||||
JVM_GetMethodTypeAnnotations;
|
||||
JVM_GetPrimitiveArrayElement;
|
||||
JVM_GetProtectionDomain;
|
||||
JVM_GetSockName;
|
||||
|
@ -135,6 +135,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetEnclosingMethodInfo;
|
||||
JVM_GetFieldAnnotations;
|
||||
JVM_GetFieldIxModifiers;
|
||||
JVM_GetFieldTypeAnnotations;
|
||||
JVM_GetHostName;
|
||||
JVM_GetInheritedAccessControlContext;
|
||||
JVM_GetInterfaceVersion;
|
||||
@ -156,6 +157,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetMethodIxSignatureUTF;
|
||||
JVM_GetMethodParameterAnnotations;
|
||||
JVM_GetMethodParameters;
|
||||
JVM_GetMethodTypeAnnotations;
|
||||
JVM_GetPrimitiveArrayElement;
|
||||
JVM_GetProtectionDomain;
|
||||
JVM_GetSockName;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
# Rules to build serviceability agent library, used by vm.make
|
||||
|
||||
# libsaproc.so: serviceability agent
|
||||
# libsaproc.so(dylib): serviceability agent
|
||||
SAPROC = saproc
|
||||
|
||||
ifeq ($(OS_VENDOR), Darwin)
|
||||
@ -37,7 +37,7 @@ AGENT_DIR = $(GAMMADIR)/agent
|
||||
|
||||
SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)
|
||||
|
||||
NON_STUB_SASRCFILES = $(SASRCDIR)/salibelf.c \
|
||||
BSD_NON_STUB_SASRCFILES = $(SASRCDIR)/salibelf.c \
|
||||
$(SASRCDIR)/symtab.c \
|
||||
$(SASRCDIR)/libproc_impl.c \
|
||||
$(SASRCDIR)/ps_proc.c \
|
||||
@ -45,13 +45,19 @@ NON_STUB_SASRCFILES = $(SASRCDIR)/salibelf.c \
|
||||
$(SASRCDIR)/BsdDebuggerLocal.c \
|
||||
$(AGENT_DIR)/src/share/native/sadis.c
|
||||
|
||||
DARWIN_NON_STUB_SASRCFILES = $(SASRCDIR)/symtab.c \
|
||||
$(SASRCDIR)/libproc_impl.c \
|
||||
$(SASRCDIR)/ps_core.c \
|
||||
$(SASRCDIR)/MacosxDebuggerLocal.m \
|
||||
$(AGENT_DIR)/src/share/native/sadis.c
|
||||
|
||||
ifeq ($(OS_VENDOR), FreeBSD)
|
||||
SASRCFILES = $(NON_STUB_SASRCFILES)
|
||||
SASRCFILES = $(BSD_NON_STUB_SASRCFILES)
|
||||
SALIBS = -lutil -lthread_db
|
||||
SAARCH = $(ARCHFLAG)
|
||||
else
|
||||
ifeq ($(OS_VENDOR), Darwin)
|
||||
SASRCFILES = $(SASRCDIR)/MacosxDebuggerLocal.m
|
||||
SASRCFILES = $(DARWIN_NON_STUB_SASRCFILES)
|
||||
SALIBS = -g -framework Foundation -F/System/Library/Frameworks/JavaVM.framework/Frameworks -framework JavaNativeFoundation -framework Security -framework CoreFoundation
|
||||
#objc compiler blows up on -march=i586, perhaps it should not be included in the macosx intel 32-bit C++ compiles?
|
||||
SAARCH = $(subst -march=i586,,$(ARCHFLAG))
|
||||
@ -102,7 +108,7 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
|
||||
fi
|
||||
@echo Making SA debugger back-end...
|
||||
$(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \
|
||||
$(SYMFLAG) $(SAARCH) $(SHARED_FLAG) $(PICFLAG) \
|
||||
$(SYMFLAG) $(SAARCH) $(SHARED_FLAG) $(PICFLAG) \
|
||||
-I$(SASRCDIR) \
|
||||
-I$(GENERATED) \
|
||||
$(BOOT_JAVA_INCLUDES) \
|
||||
|
@ -302,7 +302,7 @@ ifneq ($(OSNAME),windows)
|
||||
endif
|
||||
|
||||
# Required make macro settings for all platforms
|
||||
MAKE_ARGS += JAVA_HOME=$(ABS_BOOTDIR)
|
||||
MAKE_ARGS += BOOTDIR=$(ABS_BOOTDIR)
|
||||
MAKE_ARGS += OUTPUTDIR=$(ABS_OUTPUTDIR)
|
||||
MAKE_ARGS += GAMMADIR=$(ABS_GAMMADIR)
|
||||
MAKE_ARGS += MAKE_VERBOSE=$(MAKE_VERBOSE)
|
||||
@ -337,9 +337,6 @@ EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jni.h
|
||||
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h
|
||||
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h
|
||||
|
||||
# By default, run Queens test after building
|
||||
TEST_IN_BUILD ?= true
|
||||
|
||||
ifndef JAVASE_EMBEDDED
|
||||
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jfr.h
|
||||
endif
|
||||
|
@ -28,7 +28,8 @@ ifeq ($(INCLUDE_JVMTI), false)
|
||||
Src_Files_EXCLUDE += jvmtiGetLoadedClasses.cpp forte.cpp jvmtiThreadState.cpp jvmtiExtensions.cpp \
|
||||
jvmtiImpl.cpp jvmtiManageCapabilities.cpp jvmtiRawMonitor.cpp jvmtiUtil.cpp jvmtiTrace.cpp \
|
||||
jvmtiCodeBlobEvents.cpp jvmtiEnv.cpp jvmtiRedefineClasses.cpp jvmtiEnvBase.cpp jvmtiEnvThreadState.cpp \
|
||||
jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp
|
||||
jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp \
|
||||
jvmtiClassFileReconstituter.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(INCLUDE_FPROF), false)
|
||||
|
@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013
|
||||
|
||||
HS_MAJOR_VER=25
|
||||
HS_MINOR_VER=0
|
||||
HS_BUILD_NUMBER=23
|
||||
HS_BUILD_NUMBER=25
|
||||
|
||||
JDK_MAJOR_VER=1
|
||||
JDK_MINOR_VER=8
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -97,15 +97,18 @@ jprt.my.linux.ppcsflt.jdk7=linux_ppcsflt_2.6
|
||||
jprt.my.linux.ppcsflt.jdk7u8=${jprt.my.linux.ppcsflt.jdk7}
|
||||
jprt.my.linux.ppcsflt=${jprt.my.linux.ppcsflt.${jprt.tools.default.release}}
|
||||
|
||||
jprt.my.linux.armvfp.jdk8=linux_armvfp_2.6
|
||||
jprt.my.linux.armvfp.jdk7=linux_armvfp_2.6
|
||||
jprt.my.linux.armvfp.jdk7u8=${jprt.my.linux.armvfp.jdk7}
|
||||
jprt.my.linux.armvfp=${jprt.my.linux.armvfp.${jprt.tools.default.release}}
|
||||
jprt.my.linux.armvfpsflt.jdk8=linux_armvfpsflt_2.6
|
||||
jprt.my.linux.armvfpsflt=${jprt.my.linux.armvfpsflt.${jprt.tools.default.release}}
|
||||
|
||||
jprt.my.linux.armv6.jdk8=linux_armv6_2.6
|
||||
jprt.my.linux.armv6.jdk7=linux_armv6_2.6
|
||||
jprt.my.linux.armv6.jdk7u8=${jprt.my.linux.armv6.jdk7}
|
||||
jprt.my.linux.armv6=${jprt.my.linux.armv6.${jprt.tools.default.release}}
|
||||
jprt.my.linux.armvfphflt.jdk8=linux_armvfphflt_2.6
|
||||
jprt.my.linux.armvfphflt=${jprt.my.linux.armvfphflt.${jprt.tools.default.release}}
|
||||
|
||||
# The ARM GP vfp-sflt build is not currently supported
|
||||
#jprt.my.linux.armvs.jdk8=linux_armvs_2.6
|
||||
#jprt.my.linux.armvs=${jprt.my.linux.armvs.${jprt.tools.default.release}}
|
||||
|
||||
jprt.my.linux.armvh.jdk8=linux_armvh_2.6
|
||||
jprt.my.linux.armvh=${jprt.my.linux.armvh.${jprt.tools.default.release}}
|
||||
|
||||
jprt.my.linux.armsflt.jdk8=linux_armsflt_2.6
|
||||
jprt.my.linux.armsflt.jdk7=linux_armsflt_2.6
|
||||
@ -139,7 +142,7 @@ jprt.build.targets.standard= \
|
||||
${jprt.my.macosx.x64}-{product|fastdebug|debug}, \
|
||||
${jprt.my.windows.i586}-{product|fastdebug|debug}, \
|
||||
${jprt.my.windows.x64}-{product|fastdebug|debug}, \
|
||||
${jprt.my.linux.armv6}-{product|fastdebug}
|
||||
${jprt.my.linux.armvh}-{product|fastdebug}
|
||||
|
||||
jprt.build.targets.open= \
|
||||
${jprt.my.solaris.i586}-{productOpen}, \
|
||||
@ -151,7 +154,8 @@ jprt.build.targets.embedded= \
|
||||
${jprt.my.linux.ppc}-{productEmb|fastdebugEmb}, \
|
||||
${jprt.my.linux.ppcv2}-{productEmb|fastdebugEmb}, \
|
||||
${jprt.my.linux.ppcsflt}-{productEmb|fastdebugEmb}, \
|
||||
${jprt.my.linux.armvfp}-{productEmb|fastdebugEmb}, \
|
||||
${jprt.my.linux.armvfpsflt}-{productEmb|fastdebugEmb}, \
|
||||
${jprt.my.linux.armvfphflt}-{productEmb|fastdebugEmb}, \
|
||||
${jprt.my.linux.armsflt}-{productEmb|fastdebugEmb}
|
||||
|
||||
jprt.build.targets.all=${jprt.build.targets.standard}, \
|
||||
|
@ -300,63 +300,42 @@ platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
|
||||
|
||||
$(TARGETS_C2): $(SUBDIRS_C2)
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
||||
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
|
||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
||||
$(TARGETS_C1): $(SUBDIRS_C1)
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
||||
$(TARGETS_CORE): $(SUBDIRS_CORE)
|
||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
||||
$(TARGETS_ZERO): $(SUBDIRS_ZERO)
|
||||
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
||||
$(TARGETS_SHARK): $(SUBDIRS_SHARK)
|
||||
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
||||
$(TARGETS_MINIMAL1): $(SUBDIRS_MINIMAL1)
|
||||
cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
@ -50,7 +50,6 @@
|
||||
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
|
||||
# sa.make - generate SA jar file and natives
|
||||
# env.[ck]sh - environment settings
|
||||
# test_gamma - script to run the Queens program
|
||||
#
|
||||
# The makefiles are split this way so that "make foo" will run faster by not
|
||||
# having to read the dependency files for the vm.
|
||||
@ -64,9 +63,6 @@ include $(GAMMADIR)/make/altsrc.make
|
||||
# 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
|
||||
QUIETLY$(MAKE_VERBOSE) = @
|
||||
|
||||
# For now, until the compiler is less wobbly:
|
||||
TESTFLAGS = -Xbatch -showversion
|
||||
|
||||
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
|
||||
PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero
|
||||
else
|
||||
@ -128,7 +124,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
|
||||
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
|
||||
|
||||
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
|
||||
env.sh env.csh jdkpath.sh .dbxrc test_gamma
|
||||
env.sh env.csh jdkpath.sh
|
||||
|
||||
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
|
||||
SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
|
||||
@ -345,7 +341,7 @@ env.sh: $(BUILDTREE_MAKE)
|
||||
@echo Creating $@ ...
|
||||
$(QUIETLY) ( \
|
||||
$(BUILDTREE_COMMENT); \
|
||||
[ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \
|
||||
{ echo "JAVA_HOME=$(JDK_IMPORT_PATH)"; }; \
|
||||
{ \
|
||||
echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
|
||||
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
|
||||
@ -357,8 +353,7 @@ env.csh: env.sh
|
||||
@echo Creating $@ ...
|
||||
$(QUIETLY) ( \
|
||||
$(BUILDTREE_COMMENT); \
|
||||
[ -n "$$JAVA_HOME" ] && \
|
||||
{ echo "if (! \$$?JAVA_HOME) setenv JAVA_HOME \"$$JAVA_HOME\""; }; \
|
||||
{ echo "setenv JAVA_HOME \"$(JDK_IMPORT_PATH)\""; }; \
|
||||
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
|
||||
) > $@
|
||||
|
||||
@ -369,119 +364,6 @@ jdkpath.sh: $(BUILDTREE_MAKE)
|
||||
echo "JDK=${JAVA_HOME}"; \
|
||||
) > $@
|
||||
|
||||
.dbxrc: $(BUILDTREE_MAKE)
|
||||
@echo Creating $@ ...
|
||||
$(QUIETLY) ( \
|
||||
echo "echo '# Loading $(PLATFORM_DIR)/$(TARGET)/.dbxrc'"; \
|
||||
echo "if [ -f \"\$${HOTSPOT_DBXWARE}\" ]"; \
|
||||
echo "then"; \
|
||||
echo " source \"\$${HOTSPOT_DBXWARE}\""; \
|
||||
echo "elif [ -f \"\$$HOME/.dbxrc\" ]"; \
|
||||
echo "then"; \
|
||||
echo " source \"\$$HOME/.dbxrc\""; \
|
||||
echo "fi"; \
|
||||
) > $@
|
||||
|
||||
# Skip the test for product builds (which only work when installed in a JDK), to
|
||||
# avoid exiting with an error and causing make to halt.
|
||||
NO_TEST_MSG = \
|
||||
echo "$@: skipping the test--this build must be tested in a JDK."
|
||||
|
||||
NO_JAVA_HOME_MSG = \
|
||||
echo "JAVA_HOME must be set to run this test."
|
||||
|
||||
DATA_MODE = $(DATA_MODE/$(BUILDARCH))
|
||||
JAVA_FLAG = $(JAVA_FLAG/$(DATA_MODE))
|
||||
|
||||
DATA_MODE/i486 = 32
|
||||
DATA_MODE/sparc = 32
|
||||
DATA_MODE/sparcv9 = 64
|
||||
DATA_MODE/amd64 = 64
|
||||
DATA_MODE/ia64 = 64
|
||||
DATA_MODE/zero = $(ARCH_DATA_MODEL)
|
||||
|
||||
JAVA_FLAG/32 = -d32
|
||||
JAVA_FLAG/64 = -d64
|
||||
|
||||
WRONG_DATA_MODE_MSG = \
|
||||
echo "JAVA_HOME must point to a $(DATA_MODE)-bit OpenJDK."
|
||||
|
||||
CROSS_COMPILING_MSG = \
|
||||
echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run."
|
||||
|
||||
test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
|
||||
@echo Creating $@ ...
|
||||
$(QUIETLY) ( \
|
||||
echo "#!/bin/sh"; \
|
||||
echo ""; \
|
||||
$(BUILDTREE_COMMENT); \
|
||||
echo ""; \
|
||||
echo "# Include environment settings for gamma run"; \
|
||||
echo ""; \
|
||||
echo ". ./env.sh"; \
|
||||
echo ""; \
|
||||
echo "# Do not run gamma test for cross compiles"; \
|
||||
echo ""; \
|
||||
echo "if [ -n \"$(CROSS_COMPILE_ARCH)\" ]; then "; \
|
||||
echo " $(CROSS_COMPILING_MSG)"; \
|
||||
echo " exit 0"; \
|
||||
echo "fi"; \
|
||||
echo ""; \
|
||||
echo "# Make sure JAVA_HOME is set as it is required for gamma"; \
|
||||
echo ""; \
|
||||
echo "if [ -z \"\$${JAVA_HOME}\" ]; then "; \
|
||||
echo " $(NO_JAVA_HOME_MSG)"; \
|
||||
echo " exit 0"; \
|
||||
echo "fi"; \
|
||||
echo ""; \
|
||||
echo "# Check JAVA_HOME version to be used for the test"; \
|
||||
echo ""; \
|
||||
echo "\$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion > /dev/null 2>&1"; \
|
||||
echo "if [ \$$? -ne 0 ]; then "; \
|
||||
echo " $(WRONG_DATA_MODE_MSG)"; \
|
||||
echo " exit 0"; \
|
||||
echo "fi"; \
|
||||
echo ""; \
|
||||
echo "GAMMA_PROG=gamma"; \
|
||||
echo ""; \
|
||||
echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
|
||||
echo " # Ensure architecture for gamma and JAVA_HOME is the same."; \
|
||||
echo " # NOTE: gamma assumes the OpenJDK directory layout."; \
|
||||
echo ""; \
|
||||
echo " GAMMA_ARCH=\"\`file \$${GAMMA_PROG} | awk '{print \$$NF}'\`\""; \
|
||||
echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/libjava.$(LIBRARY_SUFFIX)\""; \
|
||||
echo " if [ ! -f \$${JVM_LIB} ]; then"; \
|
||||
echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/$${LIBARCH}/libjava.$(LIBRARY_SUFFIX)\""; \
|
||||
echo " fi"; \
|
||||
echo " if [ ! -f \$${JVM_LIB} ] || [ -z \"\`file \$${JVM_LIB} | grep \$${GAMMA_ARCH}\`\" ]; then "; \
|
||||
echo " $(WRONG_DATA_MODE_MSG)"; \
|
||||
echo " exit 0"; \
|
||||
echo " fi"; \
|
||||
echo "fi"; \
|
||||
echo ""; \
|
||||
echo "# Compile Queens program for test"; \
|
||||
echo ""; \
|
||||
echo "rm -f Queens.class"; \
|
||||
echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \
|
||||
echo ""; \
|
||||
echo "# Set library path solely for gamma launcher test run"; \
|
||||
echo ""; \
|
||||
echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
|
||||
echo "export LD_LIBRARY_PATH"; \
|
||||
echo "unset LD_LIBRARY_PATH_32"; \
|
||||
echo "unset LD_LIBRARY_PATH_64"; \
|
||||
echo ""; \
|
||||
echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
|
||||
echo " DYLD_LIBRARY_PATH=.:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/native_threads:\$${JAVA_HOME}/jre/lib:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
|
||||
echo " export DYLD_LIBRARY_PATH"; \
|
||||
echo "fi"; \
|
||||
echo ""; \
|
||||
echo "# Use the gamma launcher and JAVA_HOME to run the test"; \
|
||||
echo ""; \
|
||||
echo "./\$${GAMMA_PROG} $(TESTFLAGS) Queens < /dev/null"; \
|
||||
) > $@
|
||||
$(QUIETLY) chmod +x $@
|
||||
|
||||
FORCE:
|
||||
|
||||
.PHONY: all FORCE
|
||||
|
@ -131,6 +131,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetEnclosingMethodInfo;
|
||||
JVM_GetFieldAnnotations;
|
||||
JVM_GetFieldIxModifiers;
|
||||
JVM_GetFieldTypeAnnotations;
|
||||
JVM_GetHostName;
|
||||
JVM_GetInheritedAccessControlContext;
|
||||
JVM_GetInterfaceVersion;
|
||||
@ -152,6 +153,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetMethodIxSignatureUTF;
|
||||
JVM_GetMethodParameterAnnotations;
|
||||
JVM_GetMethodParameters;
|
||||
JVM_GetMethodTypeAnnotations;
|
||||
JVM_GetPrimitiveArrayElement;
|
||||
JVM_GetProtectionDomain;
|
||||
JVM_GetSockName;
|
||||
|
@ -131,6 +131,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetEnclosingMethodInfo;
|
||||
JVM_GetFieldAnnotations;
|
||||
JVM_GetFieldIxModifiers;
|
||||
JVM_GetFieldTypeAnnotations;
|
||||
JVM_GetHostName;
|
||||
JVM_GetInheritedAccessControlContext;
|
||||
JVM_GetInterfaceVersion;
|
||||
@ -152,6 +153,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetMethodIxSignatureUTF;
|
||||
JVM_GetMethodParameterAnnotations;
|
||||
JVM_GetMethodParameters;
|
||||
JVM_GetMethodTypeAnnotations;
|
||||
JVM_GetPrimitiveArrayElement;
|
||||
JVM_GetProtectionDomain;
|
||||
JVM_GetSockName;
|
||||
|
@ -231,36 +231,24 @@ $(SUBDIRS_CORE): $(BUILDTREE_MAKE)
|
||||
|
||||
$(TARGETS_C2): $(SUBDIRS_C2)
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
||||
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
|
||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
||||
$(TARGETS_C1): $(SUBDIRS_C1)
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
||||
$(TARGETS_CORE): $(SUBDIRS_CORE)
|
||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
|
||||
ifeq ($(TEST_IN_BUILD),true)
|
||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
|
||||
endif
|
||||
ifdef INSTALL
|
||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
|
||||
endif
|
||||
|
@ -50,21 +50,19 @@
|
||||
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
|
||||
# sa.make - generate SA jar file and natives
|
||||
# env.[ck]sh - environment settings
|
||||
# test_gamma - script to run the Queens program
|
||||
#
|
||||
# The makefiles are split this way so that "make foo" will run faster by not
|
||||
# having to read the dependency files for the vm.
|
||||
|
||||
-include $(SPEC)
|
||||
include $(GAMMADIR)/make/scm.make
|
||||
include $(GAMMADIR)/make/defs.make
|
||||
include $(GAMMADIR)/make/altsrc.make
|
||||
|
||||
|
||||
# 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
|
||||
QUIETLY$(MAKE_VERBOSE) = @
|
||||
|
||||
# For now, until the compiler is less wobbly:
|
||||
TESTFLAGS = -Xbatch -Xmx32m -showversion
|
||||
|
||||
### maye ARCH_XXX instead?
|
||||
ifdef USE_GCC
|
||||
PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH).gcc
|
||||
@ -119,7 +117,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
|
||||
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
|
||||
|
||||
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
|
||||
env.sh env.csh jdkpath.sh .dbxrc test_gamma
|
||||
env.sh env.csh jdkpath.sh
|
||||
|
||||
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
|
||||
ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
|
||||
@ -334,7 +332,7 @@ env.sh: $(BUILDTREE_MAKE)
|
||||
@echo Creating $@ ...
|
||||
$(QUIETLY) ( \
|
||||
$(BUILDTREE_COMMENT); \
|
||||
[ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \
|
||||
{ echo "JAVA_HOME=$(JDK_IMPORT_PATH)"; }; \
|
||||
{ \
|
||||
echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
|
||||
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
|
||||
@ -346,8 +344,7 @@ env.csh: env.sh
|
||||
@echo Creating $@ ...
|
||||
$(QUIETLY) ( \
|
||||
$(BUILDTREE_COMMENT); \
|
||||
[ -n "$$JAVA_HOME" ] && \
|
||||
{ echo "if (! \$$?JAVA_HOME) setenv JAVA_HOME \"$$JAVA_HOME\""; }; \
|
||||
{ echo "setenv JAVA_HOME \"$(JDK_IMPORT_PATH)\""; }; \
|
||||
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
|
||||
) > $@
|
||||
|
||||
@ -358,124 +355,6 @@ jdkpath.sh: $(BUILDTREE_MAKE)
|
||||
echo "JDK=${JAVA_HOME}"; \
|
||||
) > $@
|
||||
|
||||
.dbxrc: $(BUILDTREE_MAKE)
|
||||
@echo Creating $@ ...
|
||||
$(QUIETLY) ( \
|
||||
echo "echo '# Loading $(PLATFORM_DIR)/$(TARGET)/.dbxrc'"; \
|
||||
echo "if [ -f \"\$${HOTSPOT_DBXWARE}\" ]"; \
|
||||
echo "then"; \
|
||||
echo " source \"\$${HOTSPOT_DBXWARE}\""; \
|
||||
echo "elif [ -f \"\$$HOME/.dbxrc\" ]"; \
|
||||
echo "then"; \
|
||||
echo " source \"\$$HOME/.dbxrc\""; \
|
||||
echo "fi"; \
|
||||
) > $@
|
||||
|
||||
# Skip the test for product builds (which only work when installed in a JDK), to
|
||||
# avoid exiting with an error and causing make to halt.
|
||||
NO_TEST_MSG = \
|
||||
echo "$@: skipping the test--this build must be tested in a JDK."
|
||||
|
||||
NO_JAVA_HOME_MSG = \
|
||||
echo "JAVA_HOME must be set to run this test."
|
||||
|
||||
DATA_MODE = $(DATA_MODE/$(BUILDARCH))
|
||||
JAVA_FLAG = $(JAVA_FLAG/$(DATA_MODE))
|
||||
|
||||
DATA_MODE/i486 = 32
|
||||
DATA_MODE/sparc = 32
|
||||
DATA_MODE/sparcv9 = 64
|
||||
DATA_MODE/amd64 = 64
|
||||
DATA_MODE/ia64 = 64
|
||||
|
||||
# This bit is needed to enable local rebuilds.
|
||||
# Unless the makefile itself sets LP64, any environmental
|
||||
# setting of LP64 will interfere with the build.
|
||||
LP64_SETTING/32 = LP64 = \#empty
|
||||
LP64_SETTING/64 = LP64 = 1
|
||||
|
||||
JAVA_FLAG/32 = -d32
|
||||
JAVA_FLAG/64 = -d64
|
||||
|
||||
WRONG_DATA_MODE_MSG = \
|
||||
echo "JAVA_HOME must point to a $(DATA_MODE)-bit OpenJDK."
|
||||
|
||||
CROSS_COMPILING_MSG = \
|
||||
echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run."
|
||||
|
||||
test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
|
||||
@echo Creating $@ ...
|
||||
$(QUIETLY) ( \
|
||||
echo "#!/bin/sh"; \
|
||||
echo ""; \
|
||||
$(BUILDTREE_COMMENT); \
|
||||
echo ""; \
|
||||
echo "# Include environment settings for gamma run"; \
|
||||
echo ""; \
|
||||
echo ". ./env.sh"; \
|
||||
echo ""; \
|
||||
echo "# Do not run gamma test for cross compiles"; \
|
||||
echo ""; \
|
||||
echo "if [ -n \"$(CROSS_COMPILE_ARCH)\" ]; then "; \
|
||||
echo " $(CROSS_COMPILING_MSG)"; \
|
||||
echo " exit 0"; \
|
||||
echo "fi"; \
|
||||
echo ""; \
|
||||
echo "# Make sure JAVA_HOME is set as it is required for gamma"; \
|
||||
echo ""; \
|
||||
echo "if [ -z \"\$${JAVA_HOME}\" ]; then "; \
|
||||
echo " $(NO_JAVA_HOME_MSG)"; \
|
||||
echo " exit 0"; \
|
||||
echo "fi"; \
|
||||
echo ""; \
|
||||
echo "# Check JAVA_HOME version to be used for the test"; \
|
||||
echo ""; \
|
||||
echo "\$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion > /dev/null 2>&1"; \
|
||||
echo "if [ \$$? -ne 0 ]; then "; \
|
||||
echo " $(WRONG_DATA_MODE_MSG)"; \
|
||||
echo " exit 0"; \
|
||||
echo "fi"; \
|
||||
echo ""; \
|
||||
echo "GAMMA_PROG=gamma"; \
|
||||
echo ""; \
|
||||
echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
|
||||
echo " # Ensure architecture for gamma and JAVA_HOME is the same."; \
|
||||
echo " # NOTE: gamma assumes the OpenJDK directory layout."; \
|
||||
echo ""; \
|
||||
echo " GAMMA_ARCH=\"\`file \$${GAMMA_PROG} | awk '{print \$$NF}'\`\""; \
|
||||
echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/libjava.$(LIBRARY_SUFFIX)\""; \
|
||||
echo " if [ ! -f \$${JVM_LIB} ]; then"; \
|
||||
echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/$${LIBARCH}/libjava.$(LIBRARY_SUFFIX)\""; \
|
||||
echo " fi"; \
|
||||
echo " if [ ! -f \$${JVM_LIB} ] || [ -z \"\`file \$${JVM_LIB} | grep \$${GAMMA_ARCH}\`\" ]; then "; \
|
||||
echo " $(WRONG_DATA_MODE_MSG)"; \
|
||||
echo " exit 0"; \
|
||||
echo " fi"; \
|
||||
echo "fi"; \
|
||||
echo ""; \
|
||||
echo "# Compile Queens program for test"; \
|
||||
echo ""; \
|
||||
echo "rm -f Queens.class"; \
|
||||
echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \
|
||||
echo ""; \
|
||||
echo "# Set library path solely for gamma launcher test run"; \
|
||||
echo ""; \
|
||||
echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
|
||||
echo "export LD_LIBRARY_PATH"; \
|
||||
echo "unset LD_LIBRARY_PATH_32"; \
|
||||
echo "unset LD_LIBRARY_PATH_64"; \
|
||||
echo ""; \
|
||||
echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
|
||||
echo " DYLD_LIBRARY_PATH=.:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/native_threads:\$${JAVA_HOME}/jre/lib:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
|
||||
echo " export DYLD_LIBRARY_PATH"; \
|
||||
echo "fi"; \
|
||||
echo ""; \
|
||||
echo "# Use the gamma launcher and JAVA_HOME to run the test"; \
|
||||
echo ""; \
|
||||
echo "./\$${GAMMA_PROG} $(TESTFLAGS) Queens < /dev/null"; \
|
||||
) > $@
|
||||
$(QUIETLY) chmod +x $@
|
||||
|
||||
FORCE:
|
||||
|
||||
.PHONY: all FORCE
|
||||
|
@ -131,6 +131,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetEnclosingMethodInfo;
|
||||
JVM_GetFieldAnnotations;
|
||||
JVM_GetFieldIxModifiers;
|
||||
JVM_GetFieldTypeAnnotations;
|
||||
JVM_GetHostName;
|
||||
JVM_GetInheritedAccessControlContext;
|
||||
JVM_GetInterfaceVersion;
|
||||
@ -152,6 +153,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetMethodIxSignatureUTF;
|
||||
JVM_GetMethodParameterAnnotations;
|
||||
JVM_GetMethodParameters;
|
||||
JVM_GetMethodTypeAnnotations;
|
||||
JVM_GetPrimitiveArrayElement;
|
||||
JVM_GetProtectionDomain;
|
||||
JVM_GetSockName;
|
||||
|
@ -1,86 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
import java.util.*;
|
||||
|
||||
// Copyright 1996, Animorphic Systems
|
||||
// gri 28 Aug 92 / 15 Jan 93 / 8 Dec 95
|
||||
|
||||
class Queens {
|
||||
|
||||
static void try_i(boolean a[], boolean b[], boolean c[], int x[], int i) {
|
||||
int adj = 7;
|
||||
|
||||
for (int j = 1; j <= 8; j++) {
|
||||
if (b[j] && a[i+j] && c[adj+i-j]) {
|
||||
x[i] = j;
|
||||
b[j] = false;
|
||||
a[i+j] = false;
|
||||
c[adj+i-j] = false;
|
||||
if (i < 8) try_i(a, b, c, x, i+1);
|
||||
else print(x);
|
||||
b[j] = true;
|
||||
a[i+j] = true;
|
||||
c[adj+i-j] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String s[]) {
|
||||
boolean a[] = new boolean[16+1];
|
||||
boolean b[] = new boolean[ 8+1];
|
||||
boolean c[] = new boolean[14+1];
|
||||
int x[] = new int[8+1];
|
||||
int adj = 7;
|
||||
|
||||
for (int i = -7; i <= 16; i++) {
|
||||
if (i >= 1 && i <= 8) b[i] = true;
|
||||
if (i >= 2) a[i] = true;
|
||||
if (i <= 7) c[adj+i] = true;
|
||||
}
|
||||
|
||||
x[0] = 0; // solution counter
|
||||
|
||||
try_i(a, b, c, x, 1);
|
||||
}
|
||||
|
||||
static void print(int x[]) {
|
||||
// first correct solution: A1 B5 C8 D6 E3 F7 G2 H4
|
||||
|
||||
char LF = (char)0xA;
|
||||
char CR = (char)0xD;
|
||||
|
||||
x[0]++;
|
||||
if (x[0] < 10)
|
||||
System.out.print(" ");
|
||||
System.out.print(x[0] + ". ");
|
||||
for (int i = 1; i <= 8; i++) {
|
||||
char p = (char)('A' + i - 1);
|
||||
System.out.print(p);
|
||||
System.out.print (x[i] + " ");
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
};
|
@ -110,8 +110,6 @@ VARIANT_TEXT=Server
|
||||
!endif
|
||||
!elseif "$(Variant)" == "tiered"
|
||||
VARIANT_TEXT=Tiered
|
||||
!elseif "$(Variant)" == "kernel"
|
||||
VARIANT_TEXT=Kernel
|
||||
!endif
|
||||
|
||||
#########################################################################
|
||||
@ -305,9 +303,9 @@ $(variantDir)\local.make: checks
|
||||
checks: checkVariant checkWorkSpace checkSA
|
||||
|
||||
checkVariant:
|
||||
@ if "$(Variant)"=="" echo Need to specify "Variant=[tiered|compiler2|compiler1|kernel|core]" && false
|
||||
@ if "$(Variant)" NEQ "tiered" if "$(Variant)" NEQ "compiler2" if "$(Variant)" NEQ "compiler1" if "$(Variant)" NEQ "kernel" if "$(Variant)" NEQ "core" \
|
||||
echo Need to specify "Variant=[tiered|compiler2|compiler1|kernel|core]" && false
|
||||
@ if "$(Variant)"=="" echo Need to specify "Variant=[tiered|compiler2|compiler1|core]" && false
|
||||
@ if "$(Variant)" NEQ "tiered" if "$(Variant)" NEQ "compiler2" if "$(Variant)" NEQ "compiler1" if "$(Variant)" NEQ "core" \
|
||||
echo Need to specify "Variant=[tiered|compiler2|compiler1|core]" && false
|
||||
|
||||
checkWorkSpace:
|
||||
@ if "$(WorkSpace)"=="" echo Need to specify "WorkSpace=..." && false
|
||||
|
@ -148,7 +148,7 @@ echo HotSpotJDKDist=%HotSpotJDKDist%
|
||||
|
||||
REM This is now safe to do.
|
||||
:copyfiles
|
||||
for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
|
||||
for /D %%i in (compiler1, compiler2, tiered, core) do (
|
||||
if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated
|
||||
copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL
|
||||
)
|
||||
@ -156,7 +156,7 @@ copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\
|
||||
REM force regneration of ProjectFile
|
||||
if exist %ProjectFile% del %ProjectFile%
|
||||
|
||||
for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
|
||||
for /D %%i in (compiler1, compiler2, tiered, core) do (
|
||||
echo -- %%i --
|
||||
echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make
|
||||
echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make
|
||||
|
@ -221,13 +221,6 @@ LD_FLAGS = /SAFESEH $(LD_FLAGS)
|
||||
!endif
|
||||
!endif
|
||||
|
||||
# Compile for space above time.
|
||||
!if "$(Variant)" == "kernel"
|
||||
PRODUCT_OPT_OPTION = /O1 /Oy-
|
||||
FASTDEBUG_OPT_OPTION = /O1 /Oy-
|
||||
DEBUG_OPT_OPTION = /Od
|
||||
!endif
|
||||
|
||||
# If NO_OPTIMIZATIONS is defined in the environment, turn everything off
|
||||
!ifdef NO_OPTIMIZATIONS
|
||||
PRODUCT_OPT_OPTION = $(DEBUG_OPT_OPTION)
|
||||
|
@ -51,13 +51,6 @@ HS_BUILD_ID=$(HS_BUILD_VER)
|
||||
# Force resources to be rebuilt every time
|
||||
$(Res_Files): FORCE
|
||||
|
||||
# Kernel doesn't need exported vtbl symbols.
|
||||
!if "$(Variant)" == "kernel"
|
||||
$(AOUT): $(Res_Files) $(Obj_Files)
|
||||
$(LD) @<<
|
||||
$(LD_FLAGS) /out:$@ /implib:$*.lib $(Obj_Files) $(Res_Files)
|
||||
<<
|
||||
!else
|
||||
vm.def: $(Obj_Files)
|
||||
sh $(WorkSpace)/make/windows/build_vm_def.sh
|
||||
|
||||
@ -65,7 +58,6 @@ $(AOUT): $(Res_Files) $(Obj_Files) vm.def
|
||||
$(LD) @<<
|
||||
$(LD_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files)
|
||||
<<
|
||||
!endif
|
||||
!if "$(MT)" != ""
|
||||
# The previous link command created a .manifest file that we want to
|
||||
# insert into the linked artifact so we do not need to track it
|
||||
|
@ -89,12 +89,8 @@ STACK_SIZE=
|
||||
# AsyncGetCallTrace is not supported on IA64 yet
|
||||
AGCT_EXPORT=
|
||||
!else
|
||||
!if "$(Variant)" == "kernel"
|
||||
AGCT_EXPORT=
|
||||
!else
|
||||
AGCT_EXPORT=/export:AsyncGetCallTrace
|
||||
!endif
|
||||
!endif
|
||||
|
||||
# If you modify exports below please do the corresponding changes in
|
||||
# src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
|
||||
|
@ -1,27 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
#
|
||||
|
||||
!include ../local.make
|
||||
|
||||
!include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
|
@ -1,7 +0,0 @@
|
||||
;
|
||||
; This .DEF file is a placeholder for one which is automatically
|
||||
; generated during the build process. See
|
||||
; make\windows\build_vm_def.sh and
|
||||
; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
|
||||
; options).
|
||||
;
|
@ -1,29 +0,0 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "vm"=.\vm.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
@ -1385,13 +1385,13 @@ void MacroAssembler::_verify_oop(Register reg, const char* msg, const char * fil
|
||||
}
|
||||
#endif
|
||||
|
||||
int len = strlen(file) + strlen(msg) + 1 + 4;
|
||||
sprintf(buffer, "%d", line);
|
||||
len += strlen(buffer);
|
||||
sprintf(buffer, " at offset %d ", offset());
|
||||
len += strlen(buffer);
|
||||
char * real_msg = new char[len];
|
||||
sprintf(real_msg, "%s%s(%s:%d)", msg, buffer, file, line);
|
||||
const char* real_msg = NULL;
|
||||
{
|
||||
ResourceMark rm;
|
||||
stringStream ss;
|
||||
ss.print("%s at offset %d (%s:%d)", msg, offset(), file, line);
|
||||
real_msg = code_string(ss.as_string());
|
||||
}
|
||||
|
||||
// Call indirectly to solve generation ordering problem
|
||||
AddressLiteral a(StubRoutines::verify_oop_subroutine_entry_address());
|
||||
@ -1423,13 +1423,13 @@ void MacroAssembler::_verify_oop_addr(Address addr, const char* msg, const char
|
||||
// plausibility check for oops
|
||||
if (!VerifyOops) return;
|
||||
|
||||
char buffer[64];
|
||||
sprintf(buffer, "%d", line);
|
||||
int len = strlen(file) + strlen(msg) + 1 + 4 + strlen(buffer);
|
||||
sprintf(buffer, " at SP+%d ", addr.disp());
|
||||
len += strlen(buffer);
|
||||
char * real_msg = new char[len];
|
||||
sprintf(real_msg, "%s at SP+%d (%s:%d)", msg, addr.disp(), file, line);
|
||||
const char* real_msg = NULL;
|
||||
{
|
||||
ResourceMark rm;
|
||||
stringStream ss;
|
||||
ss.print("%s at SP+%d (%s:%d)", msg, addr.disp(), file, line);
|
||||
real_msg = code_string(ss.as_string());
|
||||
}
|
||||
|
||||
// Call indirectly to solve generation ordering problem
|
||||
AddressLiteral a(StubRoutines::verify_oop_subroutine_entry_address());
|
||||
@ -1622,9 +1622,13 @@ void MacroAssembler::untested(const char* what) {
|
||||
// in order to run automated test scripts on the VM
|
||||
// Use the flag ShowMessageBoxOnError
|
||||
|
||||
char* b = new char[1024];
|
||||
sprintf(b, "untested: %s", what);
|
||||
|
||||
const char* b = NULL;
|
||||
{
|
||||
ResourceMark rm;
|
||||
stringStream ss;
|
||||
ss.print("untested: %s", what);
|
||||
b = code_string(ss.as_string());
|
||||
}
|
||||
if (ShowMessageBoxOnError) { STOP(b); }
|
||||
else { warn(b); }
|
||||
}
|
||||
|
@ -295,14 +295,18 @@ inline bool frame::volatile_across_calls(Register reg) {
|
||||
return true;
|
||||
}
|
||||
|
||||
inline oop frame::saved_oop_result(RegisterMap* map) const {
|
||||
oop* result_adr = (oop *)map->location(rax->as_VMReg());
|
||||
guarantee(result_adr != NULL, "bad register save location");
|
||||
|
||||
|
||||
inline oop frame::saved_oop_result(RegisterMap* map) const {
|
||||
return *((oop*) map->location(rax->as_VMReg()));
|
||||
return (*result_adr);
|
||||
}
|
||||
|
||||
inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
|
||||
*((oop*) map->location(rax->as_VMReg())) = obj;
|
||||
oop* result_adr = (oop *)map->location(rax->as_VMReg());
|
||||
guarantee(result_adr != NULL, "bad register save location");
|
||||
|
||||
*result_adr = obj;
|
||||
}
|
||||
|
||||
#endif // CPU_X86_VM_FRAME_X86_INLINE_HPP
|
||||
|
@ -4262,8 +4262,13 @@ void MacroAssembler::verify_oop(Register reg, const char* s) {
|
||||
if (!VerifyOops) return;
|
||||
|
||||
// Pass register number to verify_oop_subroutine
|
||||
char* b = new char[strlen(s) + 50];
|
||||
sprintf(b, "verify_oop: %s: %s", reg->name(), s);
|
||||
const char* b = NULL;
|
||||
{
|
||||
ResourceMark rm;
|
||||
stringStream ss;
|
||||
ss.print("verify_oop: %s: %s", reg->name(), s);
|
||||
b = code_string(ss.as_string());
|
||||
}
|
||||
BLOCK_COMMENT("verify_oop {");
|
||||
#ifdef _LP64
|
||||
push(rscratch1); // save r10, trashed by movptr()
|
||||
@ -4297,9 +4302,14 @@ RegisterOrConstant MacroAssembler::delayed_value_impl(intptr_t* delayed_value_ad
|
||||
{ Label L;
|
||||
testptr(tmp, tmp);
|
||||
if (WizardMode) {
|
||||
const char* buf = NULL;
|
||||
{
|
||||
ResourceMark rm;
|
||||
stringStream ss;
|
||||
ss.print("DelayedValue="INTPTR_FORMAT, delayed_value_addr[1]);
|
||||
buf = code_string(ss.as_string());
|
||||
}
|
||||
jcc(Assembler::notZero, L);
|
||||
char* buf = new char[40];
|
||||
sprintf(buf, "DelayedValue="INTPTR_FORMAT, delayed_value_addr[1]);
|
||||
STOP(buf);
|
||||
} else {
|
||||
jccb(Assembler::notZero, L);
|
||||
@ -4343,9 +4353,13 @@ void MacroAssembler::verify_oop_addr(Address addr, const char* s) {
|
||||
|
||||
// Address adjust(addr.base(), addr.index(), addr.scale(), addr.disp() + BytesPerWord);
|
||||
// Pass register number to verify_oop_subroutine
|
||||
char* b = new char[strlen(s) + 50];
|
||||
sprintf(b, "verify_oop_addr: %s", s);
|
||||
|
||||
const char* b = NULL;
|
||||
{
|
||||
ResourceMark rm;
|
||||
stringStream ss;
|
||||
ss.print("verify_oop_addr: %s", s);
|
||||
b = code_string(ss.as_string());
|
||||
}
|
||||
#ifdef _LP64
|
||||
push(rscratch1); // save r10, trashed by movptr()
|
||||
#endif
|
||||
|
@ -145,12 +145,9 @@ address* Relocation::pd_address_in_code() {
|
||||
assert(which == Assembler::disp32_operand ||
|
||||
which == Assembler::call32_operand ||
|
||||
which == Assembler::imm_operand, "format unpacks ok");
|
||||
if (which != Assembler::imm_operand) {
|
||||
// The "address" in the code is a displacement can't return it as
|
||||
// and address* since it is really a jint*
|
||||
ShouldNotReachHere();
|
||||
return NULL;
|
||||
}
|
||||
// The "address" in the code is a displacement can't return it as
|
||||
// and address* since it is really a jint*
|
||||
guarantee(which == Assembler::imm_operand, "must be immediate operand");
|
||||
#else
|
||||
assert(which == Assembler::disp32_operand || which == Assembler::imm_operand, "format unpacks ok");
|
||||
#endif // AMD64
|
||||
|
@ -1811,13 +1811,15 @@ bool os::Linux::_stack_is_executable = false;
|
||||
class VM_LinuxDllLoad: public VM_Operation {
|
||||
private:
|
||||
const char *_filename;
|
||||
char *_ebuf;
|
||||
int _ebuflen;
|
||||
void *_lib;
|
||||
public:
|
||||
VM_LinuxDllLoad(const char *fn) :
|
||||
_filename(fn), _lib(NULL) {}
|
||||
VM_LinuxDllLoad(const char *fn, char *ebuf, int ebuflen) :
|
||||
_filename(fn), _ebuf(ebuf), _ebuflen(ebuflen), _lib(NULL) {}
|
||||
VMOp_Type type() const { return VMOp_LinuxDllLoad; }
|
||||
void doit() {
|
||||
_lib = os::Linux::dll_load_inner(_filename);
|
||||
_lib = os::Linux::dll_load_in_vmthread(_filename, _ebuf, _ebuflen);
|
||||
os::Linux::_stack_is_executable = true;
|
||||
}
|
||||
void* loaded_library() { return _lib; }
|
||||
@ -1865,13 +1867,13 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
|
||||
// This is for the case where the DLL has an static
|
||||
// constructor function that executes JNI code. We cannot
|
||||
// load such DLLs in the VMThread.
|
||||
result = ::dlopen(filename, RTLD_LAZY);
|
||||
result = os::Linux::dlopen_helper(filename, ebuf, ebuflen);
|
||||
}
|
||||
|
||||
ThreadInVMfromNative tiv(jt);
|
||||
debug_only(VMNativeEntryWrapper vew;)
|
||||
|
||||
VM_LinuxDllLoad op(filename);
|
||||
VM_LinuxDllLoad op(filename, ebuf, ebuflen);
|
||||
VMThread::execute(&op);
|
||||
if (LoadExecStackDllInVMThread) {
|
||||
result = op.loaded_library();
|
||||
@ -1883,7 +1885,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
|
||||
}
|
||||
|
||||
if (!load_attempted) {
|
||||
result = ::dlopen(filename, RTLD_LAZY);
|
||||
result = os::Linux::dlopen_helper(filename, ebuf, ebuflen);
|
||||
}
|
||||
|
||||
if (result != NULL) {
|
||||
@ -1892,11 +1894,6 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
|
||||
}
|
||||
|
||||
Elf32_Ehdr elf_head;
|
||||
|
||||
// Read system error message into ebuf
|
||||
// It may or may not be overwritten below
|
||||
::strncpy(ebuf, ::dlerror(), ebuflen-1);
|
||||
ebuf[ebuflen-1]='\0';
|
||||
int diag_msg_max_length=ebuflen-strlen(ebuf);
|
||||
char* diag_msg_buf=ebuf+strlen(ebuf);
|
||||
|
||||
@ -2039,10 +2036,19 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void * os::Linux::dll_load_inner(const char *filename) {
|
||||
void * os::Linux::dlopen_helper(const char *filename, char *ebuf, int ebuflen) {
|
||||
void * result = ::dlopen(filename, RTLD_LAZY);
|
||||
if (result == NULL) {
|
||||
::strncpy(ebuf, ::dlerror(), ebuflen - 1);
|
||||
ebuf[ebuflen-1] = '\0';
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void * os::Linux::dll_load_in_vmthread(const char *filename, char *ebuf, int ebuflen) {
|
||||
void * result = NULL;
|
||||
if (LoadExecStackDllInVMThread) {
|
||||
result = ::dlopen(filename, RTLD_LAZY);
|
||||
result = dlopen_helper(filename, ebuf, ebuflen);
|
||||
}
|
||||
|
||||
// Since 7019808, libjvm.so is linked with -noexecstack. If the VM loads a
|
||||
|
@ -95,7 +95,8 @@ class Linux {
|
||||
|
||||
public:
|
||||
static bool _stack_is_executable;
|
||||
static void *dll_load_inner(const char *name);
|
||||
static void *dlopen_helper(const char *name, char *ebuf, int ebuflen);
|
||||
static void *dll_load_in_vmthread(const char *name, char *ebuf, int ebuflen);
|
||||
|
||||
static void init_thread_fpu_state();
|
||||
static int get_fpu_control_word();
|
||||
|
@ -46,7 +46,7 @@ define_pd_global(uintx, SurvivorRatio, 8);
|
||||
|
||||
define_pd_global(uintx, JVMInvokeMethodSlack, 8192);
|
||||
|
||||
// Used on 64 bit platforms for UseCompressedOops base address or CDS
|
||||
// Used on 64 bit platforms for UseCompressedOops base address
|
||||
define_pd_global(uintx, HeapBaseMinAddress, 2*G);
|
||||
|
||||
#endif // OS_CPU_BSD_X86_VM_GLOBALS_BSD_X86_HPP
|
||||
|
@ -41,7 +41,7 @@ define_pd_global(intx, VMThreadStackSize, 512);
|
||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||
define_pd_global(uintx, JVMInvokeMethodSlack, 8192);
|
||||
|
||||
// Used on 64 bit platforms for UseCompressedOops base address or CDS
|
||||
// Used on 64 bit platforms for UseCompressedOops base address
|
||||
define_pd_global(uintx, HeapBaseMinAddress, 2*G);
|
||||
|
||||
#endif // OS_CPU_BSD_ZERO_VM_GLOBALS_BSD_ZERO_HPP
|
||||
|
@ -33,7 +33,7 @@
|
||||
define_pd_global(uintx, JVMInvokeMethodSlack, 12288);
|
||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||
|
||||
// Used on 64 bit platforms for UseCompressedOops base address or CDS
|
||||
// Used on 64 bit platforms for UseCompressedOops base address
|
||||
define_pd_global(uintx, HeapBaseMinAddress, CONST64(4)*G);
|
||||
|
||||
#endif // OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP
|
||||
|
@ -44,7 +44,7 @@ define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||
|
||||
define_pd_global(uintx,JVMInvokeMethodSlack, 8192);
|
||||
|
||||
// Used on 64 bit platforms for UseCompressedOops base address or CDS
|
||||
// Used on 64 bit platforms for UseCompressedOops base address
|
||||
define_pd_global(uintx,HeapBaseMinAddress, 2*G);
|
||||
|
||||
#endif // OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP
|
||||
|
@ -340,7 +340,7 @@ JVM_handle_linux_signal(int sig,
|
||||
// here if the underlying file has been truncated.
|
||||
// Do not crash the VM in such a case.
|
||||
CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
|
||||
nmethod* nm = cb->is_nmethod() ? (nmethod*)cb : NULL;
|
||||
nmethod* nm = (cb != NULL && cb->is_nmethod()) ? (nmethod*)cb : NULL;
|
||||
if (nm != NULL && nm->has_unsafe_access()) {
|
||||
stub = StubRoutines::handler_for_unsafe_access();
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ define_pd_global(intx, VMThreadStackSize, 512);
|
||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||
define_pd_global(uintx, JVMInvokeMethodSlack, 8192);
|
||||
|
||||
// Used on 64 bit platforms for UseCompressedOops base address or CDS
|
||||
// Used on 64 bit platforms for UseCompressedOops base address
|
||||
define_pd_global(uintx, HeapBaseMinAddress, 2*G);
|
||||
|
||||
#endif // OS_CPU_LINUX_ZERO_VM_GLOBALS_LINUX_ZERO_HPP
|
||||
|
@ -33,7 +33,7 @@
|
||||
define_pd_global(uintx, JVMInvokeMethodSlack, 12288);
|
||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||
|
||||
// Used on 64 bit platforms for UseCompressedOops base address or CDS
|
||||
// Used on 64 bit platforms for UseCompressedOops base address
|
||||
#ifdef _LP64
|
||||
define_pd_global(uintx, HeapBaseMinAddress, CONST64(4)*G);
|
||||
#else
|
||||
|
@ -43,7 +43,7 @@ define_pd_global(uintx,JVMInvokeMethodSlack, 10*K);
|
||||
|
||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||
|
||||
// Used on 64 bit platforms for UseCompressedOops base address or CDS
|
||||
// Used on 64 bit platforms for UseCompressedOops base address
|
||||
define_pd_global(uintx,HeapBaseMinAddress, 256*M);
|
||||
|
||||
#endif // OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP
|
||||
|
@ -45,7 +45,7 @@ define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||
|
||||
define_pd_global(uintx, JVMInvokeMethodSlack, 8192);
|
||||
|
||||
// Used on 64 bit platforms for UseCompressedOops base address or CDS
|
||||
// Used on 64 bit platforms for UseCompressedOops base address
|
||||
define_pd_global(uintx, HeapBaseMinAddress, 2*G);
|
||||
|
||||
#endif // OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP
|
||||
|
@ -568,36 +568,6 @@ class CoreProductConfig extends ProductConfig {
|
||||
}
|
||||
}
|
||||
|
||||
class KernelDebugConfig extends GenericDebugConfig {
|
||||
String getOptFlag() {
|
||||
return getCI().getNoOptFlag();
|
||||
}
|
||||
|
||||
KernelDebugConfig() {
|
||||
initNames("kernel", "debug", "jvm.dll");
|
||||
init(getIncludes(), getDefines());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class KernelFastDebugConfig extends GenericDebugConfig {
|
||||
String getOptFlag() {
|
||||
return getCI().getOptFlag();
|
||||
}
|
||||
|
||||
KernelFastDebugConfig() {
|
||||
initNames("kernel", "fastdebug", "jvm.dll");
|
||||
init(getIncludes(), getDefines());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class KernelProductConfig extends ProductConfig {
|
||||
KernelProductConfig() {
|
||||
initNames("kernel", "product", "jvm.dll");
|
||||
init(getIncludes(), getDefines());
|
||||
}
|
||||
}
|
||||
|
||||
abstract class CompilerInterface {
|
||||
abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir);
|
||||
|
@ -564,12 +564,6 @@ public abstract class WinGammaPlatform {
|
||||
allConfigs.add(new CoreFastDebugConfig());
|
||||
allConfigs.add(new CoreProductConfig());
|
||||
|
||||
if (platform.equals("Win32")) {
|
||||
allConfigs.add(new KernelDebugConfig());
|
||||
allConfigs.add(new KernelFastDebugConfig());
|
||||
allConfigs.add(new KernelProductConfig());
|
||||
}
|
||||
|
||||
return allConfigs;
|
||||
}
|
||||
|
||||
|
@ -284,15 +284,19 @@ void AbstractAssembler::update_delayed_values() {
|
||||
DelayedConstant::update_all();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AbstractAssembler::block_comment(const char* comment) {
|
||||
if (sect() == CodeBuffer::SECT_INSTS) {
|
||||
code_section()->outer()->block_comment(offset(), comment);
|
||||
}
|
||||
}
|
||||
|
||||
const char* AbstractAssembler::code_string(const char* str) {
|
||||
if (sect() == CodeBuffer::SECT_INSTS || sect() == CodeBuffer::SECT_STUBS) {
|
||||
return code_section()->outer()->code_string(str);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
|
||||
// Exception handler checks the nmethod's implicit null checks table
|
||||
// only when this method returns false.
|
||||
|
@ -336,6 +336,8 @@ class AbstractAssembler : public ResourceObj {
|
||||
// along with the disassembly when printing nmethods. Currently
|
||||
// only supported in the instruction section of the code buffer.
|
||||
void block_comment(const char* comment);
|
||||
// Copy str to a buffer that has the same lifetime as the CodeBuffer
|
||||
const char* code_string(const char* str);
|
||||
|
||||
// Label functions
|
||||
void bind(Label& L); // binds an unbound label L to the current code position
|
||||
|
@ -703,8 +703,8 @@ void CodeBuffer::copy_code_to(CodeBlob* dest_blob) {
|
||||
this->compute_final_layout(&dest);
|
||||
relocate_code_to(&dest);
|
||||
|
||||
// transfer comments from buffer to blob
|
||||
dest_blob->set_comments(_comments);
|
||||
// transfer strings and comments from buffer to blob
|
||||
dest_blob->set_strings(_strings);
|
||||
|
||||
// Done moving code bytes; were they the right size?
|
||||
assert(round_to(dest.total_content_size(), oopSize) == dest_blob->content_size(), "sanity");
|
||||
@ -1003,58 +1003,78 @@ void CodeSection::decode() {
|
||||
|
||||
|
||||
void CodeBuffer::block_comment(intptr_t offset, const char * comment) {
|
||||
_comments.add_comment(offset, comment);
|
||||
_strings.add_comment(offset, comment);
|
||||
}
|
||||
|
||||
class CodeComment: public CHeapObj<mtCode> {
|
||||
private:
|
||||
friend class CodeComments;
|
||||
intptr_t _offset;
|
||||
const char * _comment;
|
||||
CodeComment* _next;
|
||||
const char* CodeBuffer::code_string(const char* str) {
|
||||
return _strings.add_string(str);
|
||||
}
|
||||
|
||||
~CodeComment() {
|
||||
class CodeString: public CHeapObj<mtCode> {
|
||||
private:
|
||||
friend class CodeStrings;
|
||||
const char * _string;
|
||||
CodeString* _next;
|
||||
intptr_t _offset;
|
||||
|
||||
~CodeString() {
|
||||
assert(_next == NULL, "wrong interface for freeing list");
|
||||
os::free((void*)_comment, mtCode);
|
||||
os::free((void*)_string, mtCode);
|
||||
}
|
||||
|
||||
bool is_comment() const { return _offset >= 0; }
|
||||
|
||||
public:
|
||||
CodeComment(intptr_t offset, const char * comment) {
|
||||
_offset = offset;
|
||||
_comment = os::strdup(comment, mtCode);
|
||||
_next = NULL;
|
||||
CodeString(const char * string, intptr_t offset = -1)
|
||||
: _next(NULL), _offset(offset) {
|
||||
_string = os::strdup(string, mtCode);
|
||||
}
|
||||
|
||||
intptr_t offset() const { return _offset; }
|
||||
const char * comment() const { return _comment; }
|
||||
CodeComment* next() { return _next; }
|
||||
const char * string() const { return _string; }
|
||||
intptr_t offset() const { assert(_offset >= 0, "offset for non comment?"); return _offset; }
|
||||
CodeString* next() const { return _next; }
|
||||
|
||||
void set_next(CodeComment* next) { _next = next; }
|
||||
void set_next(CodeString* next) { _next = next; }
|
||||
|
||||
CodeComment* find(intptr_t offset) {
|
||||
CodeComment* a = this;
|
||||
while (a != NULL && a->_offset != offset) {
|
||||
a = a->_next;
|
||||
CodeString* first_comment() {
|
||||
if (is_comment()) {
|
||||
return this;
|
||||
} else {
|
||||
return next_comment();
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
// Convenience for add_comment.
|
||||
CodeComment* find_last(intptr_t offset) {
|
||||
CodeComment* a = find(offset);
|
||||
if (a != NULL) {
|
||||
while ((a->_next != NULL) && (a->_next->_offset == offset)) {
|
||||
a = a->_next;
|
||||
}
|
||||
CodeString* next_comment() const {
|
||||
CodeString* s = _next;
|
||||
while (s != NULL && !s->is_comment()) {
|
||||
s = s->_next;
|
||||
}
|
||||
return a;
|
||||
return s;
|
||||
}
|
||||
};
|
||||
|
||||
CodeString* CodeStrings::find(intptr_t offset) const {
|
||||
CodeString* a = _strings->first_comment();
|
||||
while (a != NULL && a->offset() != offset) {
|
||||
a = a->next_comment();
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
void CodeComments::add_comment(intptr_t offset, const char * comment) {
|
||||
CodeComment* c = new CodeComment(offset, comment);
|
||||
CodeComment* inspos = (_comments == NULL) ? NULL : _comments->find_last(offset);
|
||||
// Convenience for add_comment.
|
||||
CodeString* CodeStrings::find_last(intptr_t offset) const {
|
||||
CodeString* a = find(offset);
|
||||
if (a != NULL) {
|
||||
CodeString* c = NULL;
|
||||
while (((c = a->next_comment()) != NULL) && (c->offset() == offset)) {
|
||||
a = c;
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
void CodeStrings::add_comment(intptr_t offset, const char * comment) {
|
||||
CodeString* c = new CodeString(comment, offset);
|
||||
CodeString* inspos = (_strings == NULL) ? NULL : find_last(offset);
|
||||
|
||||
if (inspos) {
|
||||
// insert after already existing comments with same offset
|
||||
@ -1062,43 +1082,47 @@ void CodeComments::add_comment(intptr_t offset, const char * comment) {
|
||||
inspos->set_next(c);
|
||||
} else {
|
||||
// no comments with such offset, yet. Insert before anything else.
|
||||
c->set_next(_comments);
|
||||
_comments = c;
|
||||
c->set_next(_strings);
|
||||
_strings = c;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CodeComments::assign(CodeComments& other) {
|
||||
_comments = other._comments;
|
||||
void CodeStrings::assign(CodeStrings& other) {
|
||||
_strings = other._strings;
|
||||
}
|
||||
|
||||
|
||||
void CodeComments::print_block_comment(outputStream* stream, intptr_t offset) const {
|
||||
if (_comments != NULL) {
|
||||
CodeComment* c = _comments->find(offset);
|
||||
void CodeStrings::print_block_comment(outputStream* stream, intptr_t offset) const {
|
||||
if (_strings != NULL) {
|
||||
CodeString* c = find(offset);
|
||||
while (c && c->offset() == offset) {
|
||||
stream->bol();
|
||||
stream->print(" ;; ");
|
||||
stream->print_cr(c->comment());
|
||||
c = c->next();
|
||||
stream->print_cr(c->string());
|
||||
c = c->next_comment();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CodeComments::free() {
|
||||
CodeComment* n = _comments;
|
||||
void CodeStrings::free() {
|
||||
CodeString* n = _strings;
|
||||
while (n) {
|
||||
// unlink the node from the list saving a pointer to the next
|
||||
CodeComment* p = n->_next;
|
||||
n->_next = NULL;
|
||||
CodeString* p = n->next();
|
||||
n->set_next(NULL);
|
||||
delete n;
|
||||
n = p;
|
||||
}
|
||||
_comments = NULL;
|
||||
_strings = NULL;
|
||||
}
|
||||
|
||||
|
||||
const char* CodeStrings::add_string(const char * string) {
|
||||
CodeString* s = new CodeString(string);
|
||||
s->set_next(_strings);
|
||||
_strings = s;
|
||||
assert(s->string() != NULL, "should have a string");
|
||||
return s->string();
|
||||
}
|
||||
|
||||
void CodeBuffer::decode() {
|
||||
ttyLocker ttyl;
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "code/oopRecorder.hpp"
|
||||
#include "code/relocInfo.hpp"
|
||||
|
||||
class CodeComments;
|
||||
class CodeStrings;
|
||||
class PhaseCFG;
|
||||
class Compile;
|
||||
class BufferBlob;
|
||||
@ -240,27 +240,31 @@ class CodeSection VALUE_OBJ_CLASS_SPEC {
|
||||
#endif //PRODUCT
|
||||
};
|
||||
|
||||
class CodeComment;
|
||||
class CodeComments VALUE_OBJ_CLASS_SPEC {
|
||||
class CodeString;
|
||||
class CodeStrings VALUE_OBJ_CLASS_SPEC {
|
||||
private:
|
||||
#ifndef PRODUCT
|
||||
CodeComment* _comments;
|
||||
CodeString* _strings;
|
||||
#endif
|
||||
|
||||
CodeString* find(intptr_t offset) const;
|
||||
CodeString* find_last(intptr_t offset) const;
|
||||
|
||||
public:
|
||||
CodeComments() {
|
||||
CodeStrings() {
|
||||
#ifndef PRODUCT
|
||||
_comments = NULL;
|
||||
_strings = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
const char* add_string(const char * string) PRODUCT_RETURN_(return NULL;);
|
||||
|
||||
void add_comment(intptr_t offset, const char * comment) PRODUCT_RETURN;
|
||||
void print_block_comment(outputStream* stream, intptr_t offset) const PRODUCT_RETURN;
|
||||
void assign(CodeComments& other) PRODUCT_RETURN;
|
||||
void assign(CodeStrings& other) PRODUCT_RETURN;
|
||||
void free() PRODUCT_RETURN;
|
||||
};
|
||||
|
||||
|
||||
// A CodeBuffer describes a memory space into which assembly
|
||||
// code is generated. This memory space usually occupies the
|
||||
// interior of a single BufferBlob, but in some cases it may be
|
||||
@ -326,7 +330,7 @@ class CodeBuffer: public StackObj {
|
||||
csize_t _total_size; // size in bytes of combined memory buffer
|
||||
|
||||
OopRecorder* _oop_recorder;
|
||||
CodeComments _comments;
|
||||
CodeStrings _strings;
|
||||
OopRecorder _default_oop_recorder; // override with initialize_oop_recorder
|
||||
Arena* _overflow_arena;
|
||||
|
||||
@ -527,7 +531,7 @@ class CodeBuffer: public StackObj {
|
||||
void initialize_oop_recorder(OopRecorder* r);
|
||||
|
||||
OopRecorder* oop_recorder() const { return _oop_recorder; }
|
||||
CodeComments& comments() { return _comments; }
|
||||
CodeStrings& strings() { return _strings; }
|
||||
|
||||
// Code generation
|
||||
void relocate(address at, RelocationHolder const& rspec, int format = 0) {
|
||||
@ -556,6 +560,7 @@ class CodeBuffer: public StackObj {
|
||||
address transform_address(const CodeBuffer &cb, address addr) const;
|
||||
|
||||
void block_comment(intptr_t offset, const char * comment) PRODUCT_RETURN;
|
||||
const char* code_string(const char* str) PRODUCT_RETURN_(return NULL;);
|
||||
|
||||
// Log a little info about section usage in the CodeBuffer
|
||||
void log_section_sizes(const char* name);
|
||||
|
@ -802,6 +802,7 @@ ciInstanceKlass* ciEnv::get_instance_klass_for_declared_method_holder(ciKlass* m
|
||||
// require checks to make sure the expected type was found. Given that this
|
||||
// only occurs for clone() the more extensive fix seems like overkill so
|
||||
// instead we simply smear the array type into Object.
|
||||
guarantee(method_holder != NULL, "no method holder");
|
||||
if (method_holder->is_instance_klass()) {
|
||||
return method_holder->as_instance_klass();
|
||||
} else if (method_holder->is_array_klass()) {
|
||||
|
@ -2196,8 +2196,7 @@ methodHandle ClassFileParser::parse_method(bool is_interface,
|
||||
true, // is LVTT
|
||||
CHECK_(nullHandle));
|
||||
lvtt_cnt++;
|
||||
} else if (UseSplitVerifier &&
|
||||
_major_version >= Verifier::STACKMAP_ATTRIBUTE_MAJOR_VERSION &&
|
||||
} else if (_major_version >= Verifier::STACKMAP_ATTRIBUTE_MAJOR_VERSION &&
|
||||
_cp->symbol_at(code_attribute_name_index) == vmSymbols::tag_stack_map_table()) {
|
||||
// Stack map is only needed by the new verifier in JDK1.5.
|
||||
if (parsed_stackmap_attribute) {
|
||||
|
@ -105,6 +105,7 @@ void ClassLoaderData::oops_do(OopClosure* f, KlassClosure* klass_closure, bool m
|
||||
void ClassLoaderData::classes_do(KlassClosure* klass_closure) {
|
||||
for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
|
||||
klass_closure->do_klass(k);
|
||||
assert(k != k->next_link(), "no loops!");
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,6 +114,7 @@ void ClassLoaderData::classes_do(void f(InstanceKlass*)) {
|
||||
if (k->oop_is_instance()) {
|
||||
f(InstanceKlass::cast(k));
|
||||
}
|
||||
assert(k != k->next_link(), "no loops!");
|
||||
}
|
||||
}
|
||||
|
||||
@ -258,6 +260,7 @@ void ClassLoaderData::remove_class(Klass* scratch_class) {
|
||||
return;
|
||||
}
|
||||
prev = k;
|
||||
assert(k != k->next_link(), "no loops!");
|
||||
}
|
||||
ShouldNotReachHere(); // should have found this class!!
|
||||
}
|
||||
@ -439,6 +442,7 @@ void ClassLoaderData::dump(outputStream * const out) {
|
||||
while (k != NULL) {
|
||||
out->print_cr("klass "PTR_FORMAT", %s, CT: %d, MUT: %d", k, k->name()->as_C_string(),
|
||||
k->has_modified_oops(), k->has_accumulated_modified_oops());
|
||||
assert(k != k->next_link(), "no loops!");
|
||||
k = k->next_link();
|
||||
}
|
||||
}
|
||||
@ -465,6 +469,7 @@ void ClassLoaderData::verify() {
|
||||
for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
|
||||
guarantee(k->class_loader_data() == this, "Must be the same");
|
||||
k->verify();
|
||||
assert(k != k->next_link(), "no loops!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -348,7 +348,7 @@ class MethodFamily : public ResourceObj {
|
||||
|
||||
void disqualify_method(Method* method) {
|
||||
int* index = _member_index.get(method);
|
||||
assert(index != NULL && *index >= 0 && *index < _members.length(), "bad index");
|
||||
guarantee(index != NULL && *index >= 0 && *index < _members.length(), "bad index");
|
||||
_members.at(*index).second = DISQUALIFIED;
|
||||
}
|
||||
|
||||
|
@ -804,6 +804,32 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name, Handle cla
|
||||
}
|
||||
} // load_instance_class loop
|
||||
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
// An exception, such as OOM could have happened at various places inside
|
||||
// load_instance_class. We might have partially initialized a shared class
|
||||
// and need to clean it up.
|
||||
if (class_loader.is_null()) {
|
||||
// In some cases k may be null. Let's find the shared class again.
|
||||
instanceKlassHandle ik(THREAD, find_shared_class(name));
|
||||
if (ik.not_null()) {
|
||||
if (ik->class_loader_data() == NULL) {
|
||||
// We didn't go as far as Klass::restore_unshareable_info(),
|
||||
// so nothing to clean up.
|
||||
} else {
|
||||
MutexLocker mu(SystemDictionary_lock, THREAD);
|
||||
Klass* kk = find_class(name, ik->class_loader_data());
|
||||
if (kk != NULL) {
|
||||
// No clean up is needed if the shared class has been entered
|
||||
// into system dictionary, as load_shared_class() won't be called
|
||||
// again.
|
||||
} else {
|
||||
clean_up_shared_class(ik, class_loader, THREAD);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (load_instance_added == true) {
|
||||
// clean up placeholder entries for LOAD_INSTANCE success or error
|
||||
// This brackets the SystemDictionary updates for both defining
|
||||
@ -1140,11 +1166,6 @@ instanceKlassHandle SystemDictionary::load_shared_class(
|
||||
return load_shared_class(ik, class_loader, THREAD);
|
||||
}
|
||||
|
||||
// Note well! Changes to this method may affect oop access order
|
||||
// in the shared archive. Please take care to not make changes that
|
||||
// adversely affect cold start time by changing the oop access order
|
||||
// that is specified in dump.cpp MarkAndMoveOrderedReadOnly and
|
||||
// MarkAndMoveOrderedReadWrite closures.
|
||||
instanceKlassHandle SystemDictionary::load_shared_class(
|
||||
instanceKlassHandle ik, Handle class_loader, TRAPS) {
|
||||
assert(class_loader.is_null(), "non-null classloader for shared class?");
|
||||
@ -1205,6 +1226,19 @@ instanceKlassHandle SystemDictionary::load_shared_class(
|
||||
return ik;
|
||||
}
|
||||
|
||||
void SystemDictionary::clean_up_shared_class(instanceKlassHandle ik, Handle class_loader, TRAPS) {
|
||||
// Updating methods must be done under a lock so multiple
|
||||
// threads don't update these in parallel
|
||||
// Shared classes are all currently loaded by the bootstrap
|
||||
// classloader, so this will never cause a deadlock on
|
||||
// a custom class loader lock.
|
||||
{
|
||||
Handle lockObject = compute_loader_lock_object(class_loader, THREAD);
|
||||
check_loader_lock_contention(lockObject, THREAD);
|
||||
ObjectLocker ol(lockObject, THREAD, true);
|
||||
ik->remove_unshareable_info();
|
||||
}
|
||||
}
|
||||
|
||||
instanceKlassHandle SystemDictionary::load_instance_class(Symbol* class_name, Handle class_loader, TRAPS) {
|
||||
instanceKlassHandle nh = instanceKlassHandle(); // null Handle
|
||||
|
@ -621,6 +621,7 @@ private:
|
||||
Handle class_loader, TRAPS);
|
||||
static instanceKlassHandle load_shared_class(instanceKlassHandle ik,
|
||||
Handle class_loader, TRAPS);
|
||||
static void clean_up_shared_class(instanceKlassHandle ik, Handle class_loader, TRAPS);
|
||||
static instanceKlassHandle load_instance_class(Symbol* class_name, Handle class_loader, TRAPS);
|
||||
static Handle compute_loader_lock_object(Handle class_loader, TRAPS);
|
||||
static void check_loader_lock_contention(Handle loader_lock, TRAPS);
|
||||
|
@ -61,8 +61,8 @@
|
||||
# include "bytes_ppc.hpp"
|
||||
#endif
|
||||
|
||||
#define NOFAILOVER_MAJOR_VERSION 51
|
||||
#define STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION 52
|
||||
#define NOFAILOVER_MAJOR_VERSION 51
|
||||
#define NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION 51
|
||||
|
||||
// Access to external entry for VerifyClassCodes - old byte code verifier
|
||||
|
||||
@ -127,8 +127,7 @@ bool Verifier::verify(instanceKlassHandle klass, Verifier::Mode mode, bool shoul
|
||||
if (TraceClassInitialization) {
|
||||
tty->print_cr("Start class verification for: %s", klassName);
|
||||
}
|
||||
if (UseSplitVerifier &&
|
||||
klass->major_version() >= STACKMAP_ATTRIBUTE_MAJOR_VERSION) {
|
||||
if (klass->major_version() >= STACKMAP_ATTRIBUTE_MAJOR_VERSION) {
|
||||
ClassVerifier split_verifier(klass, THREAD);
|
||||
split_verifier.verify_class(THREAD);
|
||||
exception_name = split_verifier.result();
|
||||
@ -2027,16 +2026,19 @@ void ClassVerifier::verify_switch(
|
||||
address bcp = bcs->bcp();
|
||||
address aligned_bcp = (address) round_to((intptr_t)(bcp + 1), jintSize);
|
||||
|
||||
// 4639449 & 4647081: padding bytes must be 0
|
||||
u2 padding_offset = 1;
|
||||
while ((bcp + padding_offset) < aligned_bcp) {
|
||||
if(*(bcp + padding_offset) != 0) {
|
||||
verify_error(ErrorContext::bad_code(bci),
|
||||
"Nonzero padding byte in lookswitch or tableswitch");
|
||||
return;
|
||||
if (_klass->major_version() < NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION) {
|
||||
// 4639449 & 4647081: padding bytes must be 0
|
||||
u2 padding_offset = 1;
|
||||
while ((bcp + padding_offset) < aligned_bcp) {
|
||||
if(*(bcp + padding_offset) != 0) {
|
||||
verify_error(ErrorContext::bad_code(bci),
|
||||
"Nonzero padding byte in lookswitch or tableswitch");
|
||||
return;
|
||||
}
|
||||
padding_offset++;
|
||||
}
|
||||
padding_offset++;
|
||||
}
|
||||
|
||||
int default_offset = (int) Bytes::get_Java_u4(aligned_bcp);
|
||||
int keys, delta;
|
||||
current_frame->pop_stack(
|
||||
@ -2318,11 +2320,6 @@ void ClassVerifier::verify_invoke_instructions(
|
||||
types = (1 << JVM_CONSTANT_InterfaceMethodref) |
|
||||
(1 << JVM_CONSTANT_Methodref);
|
||||
break;
|
||||
case Bytecodes::_invokestatic:
|
||||
types = (_klass->major_version() < STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION) ?
|
||||
(1 << JVM_CONSTANT_Methodref) :
|
||||
((1 << JVM_CONSTANT_InterfaceMethodref) | (1 << JVM_CONSTANT_Methodref));
|
||||
break;
|
||||
default:
|
||||
types = 1 << JVM_CONSTANT_Methodref;
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ void CodeBlob::flush() {
|
||||
FREE_C_HEAP_ARRAY(unsigned char, _oop_maps, mtCode);
|
||||
_oop_maps = NULL;
|
||||
}
|
||||
_comments.free();
|
||||
_strings.free();
|
||||
}
|
||||
|
||||
|
||||
|
@ -66,7 +66,7 @@ class CodeBlob VALUE_OBJ_CLASS_SPEC {
|
||||
int _data_offset; // offset to where data region begins
|
||||
int _frame_size; // size of stack frame
|
||||
OopMapSet* _oop_maps; // OopMap for this CodeBlob
|
||||
CodeComments _comments;
|
||||
CodeStrings _strings;
|
||||
|
||||
public:
|
||||
// Returns the space needed for CodeBlob
|
||||
@ -186,12 +186,12 @@ class CodeBlob VALUE_OBJ_CLASS_SPEC {
|
||||
// Print the comment associated with offset on stream, if there is one
|
||||
virtual void print_block_comment(outputStream* stream, address block_begin) const {
|
||||
intptr_t offset = (intptr_t)(block_begin - code_begin());
|
||||
_comments.print_block_comment(stream, offset);
|
||||
_strings.print_block_comment(stream, offset);
|
||||
}
|
||||
|
||||
// Transfer ownership of comments to this CodeBlob
|
||||
void set_comments(CodeComments& comments) {
|
||||
_comments.assign(comments);
|
||||
void set_strings(CodeStrings& strings) {
|
||||
_strings.assign(strings);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -552,7 +552,7 @@ bool CompiledStaticCall::is_call_to_interpreted() const {
|
||||
|
||||
void CompiledStaticCall::set_to_interpreted(methodHandle callee, address entry) {
|
||||
address stub=find_stub();
|
||||
assert(stub!=NULL, "stub not found");
|
||||
guarantee(stub != NULL, "stub not found");
|
||||
|
||||
if (TraceICs) {
|
||||
ResourceMark rm;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user