Path: blob/master/test/hotspot/jtreg/vmTestbase/vm/mlvm/share/jdi/BreakpointInfo.java
41161 views
/*1* Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package vm.mlvm.share.jdi;2425import java.util.List;2627import vm.mlvm.share.jpda.StratumInfo;2829import com.sun.jdi.request.BreakpointRequest;3031public class BreakpointInfo {32public static enum Type {33/** set breakpoint via BreakpointRequest */34EXPLICIT,35/**36* don't set JDI breakpoint, verify that we can reach the location37* via stepping38*/39IMPLICIT40};4142// Initial information43public Type type = Type.EXPLICIT;44public String className = "";45public final String methodName;46public int methodLine = 0;4748/** Breakpoint stratum (JSR-045). null == default stratum */49public StratumInfo stratumInfo = null;5051/**52* How many times this breakpoint should be hit. null == any number of53* hits54*/55public Integer requiredHits = null;5657/** How many steps do via StepRequest after reaching the breakpoint */58public int stepsToTrace = 0;5960/** Conditional breakpoints should not be enabled by default */61public final boolean isConditional;6263/** Sub-breakpoints */64public List<BreakpointInfo> subBreakpoints = null;6566// Fields below are filled in by debugger67public long bci = -1;68public BreakpointRequest bpReq = null;69public int hits = 0;7071public BreakpointInfo(String methodName) {72this(methodName, false);73}7475public BreakpointInfo(String methodName, boolean isConditional) {76this.methodName = methodName;77this.isConditional = isConditional;78}7980public boolean isHit() {81if (requiredHits == null) {82return hits > 0;83} else {84return hits == requiredHits;85}86}8788@Override89public String toString() {90return className + "." + methodName + ":" + methodLine + "[bci=" + bci + ",bp=" + bpReq + "]";91}9293}949596