2007-06-19 02:10:10 +02:00
|
|
|
// Breakpoint.java - a base class for interpreter breakpoints
|
2006-10-28 20:36:16 +02:00
|
|
|
|
2007-06-19 02:10:10 +02:00
|
|
|
/* Copyright (C) 2006, 2007 Free Software Foundation
|
2006-10-28 20:36:16 +02:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
/**
|
2007-06-19 02:10:10 +02:00
|
|
|
* 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.
|
2006-10-28 20:36:16 +02:00
|
|
|
*
|
|
|
|
* @author Keith Seitz (keiths@redhat.com)
|
|
|
|
*/
|
2007-06-19 02:10:10 +02:00
|
|
|
public abstract class Breakpoint
|
2006-10-28 20:36:16 +02:00
|
|
|
{
|
|
|
|
// Location of this breakpoint
|
2007-06-19 02:10:10 +02:00
|
|
|
protected long method;
|
|
|
|
protected long location;
|
2006-10-28 20:36:16 +02:00
|
|
|
|
|
|
|
// The original instruction that this breakpoint replaced
|
|
|
|
private RawDataManaged data;
|
|
|
|
|
|
|
|
/**
|
2007-06-19 02:10:10 +02:00
|
|
|
* Constructs a new Breakpoint
|
2006-10-28 20:36:16 +02:00
|
|
|
*
|
2007-06-19 02:10:10 +02:00
|
|
|
* @param method the method in which to set the breakpoint
|
|
|
|
* @param location the location at which to set the breakpoint
|
2006-10-28 20:36:16 +02:00
|
|
|
*/
|
|
|
|
public Breakpoint (long method, long location)
|
|
|
|
{
|
|
|
|
this.method = method;
|
|
|
|
this.location = location;
|
|
|
|
}
|
|
|
|
|
2007-06-19 02:10:10 +02:00
|
|
|
public Breakpoint ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
private native void _save_insn ();
|
2006-10-28 20:36:16 +02:00
|
|
|
|
2007-06-19 02:10:10 +02:00
|
|
|
/**
|
|
|
|
* Installs the breakpoint into the interpreter
|
|
|
|
*/
|
2006-10-28 20:36:16 +02:00
|
|
|
public native void install ();
|
|
|
|
|
2007-06-19 02:10:10 +02:00
|
|
|
/**
|
|
|
|
* Removes the breakpoint from the interpreter, re-installing
|
|
|
|
* the original instruction.
|
|
|
|
*/
|
2006-10-28 20:36:16 +02:00
|
|
|
public native void remove ();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the original instruction at the location where
|
|
|
|
* this breakpoint was set
|
|
|
|
*/
|
|
|
|
public RawDataManaged getInsn ()
|
|
|
|
{
|
|
|
|
return data;
|
|
|
|
}
|
2007-06-19 02:10:10 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Execute the actions of this breakpoint
|
|
|
|
*/
|
|
|
|
public abstract void execute ();
|
2006-10-28 20:36:16 +02:00
|
|
|
}
|