当前位置: 首页>>代码示例>>Java>>正文


Java ClassPrepareRequest.addClassFilter方法代码示例

本文整理汇总了Java中com.sun.jdi.request.ClassPrepareRequest.addClassFilter方法的典型用法代码示例。如果您正苦于以下问题:Java ClassPrepareRequest.addClassFilter方法的具体用法?Java ClassPrepareRequest.addClassFilter怎么用?Java ClassPrepareRequest.addClassFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.jdi.request.ClassPrepareRequest的用法示例。


在下文中一共展示了ClassPrepareRequest.addClassFilter方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deferBreakpoint

import com.sun.jdi.request.ClassPrepareRequest; //导入方法依赖的package包/类
private void deferBreakpoint(String className, Breakpoint breakpoint) throws DebuggerException {
  List<Breakpoint> newList = new ArrayList<>();
  List<Breakpoint> list = deferredBreakpoints.putIfAbsent(className, newList);
  if (list == null) {
    list = newList;
  }
  list.add(breakpoint);

  // start listening for the load of the type
  if (!classPrepareRequests.containsKey(className)) {
    ClassPrepareRequest request = getEventManager().createClassPrepareRequest();
    // set class filter in order to reduce the amount of event traffic sent from the target VM to
    // the debugger VM
    request.addClassFilter(className);
    request.enable();
    classPrepareRequests.put(className, request);
  }

  LOG.debug("Deferred breakpoint: {}", breakpoint.getLocation().toString());
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:JavaDebugger.java

示例2: createPrepareRequest

import com.sun.jdi.request.ClassPrepareRequest; //导入方法依赖的package包/类
@Override
public ClassPrepareRequest createPrepareRequest() {
    ClassPrepareRequest request =
        Env.vm().eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(classId);
    request.addCountFilter(1);
    return request;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:PatternReferenceTypeSpec.java

示例3: addClassWatch

import com.sun.jdi.request.ClassPrepareRequest; //导入方法依赖的package包/类
private static void addClassWatch(VirtualMachine vm) {
  EventRequestManager erm = vm.eventRequestManager();
  ClassPrepareRequest classPrepareRequest = erm
      .createClassPrepareRequest();
  classPrepareRequest.addClassFilter(CLASS_NAME);
  classPrepareRequest.setEnabled(true);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:8,代码来源:FieldMonitor.java

示例4: addClassWatch

import com.sun.jdi.request.ClassPrepareRequest; //导入方法依赖的package包/类
private static void addClassWatch(VirtualMachine vm) {
    EventRequestManager erm = vm.eventRequestManager();
    ClassPrepareRequest classPrepareRequest = erm
            .createClassPrepareRequest();
    classPrepareRequest.addClassFilter(CLASS_NAME);
    classPrepareRequest.setEnabled(true);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:GetObjectLockCount.java

示例5: createPrepareRequest

import com.sun.jdi.request.ClassPrepareRequest; //导入方法依赖的package包/类
public ClassPrepareRequest createPrepareRequest() {
    ClassPrepareRequest request =
        env.vm().eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(classId);
    request.addCountFilter(1);
    return request;
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:8,代码来源:PatternReferenceTypeSpec.java

示例6: resumeToPrepareOf

import com.sun.jdi.request.ClassPrepareRequest; //导入方法依赖的package包/类
public ClassPrepareEvent resumeToPrepareOf(String className) {
    final ClassPrepareRequest request =
            eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(className);
    request.addCountFilter(1);
    request.enable();
    return (ClassPrepareEvent)resumeToEvent(request);
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:9,代码来源:Debugger.java

示例7: init

import com.sun.jdi.request.ClassPrepareRequest; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void init(String[] args) throws Exception {
    /*
     * TODO As currently jdb just supports "jdb -attach [port]" command, 
     * more work to do to parse the jdb launching command option
     */
    if (args.length >= 2 && args[0].equals("-attach")) {
        SocketAttachingConnectorImpl sac = 
            new SocketAttachingConnectorImpl(
                    (VirtualMachineManagerImpl) Bootstrap.
                    virtualMachineManager());
        Map argMap = sac.defaultArguments();
        Connector.Argument value;
        value = (Connector.Argument) argMap.get("hostname");
        value.setValue("localhost");
        value = (Connector.Argument) argMap.get("port");
        value.setValue(args[1]);
        debuggee = sac.attach(argMap);
        //VMProcess = debuggee.process();
    } else {
        System.out.println("Wrong command option. " +
                "The jdb currently only support jdb -attach [port].");
        System.exit(0);
    }
    
    eventRequestManager = debuggee.eventRequestManager();
    
    // Enable class prepare request for all classes
    ClassPrepareRequest classPrepareRequest 
        = eventRequestManager.createClassPrepareRequest();
    classPrepareRequest.addClassFilter("*");
    classPrepareRequest.setSuspendPolicy(EventRequest.SUSPEND_ALL);
    classPrepareRequest.enable();
    
    // Enable thread start request for all threads
    ThreadStartRequest threadStartRequest 
        = eventRequestManager.createThreadStartRequest();
    threadStartRequest.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
    threadStartRequest.enable();
}
 
开发者ID:shannah,项目名称:cn1,代码行数:41,代码来源:Main.java

示例8: watchBuggyClass

import com.sun.jdi.request.ClassPrepareRequest; //导入方法依赖的package包/类
private void watchBuggyClass() {
    EventRequestManager erm = vm.eventRequestManager();
    ClassPrepareRequest classPrepareRequest = erm.createClassPrepareRequest();
    classPrepareRequest.addClassFilter(location.getContainingClassName());
    classPrepareRequest.setEnabled(true);
}
 
开发者ID:SpoonLabs,项目名称:nopol,代码行数:7,代码来源:DynamothCodeGenesisImpl.java

示例9: createJVM

import com.sun.jdi.request.ClassPrepareRequest; //导入方法依赖的package包/类
public VMRemoteTarget createJVM() throws IOException, InterruptedException,
		IncompatibleThreadStateException {
	Process process = startSecondJVM(VMLocalTarget.class);
	sleep(90);
	// connect
	VirtualMachine vm = new VMAcquirer().connect(debugPort);

	ClassPrepareRequest createClassPrepareRequest = vm
			.eventRequestManager().createClassPrepareRequest();
	createClassPrepareRequest.addClassFilter(VMLocalTarget.class.getName());
	createClassPrepareRequest.enable();
	
	vm.resume();

	List<ThreadReference> allThreads = vm.allThreads();
	for (ThreadReference threadReference : allThreads) {
		System.out.println(threadReference+" isSuspended: "+threadReference.isSuspended()+" suspendCount: "+threadReference.suspendCount());
	}

	// process events
	EventQueue eventQueue = vm.eventQueue();
	while (true) {
		EventSet eventSet = eventQueue.remove();
		for (Event event : eventSet) {
			if (event instanceof ClassPrepareEvent) {
				event.request().disable();
				installHaltPoint(vm);
			}
			if (event instanceof VMDeathEvent
					|| event instanceof VMDisconnectEvent) {
				return null;
			}
			if (event instanceof BreakpointEvent) {
				event.request().disable();
				ThreadReference thread = ((BreakpointEvent) event).thread();
				return new VMRemoteTarget(process, vm, thread, debugPort);
			}
		}
		eventSet.resume();
	}
}
 
开发者ID:gravel-st,项目名称:gravel,代码行数:42,代码来源:VMTargetStarter.java


注:本文中的com.sun.jdi.request.ClassPrepareRequest.addClassFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。