java-interp.h (_Jv_InterpFrame::get_pc): Only deduct one when pc_ptr is non-NULL.
* include/java-interp.h (_Jv_InterpFrame::get_pc): Only deduct one when pc_ptr is non-NULL. * prims.cc (parse_init_args): Enable JVMTI with agentlib and agentpath options. * testsuite/lib/libjava.exp (exec_gij): Add new addl_flags parameter. * testsuite/libjava.jvmti/jvmti-interp.exp (gij_jvmti_test_one): Pass '-agentlib:dummyagent' when executing gij. (gij_jvmti_run): Build dummy JVMTI agent before running tests, and remove it when finished. * testsuite/libjava.jvmti/dummyagent.c: New file. From-SVN: r125040
This commit is contained in:
parent
ef9cc8efb4
commit
e1b871ecc1
6 changed files with 53 additions and 12 deletions
9
libjava/testsuite/libjava.jvmti/dummyagent.c
Normal file
9
libjava/testsuite/libjava.jvmti/dummyagent.c
Normal file
|
@ -0,0 +1,9 @@
|
|||
#include <jvmti.h>
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Agent_OnLoad (JavaVM *vm, char *options, void *reserved)
|
||||
{
|
||||
// nothing -- this is just a stub to get JVMTI properly
|
||||
// initialized
|
||||
}
|
||||
|
|
@ -133,7 +133,8 @@ proc gij_jvmti_test_one {file} {
|
|||
libjava_arguments
|
||||
|
||||
set jarfile [file join [file dirname $file] $main.jar]
|
||||
if {! [exec_gij $jarfile [file rootname $file].out {}]} {
|
||||
set gij_flags {-agentlib:dummyagent}
|
||||
if {! [exec_gij $jarfile [file rootname $file].out {} $gij_flags]} {
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -151,14 +152,24 @@ proc gij_jvmti_run {} {
|
|||
|
||||
# For now we only test JVMTI on native builds.
|
||||
if {$build_triplet == $host_triplet} {
|
||||
catch { lsort [glob -nocomplain ${srcdir}/${subdir}/interp/*.jar] \
|
||||
} srcfiles
|
||||
|
||||
# Build our dummy JVMTI agent library
|
||||
if {![gcj_jni_compile_c_to_so [file join $srcdir $subdir dummyagent.c]]} {
|
||||
fail "compiling dummy JVMTI agent"
|
||||
} else {
|
||||
pass "compiling dummy JVMTI agent"
|
||||
|
||||
catch {lsort [glob -nocomplain ${srcdir}/${subdir}/interp/*.jar]} \
|
||||
srcfiles
|
||||
|
||||
foreach x $srcfiles {
|
||||
gij_jvmti_test_one $x
|
||||
gij_jvmti_test_one $x
|
||||
}
|
||||
|
||||
gcj_cleanup libdummyagent.so
|
||||
}
|
||||
} else {
|
||||
verbose "JVMTI tests not run in cross-compilation environment"
|
||||
verbose "JVMTI tests not run in cross-compilation environment"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue