* gnu/gcj/jvmti/Breakpoint.java: Make abstract.
(method): Change from private to protected.
(location): Likewise.
(Breakpoint): Change argument list to take only integer type.
Add default constructor.
(initialize_native): Renamed to ...
(_save_insn): ... this to make function more explicit.
(execute): New method.
* gnu/gcj/jvmti/Breakpoint.h: Regenerate.
* gnu/gcj/jvmti/natBreakpoint.cc (initialize_native): Rename to...
(_save_insn): ... this.
(install): Save the original instruction.
* gnu/gcj/jvmti/NormalBreakpoint.java: New file.
* gnu/gcj/jvmti/NormalBreakpoint.h: New file.
* gnu/gcj/jvmti/natNormalBreakpoint.cc: New file.
* gnu/gcj/jvmti/BreakpointManager.java (newBreakpoint):
Instantiate a NormalBreakpoint instead of Breakpoint.
* interpret-run.cc (insn_breakpoint): Remove breakpoint actions
and call Breakpoint.execute to do them.
* classpath/lib/gnu/gcj/jvmti/Breakpoint.class: Regenerate.
* classpath/lib/gnu/gcj/jvmti/BreakpointManager.class: Likewise.
* classpath/lib/gnu/gcj/jvmti/NormalBreakpoint.class: New file.
* sources.am: Regenerate.
* Makefile.am (nat_source_files): Add natNormalBreakpoint.cc.
* Makefile.in: Regenerated.
From-SVN: r125834
+2007-06-18 Keith Seitz <keiths@redhat.com>
+
+ * gnu/gcj/jvmti/Breakpoint.java: Make abstract.
+ (method): Change from private to protected.
+ (location): Likewise.
+ (Breakpoint): Change argument list to take only integer type.
+ Add default constructor.
+ (initialize_native): Renamed to ...
+ (_save_insn): ... this to make function more explicit.
+ (execute): New method.
+ * gnu/gcj/jvmti/Breakpoint.h: Regenerate.
+ * gnu/gcj/jvmti/natBreakpoint.cc (initialize_native): Rename to...
+ (_save_insn): ... this.
+ (install): Save the original instruction.
+ * gnu/gcj/jvmti/NormalBreakpoint.java: New file.
+ * gnu/gcj/jvmti/NormalBreakpoint.h: New file.
+ * gnu/gcj/jvmti/natNormalBreakpoint.cc: New file.
+ * gnu/gcj/jvmti/BreakpointManager.java (newBreakpoint):
+ Instantiate a NormalBreakpoint instead of Breakpoint.
+ * interpret-run.cc (insn_breakpoint): Remove breakpoint actions
+ and call Breakpoint.execute to do them.
+ * classpath/lib/gnu/gcj/jvmti/Breakpoint.class: Regenerate.
+ * classpath/lib/gnu/gcj/jvmti/BreakpointManager.class: Likewise.
+ * classpath/lib/gnu/gcj/jvmti/NormalBreakpoint.class: New file.
+ * sources.am: Regenerate.
+ * Makefile.am (nat_source_files): Add natNormalBreakpoint.cc.
+ * Makefile.in: Regenerated.
+
2007-06-14 Keith Seitz <keiths@redhat.com>
* include/java-interp.h (_Jv_LocalVarTableEntry): Add union
gnu/gcj/io/natSimpleSHSStream.cc \
gnu/gcj/io/shs.cc \
gnu/gcj/jvmti/natBreakpoint.cc \
+gnu/gcj/jvmti/natNormalBreakpoint.cc \
gnu/gcj/runtime/natFinalizerThread.cc \
gnu/gcj/runtime/natSharedLibLoader.cc \
gnu/gcj/runtime/natSystemClassLoader.cc \
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
+ $(top_srcdir)/../config/confsubdir.m4 \
$(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/../config/enable.m4 \
$(top_srcdir)/../config/gxx-include-dir.m4 \
$(top_srcdir)/../config/no-executables.m4 \
$(top_srcdir)/../config/tls.m4 \
$(top_srcdir)/../config/unwind_ipinfo.m4 \
- $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
- $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
- $(top_srcdir)/mingwld.m4 $(top_srcdir)/pkg.m4 \
- $(top_srcdir)/shlibpath.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltgcc.m4 \
+ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \
+ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/mingwld.m4 \
+ $(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
gnu/gcj/convert/natOutput_SJIS.cc \
gnu/gcj/io/natSimpleSHSStream.cc gnu/gcj/io/shs.cc \
gnu/gcj/jvmti/natBreakpoint.cc \
+ gnu/gcj/jvmti/natNormalBreakpoint.cc \
gnu/gcj/runtime/natFinalizerThread.cc \
gnu/gcj/runtime/natSharedLibLoader.cc \
gnu/gcj/runtime/natSystemClassLoader.cc \
gnu/gcj/convert/natOutput_SJIS.lo \
gnu/gcj/io/natSimpleSHSStream.lo gnu/gcj/io/shs.lo \
gnu/gcj/jvmti/natBreakpoint.lo \
+ gnu/gcj/jvmti/natNormalBreakpoint.lo \
gnu/gcj/runtime/natFinalizerThread.lo \
gnu/gcj/runtime/natSharedLibLoader.lo \
gnu/gcj/runtime/natSystemClassLoader.lo \
gnu_gcj_jvmti_source_files = \
gnu/gcj/jvmti/Breakpoint.java \
gnu/gcj/jvmti/BreakpointManager.java \
-gnu/gcj/jvmti/Location.java
+gnu/gcj/jvmti/Location.java \
+gnu/gcj/jvmti/NormalBreakpoint.java
gnu_gcj_jvmti_header_files = $(patsubst %.java,%.h,$(gnu_gcj_jvmti_source_files))
gnu_gcj_runtime_source_files = \
gnu/gcj/io/natSimpleSHSStream.cc \
gnu/gcj/io/shs.cc \
gnu/gcj/jvmti/natBreakpoint.cc \
+gnu/gcj/jvmti/natNormalBreakpoint.cc \
gnu/gcj/runtime/natFinalizerThread.cc \
gnu/gcj/runtime/natSharedLibLoader.cc \
gnu/gcj/runtime/natSystemClassLoader.cc \
@: > gnu/gcj/jvmti/$(DEPDIR)/$(am__dirstamp)
gnu/gcj/jvmti/natBreakpoint.lo: gnu/gcj/jvmti/$(am__dirstamp) \
gnu/gcj/jvmti/$(DEPDIR)/$(am__dirstamp)
+gnu/gcj/jvmti/natNormalBreakpoint.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)
-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/jvmti/natNormalBreakpoint.$(OBJEXT)
+ -rm -f gnu/gcj/jvmti/natNormalBreakpoint.lo
-rm -f gnu/gcj/natCore.$(OBJEXT)
-rm -f gnu/gcj/natCore.lo
-rm -f gnu/gcj/runtime/natFinalizerThread.$(OBJEXT)
@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/jvmti/$(DEPDIR)/natNormalBreakpoint.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@
public:
Breakpoint(jlong, jlong);
+ Breakpoint();
private:
- void initialize_native();
+ void _save_insn();
public:
virtual void install();
virtual void remove();
virtual ::gnu::gcj::RawDataManaged * getInsn();
-private:
+ virtual void execute() = 0;
+public: // actually protected
jlong __attribute__((aligned(__alignof__( ::java::lang::Object)))) method;
jlong location;
+private:
::gnu::gcj::RawDataManaged * data;
public:
static ::java::lang::Class class$;
-// Breakpoint.java - a breakpoint in the interpreter
+// Breakpoint.java - a base class for interpreter breakpoints
-/* Copyright (C) 2006 Free Software Foundation
+/* Copyright (C) 2006, 2007 Free Software Foundation
This file is part of libgcj.
import gnu.gcj.RawDataManaged;
/**
- * Class representing a Breakpoint.
+ * Base class representing a type of breakpoint in the interpreter.
+ * This class deals with saving insns and installing and
+ * uninstalling insns in the interpreter for all breakpoint classes.
*
* @author Keith Seitz (keiths@redhat.com)
*/
-public class Breakpoint
+public abstract class Breakpoint
{
// Location of this breakpoint
- private long method;
- private long location;
+ protected long method;
+ protected long location;
// The original instruction that this breakpoint replaced
private RawDataManaged data;
/**
- * Constructs a new Breakpoint. SetBreakpoint will verify the
- * validity of the arguments.
+ * Constructs a new Breakpoint
*
- * @param method the method (a jmethodID)
- * @param location the jlocation of the breakpoint (a jlocation)
+ * @param method the method in which to set the breakpoint
+ * @param location the location at which to set the breakpoint
*/
public Breakpoint (long method, long location)
{
this.method = method;
this.location = location;
- initialize_native ();
}
- private native void initialize_native ();
+ public Breakpoint ()
+ {
+ }
+
+ private native void _save_insn ();
+ /**
+ * Installs the breakpoint into the interpreter
+ */
public native void install ();
+ /**
+ * Removes the breakpoint from the interpreter, re-installing
+ * the original instruction.
+ */
public native void remove ();
/**
{
return data;
}
+
+ /**
+ * Execute the actions of this breakpoint
+ */
+ public abstract void execute ();
}
*/
public static Breakpoint newBreakpoint (long method, long location)
{
- Breakpoint bp = new Breakpoint (method, location);
+ NormalBreakpoint bp = new NormalBreakpoint (method, location);
Location loc = new Location (method, location);
bp.install ();
_instance._breakpoints.put (loc, bp);
--- /dev/null
+
+// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
+
+#ifndef __gnu_gcj_jvmti_NormalBreakpoint__
+#define __gnu_gcj_jvmti_NormalBreakpoint__
+
+#pragma interface
+
+#include <gnu/gcj/jvmti/Breakpoint.h>
+extern "Java"
+{
+ namespace gnu
+ {
+ namespace gcj
+ {
+ namespace jvmti
+ {
+ class NormalBreakpoint;
+ }
+ }
+ }
+}
+
+class gnu::gcj::jvmti::NormalBreakpoint : public ::gnu::gcj::jvmti::Breakpoint
+{
+
+public:
+ NormalBreakpoint(jlong, jlong);
+ virtual void execute();
+ static ::java::lang::Class class$;
+};
+
+#endif // __gnu_gcj_jvmti_NormalBreakpoint__
--- /dev/null
+// NormalBreakpoint.java - a "normal" breakpoint in the interpreter
+
+/* Copyright (C) 2007 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;
+
+/**
+ * This class represents a "normal" breakpoint in the interpreter.
+ * When the interpreter hits this breakpoint type, it will send out
+ * a JVMTI breakpoint notification.
+ *
+ * @author Keith Seitz (keiths@redhat.com)
+ */
+public class NormalBreakpoint
+ extends Breakpoint
+{
+ public NormalBreakpoint (long method, long id)
+ {
+ super (method, id);
+ }
+
+ public native void execute ();
+}
}
void
-gnu::gcj::jvmti::Breakpoint::initialize_native ()
+gnu::gcj::jvmti::Breakpoint::_save_insn ()
{
_Jv_InterpMethod *imeth = get_interp_method (method);
void
gnu::gcj::jvmti::Breakpoint::install ()
{
+ _save_insn ();
_Jv_InterpMethod *imeth = get_interp_method (method);
imeth->install_break (location);
}
--- /dev/null
+// natNormalBreakpoint.cc - C++ side of NormalBreakpoint
+
+/* Copyright (C) 2007 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 <java-interp.h>
+#include <jvmti.h>
+#include "jvmti-int.h"
+
+#include <gnu/gcj/jvmti/NormalBreakpoint.h>
+#include <java/lang/Thread.h>
+
+void
+gnu::gcj::jvmti::NormalBreakpoint::execute ()
+{
+ using namespace ::java::lang;
+
+ Thread *thread = Thread::currentThread ();
+ JNIEnv *jni_env = _Jv_GetCurrentJNIEnv ();
+
+ JvAssert (JVMTI_REQUESTED_EVENT (Breakpoint));
+ _Jv_JVMTI_PostEvent (JVMTI_EVENT_BREAKPOINT, thread, jni_env,
+ method, location);
+}
insn_breakpoint:
{
- JvAssert (JVMTI_REQUESTED_EVENT (Breakpoint));
-
- // Send JVMTI notification
using namespace ::java::lang;
jmethodID method = meth->self;
jlocation location = meth->insn_index (pc - 1);
- Thread *thread = Thread::currentThread ();
- JNIEnv *jni_env = _Jv_GetCurrentJNIEnv ();
- // Save the insn here since the breakpoint could be removed
- // before the JVMTI notification returns.
using namespace gnu::gcj::jvmti;
Breakpoint *bp
= BreakpointManager::getBreakpoint (reinterpret_cast<jlong> (method),
location);
JvAssert (bp != NULL);
+
+ // Save the insn here since the breakpoint could be removed
+ // before the JVMTI notification returns.
pc_t opc = reinterpret_cast<pc_t> (bp->getInsn ());
- _Jv_JVMTI_PostEvent (JVMTI_EVENT_BREAKPOINT, thread, jni_env,
- method, location);
+ bp->execute ();
// Continue execution
#ifdef DIRECT_THREADED
gnu_gcj_jvmti_source_files = \
gnu/gcj/jvmti/Breakpoint.java \
gnu/gcj/jvmti/BreakpointManager.java \
-gnu/gcj/jvmti/Location.java
+gnu/gcj/jvmti/Location.java \
+gnu/gcj/jvmti/NormalBreakpoint.java
gnu_gcj_jvmti_header_files = $(patsubst %.java,%.h,$(gnu_gcj_jvmti_source_files))