Makefile.am (nat_source_files): Add natBreakpoint.cc.

* Makefile.am (nat_source_files): Add natBreakpoint.cc.
        * sources.am: Regenerated.
        * Makefile.in: Regenerated.
        * gnu/gcj/jvmti/Breakpoint.java: New file.
        * gnu/gcj/jvmti/natBreakpoint.java: New file.

From-SVN: r118108
This commit is contained in:
Keith Seitz 2006-10-28 18:36:16 +00:00 committed by Keith Seitz
parent 22ba88ef4b
commit 67ce74926a
6 changed files with 179 additions and 5 deletions

View File

@ -1,3 +1,11 @@
2006-10-28 Keith Seitz <keiths@redhat.com>
* Makefile.am (nat_source_files): Add natBreakpoint.cc.
* sources.am: Regenerated.
* Makefile.in: Regenerated.
* gnu/gcj/jvmti/Breakpoint.java: New file.
* gnu/gcj/jvmti/natBreakpoint.java: New file.
2006-10-27 Keith Seitz <keiths@redhat.com>
* include/java-stack.h (ncodeMap): Declare.

View File

@ -818,6 +818,7 @@ gnu/gcj/convert/natOutput_EUCJIS.cc \
gnu/gcj/convert/natOutput_SJIS.cc \
gnu/gcj/io/natSimpleSHSStream.cc \
gnu/gcj/io/shs.cc \
gnu/gcj/jvmti/natBreakpoint.cc \
gnu/gcj/runtime/natFinalizerThread.cc \
gnu/gcj/runtime/natSharedLibLoader.cc \
gnu/gcj/runtime/natSystemClassLoader.cc \

View File

