Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Labels.java

00001 package gov.nasa.arc.ase.jpf.jvm;
00002 
00003 import java.util.Hashtable;
00004 
00005 public class Labels {
00006   private static class Location {
00007     public String method;
00008     public int pos;
00009 
00010     public Location(String m, int p) {
00011       method = m;
00012       pos = p;
00013     }
00014   }
00015 
00016   private static Hashtable labels = new Hashtable();
00017 
00018   public static boolean isAt(String label, ThreadInfo th) {
00019     if(th.depth() == 0) return false;
00020     
00021     String m = th.getCurrentMethod().getFullName();
00022     int p = th.getPC().getPosition();
00023     
00024     Location l = (Location)labels.get(label);
00025     if(l == null) return false;
00026     
00027     return l.method.equals(m) && l.pos == p;
00028   }  
00029   public static void set(String label, String method, int pos) {
00030     if(labels.containsKey(label)) return;
00031 
00032     labels.put(label, new Location(method, pos));
00033   }  
00034 }

Generated at Thu Feb 7 06:49:08 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001