mirror of git://gcc.gnu.org/git/gcc.git
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
|
|
@ -1,3 +1,19 @@
|
|||
2007-05-24 Keith Seitz <keiths@redhat.com>
|
||||
|
||||
* 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.
|
||||
|
||||
2007-05-23 Steve Ellcey <sje@cup.hp.com>
|
||||
|
||||
* Makefile.in: Regenerate.
|
||||
|
|
|
|||
|
|
@ -466,9 +466,9 @@ public:
|
|||
if (pc_ptr == NULL)
|
||||
pc = 0;
|
||||
else
|
||||
pc = *pc_ptr;
|
||||
pc = *pc_ptr - 1;
|
||||
|
||||
return pc - 1;
|
||||
return pc;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// prims.cc - Code for core of runtime environment.
|
||||
|
||||
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
|
||||
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
|
||||
|
||||
This file is part of libgcj.
|
||||
|
||||
|
|
@ -1522,6 +1522,9 @@ parse_init_args (JvVMInitArgs* vm_args)
|
|||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Mark JVMTI active
|
||||
JVMTI::enabled = true;
|
||||
}
|
||||
|
||||
continue;
|
||||
|
|
@ -1564,6 +1567,8 @@ parse_init_args (JvVMInitArgs* vm_args)
|
|||
return -1;
|
||||
}
|
||||
|
||||
// Mark JVMTI active
|
||||
JVMTI::enabled = true;
|
||||
continue;
|
||||
}
|
||||
else if (vm_args->ignoreUnrecognized)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free Software Foundation
|
||||
# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007 Free Software Foundation
|
||||
|
||||
proc load_gcc_lib { filename } {
|
||||
global srcdir
|
||||
|
|
@ -494,7 +494,7 @@ proc gcj_invoke {program expectFile ld_library_additions} {
|
|||
}
|
||||
}
|
||||
|
||||
proc exec_gij {jarfile expectFile ld_library_additions} {
|
||||
proc exec_gij {jarfile expectFile {ld_library_additions {}} {addl_flags {}}} {
|
||||
global env
|
||||
global libjava_ld_library_path
|
||||
global ld_library_path
|
||||
|
|
@ -512,9 +512,9 @@ proc exec_gij {jarfile expectFile ld_library_additions} {
|
|||
set gij [libjava_find_gij]
|
||||
set classname [file rootname [file tail $jarfile]]
|
||||
|
||||
puts "LD_LIBRARY_PATH=. $gij -cp $jarfile $classname"
|
||||
puts "LD_LIBRARY_PATH=. $gij -cp $jarfile $addl_flags $classname"
|
||||
|
||||
set result [libjava_load $gij "-cp $jarfile $classname"]
|
||||
set result [libjava_load $gij "-cp $jarfile $addl_flags $classname"]
|
||||
set status [lindex $result 0]
|
||||
set output [lindex $result 1]
|
||||
|
||||
|
|
|
|||
|
|
@ -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…
Reference in New Issue