@ -149,9 +149,9 @@ am__DEPENDENCIES_1 = gnu/awt.lo gnu/awt/j2d.lo gnu/classpath.lo \
gnu/classpath/jdwp/exception.lo gnu/classpath/jdwp/id.lo \
gnu/classpath/jdwp/processor.lo \
gnu/classpath/jdwp/transport.lo gnu/classpath/jdwp/util.lo \
gnu/gcj.lo gnu/gcj/convert.lo gnu/gcj/io.lo gnu/gcj/runtime.lo \
gnu/gcj/util.lo gnu/java/awt.lo gnu/java/awt/color.lo \
gnu/java/awt/dnd.lo gnu/java/awt/font.lo \
gnu/gcj.lo gnu/gcj/convert.lo gnu/gcj/io.lo gnu/gcj/jvmti.lo \
gnu/gcj/runtime.lo gnu/gcj/util.lo gnu/java/awt.lo \
gnu/java/awt/color.lo gnu/java/awt/dnd.lo gnu/java/awt/font.lo \
gnu/java/awt/font/opentype.lo \
gnu/java/awt/font/opentype/truetype.lo gnu/java/awt/image.lo \
gnu/java/awt/java2d.lo gnu/java/awt/peer.lo \
@ -275,6 +275,7 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc jvmti.cc exception.cc \
gnu/gcj/convert/natOutput_EUCJIS.cc \
gnu/gcj/convert/natOutput_SJIS.cc \
gnu/gcj/io/natSimpleSHSStream.cc gnu/gcj/io/shs.cc \
gnu/gcj/jvmti/natBreakpoint.cc \
gnu/gcj/runtime/natFinalizerThread.cc \
gnu/gcj/runtime/natSharedLibLoader.cc \
gnu/gcj/runtime/natSystemClassLoader.cc \
@ -322,6 +323,7 @@ am__objects_2 = gnu/classpath/natSystemProperties.lo \
gnu/gcj/convert/natOutput_EUCJIS.lo \
gnu/gcj/convert/natOutput_SJIS.lo \
gnu/gcj/io/natSimpleSHSStream.lo gnu/gcj/io/shs.lo \
gnu/gcj/jvmti/natBreakpoint.lo \
gnu/gcj/runtime/natFinalizerThread.lo \
gnu/gcj/runtime/natSharedLibLoader.lo \
gnu/gcj/runtime/natSystemClassLoader.lo \
@ -1213,6 +1215,10 @@ gnu/gcj/io/MimeTypes.java \
gnu/gcj/io/SimpleSHSStream.java
gnu_gcj_io_header_files = $(patsubst %.java,%.h,$(gnu_gcj_io_source_files))
gnu_gcj_jvmti_source_files = \
gnu/gcj/jvmti/Breakpoint.java
gnu_gcj_jvmti_header_files = $(patsubst %.java,%.h,$(gnu_gcj_jvmti_source_files))
gnu_gcj_runtime_source_files = \
gnu/gcj/runtime/BootClassLoader.java \
gnu/gcj/runtime/ExtensionClassLoader.java \
@ -6772,6 +6778,7 @@ all_packages_source_files = \
gnu/gcj.list \
gnu/gcj/convert.list \
gnu/gcj/io.list \
gnu/gcj/jvmti.list \
gnu/gcj/runtime.list \
gnu/gcj/util.list \
gnu/java/awt.list \
@ -7003,6 +7010,7 @@ ordinary_header_files = \
$(gnu_gcj_header_files) \
$(gnu_gcj_convert_header_files) \
$(gnu_gcj_io_header_files) \
$(gnu_gcj_jvmti_header_files) \
$(gnu_gcj_runtime_header_files) \
$(gnu_gcj_util_header_files) \
$(gnu_java_awt_header_files) \
@ -7381,6 +7389,7 @@ gnu/gcj/convert/natOutput_EUCJIS.cc \
gnu/gcj/convert/natOutput_SJIS.cc \
gnu/gcj/io/natSimpleSHSStream.cc \
gnu/gcj/io/shs.cc \
gnu/gcj/jvmti/natBreakpoint.cc \
gnu/gcj/runtime/natFinalizerThread.cc \
gnu/gcj/runtime/natSharedLibLoader.cc \
gnu/gcj/runtime/natSystemClassLoader.cc \
@ -7759,6 +7768,14 @@ gnu/gcj/io/natSimpleSHSStream.lo: gnu/gcj/io/$(am__dirstamp) \
gnu/gcj/io/$(DEPDIR)/$(am__dirstamp)
gnu/gcj/io/shs.lo: gnu/gcj/io/$(am__dirstamp) \
gnu/gcj/io/$(DEPDIR)/$(am__dirstamp)
gnu/gcj/jvmti/$(am__dirstamp):
@$(mkdir_p) gnu/gcj/jvmti
@: > gnu/gcj/jvmti/$(am__dirstamp)
gnu/gcj/jvmti/$(DEPDIR)/$(am__dirstamp):
@$(mkdir_p) gnu/gcj/jvmti/$(DEPDIR)
@: > gnu/gcj/jvmti/$(DEPDIR)/$(am__dirstamp)
gnu/gcj/jvmti/natBreakpoint.lo: gnu/gcj/jvmti/$(am__dirstamp) \
gnu/gcj/jvmti/$(DEPDIR)/$(am__dirstamp)
gnu/gcj/runtime/$(am__dirstamp):
@$(mkdir_p) gnu/gcj/runtime
@: > gnu/gcj/runtime/$(am__dirstamp)
@ -8116,6 +8133,8 @@ mostlyclean-compile:
-rm -f gnu/gcj/io/natSimpleSHSStream.lo
-rm -f gnu/gcj/io/shs.$(OBJEXT)
-rm -f gnu/gcj/io/shs.lo
-rm -f gnu/gcj/jvmti/natBreakpoint.$(OBJEXT)
-rm -f gnu/gcj/jvmti/natBreakpoint.lo
-rm -f gnu/gcj/natCore.$(OBJEXT)
-rm -f gnu/gcj/natCore.lo
-rm -f gnu/gcj/runtime/natFinalizerThread.$(OBJEXT)
@ -8308,6 +8327,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@gnu/gcj/convert/$(DEPDIR)/natOutput_SJIS.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/gcj/io/$(DEPDIR)/natSimpleSHSStream.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/gcj/io/$(DEPDIR)/shs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/gcj/jvmti/$(DEPDIR)/natBreakpoint.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/gcj/runtime/$(DEPDIR)/natFinalizerThread.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/gcj/runtime/$(DEPDIR)/natSharedLibLoader.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/gcj/runtime/$(DEPDIR)/natStringBuffer.Plo@am__quote@
@ -8638,6 +8658,7 @@ clean-libtool:
-rm -rf gnu/gcj/.libs gnu/gcj/_libs
-rm -rf gnu/gcj/convert/.libs gnu/gcj/convert/_libs
-rm -rf gnu/gcj/io/.libs gnu/gcj/io/_libs
-rm -rf gnu/gcj/jvmti/.libs gnu/gcj/jvmti/_libs
-rm -rf gnu/gcj/runtime/.libs gnu/gcj/runtime/_libs
-rm -rf gnu/gcj/util/.libs gnu/gcj/util/_libs
-rm -rf gnu/gcj/xlib/.libs gnu/gcj/xlib/_libs
@ -9029,6 +9050,8 @@ distclean-generic:
-rm -f gnu/gcj/convert/$(am__dirstamp)
-rm -f gnu/gcj/io/$(DEPDIR)/$(am__dirstamp)
-rm -f gnu/gcj/io/$(am__dirstamp)
-rm -f gnu/gcj/jvmti/$(DEPDIR)/$(am__dirstamp)
-rm -f gnu/gcj/jvmti/$(am__dirstamp)
-rm -f gnu/gcj/runtime/$(DEPDIR)/$(am__dirstamp)
-rm -f gnu/gcj/runtime/$(am__dirstamp)
-rm -f gnu/gcj/tools/gcj_dbtool/$(DEPDIR)/$(am__dirstamp)
@ -9085,7 +9108,7 @@ clean-am: clean-binPROGRAMS clean-dbexecLTLIBRARIES clean-generic \
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf ./$(DEPDIR) classpath/tools/$(DEPDIR) gnu/classpath/$(DEPDIR) gnu/classpath/jdwp/$(DEPDIR) gnu/gcj/$(DEPDIR) gnu/gcj/convert/$(DEPDIR) gnu/gcj/io/$(DEPDIR) gnu/gcj/runtime/$(DEPDIR) gnu/gcj/tools/gcj_dbtool/$(DEPDIR) gnu/gcj/util/$(DEPDIR) gnu/gcj/xlib/$(DEPDIR) gnu/java/lang/$(DEPDIR) gnu/java/net/$(DEPDIR) gnu/java/net/protocol/core/$(DEPDIR) gnu/java/nio/$(DEPDIR) gnu/java/nio/channels/$(DEPDIR) java/io/$(DEPDIR) java/lang/$(DEPDIR) java/lang/ref/$(DEPDIR) java/lang/reflect/$(DEPDIR) java/net/$(DEPDIR) java/nio/$(DEPDIR) java/nio/channels/$(DEPDIR) java/security/$(DEPDIR) java/text/$(DEPDIR) java/util/$(DEPDIR) java/util/logging/$(DEPDIR) java/util/zip/$(DEPDIR)
-rm -rf ./$(DEPDIR) classpath/tools/$(DEPDIR) gnu/classpath/$(DEPDIR) gnu/classpath/jdwp/$(DEPDIR) gnu/gcj/$(DEPDIR) gnu/gcj/convert/$(DEPDIR) gnu/gcj/io/$(DEPDIR) gnu/gcj/jvmti/$(DEPDIR) gnu/gcj/runtime/$(DEPDIR) gnu/gcj/tools/gcj_dbtool/$(DEPDIR) gnu/gcj/util/$(DEPDIR) gnu/gcj/xlib/$(DEPDIR) gnu/java/lang/$(DEPDIR) gnu/java/net/$(DEPDIR) gnu/java/net/protocol/core/$(DEPDIR) gnu/java/nio/$(DEPDIR) gnu/java/nio/channels/$(DEPDIR) java/io/$(DEPDIR) java/lang/$(DEPDIR) java/lang/ref/$(DEPDIR) java/lang/reflect/$(DEPDIR) java/net/$(DEPDIR) java/nio/$(DEPDIR) java/nio/channels/$(DEPDIR) java/security/$(DEPDIR) java/text/$(DEPDIR) java/util/$(DEPDIR) java/util/logging/$(DEPDIR) java/util/zip/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-local distclean-tags
@ -9117,7 +9140,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -rf ./$(DEPDIR) classpath/tools/$(DEPDIR) gnu/classpath/$(DEPDIR) gnu/classpath/jdwp/$(DEPDIR) gnu/gcj/$(DEPDIR) gnu/gcj/convert/$(DEPDIR) gnu/gcj/io/$(DEPDIR) gnu/gcj/runtime/$(DEPDIR) gnu/gcj/tools/gcj_dbtool/$(DEPDIR) gnu/gcj/util/$(DEPDIR) gnu/gcj/xlib/$(DEPDIR) gnu/java/lang/$(DEPDIR) gnu/java/net/$(DEPDIR) gnu/java/net/protocol/core/$(DEPDIR) gnu/java/nio/$(DEPDIR) gnu/java/nio/channels/$(DEPDIR) java/io/$(DEPDIR) java/lang/$(DEPDIR) java/lang/ref/$(DEPDIR) java/lang/reflect/$(DEPDIR) java/net/$(DEPDIR) java/nio/$(DEPDIR) java/nio/channels/$(DEPDIR) java/security/$(DEPDIR) java/text/$(DEPDIR) java/util/$(DEPDIR) java/util/logging/$(DEPDIR) java/util/zip/$(DEPDIR)
-rm -rf ./$(DEPDIR) classpath/tools/$(DEPDIR) gnu/classpath/$(DEPDIR) gnu/classpath/jdwp/$(DEPDIR) gnu/gcj/$(DEPDIR) gnu/gcj/convert/$(DEPDIR) gnu/gcj/io/$(DEPDIR) gnu/gcj/jvmti/$(DEPDIR) gnu/gcj/runtime/$(DEPDIR) gnu/gcj/tools/gcj_dbtool/$(DEPDIR) gnu/gcj/util/$(DEPDIR) gnu/gcj/xlib/$(DEPDIR) gnu/java/lang/$(DEPDIR) gnu/java/net/$(DEPDIR) gnu/java/net/protocol/core/$(DEPDIR) gnu/java/nio/$(DEPDIR) gnu/java/nio/channels/$(DEPDIR) java/io/$(DEPDIR) java/lang/$(DEPDIR) java/lang/ref/$(DEPDIR) java/lang/reflect/$(DEPDIR) java/net/$(DEPDIR) java/nio/$(DEPDIR) java/nio/channels/$(DEPDIR) java/security/$(DEPDIR) java/text/$(DEPDIR) java/util/$(DEPDIR) java/util/logging/$(DEPDIR) java/util/zip/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -9377,6 +9400,16 @@ gnu/gcj/io.list: $(gnu_gcj_io_source_files)
-include gnu/gcj/io.deps
gnu/gcj/jvmti.list: $(gnu_gcj_jvmti_source_files)
@$(mkinstalldirs) $(dir $@)
@for file in $(gnu_gcj_jvmti_source_files); do \
if test -f $(srcdir)/$$file; then \
echo $(srcdir)/$$file; \
else echo $$file; fi; \
done > gnu/gcj/jvmti.list
-include gnu/gcj/jvmti.deps
gnu/gcj/runtime.list: $(gnu_gcj_runtime_source_files)
@$(mkinstalldirs) $(dir $@)
@for file in $(gnu_gcj_runtime_source_files); do \

