1 // Breakpoint.java - a base class for interpreter breakpoints 2 3 /* Copyright (C) 2006, 2007 Free Software Foundation 4 5 This file is part of libgcj. 6 7 This software is copyrighted work licensed under the terms of the 8 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for 9 details. */ 10 11 package gnu.gcj.jvmti; 12 13 import gnu.gcj.RawDataManaged; 14 15 /** 16 * Base class representing a type of breakpoint in the interpreter. 17 * This class deals with saving insns and installing and 18 * uninstalling insns in the interpreter for all breakpoint classes. 19 * 20 * @author Keith Seitz (keiths@redhat.com) 21 */ 22 public abstract class Breakpoint 23 { 24 // Location of this breakpoint 25 protected long method; 26 protected long location; 27 28 // The original instruction that this breakpoint replaced 29 private RawDataManaged data; 30 31 /** 32 * Constructs a new Breakpoint 33 * 34 * @param method the method in which to set the breakpoint 35 * @param location the location at which to set the breakpoint 36 */ Breakpoint(long method, long location)37 public Breakpoint (long method, long location) 38 { 39 this.method = method; 40 this.location = location; 41 } 42 Breakpoint()43 public Breakpoint () 44 { 45 } 46 _save_insn()47 private native void _save_insn (); 48 49 /** 50 * Installs the breakpoint into the interpreter 51 */ install()52 public native void install (); 53 54 /** 55 * Removes the breakpoint from the interpreter, re-installing 56 * the original instruction. 57 */ remove()58 public native void remove (); 59 60 /** 61 * Returns the original instruction at the location where 62 * this breakpoint was set 63 */ getInsn()64 public RawDataManaged getInsn () 65 { 66 return data; 67 } 68 69 /** 70 * Execute the actions of this breakpoint 71 */ execute()72 public abstract void execute (); 73 } 74