View File

@ -0,0 +1,57 @@
// Breakpoint.java - a breakpoint in the interpreter
/* Copyright (C) 2006 Free Software Foundation
This file is part of libgcj.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package gnu.gcj.jvmti;
import gnu.gcj.RawDataManaged;
/**
* Class representing a Breakpoint.
*
* @author Keith Seitz (keiths@redhat.com)
*/
public class Breakpoint
{
// Location of this breakpoint
private long method;
private long location;
// The original instruction that this breakpoint replaced
private RawDataManaged data;
/**
* Constructs a new Breakpoint. SetBreakpoint will verify the
* validity of the arguments.
*
* @param method the method (a jmethodID)
* @param location the jlocation of the breakpoint (a jlocation)
*/
public Breakpoint (long method, long location)
{
this.method = method;
this.location = location;
initialize_native ();
}
private native void initialize_native ();
public native void install ();
public native void remove ();
/**
* Returns the original instruction at the location where
* this breakpoint was set
*/
public RawDataManaged getInsn ()
{
return data;
}
}

View File

@ -0,0 +1,57 @@
// natBreakpoint.cc - C++ side of Breakpoint
/* Copyright (C) 2006 Free Software Foundation
This file is part of libgcj.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <config.h>
#include <gcj/cni.h>
#include <gcj/method.h>
#include <java-interp.h>
#include <java-insns.h>
#include <java-assert.h>
#include <jvmti.h>
#include <gnu/gcj/jvmti/Breakpoint.h>
static _Jv_InterpMethod *
get_interp_method (jlong method)
{
jmethodID id = reinterpret_cast<jmethodID> (method);
jclass klass = _Jv_GetMethodDeclaringClass (id);
JvAssert (_Jv_IsInterpretedClass (klass));
_Jv_MethodBase *base
= _Jv_FindInterpreterMethod (klass, id);
JvAssert (base != NULL);
return reinterpret_cast<_Jv_InterpMethod *> (base);
}
void
gnu::gcj::jvmti::Breakpoint::initialize_native ()
{
_Jv_InterpMethod *imeth = get_interp_method (method);
// copy contents of insn at location into data
pc_t code = imeth->get_insn (location);
data = (RawDataManaged *) JvAllocBytes (sizeof (*code));
memcpy (data, code, sizeof (*code));
install ();
}
void
gnu::gcj::jvmti::Breakpoint::install ()
{
_Jv_InterpMethod *imeth = get_interp_method (method);
imeth->install_break (location);
}
void
gnu::gcj::jvmti::Breakpoint::remove ()
{
_Jv_InterpMethod *imeth = get_interp_method (method);
imeth->set_insn (location, reinterpret_cast<pc_t> (data));
}

View File

@ -565,6 +565,22 @@ gnu/gcj/io.list: $(gnu_gcj_io_source_files)
-include gnu/gcj/io.deps
gnu_gcj_jvmti_source_files = \
gnu/gcj/jvmti/Breakpoint.java
gnu_gcj_jvmti_header_files = $(patsubst %.java,%.h,$(gnu_gcj_jvmti_source_files))
gnu/gcj/jvmti.list: $(gnu_gcj_jvmti_source_files)
@$(mkinstalldirs) $(dir $@)
@for file in $(gnu_gcj_jvmti_source_files); do \
if test -f $(srcdir)/$$file; then \
echo $(srcdir)/$$file; \
else echo $$file; fi; \
done > gnu/gcj/jvmti.list
-include gnu/gcj/jvmti.deps
gnu_gcj_runtime_source_files = \
gnu/gcj/runtime/BootClassLoader.java \
gnu/gcj/runtime/ExtensionClassLoader.java \
@ -8785,6 +8801,7 @@ all_packages_source_files = \
gnu/gcj.list \
gnu/gcj/convert.list \
gnu/gcj/io.list \
gnu/gcj/jvmti.list \
gnu/gcj/runtime.list \
gnu/gcj/util.list \
gnu/java/awt.list \
@ -9016,6 +9033,7 @@ ordinary_header_files = \
$(gnu_gcj_header_files) \
$(gnu_gcj_convert_header_files) \
$(gnu_gcj_io_header_files) \
$(gnu_gcj_jvmti_header_files) \
$(gnu_gcj_runtime_header_files) \
$(gnu_gcj_util_header_files) \
$(gnu_java_awt_header_files) \